Datasets:
Add files using upload-large-folder tool
Browse files- md/train/-b5OSCydOMe/-b5OSCydOMe.md +286 -0
- md/train/0HW7A5YZjq7/0HW7A5YZjq7.md +352 -0
- md/train/3ccoZ40Us0N/3ccoZ40Us0N.md +224 -0
- md/train/6YL_BntJrz6/6YL_BntJrz6.md +282 -0
- md/train/784_F-WCW46/784_F-WCW46.md +201 -0
- md/train/9BpjtPMyDQ/9BpjtPMyDQ.md +241 -0
- md/train/ALvt7nXa2q/ALvt7nXa2q.md +362 -0
- md/train/BJedHRVtPB/BJedHRVtPB.md +451 -0
- md/train/BJij4yg0Z/BJij4yg0Z.md +326 -0
- md/train/BJlguT4YPr/BJlguT4YPr.md +420 -0
- md/train/BJlo91BYPr/BJlo91BYPr.md +336 -0
- md/train/Byl1W1rtvH/Byl1W1rtvH.md +376 -0
- md/train/Byx93sC9tm/Byx93sC9tm.md +264 -0
- md/train/EmeWbcWORRg/EmeWbcWORRg.md +242 -0
- md/train/HJx81ySKwr/HJx81ySKwr.md +271 -0
- md/train/HkMCybx0-/HkMCybx0-.md +152 -0
- md/train/HklUCCVKDB/HklUCCVKDB.md +361 -0
- md/train/HyBbjW-RW/HyBbjW-RW.md +238 -0
- md/train/HyEl3o05Fm/HyEl3o05Fm.md +364 -0
- md/train/HyxGB2AcY7/HyxGB2AcY7.md +367 -0
- md/train/PbEHqvFtcS/PbEHqvFtcS.md +0 -0
- md/train/PmVfnB0nkqr/PmVfnB0nkqr.md +607 -0
- md/train/S1EHOsC9tX/S1EHOsC9tX.md +381 -0
- md/train/S1x2PCNKDB/S1x2PCNKDB.md +415 -0
- md/train/S1xtAjR5tX/S1xtAjR5tX.md +433 -0
- md/train/S9ZyhWC17wJ/S9ZyhWC17wJ.md +264 -0
- md/train/SOVSJZ9PTO7/SOVSJZ9PTO7.md +287 -0
- md/train/SklXvs0qt7/SklXvs0qt7.md +291 -0
- md/train/SkqMSCHxe/SkqMSCHxe.md +179 -0
- md/train/SypU81Ole/SypU81Ole.md +189 -0
- md/train/Syx6bz-Ab/Syx6bz-Ab.md +297 -0
- md/train/TiwPYwg3IRf/TiwPYwg3IRf.md +325 -0
- md/train/Wua2zjxJdYo/Wua2zjxJdYo.md +276 -0
- md/train/_WnAQKse_uK/_WnAQKse_uK.md +272 -0
- md/train/aExAsh1UHZo/aExAsh1UHZo.md +422 -0
- md/train/af_hng9tuNj/af_hng9tuNj.md +322 -0
- md/train/hXWPpJedrVP/hXWPpJedrVP.md +269 -0
- md/train/jfDaBf8PAE/jfDaBf8PAE.md +208 -0
- md/train/l0BP1lHpPW/l0BP1lHpPW.md +509 -0
- md/train/l3YcqzaPlx0/l3YcqzaPlx0.md +330 -0
- md/train/lgNx56yZh8a/lgNx56yZh8a.md +0 -0
- md/train/rC8sJ4i6kaH/rC8sJ4i6kaH.md +0 -0
- md/train/rJeIGkBKPS/rJeIGkBKPS.md +293 -0
- md/train/rJgVwTVtvS/rJgVwTVtvS.md +554 -0
- md/train/rJg_NjCqtX/rJg_NjCqtX.md +180 -0
- md/train/rkGG6s0qKQ/rkGG6s0qKQ.md +343 -0
- md/train/rkeT8iR9Y7/rkeT8iR9Y7.md +0 -0
- md/train/rkgt0REKwS/rkgt0REKwS.md +564 -0
- md/train/rkllGyBFPH/rkllGyBFPH.md +0 -0
- md/train/rylztAEYvr/rylztAEYvr.md +269 -0
md/train/-b5OSCydOMe/-b5OSCydOMe.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sparse is Enough in Scaling Transformers
|
| 2 |
+
|
| 3 |
+
Sebastian Jaszczur∗ University of Warsaw
|
| 4 |
+
|
| 5 |
+
Aakanksha Chowdhery Google Research
|
| 6 |
+
|
| 7 |
+
Afroz Mohiuddin Google Research
|
| 8 |
+
|
| 9 |
+
Łukasz Kaiser∗ OpenAI
|
| 10 |
+
|
| 11 |
+
Wojciech Gajewski Google Research
|
| 12 |
+
|
| 13 |
+
Henryk Michalewski Google Research
|
| 14 |
+
|
| 15 |
+
Jonni Kanerva Google Research
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Large Transformer models yield impressive results on many tasks, but are expensive to train, or even fine-tune, and so slow at decoding that their use and study becomes out of reach. We address this problem by leveraging sparsity. We study sparse variants for all layers in the Transformer and propose Scaling Transformers, a family of next generation Transformer models that use sparse layers to scale efficiently and perform unbatched decoding much faster than the standard Transformer as we scale up the model size. Surprisingly, the sparse layers are enough to obtain the same perplexity as the standard Transformer with the same number of parameters. We also integrate with prior sparsity approaches to attention and enable fast inference on long sequences even with limited memory. This results in performance competitive to the state-of-the-art on long text summarization.
|
| 20 |
+
|
| 21 |
+
# 1 Introduction
|
| 22 |
+
|
| 23 |
+
The field of natural language processing has seen dramatic improvements in recent years due to large neural networks based on the Transformer architecture. The original Transformer [42] significantly advanced state-of-the-art in machine translation. BERT [7] surpassed all previous methods on question answering, language inference and other NLP tasks and was followed by a line of models like T5 [30] that further improved these results. The GPT line of models [29, 3] elevated language generation to the point that GPT-2 was invited to write short passages for the Economist and GPT-3 created whole articles almost indistinguishable from human-written ones.
|
| 24 |
+
|
| 25 |
+
The benefits of this progress are undercut by the huge costs such models incur. Strubell et al. [36] estimate that training a single base BERT model costs $\$ 4 k -\$ 12 k$ and emits as much $\mathrm { C O _ { 2 } }$ as one passenger’s share of a 4-hour flight and later Patterson et al. [27] estimate that training GPT-3 has three times as much $\mathrm { t C O _ { 2 } e }$ (metric tons of $\mathrm { C O _ { 2 } }$ equivalent) emissions as a SF-NY round trip flight. Data and serving costs are also forbidding: a single training run of BERT, for example, processes 128B tokens, and Google Translate reportedly1 serves over 143B words per day.
|
| 26 |
+
|
| 27 |
+
With the growing popularity and size of these models, it is increasingly valuable to make them scale efficiently. In this work we propose Scaling Transformers with a separate sparse mechanism for the query, key, value and output layers (QKV layers for short) and combine it with sparse feedforward blocks to get a fully sparse Transformer architecture.
|
| 28 |
+
|
| 29 |
+
To quantify the computational complexity of inference in Transformer models, recall the architecture of a Transformer decoder block. It consists of three parts: a masked self-attention layer, an encoderdecoder attention layer and a feedforward block. The sizes of these layers are parameterized by $d _ { \mathrm { m o d e l } }$ and $d _ { \mathrm { f f } }$ . The base BERT model sets $d _ { \mathrm { m o d e l } } = 7 6 8$ , the large BERT has $d _ { \mathrm { m o d e l } } = 1 0 2 4$ , the largest
|
| 30 |
+
|
| 31 |
+
Table 1: Decoding speed (in seconds) of a single token. For Transformer model (equivalent to T5 large with approximately 800M parameters), Scaling Transformers with proposed sparsity mechanisms $( F F { + } Q K V )$ achieve up to $2 x$ speedup in decoding compared to baseline dense model and 20x speedup for $I 7 B$ param model.
|
| 32 |
+
|
| 33 |
+
<table><tr><td></td><td>Params</td><td>Dec. time</td><td>Dec.time per block</td></tr><tr><td>baseline Transf.</td><td>800M</td><td>0.160s</td><td>5.9ms</td></tr><tr><td>+ Sparse FF</td><td></td><td>0.093s</td><td>3.1ms</td></tr><tr><td>+ Sparse QKV</td><td></td><td>0.152s</td><td>6.2ms</td></tr><tr><td>+ Sparse FF+QKV</td><td></td><td>0.061s</td><td>1.9ms</td></tr><tr><td>Speedup</td><td></td><td>2.62x</td><td>3.05x</td></tr><tr><td>baseline Transf.</td><td>17B</td><td>3.690s</td><td>0.581s</td></tr><tr><td>+Sparse FF</td><td>■</td><td>1.595s</td><td>0.259s</td></tr><tr><td>+Sparse QKV</td><td></td><td>3.154s</td><td>0.554s</td></tr><tr><td>+Sparse FF+QKV</td><td>=</td><td>0.183s</td><td>0.014s</td></tr><tr><td>Speedup</td><td></td><td>20.0x</td><td>42.5x</td></tr></table>
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Log-perplexity of Scaling Transformers (equivalent to T5 large with approximately 800M parameters) on $C 4$ dataset with proposed sparsity mechanisms (FF, QKV, $F F { + } Q K V )$ is similar to baseline dense model. Other models used in this paper are shown in grey lines; raw data is available in the appendix.
|
| 37 |
+
|
| 38 |
+
GPT-2 has $d _ { \mathrm { m o d e l } } = 1 6 0 0$ and GPT-3 reaches $d _ { \mathrm { m o d e l } } = 1 2 2 8 8$ . For both BERT and GPT models the authors use $d _ { \mathrm { f f } } = 4 d _ { \mathrm { m o d e l } }$ . While decoding a token, the self-attention layer needs to activate four matrices of size $d _ { \mathrm { m o d e l } } \times d _ { \mathrm { m o d e l } }$ : one each for the queries, keys and values input to the attention and one for merging the output. In the encoder-decoder attention, the keys and values may already be cached, so only two matrices of size $d _ { \mathrm { m o d e l } } \times d _ { \mathrm { m o d e l } }$ are activated. The feedforward block consists of twoup to: a sing $4 d _ { \mathrm { m o d e l } } ^ { 2 } + 2 d _ { \mathrm { m o d e l } } ^ { 2 } + 2 d _ { \mathrm { m o d e l } } d _ { \mathrm { f f } }$ $d _ { \mathrm { m o d e l } } \times d _ { \mathrm { f f } }$ mitting small additional contribution of biases. The total adds. This sum describes both the number of trainable weights of the number of floating-point operations needed for decoding a single token, except for the attention operations (discussed later). The complexity is quadratic in $d _ { \mathrm { m o d e l } }$ ; for example, as $d _ { \mathrm { m o d e l } }$ increases 16-fold from base BERT to GPT-3, the complexity of a single block grows 256-fold.
|
| 39 |
+
|
| 40 |
+
In comparison Scaling Transformers use only $2 d _ { \mathrm { m o d e l } } \sqrt { d _ { \mathrm { m o d e l } } } = 2 d _ { \mathrm { m o d e l } } ^ { 1 . 5 }$ parameters in QKV layers and yield results as good as the baseline (fully dense) Transformer with the same number of parameters and complexity: $\mathrm { \bar { 8 } } d _ { \mathrm { m o d e l } } ^ { 1 . 5 } + 4 d _ { \mathrm { m o d e l } } ^ { 1 . 5 } + 4 \dot { d } _ { \mathrm { m o d e l } } ^ { 1 . 5 }$ . We were surprised that the fully sparse Scaling Transformers are indeed enough to match the results of the baseline Transformer on the large C4 dataset [30] (Figure 1). The improvement in complexity holds not just asymptotically but yields over $2 . 6 \mathbf { x }$ speedup in wall-clock hed decoding time already for a model with 800M parameters and $2 0 \mathrm { x }$ improvement for a model with 17B parameters, as shown in Table 1.
|
| 41 |
+
|
| 42 |
+
To verify that Scaling Transformers can be used with other Transformer improvements on real tasks, we create Terraformer – a Transformer model that uses reversible layers for memory efficiency and sparse attention to handle long sequences. We pre-train Terraformer on the C4 dataset and fine-tune it on the challenging task of summarizing arxiv articles. Terraformer yields results competitive to the state-of-the-art BigBird-Pegasus without using the Pegasus loss in pre-training (Table 5).
|
| 43 |
+
|
| 44 |
+
# 2 Related Work
|
| 45 |
+
|
| 46 |
+
As discussed in the previous section, large Transformer models brings significant improvements in performance, as seen in models such as GPT-3 [3, 17] or T5 [44, 30]. Training and inference incur a high computational cost at the scale of hundreds of billions of parameters. Numerous techniques improve the efficiency of Transformer models, and Gupta and Agrawal [11] divide them into several classes, including pruning, knowledge distillation, quantization, parameter sharing, efficient attention, and efficient feedforward.
|
| 47 |
+
|
| 48 |
+
Model compression. Model pruning [24, 2] makes matrices smaller by removing unneeded weights after or during training, however, the gains in computational complexity on sparse matrices often do not result in inference speedups on actual hardware [9]. Structured pruning based approaches [47, 22, 43] account for this challenge by leveraging sparsity in hardware in CPU and GPU architectures [1]. Our paper is different from pruning approaches in that it relies on dynamic sparsity wherein the feedforward layer loads only a subset of weights in the layer for each token. Our approach is complementary to model quantization studies [35, 38, 28] that use fewer bits for the weights.
|
| 49 |
+
|
| 50 |
+
Model distillation. Several natural language models used for mobile inference [13, 39] rely on distillation [32] to speed up inference from the pretrained large models. For example, [18] pretrains a large model and uses knowledge distillation along with pruning to get more than 10x faster inference. Instead of distilling a large model, our approach speeds up inference by reducing the number of weights loaded in memory from the model.
|
| 51 |
+
|
| 52 |
+
Sparse attention. Sparse attention-based approaches have made the attention layer more efficient, especially for long sequences, by incorporating additional combinatorial mechanisms, as in [40], or selecting a subset of tokens this layer attends to [31, 5, 19, 37, 15, 4] or other approaches [12]. Our work is complementary to these approaches for sparse attention and reuses the advances on SOTA therein. Inference speedups in the attention layers also use bottleneck layers [39] or grouped convolutions [13]. Our work extends beyond the idea of grouped convolutions approach because each attention head is limited to using only a fixed part of the embedding while our work is able to permute the embeddings to improve model quality; see Section 3.2 for details.
|
| 53 |
+
|
| 54 |
+
Tensor Decomposition. The approaches discussed above significantly improve Transformer speed and handling of long sequences, however none of them addresses the fundamental scaling issue: even if we distill into a smaller model, quantize it and prune a percentage of the weights, the complexity still grows quadratically with $d _ { \mathrm { m o d e l } }$ . The final approach, which does attack this scaling issue, is called tensor decompositions in [11]. Unluckily, as the authors there note, the approach is most effective in dealing with large input and output embedding matrices and tends to produce lower performance than unstructured models if used inside the decoder block.
|
| 55 |
+
|
| 56 |
+
Sparse feedforward. Mixture of experts approaches have been shown to achieve computational efficiency in training [33, 21, 34], scaling up to a trillion parameters [8]. The key idea is to partition the $d _ { \mathrm { f f } }$ -sized dimension into parts (called experts) and retrieve only one part per token, which reduces the complexity of the feedforward block from $2 d _ { \mathrm { m o d e l } } d _ { \mathrm { f f } }$ to $2 d _ { \mathrm { m o d e l } } d _ { \mathrm { f f } } / n _ { \mathrm { e x p e r t s } }$ . These speedups are mostly measured in training speed, and the method focuses on feedforward blocks. In contrast to prior methods, we train a full weight matrix and then only activate specific parts of it for each input token during decoding; see Section 3.1.
|
| 57 |
+
|
| 58 |
+
# 3 Sparse is Enough
|
| 59 |
+
|
| 60 |
+
We study how to sparsify every part of the Transformer model—otherwise the non-sparse parts dominate decoding time and become a bottleneck. This means we need sparse equivalents for the feedforward blocks, for the dense Q, K, V and output layers in attention, and for the final dense layer before the softmax and loss.
|
| 61 |
+
|
| 62 |
+
# 3.1 Sparse Feedforward Layer
|
| 63 |
+
|
| 64 |
+
In a baseline Transformer, decoding speed is dominated by the execution cost of the feedforward block. Recall that this block consists of two fully-connected (dense) layers with a ReLU nonlinearity in between. The dimensionality of activation vectors between these 2 layers is usually denoted by $d _ { \mathrm { f f } }$ and is often 4 or 8 times larger than the dimensionality of the activations in other places $[ d _ { \mathrm { m o d e l } } ]$ ).
|
| 65 |
+
|
| 66 |
+
We make use of the structure of the feedforward block to sparsify it. One main observation is that the ReLU in the middle creates a lot of zeros2. We impose a fixed structure on this middle activation vector: only one float in every block of $N$ will be allowed to be non-zero. Prior techniques prune weights or blocks from weight matrices and can be referred to as static sparsity. Our proposed technique will train a full weight matrix but only activate specific parts of it for each input token during decoding. We call this dynamic sparsity, because the model dynamically selects only a fraction of its parameters, and the selection is independent for each token.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: (a) Sparse Feedforward Layer only activates 1 in N rows/columns of each block to reduce the decoding time. Here only two rows/colums in blocks of size 4 are loaded while the weights in dark red are not loaded from memory during inference. (b) Sparse Feedforward Controller with the output of 2 blocks of size 4 (1 in 4 sparsity).
|
| 70 |
+
|
| 71 |
+
We train a controller to determine which activation in each block can be non-zero; the rest will be set to zero. This can be represented as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { c } { Y _ { \mathrm { s p a r s e } } = \operatorname* { m a x } ( 0 , x W _ { 1 } + b _ { 1 } ) \odot \mathrm { C o n t r o l l e r } ( x ) } \\ { \mathrm { S p a r s e F F N } ( x ) = Y _ { \mathrm { s p a r s e } } W _ { 2 } + b _ { 2 } } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\odot$ is element-wise multiplication. Note that each activation in $Y _ { \mathrm { s p a r s e } }$ corresponds to a single column in $W _ { 1 }$ and a single row in $W _ { 2 }$ . Therefore, if we compute Controller $( x )$ output first, we don’t have to use any columns in $W _ { 1 }$ or any rows in $W _ { 2 }$ that correspond to an activation set to zero by the controller. This allows for much faster decoding, as we have to process only 1 in $N$ columns in $W _ { 1 }$ and rows in $W _ { 2 }$ (see Figure 2(a)).
|
| 78 |
+
|
| 79 |
+
To design the controller to be computationally inexpensive, we project the input using a low-rank bottleneck dense layer. Figure 2(b) illustrates the controller which produces the output as follows
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\operatorname { C o n t r o l l e r } ( x ) = \arg \operatorname* { m a x } ( \operatorname { R e s h a p e } ( x C _ { 1 } C _ { 2 } , ( - 1 , N ) ) )
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $C _ { 1 } \in \mathbb { R } ^ { d _ { \mathrm { m o d e l } } \times d _ { \mathrm { l o w r a n k } } }$ and $C _ { 2 } \in \mathbb { R } ^ { d _ { \mathrm { l o w r a n k } } \times d _ { \mathrm { f f } } }$ , with $d _ { \mathrm { l o w r a n k } }$ usually set to $( d _ { \mathrm { m o d e l } } / N )$
|
| 86 |
+
|
| 87 |
+
During inference the controller uses a discrete argmax function, but during training the model uses a softmax to calculate and sample from a distribution. The model learns to select which row/column will be non-zero using the Gumbel-Softmax trick for discretization. To determine the active row/column in each block, we reparameterize sampling from a Bernoulli distribution by using the Gumbel-Softmax trick [25]. Instead of using the logits in each block to directly sample a binary value, we add independent noise from the Gumbel distribution to each of the logits, and then select the binary value with the highest logit (i.e., argmax) as the sample $z$ . The argmax operation is not differentiable, but it can be approximated by a softmax with annealing temperature. Therefore, on the forward pass, we use the argmax to obtain a binary one-hot vector for each block, while on the backward pass, we approximate it with softmax. This approach is known as the Straight-Through Gumbel-Softmax estimator [14].
|
| 88 |
+
|
| 89 |
+
Ablations. We investigate the impact of sparse FF on the model equivalent to T5-large with varying levels of sparsity, with $d _ { \mathrm { m o d e l } } = 1 0 2 4$ , $d _ { \mathrm { f f } } = 4 0 9 6$ , and 16 attention heads. When we set the sparsity level to $N$ (for e.g. $N = 6 4 ,$ ) then every block of size $N$ has one non-zero value activated for inference. During training, the controller uses the bottleneck layer with $d _ { \mathrm { l o w r a n k } } = 6 4$ and temperature of Gumbel softmax estimator set to 0.1. To improve training stability, the controller in the forward pass will use the output of argmax that is a binary one-hot vector for each block with a probability of $30 \%$ and otherwise it uses the output of softmax. Table 2 and Figure 3 show the perplexity and the decoding time of this model with varying levels of sparsity in feedforward layer. As the level of sparsity increases from 0 to 128, we observe a significant decrease in the decoding time, while the neg-log-perplexity of the model with $N = 6 4$ sparsity is comparable to the baseline.
|
| 90 |
+
|
| 91 |
+
Table 2: Decoding time of a singe token decreases with increasing level of sparsity in the FF layer.
|
| 92 |
+
|
| 93 |
+
<table><tr><td></td><td>Dec. time</td></tr><tr><td>baseline</td><td>0.160s</td></tr><tr><td>Sparse FF 64</td><td>0.093s</td></tr><tr><td>Sparse FF128</td><td>0.089s</td></tr></table>
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: Log-perplexity of Scaling Transformers with Sparse Feedforward layer is very similar to dense baseline for sparsity level $N = 6 4$ but degrades slightly for $N { = } I 2 8$ .
|
| 97 |
+
|
| 98 |
+
We also checked the performance of the feedforward block with Mixture-of-Experts [33] style sparsity. As expected, this technique achieved decoding time comparable to sparse FF – 0.11s instead of $0 . 0 9 s$ – but with its lack of granularity it achieved log-perplexity of 1.64, worse than both our method and the dense baseline.
|
| 99 |
+
|
| 100 |
+
# 3.2 Sparse QKV Layer
|
| 101 |
+
|
| 102 |
+
The decoding speed for a model with sparse feedforward blocks is dominated next by the query, key, value and output computation—the dense layers in attention, which we jointly call a QKV layer. Each of these dense layers has $d _ { \mathrm { m o d e l } } ^ { 2 }$ parameters and computation cost. Unfortunately, QKV layers don’t have ReLUs, so the method used above to sparsify feedforward blocks is not viable here.
|
| 103 |
+
|
| 104 |
+
To make QKV layers sparse, we subdivide the dimensionality of the layer, $d _ { \mathrm { m o d e l } }$ , into $S$ modules of size $M = d _ { \mathrm { m o d e l } } / S$ , similar to splitting an activation vector into multiple heads. These modules can be processed with a convolutional layer with fewer weights and faster computation. However, with na¨ıve design each module (and corresponding attention head) could access only a small part of a given token embedding. To alleviate that, we develop a multiplicative layer that can represent an arbitrary permutation and has fewer parameters and lower computation time than a dense layer. This multiplicative layer is inserted right before the convolutional layer, letting each head access any part of the embedding (see Figure 4(a)). This solution yields well-performing models that also decode fast.
|
| 105 |
+
|
| 106 |
+
Multiplicative dense layer. Our new multiplicative dense layer can represent an arbitrary permutation and has $d _ { \mathrm { m o d e l } } ^ { 2 } / S + \bar { d } _ { \mathrm { m o d e l } } S$ parameters, dependent on the sparsity hyperparameter $S$ . It processes an input vector $\mathbf { x } \in \mathbb { R } ^ { d _ { \mathrm { m o d e l } } }$ by splitting it into S “modules” of size $M = d _ { \mathrm { m o d e l } } / S$ . It produces output $\mathbf { y } \in \mathring { \mathbb { R } } ^ { S \times M }$ as follows
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathrm { y } _ { s , m } = \sum _ { i } \mathrm { x } _ { i } D _ { i , s } E _ { i , m }
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where the two weight matrices are $D \in \mathbb { R } ^ { d _ { \mathrm { m o d e l } } \times S }$ , and $E \in \mathbb { R } ^ { d _ { \mathrm { m o d e l } } \times M }$ (see Figure 4(b)). This layer executes significantly faster during inference because of the decreased number of parameters which need to be loaded from memory. Unless stated otherwise, we use $S = 1 6$ .
|
| 113 |
+
|
| 114 |
+
The multiplicative layer is designed primarily to represent any permutation, so that each attention head can access information from any part of the embedding. We first verify that the multiplicative layer can indeed represent an arbitrary permutation (the proof is presented in the Appendix).
|
| 115 |
+
|
| 116 |
+
Theorem 1. For any bijective function $f : \{ 1 \cdots d _ { m o d e l } \} \Rightarrow \{ 1 \cdots S \} \times \{ 1 \cdots M \}$ there exists $a$ pair of weights of multiplicative layer $D$ , $E$ such that $x _ { i } = y _ { s , m }$ for $\{ s , m \} = f ( i )$ .
|
| 117 |
+
|
| 118 |
+
Convolutional layer. The output of the multiplicative layer is a tensor of type/shape $\in$ Rbatch×length×S×M . We process this tensor with a two-dimensional convolutional layer, treating the length dimension and number of modules $S$ like height and width of an image. This layer uses $M$ filters and a kernel size of $F \times F$ so that each filter looks at $F$ modules ( $\mathbf { \partial } ^ { \ast } \mathbf { S } ^ { \ast }$ axis) of the last $F$ tokens (‘length’ axis). Replacing the standard dense layer with such a convolution reduces the parameter count and computation time of the QKV layer. At the same time, by convolving over the ‘length’ axis, the model can incorporate more context into this computation [23].
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: (a) Multiplicative layer can represent an arbitrary permutation, but has fewer parameters and reduced computation time compared to a dense layer. (b) Sparse QKV layer replaces $Q , K ,$ , and $V$ dense layers by composing multiplicative and convolutional layers and reducing the number of parameters and decoding time.
|
| 122 |
+
|
| 123 |
+
The output of this layer has the same shape as the input. The optimal value of $S$ is less than $\sqrt { d _ { \mathrm { m o d e l } } }$ Empirically we set $F$ to 3, $S$ equal to the number of heads in the attention mechanism and $M$ to be the dimensionality of a single attention head. In this case, we can feed the output of the convolution directly to the attention mechanism without reshaping the output. This convolutional layer has fewer parameters $( 9 M ^ { 2 } + M = F ^ { 2 } ( d _ { \mathrm { m o d e l } } / S ) ^ { 2 } + ( \bar { d } _ { \mathrm { m o d e l } } / S ) )$ , and lower computational complexity $( O ( d _ { \mathrm { m o d e l } } ^ { 2 } / S ) )$ ). Unless stated otherwise, we use $S = 1 6$ and $F = 3$ .
|
| 124 |
+
|
| 125 |
+
Combining multiplicative and convolutional layers. There are four dense layers to replace in the original attention mechanism: Q, K, V, and output. As shown in Figure 4(b), we replace Q, K, and $\mathrm { v }$ dense layers by composing multiplicative and convolutional layers, but with a multiplicative layer shared across all three: $Q = \mathsf { c o n v } _ { Q } ( \mathsf { m u l t } ( x ) )$ , $K = \operatorname { c o n v } _ { K } ( \operatorname { m u l t } ( x ) )$ , $V = \mathrm { c o n v } _ { V } ( \bar { \mathrm { m u l t } } ( x ) )$ . We remove the output dense layer. Note that the combined multiplicative-convolutional variant has the output dense layer removed, while the other variants have it replaced with their respective sparse layers. Including this output layer negatively impacts decoding time. We can set the parameter √ $S$ to around $\sqrt { d _ { m o d e l } }$ , getting the number of layer parameters to scale proportionally to $d _ { m o d e l } ^ { 1 . 5 }$ compared to $d _ { m o d e l } ^ { 2 }$ of standard QKV layer.
|
| 126 |
+
|
| 127 |
+
Interpretation of QKV layer. Note that when parameter $S$ in convolutional layer is equal to the number of heads in the attention mechanism, which is the case in our experiments, then each of the S modules corresponds to a single attention head. Therefore, the model uses the convolution to process each head using the same linear projection. Without the multiplicative layer this projection would operate on a predetermined part of the embedding layer for each head. However, by adding it the model can perform arbitrary permutation of dimensions, so each head can have access to arbitrary subset of embedding dimensions, not a predetermined subset of them. This fact helps with keeping the expressibility of resulting QKV layer despite the reduced number of parameters.
|
| 128 |
+
|
| 129 |
+
Ablations. We investigate the impact of sparse QKV layers on the model equivalent to T5-large in Figure 5. We increase the value of $d _ { \mathrm { f f } }$ from 4096 to 6144 to preserve the number of parameters (see the next subsection for details). The decoding time with sparse QKV layer variants is similar to the baseline because it is dominated by the dense feedforward layer (details in appendix).
|
| 130 |
+
|
| 131 |
+
Combined feedforward and QKV sparsity. Sparse QKV layers lower the total number of model parameters. To keep the model size matched to the baseline, we increase $d _ { \mathrm { f f } }$ to keep the number of parameters similar across all models we compare. For the T5-Large equivalent model, we increase $d _ { \mathrm { f f } }$ from 4096 to 6144. With increased $d _ { \mathrm { f f } }$ , decoding time in the feedforward layer increases and thus, Sparse QKV layers alone do not speed up the model. However, when we combine Sparse QKV layers with sparse FF layers, we get a $3 . 0 5 \mathrm { x }$ speedup in decoding time of each decoding block with comparable perplexity (see Table 1 and Figure 1). While the baseline these is a vanilla Transformer, the decoding speed is almost the same for a Reformer model as well.
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
|
| 135 |
+
Figure 5: Log-perplexity of Scaling Transformers with Sparse QKV with different sparsity levels (S) and kernel sizes (F) is very similar to dense baseline within variance while multi-layer even improves perplexity.
|
| 136 |
+
Table 3: Accuracy of Scaling Transformer model and Terraformer model with sparse $Q K V + F F$ is comparable to the baseline Transformer within variance. The results are obtained by fine-tuning on selected downstream tasks from the GLUE dataset (validation split).
|
| 137 |
+
|
| 138 |
+
<table><tr><td></td><td>RTE</td><td>MRPC</td><td>SST-2</td><td>QNLI</td><td>MNLI-m</td><td>QQP</td></tr><tr><td>Baseline Transformer (dense)</td><td>70.1 ± 1.1</td><td>83.6±0.72</td><td>92.6±0.85</td><td>88.6±0.5</td><td>78.5 ± 0.41</td><td>85.2±0.6</td></tr><tr><td>Scaling Transformer (Sparse FF+QKV)</td><td>68.4</td><td>81.2</td><td>91.6</td><td>90.1</td><td>82.9</td><td>89.9</td></tr><tr><td>Terraformer (Sparse FF+QKV)</td><td>66.1</td><td>84.6</td><td>92.3</td><td>88.3</td><td>79.1</td><td>85.5</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 3 shows the accuracy of fine-tuning the model for downstream tasks from the GLUE dataset.
|
| 141 |
+
Note that the model with sparseFF $^ +$ QKV achieves accuracy similar to the baseline.
|
| 142 |
+
|
| 143 |
+
# 3.3 Sparse loss layer.
|
| 144 |
+
|
| 145 |
+
A final dense layer maps the model embedding into vocabulary size to compute the loss. We can sparsify this part of the model by replacing the dense layer with a multiplicative layer similar to previous sections; this speeds up decoding time but may degrade perplexity. The results are presented in appendix.
|
| 146 |
+
|
| 147 |
+
# 4 Sparsity for Long Sequences
|
| 148 |
+
|
| 149 |
+
The above gains from sparsifying the dense layers are encouraging, but we omitted one fundamental issue. When applied to longer sequences, the gains would effectively be lost, as the decoding time will be dominated by attention operations. Luckily, a number of methods have been proposed to solve this problem for Transformers, see [41] for a survey. We focus on the LSH (Locality-Sensitive Hashing) attention from Reformer [19] and show how to integrate this sparse attention mechanism, as well as recurrent blocks, into a Scaling Transformer, yielding a Terraformer.
|
| 150 |
+
|
| 151 |
+
# 4.1 Architecture for Long Sequences
|
| 152 |
+
|
| 153 |
+
While integrating sparse attention layers into a Scaling Transformer, we notice that the architecture of the Transformer decoder block is suboptimal and can be redesigned to make a better use of these layers. In particular, separating decoder self-attention and encoder-decoder attention is not necessary any more from the perspective of efficiency. We therefore remove the encoder-decoder attention, but just concatenate the encoder representations before the decoder tokens. Doing this alone isn’t enough though, since we took away one attention mechanism (encoder-decoder attention). We remedy this by having two attention mechanisms before the feedforward block. This simple architecture is as fast as the baseline Transformer while giving better results.
|
| 154 |
+
|
| 155 |
+
Putting this together, if $v _ { e n c }$ are the encoder activations and $v _ { d e c }$ are the decoder embeddings, the input to the decoder block $x$ is their concatenation on the length axis, LengthConcat $( v _ { e n c } , v _ { d e c } )$
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 6: Reversible decoder block in Terraformer.
|
| 159 |
+
|
| 160 |
+
Each decoder block can be represented as:
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\begin{array} { r l } & { y _ { 1 } = \ x + \mathrm { D r o p o u t } ( \mathrm { A t t e n t i o n } ( \mathrm { L a y e r N o r m } ( x ) ) ) } \\ & { y _ { 2 } = y _ { 1 } + \mathrm { D r o p o u t } ( \mathrm { A t t e n t i o n } ( \mathrm { L a y e r N o r m } ( y _ { 1 } ) ) ) } \\ & { \ y = y _ { 2 } + \mathrm { F F N } ( y _ { 2 } ) } \end{array}
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
where $y$ becomes the input to the next decoder layer. See the appendix for a full diagram of the resulting architecture.
|
| 167 |
+
|
| 168 |
+
# 4.2 Reversibility for Memory Efficiency
|
| 169 |
+
|
| 170 |
+
To enable training Terraformer with large batches, and to fine-tune even large models on single machines, we apply ideas from the Reformer [19], in particular, reversible layers for the encoder and decoder blocks.
|
| 171 |
+
|
| 172 |
+
The original Reformer decoder block contained feedforward and attention layers in a 1-1 ratio. In the Terraformer architecture, as described above, there are two attention layers in the decoder block, so there are three swaps in the reversible layers in the decoder block (see Figure 6). In our experiments, this significantly improved performance.
|
| 173 |
+
|
| 174 |
+
Another issue with reversibility is that it is only formally correct for continuous functions. We find that this is not just a formal issue, but an important problem in practice. To make reversible layers train well with sparsity, we need to store the discrete decisions—i.e., the integers saying which rows to select—and use them for reversing. Recalculating these decisions on the backwards pass leads to worse results.
|
| 175 |
+
|
| 176 |
+
# 4.3 Recurrence for Generalization
|
| 177 |
+
|
| 178 |
+
In addition to incorporating sparse attention and reversibility, we also add recurrence to the feedforward block of Terraformer. Recurrent layers allow information to propagate in time, even in a single decoder block. It is challenging though to use them without decreasing model speed, esp. in training. For that reason, we use simple recurrent units [20] which parallelize well during training.
|
| 179 |
+
|
| 180 |
+
SRUs contain dense layers, so their use could negate the benefits of sparsity elsewhere. We tried a few methods to alleviate that, but it turns out that simply reducing the dimensionality of the SRUs works. So we first project from $d _ { \mathrm { m o d e l } }$ to a small dimension (32 in our experiments), then apply the SRU, and then project back to $d _ { \mathrm { m o d e l } }$ and add the result to the feedforward block. This low-rank recurrence is in our experiments sufficient to transfer enough information through time for the network to generalize.
|
| 181 |
+
|
| 182 |
+
Since the effects of SRUs on C4 are minimal (as the training and evaluation data are very similar), we use synthetic tasks to investigate out-of-distribution generalization. We train the models on long addition and on the task of copying a decimal digit. We train on inputs with at most 128 digits and evaluate on inputs lengths from 256 to 300, so over $2 \mathbf { x }$ longer. As can be seen in the table below, the baseline Transformer does not generalize well, while Terraformer manages to get a large portion correctly, even if it is not perfect like the Neural GPU [16].
|
| 183 |
+
|
| 184 |
+
# 4.4 Experiments
|
| 185 |
+
|
| 186 |
+
We designed Terraformer so that the benefits from sparsity would not be lost on long sequences, nor on downstream finetuning tasks. To test this, we chose the task of summarizing scientific papers
|
| 187 |
+
|
| 188 |
+
Table 4: Comparison of out-of-distribution generalization for Terraformer and Transformer on two toy tasks, long addition and copying on decimal numbers. Under (seq) we report the number of fully correct sequences generated as answers.
|
| 189 |
+
|
| 190 |
+
<table><tr><td>Model</td><td>copy</td><td>copy (seq)</td><td>add</td><td>add (seq)</td></tr><tr><td>Transformer</td><td>79.8%</td><td>0%</td><td>36.4%</td><td>0%</td></tr><tr><td>Terraformer</td><td>99.9%</td><td>93.9%</td><td>86.9%</td><td>32.4%</td></tr></table>
|
| 191 |
+
|
| 192 |
+
<table><tr><td>Model</td><td>R-1</td><td>R-2</td><td>R-LSum</td><td>R-LSent</td></tr><tr><td>Terraformer</td><td>45.40</td><td>17.86</td><td>41.21</td><td>26.33</td></tr><tr><td>DANCERRUM</td><td>42.70</td><td>16.54</td><td>38.44</td><td>一</td></tr><tr><td>BIGBIRD-RoBERTa</td><td>41.22</td><td>16.43</td><td>36.96</td><td>1</td></tr><tr><td>Pegasus Large (C4)</td><td>44.21</td><td>16.95</td><td>38.83</td><td>25.67</td></tr><tr><td>DANCERPEGASUS</td><td>45.01</td><td>17.6</td><td>40.56</td><td>一</td></tr><tr><td>BIGBIRD-Pegasus</td><td>46.63</td><td>19.02</td><td>41.77</td><td></td></tr></table>
|
| 193 |
+
|
| 194 |
+
Table 5: Terraformer is competitive with strong baselines [46, 45, 10] on the ArXiv summarization task, without using the Pegasus loss and without beam search. On R-1, R-2 and R-LSum, Terraformer outperforms all previous models except for BigBird-Pegasus.
|
| 195 |
+
|
| 196 |
+
using the dataset of scientific papers from arXiv3[6]. In this task, the input is a whole paper—a long sequence—and the model is asked to output its abstract. Several recent papers studied this dataset and tasks and it has been shown [46, 45] that pretraining on C4 yields significant improvements on this task. We also pretrain Terraformer on C4 (like in all experiments in this paper) and fine-tuned it on the arXiv summarization task. We find that Terraformer is competitive with the above baselines, even though we mask single words (we do not use the Pegasus sentence loss) and decode the answers in a greedy way (no beam search). Note that ROUGE scores are computed using open-source scorer4 with the metrics described in its documentation5. We also observe certain confusion between ROUGE-L metrics reported. As noted in the open-source scorer, there are two versions of ROUGEL-SentenceLevel (R-LSent) and ROUGEL-Summary-Level (R-LSum). For clarity, we report both of these metrics. Furthermore we only report the F1 measure of any ROUGE metric. We include a few examples of the generated abstracts in the appendix.
|
| 197 |
+
|
| 198 |
+
We pretrained Terraformer in the same way as all other baselines reported in this paper with the same number of parameters (800M), the same dimensions as mentioned before, and loss sparsity 4 to get the fastest model. Compared to the sparse Transformer model from the previous section that achieves a decoding speed of 0.061s, Terraformer achieves a decoding speed of 0.086s with a similar performance in terms of perplexity (see appendix for details). We also observe that the Terraformer model achieves accuracy similar to the Transformer model in Table 3 for selected downstream tasks on GLUE dataset.
|
| 199 |
+
|
| 200 |
+
Table 6 shows the speedup in decoding with sparse layers when we scale up Terraformer to 17B parameters. Note that sparsifying all the layers gives us $3 7 \mathrm { x }$ speedup in decoding.
|
| 201 |
+
|
| 202 |
+
# 5 Conclusion
|
| 203 |
+
|
| 204 |
+
When starting to investigate sparse variants of Transformers, we assumed that there would be a price to pay for sparsity—that a sparse model would always underperform a dense one with the same number of parameters. To our surprise, this is not the case: sparse is enough!
|
| 205 |
+
|
| 206 |
+
In our experiments with large models on the C4 dataset, the sparse models match the performance of their dense counterparts while being many times faster at inference. And, when scaling the models up, the benefits of sparsity become even larger. This promises to put Transformers back on a sustainable track and make large models more useful.
|
| 207 |
+
|
| 208 |
+
Table 6: Decoding speed of a single token for Terraformer with 17B parameters is $3 7 x$ faster than a dense baseline model, requiring less than 100ms/token for inference. Here attention-sparsity $= ~ 6 4$ , $\mathcal { H }$ -sparsity $=$ 256, and loss-sparsity $= 4$ .
|
| 209 |
+
|
| 210 |
+
<table><tr><td>Terraformer</td><td>Dec. time</td><td>Speedup</td></tr><tr><td>dense</td><td>3.651s</td><td>1x</td></tr><tr><td>Sparse FF</td><td>1.595s</td><td>2.29x</td></tr><tr><td>SparseFF+QKV</td><td>0.183s</td><td>19.98x</td></tr><tr><td>SparseFF+QKV+loss</td><td>0.097s</td><td>37.64x</td></tr></table>
|
| 211 |
+
|
| 212 |
+
The current results have a number of limitations. For one, the practical speedups we see are only for inference, not at training time. Moreover, we consider unbatched inference on CPUs, while often inference is ran in batched mode on GPUs. We believe with more work sparsity can bring improvements in these settings too, as our fundamental result shows that the sparse models reach the same perplexity as their dense counterparts with the same number of parameters.
|
| 213 |
+
|
| 214 |
+
So while we demonstrate that Scaling Transformers are possible, we consider this paper as a
|
| 215 |
+
|
| 216 |
+
first step on the way to sustainable large models. There are numerous techniques for making models faster that could greatly benefit Terraformer and other Scaling Transformers. For example, we did not study quantization and we believe that it can make Scaling Transformers even faster. We also focused on inference speed and did not get improvements in training speed. The main reason is our use of Gumbel-Softmax when training the feedforward block (see Section 3.1). Fedus et al. [8] already provide a promising alternative, and we look forward to exploring it in future work.
|
| 217 |
+
|
| 218 |
+
Further, we hope that the community will take inspiration from Scaling Transformers and tune them for their needs. We ran experiments using layer sizes and hyperparameters borrowed from dense Transformers and they are most probably not optimal for Scaling Transformer. With proper tuning and further improvements we believe one could train a Scaling Transformer to match GPT-3 in accuracy but also run inference in reasonable time on a laptop. We put it as a fascinating challenge to the community, since such Scaling Transformers will not only be more sustainable but will also make large models accessible to everyone.
|
| 219 |
+
|
| 220 |
+
# References
|
| 221 |
+
|
| 222 |
+
[1] Nvidia Ampere Architecture. https://developer.nvidia.com/blog/nvidia-ampere-architecture-in-depth/.
|
| 223 |
+
[2] Christopher Brix, Parnia Bahar, and Hermann Ney. Successfully applying the stabilized lottery ticket hypothesis to the transformer architecture. arXiv preprint arXiv:2005.03454, 2020.
|
| 224 |
+
[3] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 225 |
+
[4] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 226 |
+
[5] Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020.
|
| 227 |
+
[6] Arman Cohan, Franck Dernoncourt, Doo Soon Kim, Trung Bui, Seokhwan Kim, Walter Chang, and Nazli Goharian. A discourse-aware attention model for abstractive summarization of long documents. Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), 2018. doi: 10.18653/v1/n18-2097. URL http://dx.doi.org/10.18653/ v1/n18-2097.
|
| 228 |
+
[7] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 229 |
+
[8] William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. arXiv preprint arXiv:2101.03961, 2021.
|
| 230 |
+
[9] Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019.
|
| 231 |
+
[10] A. Gidiotis and G. Tsoumakas. A divide-and-conquer approach to the summarization of long documents. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 28: 3029–3040, 2020. doi: 10.1109/TASLP.2020.3037401.
|
| 232 |
+
[11] Manish Gupta and Puneet Agrawal. Compression of deep learning models for text: A survey. arXiv preprint arXiv:2008.05221, 2020.
|
| 233 |
+
[12] Tianyu He, Xu Tan, Yingce Xia, Di He, Tao Qin, Zhibo Chen, and Tie-Yan Liu. Layer-wise coordination between encoder and decoder for neural machine translation. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31, 2018.
|
| 234 |
+
[13] Forrest N Iandola, Albert E Shaw, Ravi Krishna, and Kurt W Keutzer. Squeezebert: What can computer vision teach nlp about efficient neural networks? arXiv preprint arXiv:2006.11316, 2020.
|
| 235 |
+
[14] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 236 |
+
[15] Łukasz Kaiser and Samy Bengio. Discrete autoencoders for sequence models. arXiv preprint arXiv:1801.09797, 2018.
|
| 237 |
+
[16] Łukasz Kaiser and Ilya Sutskever. Neural gpus learn algorithms. arXiv preprint arXiv:1511.08228, 2015.
|
| 238 |
+
[17] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
|
| 239 |
+
[18] Young Jin Kim and Hany Hassan Awadalla. Fastformers: Highly efficient transformer models for natural language understanding. arXiv preprint arXiv:2010.13382, 2020.
|
| 240 |
+
[19] Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020.
|
| 241 |
+
[20] Tao Lei, Yu Zhang, and Yoav Artzi. Training rnns as fast as cnns. CoRR, abs/1709.02755, 2017. URL http://arxiv.org/abs/1709.02755.
|
| 242 |
+
[21] Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. arXiv preprint arXiv:2006.16668, 2020.
|
| 243 |
+
[22] Bingbing Li, Zhenglun Kong, Tianyun Zhang, Ji Li, Zhengang Li, Hang Liu, and Caiwen Ding. Efficient transformer-based large scale language representations using hardware-friendly block structured pruning. arXiv preprint arXiv:2009.08065, 2020.
|
| 244 |
+
[23] Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. arXiv preprint arXiv:1907.00235, 2019.
|
| 245 |
+
[24] Zhuohan Li, Eric Wallace, Sheng Shen, Kevin Lin, Kurt Keutzer, Dan Klein, and Joey Gonzalez. Train big, then compress: Rethinking model size for efficient training and inference of transformers. In International Conference on Machine Learning, pages 5958–5968. PMLR, 2020.
|
| 246 |
+
[25] Krzysztof Maziarz, Efi Kokiopoulou, Andrea Gesmundo, Luciano Sbaiz, Gabor Bartok, and Jesse Berent. Gumbel-matrix routing for flexible multi-task learning. arXiv preprint arXiv:1910.04915, 2019.
|
| 247 |
+
[26] Sharan Narang, Hyung Won Chung, Yi Tay, William Fedus, Thibault Fevry, Michael Matena, Karishma Malkan, Noah Fiedel, Noam Shazeer, Zhenzhong Lan, Yanqi Zhou, Wei Li, Nan Ding, Jake Marcus, Adam Roberts, and Colin Raffel. Do transformer modifications transfer across implementations and applications? arXiv preprint arXiv:2102.11972, 2021.
|
| 248 |
+
|
| 249 |
+
[27] David Patterson, Joseph Gonzalez, Quoc Le, Chen Liang, Lluis-Miquel Munguia, Daniel Rothchild, David So, Maud Texier, and Jeff Dean. Carbon emissions and large neural network training. arXiv preprint arXiv:2104.10350, 2021.
|
| 250 |
+
|
| 251 |
+
[28] Gabriele Prato, Ella Charlaix, and Mehdi Rezagholizadeh. Fully quantized transformer for machine translation. arXiv preprint arXiv:1910.10485, 2019.
|
| 252 |
+
|
| 253 |
+
[29] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
|
| 254 |
+
|
| 255 |
+
[30] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:1–67, 2020.
|
| 256 |
+
|
| 257 |
+
[31] Aurko Roy, Mohammad Saffar, Ashish Vaswani, and David Grangier. Efficient content-based sparse attention with routing transformers. arXiv preprint arXiv:2003.05997, 2020.
|
| 258 |
+
|
| 259 |
+
[32] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
|
| 260 |
+
|
| 261 |
+
[33] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538, 2017.
|
| 262 |
+
|
| 263 |
+
[34] Noam Shazeer, Youlong Cheng, Niki Parmar, Dustin Tran, Ashish Vaswani, Penporn Koanantakool, Peter Hawkins, HyoukJoong Lee, Mingsheng Hong, Cliff Young, et al. Mesh-tensorflow: Deep learning for supercomputers. In Advances in Neural Information Processing Systems, pages 10414–10423, 2018.
|
| 264 |
+
|
| 265 |
+
[35] Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. Q-bert: Hessian based ultra low precision quantization of bert. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 8815–8821, 2020.
|
| 266 |
+
|
| 267 |
+
[36] Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for deep learning in nlp. arXiv preprint arXiv:1906.02243, 2019.
|
| 268 |
+
|
| 269 |
+
[37] Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive attention span in transformers. arXiv preprint arXiv:1905.07799, 2019.
|
| 270 |
+
|
| 271 |
+
[38] Xiao Sun, Jungwook Choi, Chia-Yu Chen, Naigang Wang, Swagath Venkataramani, Vijayalakshmi Viji Srinivasan, Xiaodong Cui, Wei Zhang, and Kailash Gopalakrishnan. Hybrid 8-bit floating point (hfp8) training and inference for deep neural networks. Advances in neural information processing systems, 32:4900–4909, 2019.
|
| 272 |
+
|
| 273 |
+
[39] Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. Mobilebert: a compact task-agnostic bert for resource-limited devices. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2158–2170, 2020.
|
| 274 |
+
|
| 275 |
+
[40] Yi Tay, Dara Bahri, Liu Yang, Donald Metzler, and Da-Cheng Juan. Sparse sinkhorn attention, 2020.
|
| 276 |
+
|
| 277 |
+
[41] Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey. arXiv preprint arXiv:2009.06732, 2020.
|
| 278 |
+
|
| 279 |
+
[42] 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.
|
| 280 |
+
|
| 281 |
+
[43] Hanrui Wang, Zhanghao Wu, Zhijian Liu, Han Cai, Ligeng Zhu, Chuang Gan, and Song Han. Hat: Hardware-aware transformers for efficient natural language processing. arXiv preprint arXiv:2005.14187, 2020.
|
| 282 |
+
|
| 283 |
+
[44] Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. mt5: A massively multilingual pre-trained text-to-text transformer, 2020.
|
| 284 |
+
[45] Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. arXiv preprint arXiv:2007.14062, 2020.
|
| 285 |
+
[46] Jingqing Zhang, Yao Zhao, Mohammad Saleh, and Peter J. Liu. Pegasus: Pre-training with extracted gap-sentences for abstractive summarization, 2020.
|
| 286 |
+
[47] Aojun Zhou, Yukun Ma, Junnan Zhu, Jianbo Liu, Zhijie Zhang, Kun Yuan, Wenxiu Sun, and Hongsheng Li. Learning n:m fine-grained structured sparse neural networks from scratch. In International Conference on Learning Representations, 2021. URL https://openreview. net/forum?id=K9bw7vqp_s.
|
md/train/0HW7A5YZjq7/0HW7A5YZjq7.md
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Self-Supervised Learning with Kernel Dependence Maximization
|
| 2 |
+
|
| 3 |
+
Yazhe Li∗ DeepMind and Gatsby Unit, UCL yazhe@google.com
|
| 4 |
+
|
| 5 |
+
Roman Pogodin∗ Gatsby Unit, UCL roman.pogodin.17@ucl.ac.uk
|
| 6 |
+
|
| 7 |
+
Danica J. Sutherland UBC and Amii† dsuth@cs.ubc.ca
|
| 8 |
+
|
| 9 |
+
Arthur Gretton Gatsby Unit, UCL arthur.gretton@gmail.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
We approach self-supervised learning of image representations from a statistical dependence perspective, proposing Self-Supervised Learning with the HilbertSchmidt Independence Criterion (SSL-HSIC). SSL-HSIC maximizes dependence between representations of transformations of an image and the image identity, while minimizing the kernelized variance of those representations. This framework yields a new understanding of InfoNCE, a variational lower bound on the mutual information (MI) between different transformations. While the MI itself is known to have pathologies which can result in learning meaningless representations, its bound is much better behaved: we show that it implicitly approximates SSLHSIC (with a slightly different regularizer). Our approach also gives us insight into BYOL, a negative-free SSL method, since SSL-HSIC similarly learns local neighborhoods of samples. SSL-HSIC allows us to directly optimize statistical dependence in time linear in the batch size, without restrictive data assumptions or indirect mutual information estimators. Trained with or without a target network, SSL-HSIC matches the current state-of-the-art for standard linear evaluation on ImageNet [1], semi-supervised learning and transfer to other classification and vision tasks such as semantic segmentation, depth estimation and object recognition. Code is available at https://github.com/deepmind/ssl_hsic.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Learning general-purpose visual representations without human supervision is a long-standing goal of machine learning. Specifically, we wish to find a feature extractor that captures the image semantics of a large unlabeled collection of images, so that e.g. various image understanding tasks can be achieved with simple linear models. One approach takes the latent representation of a likelihood-based generative model [2–8]; such models, though, solve a harder problem than necessary since semantic features need not capture low-level details of the input. Another option is to train a self-supervised model for a “pretext task,” such as predicting the position of image patches, identifying rotations, or image inpainting [9–14]. Designing good pretext tasks, however, is a subtle art, with little theoretical guidance available. Recently, a class of models based on contrastive learning [15–22] has seen substantial success: dataset images are cropped, rotated, color shifted, etc. into several views, and features are then trained to pull together representations of the “positive” pairs of views of the same source image, and push apart those of “negative” pairs (from different images). These methods are either understood from an information theoretic perspective as estimating the mutual information between the “positives” [15], or explained as aligning features subject to a uniformity constraint [23]. Another line of research [24, 25] attempts to learn representation without the “negative” pairs, but requires either a target network or stop-gradient operation to avoid collapsing.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Top-1 accuracies with linear evaluation for different ResNet architecture and methods: supervised (as in [25]), SSL-HSIC (with a target network; ours), BYOL [25], SwAV [18], SimCLR [19], MoCo v2 [20] and Barlow Twins [22].
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2: Statistical dependence view of contrastive learning: representations of transformed images should highly depend on image identity. Measuring dependence with HSIC, this pushes different images’ representation distributions apart (black arrows) and pulls representations of the same image together (colored shapes).
|
| 24 |
+
|
| 25 |
+
We examine the contrastive framework from a statistical dependence point of view: feature representations for a given transformed image should be highly dependent on the image identity (Figure 2). To measure dependence, we turn to the Hilbert-Schmidt Independence Criterion (HSIC) [26], and propose a new loss for self-supervised learning which we call SSL-HSIC. Our loss is inspired by HSIC Bottleneck [27, 28], an alternative to Information Bottleneck [29], where we use the image identity as the label, but change the regularization term.
|
| 26 |
+
|
| 27 |
+
Through the dependence maximization perspective, we present a unified view of various selfsupervised losses. Previous work [30] has shown that the success of InfoNCE cannot be solely attributed to properties of mutual information, in particular because mutual information (unlike kernel measures of dependence) has no notion of geometry in feature space: for instance, all invertible encoders achieve maximal mutual information, but they can output dramatically different representations with very different downstream performance [30]. Variational bounds on mutual information do impart notions of locality that allow them to succeed in practice, departing from the mutual information quantity that they try to estimate. We prove that InfoNCE, a popular such bound, in fact approximates SSL-HSIC with a variance-based regularization. Thus, InfoNCE can be thought of as working because it implicitly estimates a kernel-based notion of dependence. We additionally show SSL-HSIC is related to metric learning, where the features learn to align to the structure induced by the self-supervised labels. This perspective is closely related to the objective of BYOL [25], and can explain properties such as alignment and uniformity [23] observed in contrastive learning.
|
| 28 |
+
|
| 29 |
+
Our perspective brings additional advantages, in computation and in simplicity of the algorithm, compared with existing approaches. Unlike the indirect variational bounds on mutual information [15, 31, 32], SSL-HSIC can be directly estimated from mini-batches of data. Unlike “negative-free” methods, the SSL-HSIC loss itself penalizes trivial solutions, so techniques such as target networks are not needed for reasonable outcomes. Using a target network does improve the performance of our method, however, suggesting target networks have other advantages that are not yet well understood. Finally, we employ random Fourier features [33] in our implementation, resulting in cost linear in batch size.
|
| 30 |
+
|
| 31 |
+
Our main contributions are as follows:
|
| 32 |
+
|
| 33 |
+
• We introduce SSL-HSIC, a principled self-supervised loss using kernel dependence maximization. • We present a unified view of contrastive learning through dependence maximization, by establishing relationships between SSL-HSIC, InfoNCE, and metric learning.
|
| 34 |
+
|
| 35 |
+
• Our method achieves top-1 accuracy of $7 4 . 8 \%$ and top-5 accuracy of $9 2 . 2 \%$ with linear evaluations (see Figure 1 for a comparison with other methods), top-1 accuracy of $8 0 . 2 \%$ and Top-5 accuracy of $9 4 . 7 \%$ with fine-tuning, and competitive performance on a diverse set of downstream tasks.
|
| 36 |
+
|
| 37 |
+
# 2 Background
|
| 38 |
+
|
| 39 |
+
# 2.1 Self-supervised learning
|
| 40 |
+
|
| 41 |
+
Recent developments in self-supervised learning, such as contrastive learning, try to ensure that features of two random views of an image are more associated with each other than with random views of other images. Typically, this is done through some variant of a classification loss, with one “positive” pair and many “negatives.” Other methods can learn solely from “positive” pairs, however. There have been many variations of this general framework in the past few years.
|
| 42 |
+
|
| 43 |
+
Van den Oord et al. [15] first formulated the InfoNCE loss, which estimates a lower bound of the mutual information between the feature and the context. SimCLR [19, 34] carefully investigates the contribution of different data augmentations, and scales up the training batch size to include more negative examples. MoCo [17] increases the number of negative examples by using a memory bank. BYOL [25] learns solely on positive image pairs, training so that representations of one view match that of the other under a moving average of the featurizer. Instead of the moving average, SimSiam [24] suggests a stop-gradient on one of the encoders is enough to prevent BYOL from finding trivial solutions. SwAV [18] clusters the representation online, and uses distance from the cluster centers rather than computing pairwise distances of the data. Barlow Twins [22] uses an objective related to the cross-correlation matrix of the two views, motivated by redundancy reduction. It is perhaps the most related to our work in the literature (and their covariance matrix can be connected to HSIC [35]), but our method measures dependency more directly. While Barlow Twins decorrelates components of final representations, we maximize the dependence between the image’s abstract identity and its transformations.
|
| 44 |
+
|
| 45 |
+
On the theory side, InfoNCE is proposed as a variational bound on Mutual Information between the representation of two views of the same image [15, 32]. Tschannen et al. [30] observe that InfoNCE performance cannot be explained solely by the properties of the mutual information, however, but is influenced more by other factors, such as the formulation of the estimator and the architecture of the feature extractor. Essentially, representations with the same MI can have drastically different representational qualities.
|
| 46 |
+
|
| 47 |
+
To see this, consider a problem with two inputs, $A$ and $B$ (Figure 3, green and purple), and a one-dimensional featurizer, parameterized by the integer $M$ , which maps $A$ to Uniform $\langle \bar { \{ 0 , 2 , \ldots , 2 M \} } \rangle$ ) and $B$ to $\operatorname { U n i f o r m } ( \{ 1 , 3 , \dotsc , 2 M + 1 \} )$ . When $M \ = \ 0$ , the inputs are encoded into linearly separable features $A = 0$ and $B = 1$ (Figure 3, bottom). Otherwise when $M > 0$ , they are interspersed like $A B A B A B A B - { \mathfrak { a } }$ representation which is much harder to work with for downstream learners. Nevertheless, the mutual information between the features of any two augmentations of the same input (a positive pair) is independent of $M$ , that is $H [ Z _ { 1 } ] - H [ Z _ { 1 } \bar { | } Z _ { 2 } ] = \log 2$ for any $M$ . Note that InfoNCE would strongly prefer $M = 0$ , indeed behaving very differently from MI.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 3: Three distributions of positive examples for two classes (green and purple) that have the same mutual information, but drastically different quality for downstream learners.
|
| 51 |
+
|
| 52 |
+
ater theories suggest that contrastive losses balance alignment of individual features and uniformity of the feature distribution [23], or in general alignment and some loss-defined distribution [36]. We propose to interpret the contrastive loss through the lens of statistical dependence, and relate it to metric learning, which naturally leads to alignment and uniformity.
|
| 53 |
+
|
| 54 |
+
# 2.2 Hilbert-Schmidt Independence Criterion (HSIC)
|
| 55 |
+
|
| 56 |
+
The Hilbert-Schmidt Independence Criterion (HSIC) [26] is a kernel-based measure of dependence between probability distributions. Like mutual information, for a wide range of kernels ${ \mathrm { H S I C } } ( X , Y ) = 0$ if and only if $X$ and $Y$ are independent [37], and large values of the measure correspond to “more dependence.” Unlike mutual information, HSIC incorporates a notion of geometry (via the kernel choice), and is both statistically and computationally easy to estimate. It has been used in a variety of applications, particularly for independence testing [38], but it has also been maximized in applications such as feature selection [39], clustering [40, 41], active learning [42], and as a classification loss called HSIC Bottleneck [27, 28] (similar ideas were expressed in [43, 44]).
|
| 57 |
+
|
| 58 |
+
HSIC measures the dependence between two random variables by first taking a nonlinear feature transformation of each, say $\phi : \mathcal { X } \to \mathcal { F }$ and $\psi : \mathcal { V } \to \mathcal { G }$ (with $\mathcal { F }$ and $\mathcal { G }$ reproducing kernel Hilbert spaces, RKHSes1), and then evaluating the norm of the cross-covariance between those features:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\operatorname { H S I C } ( X , Y ) = \left\| \mathbb { E } [ \phi ( X ) \psi ( Y ) ^ { \top } ] - \mathbb { E } [ \phi ( X ) ] \mathbb { E } [ \psi ( Y ) ] ^ { \top } \right\| _ { H S } ^ { 2 } .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Here $\| \cdot \| _ { H S }$ is the Hilbert-Schmidt norm, which in finite dimensions is the usual Frobenius norm. HSIC measures the scale of the correlation in these nonlinear features, which allows it to identify nonlinear dependencies between $X$ and $Y$ with appropriate features $\phi$ and $\psi$ .
|
| 65 |
+
|
| 66 |
+
Inner products in an RKHS are by definition kernel functions: $k ( x , x ^ { \prime } ) \ = \ \langle \phi ( x ) , \phi ( x ^ { \prime } ) \rangle _ { \mathcal { F } }$ and $l ( y , y ^ { \prime } ) = \langle \psi ( y ) , \psi ( y ^ { \prime } ) \rangle _ { \mathcal { G } }$ . Let $( X ^ { \prime } , Y ^ { \prime } )$ , $( X ^ { \prime \prime } , Y ^ { \prime \prime } )$ be independent copies of $( X , Y )$ ; this gives
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\operatorname { H S I C } ( X , Y ) = \operatorname { \mathbb { E } } \left[ k ( X , X ^ { \prime } ) l ( Y , Y ^ { \prime } ) \right] - 2 \operatorname { \mathbb { E } } \left[ k ( X , X ^ { \prime } ) l ( Y , Y ^ { \prime \prime } ) \right] + \operatorname { \mathbb { E } } \left[ k ( X , X ^ { \prime } ) \right] \operatorname { \mathbb { E } } \left[ l ( Y , Y ^ { \prime } ) \right] .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
HSIC is also straightforward to estimate: given i.i.d. samples $\left\{ ( x _ { 1 } , y _ { 1 } ) , \dotsc , ( x _ { N } , y _ { N } ) \right\}$ drawn i.i.d. from the joint distribution of $( X , Y )$ , Gretton et al. [26] propose an estimator
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
{ \widehat { \mathrm { H S I C } } } ( X , Y ) = \frac { 1 } { ( N - 1 ) ^ { 2 } } \mathrm { T r } ( K H L H ) ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $K _ { i j } = k ( x _ { i } , x _ { j } )$ and $L _ { i j } = l ( y _ { i } , y _ { j } )$ are the kernel matrices, and $\begin{array} { r } { H = I - \frac { 1 } { N } \mathbf { 1 } \mathbf { 1 } ^ { \top } } \end{array}$ is called the centering matrix. This estimator has an $\bar { O } ( 1 / N )$ bias, which is not a concern for our uses; however, an unbiased estimator with the same computational cost is available [39].
|
| 79 |
+
|
| 80 |
+
# 3 Self-supervised learning with Kernel Dependence Maximization
|
| 81 |
+
|
| 82 |
+
Our method builds on the self-supervised learning framework used by most of the recent selfsupervised learning approaches [16–19, 22, 24, 25]. For a dataset with $N$ points $x _ { i }$ , each point goes through a random transformation $t ^ { p } ( x _ { i } )$ (e.g. random crop), and then forms a feature representation $z _ { i } ^ { p } = { \bar { f } } _ { \theta } ( t ^ { p } ( x _ { i } ) )$ with an encoder network $f _ { \theta }$ . We associate each image $x _ { i }$ with its identity $y _ { i }$ , which works as a one-hot encoded label: $y _ { i } \in \mathbb { R } ^ { N }$ and $( y _ { i } ) _ { d } = 1$ iff $d = i$ (and zero otherwise). To match the transformations and image identities, we maximize the dependence between $z _ { i }$ and $y _ { i }$ such that $z _ { i }$ is predictive of its original image. To build representations suitable for downstream tasks, we also need to penalize high-variance representations. These ideas come together in our HSIC-based objective for self-supervised learning, which we term SSL-HSIC:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { S S L - H S I C } } ( \boldsymbol { \theta } ) = - \mathrm { H S I C } \left( \boldsymbol { Z } , \boldsymbol { Y } \right) + \gamma \sqrt { \mathrm { H S I C } \left( \boldsymbol { Z } , \boldsymbol { Z } \right) } . } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Unlike contrastive losses, which make the $z _ { i } ^ { p }$ from the same $x _ { i }$ closer and those from different $x _ { j }$ more distant, we propose an alternative way to match different transformations of the same image with its abstract identity (e.g. position in the dataset).
|
| 89 |
+
|
| 90 |
+
Our objective also resembles the HSIC bottleneck for supervised learning [27] (in particular, the version of [28]), but ours uses a square root for $\mathrm { H S I C } ( Z , Z )$ . The square root makes the two terms on the same scale: $\mathrm { H S I C } ( Z , Y )$ is effectively a dot product, and $\sqrt { \mathrm { H S I C } ( Z , Z ) }$ a norm, so that e.g. scaling the kernel by a constant does not change the relative amount of regularization;2 this also gives better performance in practice.
|
| 91 |
+
|
| 92 |
+
Due to the one-hot encoded labels, we can re-write HSIC $( Z , Y )$ as (see Appendix A)
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { \mathrm { H S I C } ( Z , Y ) \propto \mathbb { E } _ { z _ { 1 } , z _ { 2 } \sim p o s } \left[ k ( z _ { 1 } , z _ { 2 } ) \right] - \mathbb { E } _ { z _ { 1 } } \mathbb { E } _ { z _ { 2 } } \left[ k ( z _ { 1 } , z _ { 2 } ) \right] , } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where the first expectation is over the distribution of “positive” pairs (those from the same source image), and the second one is a sum over all image pairs, including their transformations. The first term in (5) pushes representations belonging to the same image identity together, while the second term keeps mean representations for each identity apart (as in Figure 2). The scaling of $\mathrm { H S I C } ( Z , Y )$ depends on the choice of the kernel over $Y$ , and is irrelevant to the optimization.
|
| 99 |
+
|
| 100 |
+
This form also reveals three key theoretical results. Section 3.1 shows that InfoNCE is better understood as an HSIC-based loss than a mutual information between views. Section 3.2 reveals that the dependence maximization in $\mathrm { H S I C } ( Z , Y )$ can also be viewed as a form of distance metric learning, where the cluster structure is defined by the labels. Finally, $\mathrm { H S I C } ( Z , Y )$ is proportional to the average kernel-based distance between the distribution of views for each source image (the maximum mean discrepancy, MMD; see Appendix B.2).
|
| 101 |
+
|
| 102 |
+
# 3.1 Connection to InfoNCE
|
| 103 |
+
|
| 104 |
+
In this section we show the connection between InfoNCE and our loss; see Appendix B for full details. We first write the latter in its infinite sample size limit (see [23] for a derivation) as
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\mathcal { L } _ { \mathrm { I n f o N C E } } ( \theta ) = - \mathbb { E } _ { z _ { 1 } , z _ { 2 } \sim \mathrm { p o s } } \left[ k ( z _ { 1 } , z _ { 2 } ) \right] + \mathbb { E } _ { z _ { 1 } } \log \mathbb { E } _ { z _ { 2 } } \left[ \exp \left( k ( z _ { 1 } , z _ { 2 } ) \right) \right] ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where the last two expectations are taken over all points, and the first is over the distribution of positive pairs. The kernel $k ( z _ { 1 } , z _ { 2 } )$ was originally formulated as a scoring function in a form of a dot product [15], and then a scaled cosine similarity [19]. Both functions are valid kernels.
|
| 111 |
+
|
| 112 |
+
Now assume that $k ( z _ { 1 } , z _ { 2 } )$ doesn’t deviate much from $\mathbb { E } _ { z _ { 2 } } \left[ k ( z _ { 1 } , z _ { 2 } ) \right]$ , Taylor-expand the exponent in (6) around $\mathbb { E } _ { z _ { 2 } } \left[ k ( z _ { 1 } , z _ { 2 } ) \right]$ , then expand $\log ( 1 + \mathbb { E } _ { z _ { 2 } } ( . . . ) ) \approx \mathbb { E } _ { z _ { 2 } } ( . . . )$ . We obtain an $\mathrm { H S I C } ( Z , Y )$ - based objective:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\mathcal { L } _ { \mathrm { I n f o N C E } } ( \theta ) \approx \underbrace { - \mathbb { E } _ { z _ { 1 } , z _ { 2 } \sim \mathrm { p o s } } \left[ k ( z _ { 1 } , z _ { 2 } ) \right] + \mathbb { E } _ { z _ { 1 } } \mathbb { E } _ { z _ { 2 } } \left[ k ( z _ { 1 } , z _ { 2 } ) \right] } _ { \propto - \mathrm { H S I C } ( Z , Y ) } + \underbrace { \frac { 1 } { 2 } \mathbb { E } _ { z _ { 1 } } \left[ \mathbb { V } \mathrm { a r } _ { z _ { 2 } } \left[ k ( z _ { 1 } , z _ { 2 } ) \right] \right] } _ { \mathrm { v a r i a n c e p e n a l t y } } .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
Since the scaling of $\mathrm { H S I C } ( Z , Y )$ is irrelevant to the optimization, we assume scaling to replace $\propto$ with $=$ . In the small variance regime, we can show that for the right $\gamma$ ,
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r } { - \mathrm { H S I C } \left( Z , Y \right) + \gamma \mathrm { H S I C } \left( Z , Z \right) \le \mathcal { L } _ { \mathrm { I n f o N C E } } ( \theta ) + o ( \mathrm { v a r i a n c e } ) . } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
For $\mathrm { H S I C } ( Z , Z ) \le 1$ , we also have that
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
- \mathrm { H S I C } \left( Z , Y \right) + \gamma \mathrm { H S I C } \left( Z , Z \right) \leq \mathcal { L } _ { \mathrm { S S L - H S I C } } ( \theta )
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
due to the square root. InfoNCE and SSL-HSIC in general don’t quite bound each other due to discrepancy in the variance terms, but in practice the difference is small.
|
| 131 |
+
|
| 132 |
+
Why should we prefer the HSIC interpretation of InfoNCE? Initially, InfoNCE was suggested as a variational approximation to the mutual information between two views [15]. It has been observed, however, that using tighter estimators of mutual information leads to worse performance [30]. It is also simple to construct examples where InfoNCE finds different representations while the underlying MI remains constant [30]. Alternative theories suggest that InfoNCE balances alignment of “positive” examples and uniformity of the overall feature representation [23], or that (under strong assumptions) it can identify the latent structure in a hypothesized data-generating process, akin to nonlinear ICA [50]. Our view is consistent with these theories, but doesn’t put restrictive assumptions on the input data or learned representations. In Section 5 (summarized in Table 8a), we show that our interpretation gives rise to a better objective in practice.
|
| 133 |
+
|
| 134 |
+
# 3.2 Connection to metric learning
|
| 135 |
+
|
| 136 |
+
Our SSL-HSIC objective is closely related to kernel alignment [48], especially centered kernel alignment [49]. As a kernel method for distance metric learning, kernel alignment measures the agreement between a kernel function and a target function. Intuitively, the self-supervised labels $Y$ imply a cluster structure, and $\mathrm { H S I C } ( Z , Y )$ estimates the degree of agreement between the learned features and this cluster structure in the kernel space. This relationship with clustering is also established in [40, 41, 45], where labels are learned rather than features. The clustering perspective is more evident when we assume linear kernels over both $Z$ and $Y$ , and $Z$ is unit length and centered:3
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r l } & { - \mathrm { H S I C } ( Z , Y ) \propto - \displaystyle \frac { 1 } { M } T r ( Y ^ { \top } Z ^ { \top } Z Y ) + T r ( Z ^ { \top } Z ) - N M } \\ & { \qquad = - \displaystyle \frac { 1 } { M } \sum _ { i = 1 } ^ { N } \left\| \sum _ { p = 1 } ^ { M } z _ { i } ^ { p } \right\| _ { 2 } ^ { 2 } + \sum _ { i = 1 } ^ { N } \sum _ { p = 1 } ^ { M } \| z _ { i } ^ { p } \| _ { 2 } ^ { 2 } - N M = \sum _ { i = 1 } ^ { N } \sum _ { p = 1 } ^ { M } \| z _ { i } ^ { p } - \bar { z } _ { i } \| _ { 2 } ^ { 2 } - N M , } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
with $M$ the number of augmentations per image and $\bar { z } _ { i } = \sum _ { p } z _ { i } ^ { p } / M$ the average feature vector of the augmented views of $x _ { i }$ . We emphasize, though, that (10) assumes centered, normalized data with linear kernels; the right-hand side of (10) could be optimized by setting all $z _ { i } ^ { p }$ to the same vector for each $i$ , but this does not actually optimize $\mathrm { H S I C } ( Z , \bar { Y } )$ .
|
| 143 |
+
|
| 144 |
+
Equation (10) shows that we recover the spectral formulation [51] and sum-of-squares loss used in the $\mathbf { k }$ -means clustering algorithm from the kernel objective. Moreover, the self-supervised label imposes that the features from transformations of the same image are gathered in the same cluster. Equation (10) also allows us to connect SSL-HSIC to non-contrastive objectives such as BYOL, although the connection is subtle because of its use of predictor and target networks. If each image is augmented with two views, we can compute (10) using $\bar { z _ { i } } \approx ( z _ { i } ^ { 1 } + \bar { z _ { i } ^ { 2 } } ) / 2$ , so the clustering loss becomes $\propto \textstyle \sum _ { i } | | z _ { i } ^ { 1 } - z _ { i } ^ { 2 } | | _ { 2 } ^ { 2 }$ . This is exactly the BYOL objective, only that $z _ { i } ^ { 2 }$ in BYOL comes from a target network. The assumption of centered and normalized features for (10) is important in the case of BYOL: without it, BYOL can find trivial solutions where all the features are collapsed to the same feature vector far away from the origin. The target network is used to prevent the collapse. SSL-HSIC, on the other hand, rules out such a solution by building the centering into the loss function, and therefore can be trained successfully without a target network or stop gradient operation.
|
| 145 |
+
|
| 146 |
+
# 3.3 Estimator of SSL-HSIC
|
| 147 |
+
|
| 148 |
+
To use SSL-HSIC, we need to correctly and efficiently estimate (4). Both points are non-trivial: the self-supervised framework implies non-i.i.d. batches (due to positive examples), while the estimator in (3) assumes i.i.d. data; moreover, the time to compute (3) is quadratic in the batch size.
|
| 149 |
+
|
| 150 |
+
First, for $\mathrm { H S I C } ( Z , Z )$ we use the biased estimator in (3). Although the i.i.d. estimator (3) results in an $O ( 1 / B )$ bias for $B$ original images in the batch size (see Appendix A), the batch size $B$ is large in our case and therefore the bias is negligible. For $\mathrm { H S I C } ( Z , Y )$ the situation is more delicate: the i.i.d. estimator needs re-scaling, and its bias depends on the number of positive examples $M$ , which is typically very small (usually 2). We propose the following estimator:
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\widehat { \mathrm { H S I C } } ( Z , Y ) = \frac { \Delta l } { N } \left( \frac { 1 } { B M ( M - 1 ) } \sum _ { i p l } k ( z _ { i } ^ { p } , z _ { i } ^ { l } ) - \frac { 1 } { B ^ { 2 } M ^ { 2 } } \sum _ { i j p l } k ( z _ { i } ^ { p } , z _ { j } ^ { l } ) - \frac { 1 } { M - 1 } \right) ,
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
where $i$ and $j$ index original images, and $p$ and $l$ their random transformations; $k$ is the kernel used for latent $Z , l$ is the kernel used for the labels, and $\Delta l = l ( i , i ) - l ( i , j )$ ( $\it l$ for same labels minus $l$ for different labels). Note that due to the one-hot structure of self-supervised labels $Y$ , the standard (i.i.d.-based) estimator would miss the $1 / N$ scaling and the $M - 1$ correction (the latter is important in practice, as we usually have $M = 2$ ). See Appendix A for the derivations.
|
| 157 |
+
|
| 158 |
+
For convenience, we assume $\Delta l = N$ (any scaling of $l$ can be subsumed by $\gamma$ ), and optimize
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\widehat { \mathcal { L } } _ { \mathrm { S S L - H S I C } } ( \theta ) = - \widehat { \mathrm { H S I C } } ( Z , Y ) + \gamma \sqrt { \widehat { \mathrm { H S I C } } ( Z , Z ) } .
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
The computational complexity of the proposed estimators is $O ( B ^ { 2 } M ^ { 2 } )$ for each mini-batch of size $B$ with $M$ augmentations. We can reduce the complexity to $O ( B M )$ by using random Fourier features (RFF) [33], which approximate the kernel $k ( z _ { 1 } , z _ { 2 } )$ with a carefully chosen random $D$ -dimensional approximation $R ( z _ { 1 } ) ^ { \top } R ( z _ { 2 } )$ for $R ( z ) : \mathbb { R } ^ { D _ { z } } \mathbb { R } ^ { D }$ , such that $\begin{array} { r } { k ( z _ { 1 } , z _ { 2 } ) = \mathbb { E } \left[ R ( z _ { 1 } ) ^ { \top } R ( z _ { 2 } ) \right] , } \end{array}$ . Fourier frequencies are sampled independently for the two kernels on $Z$ in $\mathrm { H S I C } ( Z , Z )$ at each training step. We leave the details on how to construct $R ( z )$ for the kernels we use to Appendix C.
|
| 165 |
+
|
| 166 |
+
# 4 Experiments
|
| 167 |
+
|
| 168 |
+
In this section, we present our experimental setup, where we assess the performance of the representation learned with SSL-HSIC both with and without a target network. First, we train a model with a standard ResNet-50 backbone using SSL-HSIC as objective on the training set of ImageNet ILSVRC-2012 [1]. For evaluation, we retain the backbone as a feature extractor for downstream tasks. We evaluate the representation on various downstream tasks including classification, object segmentation, object detection and depth estimation.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 4: Architecture and SSL-HSIC objective. A self-supervised label $y$ – an indicator of the image identity – is associated with an image $x$ . Image transformation functions $t$ are sampled and applied to the original image, resulting in views $t ^ { 1 } ( x )$ and $t ^ { 2 } ( x )$ . Features $z ^ { 1 }$ and $z ^ { 2 }$ are obtained after passing the augmented views through encoder $( f )$ , projector $( g )$ , and possibly predictor $( q )$ networks, while label $y$ is retained. Kernel matrices, $K$ for the latents and $L$ for the labels, are computed on the mini-batch of data; SSL-HSIC is estimated with $K$ and $L$ as in (12). The blue boxes reflect two potential options: when using a target network, $\xi$ is a moving average of $\theta$ , and a predictor network $q$ is added; without the target network, $q$ is removed and $\xi$ is simply equal to $\theta$ .
|
| 172 |
+
|
| 173 |
+
# 4.1 Implementation
|
| 174 |
+
|
| 175 |
+
Architecture Figure 4 illustrates the architecture we used for SSL-HSIC in this section. To facilitate comparison between different methods, our encoder $f _ { \theta }$ uses the standard ResNet-50 backbone without the final classification layer. The output of the encoder is a 2048-dimension embedding vector, which is the representation used for downstream tasks. As in BYOL [25], our projector $g$ and predictor $q$ networks are 2-layer MLPs with 4096 hidden dimensions and 256 output dimensions. The outputs of the networks are batch-normalized and rescaled to unit norm before computing the loss. We use an inverse multiquadric kernel (IMQ) for the latent representation (approximated with 512 random Fourier features that are resampled at each step; see Appendix C for details) and a linear kernel for labels. $\gamma$ in (4) is set to 3. When training without a target network, unlike SimSiam [24], we do not stop gradients for either branch. If the target network is used, its weights are an exponential moving average of the online network weights. We employ the same schedule as BYOL [25], $\tau = 1 \stackrel { - } { - } 0 . 0 1 \stackrel { - } { \cdot } ( \cos ( \pi t / T ) + 1 ) / 2$ with $t$ the current step and $T$ the total training steps.
|
| 176 |
+
|
| 177 |
+
Image augmentation Our method uses the same data augmentation scheme as BYOL (see Appendix D.1). Briefly, we first draw a random patch from the original image and resize it to $2 2 4 \times 2 2 4$ Then, we apply a random horizontal flip, followed by color jittering, consisting of a random sequence of brightness, contrast, saturation, hue adjustments, and an optional grayscale conversion. Finally Gaussian blur and solarization are applied, and the view is normalized with ImageNet statistics.
|
| 178 |
+
|
| 179 |
+
Optimization We train the model with a batch size of 4096 on 128 Cloud TPU v4 cores. Again, following [19, 25], we use the LARS optimizer [52] with a cosine decay learning rate schedule over 1000 epochs. The base learning rate to all of our experiments is 0.4 and it is scaled linearly [53] with the batch size $l r = 0 . 4 \times b a t c h { \_ } s i z e / 2 5 6 .$ . All experiments use weight decay of $1 0 ^ { - 6 }$ .
|
| 180 |
+
|
| 181 |
+
Learning kernel parameters We use a linear kernel for labels, since the type of kernel only scales (12). Our inverse multiquadric kernel for the latent $Z$ has an additional kernel scale parameter. We optimize this along with all other parameters, but regularize it to maximize the entropy of the distribution $k _ { \sigma } ( s )$ , where $s _ { i j } = \lVert { z } _ { i } - { z } _ { j } \rVert ^ { 2 }$ ; this amounts to maximizing $\log \lVert k _ { \sigma } ^ { \prime } ( s ) \rVert ^ { 2 }$ (Appendix D.1.2).
|
| 182 |
+
|
| 183 |
+
Linear evaluation on ImageNet Learned features are evaluated with the standard linear evaluation protocol commonly used in evaluating self-supervised learning methods [15–22, 25]. Table 1 reports the top-1 and top-5 accuracies obtained with SSL-HSIC on ImageNet validation set, and compares to previous self-supervised learning methods. Without a target network, our method reaches $7 2 . 2 \%$ top-1 and $9 0 . 7 \%$ top-5 accuracies. Unlike BYOL, the SSL-HSIC objective prevents the network from finding trivial solutions as explained in Section 3.2. Adding the target network, our method outperforms most previous methods, achieving top-1 accuracy of $7 4 . 8 \%$ and top-5 accuracy of $9 2 . 2 \%$ The fact that we see performance gains from adopting a target network suggests that its effect is not yet well understood, although note discussion in [25] which points to its stabilizing effect.
|
| 184 |
+
|
| 185 |
+
Table 1: Linear evaluation on the ImageNet validation set.
|
| 186 |
+
|
| 187 |
+
<table><tr><td></td><td>Top-1(%)</td><td>Top-5(%)</td></tr><tr><td>Supervised [54]</td><td>75.9</td><td>92.8</td></tr><tr><td>SimCLR[19]</td><td>69.3</td><td>89.0</td></tr><tr><td>MoCo v2 [20]</td><td>71.1</td><td>90.1</td></tr><tr><td>BYOL [25]</td><td>74.3</td><td>91.6</td></tr><tr><td>SwAV[18]</td><td>75.3</td><td>-</td></tr><tr><td>Barlow Twins [22]</td><td>73.2</td><td>91.0</td></tr><tr><td>SSL-HSIC (w/o target)</td><td>72.2</td><td>90.7</td></tr><tr><td>SSL-HSIC (w/ target)</td><td>74.8</td><td>92.2</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 2: Fine-tuning on $1 \%$ , $10 \%$ and $100 \%$ of the ImageNet training set and evaluating on the validation set.
|
| 190 |
+
|
| 191 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Top-1(%)</td><td colspan="3">Top-5(%)</td></tr><tr><td>1%</td><td>10%</td><td>100%</td><td>1%</td><td>10%</td><td>100%</td></tr><tr><td>Supervised [54]</td><td>25.4</td><td>56.4</td><td>75.9</td><td>48.4</td><td>80.4</td><td>92.8</td></tr><tr><td>SimCLR [19]</td><td>48.3</td><td>65.6</td><td>76.0</td><td>75.5</td><td>87.8</td><td>93.1</td></tr><tr><td>BYOL [25]</td><td>53.2</td><td>68.8</td><td>77.7</td><td>78.4</td><td>89.0</td><td>93.9</td></tr><tr><td>SwAV[18]</td><td>53.9</td><td>70.2</td><td>1</td><td>78.5</td><td>89.9</td><td>-</td></tr><tr><td>Barlow Twins [22]</td><td>55.0</td><td>69.7</td><td>-</td><td>79.2</td><td>89.3</td><td>-</td></tr><tr><td>SSL-HSIC (w/o target)</td><td>45.3</td><td>65.5</td><td>76.4</td><td>72.7</td><td>87.5</td><td>93.2</td></tr><tr><td>SSL-HSIC (w/ target)</td><td>52.1</td><td>67.9</td><td>77.2</td><td>77.7</td><td>88.6</td><td>93.6</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Semi-supervised learning on ImageNet We fine-tune the network pretrained with SSL-HSIC on $1 \%$ , $10 \%$ and $100 \%$ of ImageNet, using the same ImageNet splits as SimCLR [19]. Table 2 summarizes the semi-supervised learning performance. Our method, with or without a target network, has competitive performance in both data regimes. The target network has the most impact on the small-data regime, with $1 \%$ labels.
|
| 194 |
+
|
| 195 |
+
Table 3: Comparison of transfer learning performance on 12 image datasets. Supervised-IN is trained on ImageNet with supervised pretrainining. Random init trains on individual dataset with randomly initialized weights. MPCA refers to mean per-class accuracy; AP50 is average precision at $\mathrm { I o U } { = } 0 . 5$ .
|
| 196 |
+
|
| 197 |
+
<table><tr><td>Dataset Metric</td><td>Birdsnap Caltechl01 Cifarl0 Cifarl001 Top-1</td><td>MPCA</td><td></td><td>Top-1</td><td>DTD Top-1</td><td>Aircraft Food Flowers</td><td>MPCA Top-1</td><td>MPCA MPCA Top-1</td><td>Pets</td><td>Cars</td><td>Top-1</td><td>SUN397 VOC2007 AP50</td></tr><tr><td>Linear:</td><td></td><td></td><td>Top-1</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Supervised-IN [19]</td><td>53.7</td><td>94.5</td><td>93.6</td><td>78.3</td><td></td><td>61.0</td><td>72.3</td><td>94.7</td><td>91.5</td><td>67.8</td><td>61.9</td><td>82.8</td></tr><tr><td>SimCLR[19]</td><td>37.4</td><td>90.3</td><td>90.6</td><td>71.6</td><td>74.9 74.5</td><td>50.3</td><td>68.4</td><td>90.3</td><td>83.6</td><td>50.3</td><td>58.8</td><td>80.5</td></tr><tr><td>BYOL [25]</td><td>57.2</td><td>94.2</td><td>91.3</td><td>78.4</td><td>75.5</td><td>60.6</td><td>75.3</td><td>96.1</td><td>90.4</td><td>66.7</td><td>62.2</td><td>82.5</td></tr><tr><td>SSL-HSIC (w/o target)</td><td>50.6</td><td>92.3</td><td>91.5</td><td>75.9</td><td>75.3</td><td>57.9</td><td>73.6</td><td>95.0</td><td>88.2</td><td>59.3</td><td>61.0</td><td>81.4</td></tr><tr><td>SSL-HSIC (w/ target)</td><td>57.8</td><td>93.5</td><td>92.3</td><td>77.0</td><td>76.2</td><td>58.5</td><td>75.6</td><td>95.4</td><td>91.2</td><td>62.6</td><td>61.8</td><td>83.3</td></tr><tr><td>Fine-tuned:</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Supervised-IN [19]</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>85.0</td></tr><tr><td>Random init [19]</td><td>75.8</td><td>93.3</td><td>97.5</td><td>86.4</td><td>74.6</td><td>86.0 85.9</td><td>88.3</td><td>97.6</td><td>92.1</td><td>92.1</td><td>94.3 53.6</td><td>67.3</td></tr><tr><td>SimCLR[19]</td><td>76.1 75.9</td><td>72.6 92.1</td><td>95.9 97.7</td><td>80.2 85.9</td><td>64.8 73.2</td><td>88.1</td><td>86.9 88.2</td><td>92.0 97.0</td><td>81.5 89.2</td><td>91.4 91.3</td><td>63.5</td><td>84.1</td></tr><tr><td>BYOL [25]</td><td>76.3</td><td>93.8</td><td>97.8</td><td>86.1</td><td>76.2</td><td>88.1</td><td>88.5</td><td>97.0</td><td>91.7</td><td>91.6</td><td>63.7</td><td>85.4</td></tr><tr><td>SSL-HSIC (w/o target)</td><td>73.1</td><td>91.5</td><td>97.4</td><td>85.3</td><td>75.3</td><td>87.1</td><td>87.5</td><td>96.4</td><td>90.6</td><td>91.6</td><td>62.2</td><td>84.1</td></tr><tr><td>SSL-HSIC (w/ target)</td><td>74.9</td><td>93.8</td><td>97.8</td><td>84.7</td><td>75.4</td><td>88.9</td><td>87.7</td><td>97.3</td><td>91.7</td><td>91.8</td><td>61.7</td><td>84.1</td></tr></table>
|
| 198 |
+
|
| 199 |
+
Transfer to other classification tasks To investigate the generality of the representation learned with SSL-HSIC, we evaluate the transfer performance for classification on 12 natural image datasets [55–64] using the same procedure as [19, 25, 65]. Table 3 shows the top-1 accuracy of the linear evaluation and fine-tuning performance on the test set. SSL-HSIC gets state-of-the-art performance on 3 of the classification tasks and reaches strong performance on others for this benchmark, indicating the learned representations are robust for transfer learning.
|
| 200 |
+
|
| 201 |
+
Transfer to other vision tasks To test the ability of transferring to tasks other than classification, we fine-tune the network on semantic segmentation, depth estimation and object detection tasks. We use Pascal VOC2012 dataset [58] for semantic segmentation, NYU v2 dataset [66] for depth estimation and COCO [67] for object detection. Object detection outputs either bounding box or object segmentation (instance segmentation). Details of the evaluations setup is in Appendix D.2. Table 4 and Table 5 shows that SSL-HSIC achieves competitive performance on all three vision tasks.
|
| 202 |
+
|
| 203 |
+
Table 4: Fine-tuning performance on semantic segmentation and depth estimation. Mean Intersection over Union (mIoU) is reported for semantic segmentation. Relative error (rel), root mean squared error (rms), and the percent of pixels (pct) where the error is below $1 . 2 5 ^ { n }$ thresholds are reported for depth estimation.
|
| 204 |
+
|
| 205 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">VOC2012 mIoU</td><td colspan="5">NYU v2</td></tr><tr><td>pct.<1.25</td><td>pct.<1.252</td><td>pct.<1.253</td><td>rms</td><td>rel</td></tr><tr><td>Supervised-IN</td><td>74.4</td><td>81.1</td><td>95.3</td><td>98.8</td><td>0.573</td><td>0.127</td></tr><tr><td>SimCLR</td><td>75.2</td><td>83.3</td><td>96.5</td><td>99.1</td><td>0.557</td><td>0.134</td></tr><tr><td>BYOL</td><td>76.3</td><td>84.6</td><td>96.7</td><td>99.1</td><td>0.541</td><td>0.129</td></tr><tr><td>SSL-HSIC(w/o target)</td><td>74.9</td><td>84.1</td><td>96.7</td><td>99.2</td><td>0.539</td><td>0.130</td></tr><tr><td>SSL-HSIC(w/ target)</td><td>76.0</td><td>83.8</td><td>96.8</td><td>99.1</td><td>0.548</td><td>0.130</td></tr></table>
|
| 206 |
+
|
| 207 |
+
Table 5: Fine-tuning performance on COCO object detection tasks. Precision, averaged over $1 0 \ \mathrm { I o U }$ (Intersection over Union) thresholds, is reported for both bounding box and object segmentation.
|
| 208 |
+
|
| 209 |
+
<table><tr><td>Method</td><td>APbb</td><td>Apmk</td></tr><tr><td>Supervised</td><td>39.6</td><td>35.6</td></tr><tr><td>SimCLR</td><td>39.7</td><td>35.8</td></tr><tr><td>MoCo v2</td><td>40.1</td><td>36.3</td></tr><tr><td>BYOL</td><td>41.6</td><td>37.2</td></tr><tr><td>SwAV</td><td>41.6</td><td>37.8</td></tr><tr><td>SSL-HSIC(w/o target)</td><td>40.5</td><td>36.3</td></tr><tr><td>SSL-HSIC(w/ target)</td><td>41.3</td><td>36.8</td></tr></table>
|
| 210 |
+
|
| 211 |
+
# 5 Ablation Studies
|
| 212 |
+
|
| 213 |
+
We present ablation studies to gain more intuition on SSL-HSIC. Here, we use a ResNet-50 backbone trained for 100 epochs on ImageNet, and evaluate with the linear protocol unless specified.
|
| 214 |
+
|
| 215 |
+
ResNet architectures In this ablation, we investigate the performance of SSL-HSIC with wider and deeper ResNet architecture. Figure 1 and Table 6 show our main results. The performance of SSL-HSIC gets better with larger networks. We used the supervised baseline from [25] which our training framework is based on ([19] reports lower performance). The performance gap between SSL-HSIC and the supervised baseline diminishes with larger architectures. In addition, Table 7 presents the semi-supervise learning results with subsets $1 \%$ , $10 \%$ and $100 \%$ of the ImageNet data.
|
| 216 |
+
|
| 217 |
+
Table 6: Top-1 and top-5 accuracies for different ResNet architectures using linear evaluation protocol.
|
| 218 |
+
|
| 219 |
+
<table><tr><td></td><td colspan="2">SSL-HSIC</td><td colspan="2">BYOL[25]</td><td colspan="2">Sup.[25]</td></tr><tr><td>ResNet</td><td>Top1</td><td>Top5</td><td>Top1</td><td>Top5</td><td>Top1</td><td>Top5</td></tr><tr><td>50 (1x)</td><td>74.8</td><td>92.2</td><td>74.3</td><td>91.6</td><td>76.4</td><td>92.9</td></tr><tr><td>50 (2x)</td><td>77.9</td><td>94.0</td><td>77.4</td><td>93.6</td><td>79.9</td><td>95.0</td></tr><tr><td>50(4x)</td><td>79.1</td><td>94.5</td><td>78.6</td><td>94.2</td><td>80.7</td><td>95.3</td></tr><tr><td>200 (2x)</td><td>79.6</td><td>94.8</td><td>79.6</td><td>94.9</td><td>80.1</td><td>95.2</td></tr></table>
|
| 220 |
+
|
| 221 |
+
Table 7: Top-1 and top-5 accuracies for different ResNet architectures using semisupervised fine-tuning.
|
| 222 |
+
|
| 223 |
+
<table><tr><td></td><td colspan="3">Top1</td><td colspan="3">Top5</td></tr><tr><td>ResNet</td><td>1%</td><td>10%</td><td>100%</td><td>1%</td><td>10%</td><td>100%</td></tr><tr><td>50 (1x)</td><td>52.1</td><td>67.9</td><td>77.2</td><td>77.7</td><td>88.6</td><td>93.6</td></tr><tr><td>50 (2x)</td><td>61.2</td><td>72.6</td><td>79.3</td><td>83.8</td><td>91.2</td><td>94.7</td></tr><tr><td>50 (4x)</td><td>67.0</td><td>75.4</td><td>79.7</td><td>87.4</td><td>92.5</td><td>94.8</td></tr><tr><td>200(2x)</td><td>69.0</td><td>76.3</td><td>80.5</td><td>88.3</td><td>92.9</td><td>95.2</td></tr></table>
|
| 224 |
+
|
| 225 |
+
Regularization term We compare performance of InfoNCE with SSL-HSIC in Table 8a since they can be seen as approximating the same $\mathrm { H S I C } ( Z , Y )$ objective but with different forms of regularization. We reproduce the InfoNCE result in our codebase, using the same architecture and data augmentiation as for SSL-HSIC. Trained for 100 epochs (without a target network), InfoNCE achieves $6 6 . 0 \%$ top-1 and $8 6 . 9 \%$ top-5 accuracies, which is better than the result reported in [19]. For comparison, SSL-HSIC reaches $6 6 . 7 \%$ top-1 and $8 7 . 6 \%$ top-5 accuracies. This suggests that the regularization employed by SSL-HSIC is more effective.
|
| 226 |
+
|
| 227 |
+
Kernel type We investigate the effect of using different a kernel on latents $Z$ . Training without a target network or random Fourier feature approximation, the top-1 accuracies for linear, Gaussian, and inverse multiquadric (IMQ) kernels are $6 5 . 2 7 \%$ , $6 6 . 6 7 \%$ and $6 6 . 7 2 \%$ respectively. Non-linear kernels indeed improve the performance; Gaussian and IMQ kernels reach very similar performance for 100 epochs. We choose IMQ kernel for longer runs, because its heavy-tail property can capture more signal when points are far apart.
|
| 228 |
+
|
| 229 |
+
Number of RFF Features Table 8b shows the performance of SSL-HSIC with different numbers of Fourier features. The RFF approximation has a minor impact on the overall performance, as long as we resample them; fixed sets of features performed poorly. Our main result picked 512 features, for substantial computational savings with minor loss in accuracy.
|
| 230 |
+
|
| 231 |
+
Batch size Similar to most of the self-supervised learning methods [19, 25], SSL-HSIC benefits from using a larger batch size during training. However, the drop of performance from using smaller batch size is not as pronounced as it is in SimCLR[19] as shown in Table 8c.
|
| 232 |
+
|
| 233 |
+
(a) Regularization
|
| 234 |
+
|
| 235 |
+
<table><tr><td></td><td>Top-1</td><td>Top-5</td></tr><tr><td>SSL-HSIC</td><td>66.7</td><td>87.6</td></tr><tr><td>InfoNCE</td><td>66.0</td><td>86.9</td></tr></table>
|
| 236 |
+
|
| 237 |
+
Table 8: Linear evaluation results when varying different hyperparameters.
|
| 238 |
+
(d) Projector/predictor size
|
| 239 |
+
|
| 240 |
+
<table><tr><td>Output Dim</td><td>Top-1(%)</td></tr><tr><td>64</td><td>65.4</td></tr><tr><td>128</td><td>66.0</td></tr><tr><td>256</td><td>66.4</td></tr><tr><td>512</td><td>66.6</td></tr><tr><td>1024</td><td>66.6</td></tr></table>
|
| 241 |
+
|
| 242 |
+
(b) # Fourier features
|
| 243 |
+
|
| 244 |
+
<table><tr><td>#RFFs</td><td>Top-1(%)</td></tr><tr><td>64</td><td>66.0</td></tr><tr><td>128</td><td>66.2</td></tr><tr><td>256</td><td>66.2</td></tr><tr><td>512</td><td>66.4</td></tr><tr><td>1024</td><td>66.5</td></tr><tr><td>2048</td><td>66.5</td></tr><tr><td>No Approx.</td><td>66.7</td></tr></table>
|
| 245 |
+
|
| 246 |
+
(c) Batch size
|
| 247 |
+
|
| 248 |
+
<table><tr><td colspan="4">Top-1(%)</td></tr><tr><td>Batch Size</td><td>SSL-HSIC</td><td>SimCLR</td><td></td></tr><tr><td>256</td><td>63.7</td><td>57.5</td><td></td></tr><tr><td>512</td><td>65.6</td><td></td><td>60.7</td></tr><tr><td>1024</td><td>66.7</td><td></td><td>62.8</td></tr><tr><td>2048</td><td>67.1</td><td></td><td>64.0</td></tr><tr><td>4096</td><td>66.7</td><td></td><td>64.6</td></tr></table>
|
| 249 |
+
|
| 250 |
+
Projector and predictor output size Table 8d shows the performance when using different output dimension for the projector/predictor networks. The performance saturates at 512 dimensions.
|
| 251 |
+
|
| 252 |
+
# 6 Conclusions
|
| 253 |
+
|
| 254 |
+
We introduced SSL-HSIC, a loss function for self-supervised representation learning based on kernel dependence maximization. We provided a unified view on various self-supervised learning losses: we proved that InfoNCE, a lower bound of mutual information, actually approximates SSL-HSIC with a variance-based regularization, and we can also interpret SSL-HSIC as metric learning where the cluster structure is imposed by the self-supervised label, of which the BYOL objective is a special case. We showed that training with SSL-HSIC achieves performance on par with the state-of-the-art on the standard self-supervised benchmarks.
|
| 255 |
+
|
| 256 |
+
Although using the image identity as self-supervised label provides a good inductive bias, it might not be wholly satisfactory; we expect that some images pairs are in fact more similar than others, based e.g. on their ImageNet class label. It will be interesting to explore methods that combine label structure discovery with representation learning (as in SwAV [18]). In this paper, we only explored learning image representations, but in future work SSL-HSIC can be extended to learning structure for $Y$ as well, building on existing work [41, 45].
|
| 257 |
+
|
| 258 |
+
# Broader impact
|
| 259 |
+
|
| 260 |
+
Our work concentrates on providing a more theoretically grounded and interpretable loss function for self-supervised learning. A better understanding of self-supervised learning, especially through more interpretable learning dynamics, is likely to lead to better and more explicit control over societal biases of these algorithms. SSL-HSIC yields an alternative, clearer understanding of existing selfsupervised methods. As such, it is unlikely that our method introduces further biases than those already present for self-supervised learning.
|
| 261 |
+
|
| 262 |
+
The broader impacts of the self-supervised learning framework is an area that has not been studied by the AI ethics community, but we think it calls for closer inspection. An important concern for fairness of ML algorithms is dataset bias. ImageNet is known for a number of problems such as offensive annotations, non-visual concepts and lack of diversity, in particular for underrepresented groups. Existing works and remedies typically focus on label bias. Since SSL doesn’t use labels, however, the type and degree of bias could be very different from that of supervised learning. To mitigate the risk of dataset bias, one could employ dataset re-balancing to correct sampling bias [68] or completely exclude human images from the dataset while achieving the same performance [69].
|
| 263 |
+
|
| 264 |
+
A new topic to investigate for self-supervised learning is how the bias/unbiased representation could be transferred to downstream tasks. We are not aware of any work in this direction. Another area of concern is security and robustness. Compared to supervised learning, self-supervised learning typically involves more intensive data augmentation such as color jittering, brightness adjustment, etc. There is some initial evidence suggesting self-supervised learning improves model robustness [70]. However, since data augmentation can either be beneficial [71] or detrimental [72] depending on the type of adversarial attacks, more studies are needed to assess its role for self-supervised learning.
|
| 265 |
+
|
| 266 |
+
# Acknowledgments and Disclosure of Funding
|
| 267 |
+
|
| 268 |
+
The authors would like to thank Olivier J. Hénaff for valuable feedback on the manuscript and the help for evaluating object detection task. We thank Aaron Van den Oord and Oriol Vinyals for providing valuable feedback on the manuscript. We are grateful to Yonglong Tian, Ting Chen and the BYOL authors for the help with reproducing baselines and evaluating downstream tasks.
|
| 269 |
+
|
| 270 |
+
This work was supported by DeepMind, the Gatsby Charitable Foundation, the Wellcome Trust, NSERC, and the Canada CIFAR AI Chairs program.
|
| 271 |
+
|
| 272 |
+
# References
|
| 273 |
+
|
| 274 |
+
[1] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. “ImageNet large scale visual recognition challenge.” International Journal of Computer Vision 115.3 (2015), pp. 211–252.
|
| 275 |
+
[2] G. E. Hinton and R. R. Salakhutdinov. “Reducing the dimensionality of data with neural networks.” Science 313.5786 (2006), pp. 504–507.
|
| 276 |
+
[3] P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, P.-A. Manzagol, and L. Bottou. “Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion.” Journal of Machine Learning Research 11.12 (2010).
|
| 277 |
+
[4] A. Coates and A. Y. Ng. “Learning feature representations with k-means.” Neural networks: Tricks of the trade. Springer, 2012, pp. 561–580.
|
| 278 |
+
[5] I. Higgins, L. Matthey, A. Pal, C. Burgess, X. Glorot, M. Botvinick, S. Mohamed, and A. Lerchner. “beta-VAE: Learning basic visual concepts with a constrained variational framework.” ICLR. 2016.
|
| 279 |
+
[6] A. van den Oord, O. Vinyals, and K. Kavukcuoglu. “Neural Discrete Representation Learning.” NeurIPS. 2017. arXiv: 1711.00937.
|
| 280 |
+
[7] W. Grathwohl, R. T. Q. Chen, J. Bettencourt, and D. Duvenaud. “Scalable Reversible Generative Models with Free-form Continuous Dynamics.” ICLR. 2019. arXiv: 1810.01367.
|
| 281 |
+
[8] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. M. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever, and D. Amodei. “Language Models are Few-Shot Learners.” NeurIPS. 2020. arXiv: 2005.14165.
|
| 282 |
+
[9] C. Doersch, A. Gupta, and A. A. Efros. “Unsupervised Visual Representation Learning by Context Prediction.” ICCV. 2015. arXiv: 1505.05192.
|
| 283 |
+
[10] G. Larsson, M. Maire, and G. Shakhnarovich. “Learning representations for automatic colorization.” ECCV. Springer. 2016, pp. 577–593.
|
| 284 |
+
[11] M. Noroozi and P. Favaro. “Unsupervised learning of visual representations by solving jigsaw puzzles.” ECCV. Springer. 2016, pp. 69–84.
|
| 285 |
+
[12] D. Pathak, P. Krahenbuhl, J. Donahue, T. Darrell, and A. A. Efros. “Context encoders: Feature learning by inpainting.” CVPR. 2016, pp. 2536–2544.
|
| 286 |
+
[13] R. Zhang, P. Isola, and A. A. Efros. “Colorful image colorization.” ECCV. Springer. 2016, pp. 649–666.
|
| 287 |
+
[14] S. Gidaris, P. Singh, and N. Komodakis. “Unsupervised representation learning by predicting image rotations.” ICLR. 2018. arXiv: 1803.07728.
|
| 288 |
+
[15] A. van den Oord, Y. Li, and O. Vinyals. “Representation learning with contrastive predictive coding.” 2018. arXiv: 1807.03748.
|
| 289 |
+
[16] P. Bachman, R. D. Hjelm, and W. Buchwalter. “Learning representations by maximizing mutual information across views.” NeurIPS. 2019. arXiv: 1906.00910.
|
| 290 |
+
[17] K. He, H. Fan, Y. Wu, S. Xie, and R. B. Girshick. “Momentum Contrast for Unsupervised Visual Representation Learning.” CVPR. 2019. arXiv: 1911.05722.
|
| 291 |
+
[18] M. Caron, I. Misra, J. Mairal, P. Goyal, P. Bojanowski, and A. Joulin. “Unsupervised learning of visual features by contrasting cluster assignments.” NeurIPS. 2020. arXiv: 2006.09882.
|
| 292 |
+
[19] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. “A Simple Framework for Contrastive Learning of Visual Representations.” ICML. 2020. arXiv: 2002.05709.
|
| 293 |
+
[20] X. Chen, H. Fan, R. B. Girshick, and K. He. “Improved Baselines with Momentum Contrastive Learning.” 2020. arXiv: 2003.04297.
|
| 294 |
+
[21] O. Henaff. “Data-efficient image recognition with contrastive predictive coding.” ICML. 2020. arXiv: 1905.09272.
|
| 295 |
+
[22] J. Zbontar, L. Jing, I. Misra, Y. LeCun, and S. Deny. “Barlow Twins: Self-Supervised Learning via Redundancy Reduction.” 2021. arXiv: 2103.03230.
|
| 296 |
+
[23] T. Wang and P. Isola. “Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere.” 2020. arXiv: 2005.10242.
|
| 297 |
+
[24] X. Chen and K. He. “Exploring Simple Siamese Representation Learning.” 2020. arXiv: 2011.10566.
|
| 298 |
+
[25] J.-B. Grill, F. Strub, F. Altché, C. Tallec, P. H. Richemond, E. Buchatskaya, C. Doersch, B. A. Pires, Z. D. Guo, M. G. Azar, B. Piot, K. Kavukcuoglu, R. Munos, and M. Valko. “Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning.” NeurIPS. 2020. arXiv: 2006.07733.
|
| 299 |
+
[26] A. Gretton, O. Bousquet, A. Smola, and B. Schölkopf. “Measuring statistical dependence with Hilbert-Schmidt norms.” ALT. Springer. 2005, pp. 63–77.
|
| 300 |
+
[27] K. W.-D. Ma, J. P. Lewis, and W. B. Kleijn. “The HSIC Bottleneck: Deep Learning without Back-Propagation.” AAAI. 2020.
|
| 301 |
+
[28] R. Pogodin and P. Latham. “Kernelized information bottleneck leads to biologically plausible 3-factor Hebbian learning in deep networks.” NeurIPS (2020).
|
| 302 |
+
[29] N. Tishby and N. Zaslavsky. “Deep Learning and the Information Bottleneck Principle.” IEEE Information Theory Workshop. 2015. arXiv: 1503.02406.
|
| 303 |
+
[30] M. Tschannen, J. Djolonga, P. K. Rubenstein, S. Gelly, and M. Lucic. “On mutual information maximization for representation learning.” ICLR. 2020. arXiv: 1907.13625.
|
| 304 |
+
[31] I. Belghazi, S. Rajeswar, A. Baratin, R. D. Hjelm, and A. C. Courville. “MINE: Mutual Information Neural Estimation.” ICML. 2018. arXiv: 1801.04062.
|
| 305 |
+
[32] B. Poole, S. Ozair, A. van den Oord, A. A. Alemi, and G. Tucker. “On Variational Bounds of Mutual Information.” ICML. 2019. arXiv: 1905.06922.
|
| 306 |
+
[33] A. Rahimi and B. Recht. “Random Features for Large-Scale Kernel Machines.” NeurIPS. 2007.
|
| 307 |
+
[34] T. Chen, S. Kornblith, K. Swersky, M. Norouzi, and G. Hinton. “Big Self-Supervised Models are Strong Semi-Supervised Learners.” NeurIPS. 2020. arXiv: 2006.10029.
|
| 308 |
+
[35] Y.-H. H. Tsai, S. Bai, L.-P. Morency, and R. Salakhutdinov. “A note on connecting barlow twins with negative-sample-free contrastive learning.” arXiv preprint arXiv:2104.13712 (2021).
|
| 309 |
+
[36] T. Chen and L. Li. “Intriguing Properties of Contrastive Losses.” 2020. arXiv: 2011.02803.
|
| 310 |
+
[37] Z. Szabó and B. K. Sriperumbudur. “Characteristic and Universal Tensor Product Kernels.” Journal of Machine Learning Research 18.233 (2018), pp. 1–29.
|
| 311 |
+
[38] A. Gretton, K. Fukumizu, C. H. Teo, L. Song, B. Schölkopf, and A. J. Smola. “A kernel statistical test of independence.” NeurIPS. 2007.
|
| 312 |
+
[39] L. Song, A. Smola, A. Gretton, J. Bedo, and K. Borgwardt. “Feature selection via dependence maximization.” Journal of Machine Learning Research 13.5 (2012).
|
| 313 |
+
[40] L. Song, A. Smola, A. Gretton, and K. M. Borgwardt. “A Dependence Maximization View of Clustering.” ICML. 2007.
|
| 314 |
+
[41] M. B. Blaschko and A. Gretton. “Learning Taxonomies by Dependence Maximization.” NeurIPS. 2009.
|
| 315 |
+
[42] S. Jain, G. Liu, and D. Gifford. “Information Condensing Active Learning.” 2020. arXiv: 2002.07916.
|
| 316 |
+
[43] D. Wu, Y. Zhao, Y.-H. H. Tsai, M. Yamada, and R. Salakhutdinov. “‘Dependency Bottleneck’ in Auto-encoding Architectures: an Empirical Study.” 2018. arXiv: 1802.05408.
|
| 317 |
+
[44] A. Nøkland and L. H. Eidnes. “Training neural networks with local error signals.” ICML. 2019. arXiv: 1901.06656.
|
| 318 |
+
[45] M. B. Blaschko, W. Zaremba, and A. Gretton. “Taxonomic Prediction with Tree-Structured Covariances.” Machine Learning and Knowledge Discovery in Databases. Springer Berlin Heidelberg, 2013, pp. 304–319.
|
| 319 |
+
[46] based and RKHS-based statistics in hypothesis testing.” The Annals of Statistics 41.5 (2013), pp. 2263–2291.
|
| 320 |
+
[47] G. J. Székely, M. L. Rizzo, and N. K. Bakirov. “Measuring and testing dependence by correlation of distances.” The Annals of Statistics 35.6 (2007), pp. 2769–2794.
|
| 321 |
+
[48] N. Cristianini, J. Shawe-Taylor, A. Elisseeff, and J. Kandola. “On Kernel-Target Alignment.” NeurIPS. Vol. 14. 2002.
|
| 322 |
+
[49] C. Cortes, M. Mohri, and A. Rostamizadeh. “Algorithms for learning kernels based on centered alignment.” The Journal of Machine Learning Research 13.1 (2012), pp. 795–828.
|
| 323 |
+
[50] R. S. Zimmermann, Y. Sharma, S. Schneider, M. Bethge, and W. Brendel. “Contrastive Learning Inverts the Data Generating Process.” 2021. arXiv: 2102.08850.
|
| 324 |
+
[51] H. Zha, X. He, C. Ding, M. Gu, and H. D. Simon. “Spectral relaxation for $\mathbf { k }$ -means clustering.” NeurIPS. 2001, pp. 1057–1064.
|
| 325 |
+
[52] Y. You, I. Gitman, and B. Ginsburg. “Scaling SGD Batch Size to 32K for ImageNet Training.” 2017. arXiv: 1708.03888.
|
| 326 |
+
[53] P. Goyal, P. Dollár, R. B. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He. “Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour.” 2017. arXiv: 1706.02677.
|
| 327 |
+
[54] X. Zhai, A. Oliver, A. Kolesnikov, and L. Beyer. ${ } ^ { \cdot } \mathrm { s } ^ { 4 } \mathrm { L }$ : Self-Supervised Semi-Supervised Learning.” ICCV. 2019. arXiv: 1905.03670.
|
| 328 |
+
[55] L. Fei-Fei, R. Fergus, and P. Perona. “Learning Generative Visual Models from Few Training Examples: An Incremental Bayesian Approach Tested on 101 Object Categories.” CVPR Workshop. 2004.
|
| 329 |
+
[56] M.-E. Nilsback and A. Zisserman. “Automated flower classification over a large number of classes.” 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing. IEEE. 2008, pp. 722–729.
|
| 330 |
+
[57] A. Krizhevsky. “Learning multiple layers of features from tiny images.” 2009. URL: https: //www.cs.toronto.edu/\~kriz/learning-features-2009-TR.pdf.
|
| 331 |
+
[58] M. Everingham, L. Van Gool, C. K. Williams, J. Winn, and A. Zisserman. “The Pascal visual object classes (VOC) challenge.” IJCV 88.2 (2010), pp. 303–338.
|
| 332 |
+
[59] J. Xiao, J. Hays, K. A. Ehinger, A. Oliva, and A. Torralba. “SUN database: Large-scale scene recognition from abbey to zoo.” CVPR. 2010.
|
| 333 |
+
[60] O. M. Parkhi, A. Vedaldi, A. Zisserman, and C. V. Jawahar. “Cats and Dogs.” CVPR. 2012.
|
| 334 |
+
[61] M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, and A. Vedaldi. “Describing Textures in the Wild.” CVPR. 2013. arXiv: 1311.3618.
|
| 335 |
+
[62] J. Krause, J. Deng, M. Stark, and L. Fei-fei. “Collecting a large-scale dataset of fine-grained cars. The Second Workshop on Fine-Grained Visual Categorization.” 2013.
|
| 336 |
+
[63] L. Bossard, M. Guillaumin, and L. Van Gool. “Food-101–mining discriminative components with random forests.” ECCV. Springer. 2014, pp. 446–461.
|
| 337 |
+
[64] S. Maji, E. Rahtu, J. Kannala, M. B. Blaschko, and A. Vedaldi. “Fine-Grained Visual Classification of Aircraft.” arXiv: 1306.5151.
|
| 338 |
+
[65] S. Kornblith, J. Shlens, and Q. V. Le. “Do Better ImageNet Models Transfer Better?” CVPR. 2019. arXiv: 1805.08974.
|
| 339 |
+
[66] N. Silberman, D. Hoiem, P. Kohli, and R. Fergus. “Indoor Segmentation and Support Inference from RGBD Images.” ECCV. 2012.
|
| 340 |
+
[67] T.-Y. Lin, M. Maire, S. J. Belongie, L. D. Bourdev, R. B. Girshick, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. “Microsoft COCO: Common Objects in Context.” ECCV. 2014. arXiv: 1405.0312.
|
| 341 |
+
[68] K. Yang, K. Qinami, L. Fei-Fei, J. Deng, and O. Russakovsky. “Towards fairer datasets: Filtering and balancing the distribution of the people subtree in the imagenet hierarchy.” Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency. 2020, pp. 547–558.
|
| 342 |
+
[69] Y. Asano, C. Rupprecht, A. Zisserman, and A. Vedaldi. “PASS: An ImageNet replacement for self-supervised pretraining without humans” (2021).
|
| 343 |
+
[70] D. Hendrycks, M. Mazeika, S. Kadavath, and D. Song. “Using self-supervised learning can improve model robustness and uncertainty.” arXiv preprint arXiv:1906.12340 (2019).
|
| 344 |
+
[71] A. Sablayrolles, M. Douze, C. Schmid, Y. Ollivier, and H. Jégou. “White-box vs black-box: Bayes optimal strategies for membership inference.” International Conference on Machine Learning. PMLR. 2019, pp. 5558–5567.
|
| 345 |
+
[72] D. Yu, H. Zhang, W. Chen, J. Yin, and T.-Y. Liu. “How Does Data Augmentation Affect Privacy in Machine Learning?” Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 35. 12. 2021, pp. 10746–10753.
|
| 346 |
+
[73] L. Grafakos. Classical Fourier Analysis. Vol. 2. Springer, 2008.
|
| 347 |
+
[74] R. Piessens. “The Hankel transform.” The Transforms and Applications Handbook 2.9 (2000).
|
| 348 |
+
[75] F. Johansson et al. mpmath: a Python library for arbitrary-precision floating-point arithmetic (version 0.18). http://mpmath.org/. 2013.
|
| 349 |
+
[76] J. Long, E. Shelhamer, and T. Darrell. “Fully Convolutional Networks for Semantic Segmentation.” CVPR. 2015. arXiv: 1411.4038.
|
| 350 |
+
[77] O. J. Hénaff, S. Koppula, J.-B. Alayrac, A. van den Oord, O. Vinyals, and J. Carreira. “Efficient Visual Pretraining with Contrastive Detection.” 2021. arXiv: 2103.10957.
|
| 351 |
+
[78] K. He, G. Gkioxari, P. Dollár, and R. B. Girshick. “Mask R-CNN.” ICCV. 2017. arXiv: 1703.06870.
|
| 352 |
+
[79] T.-Y. Lin, P. Dollár, R. B. Girshick, K. He, B. Hariharan, and S. J. Belongie. “Feature Pyramid Networks for Object Detection.” CVPR. 2017. arXiv: 1612.03144.
|
md/train/3ccoZ40Us0N/3ccoZ40Us0N.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CLIP-It! Language-Guided Video Summarization
|
| 2 |
+
|
| 3 |
+
Medhini Narasimhan Anna Rohrbach Trevor Darrell
|
| 4 |
+
|
| 5 |
+
University of California, Berkeley {medhini, anna.rohrbach, trevordarrell}@berkeley.edu https://medhini.github.io/clip_it
|
| 6 |
+
|
| 7 |
+

|
| 8 |
+
Figure 1: We introduce CLIP-It, a language-guided multimodal transformer for generic and query-focused video summarization. The figure shows results from our method. Given a day-long video of a national park tour, the generic summary (top) is a video with relevant and diverse keyframes. When using the query “All the scenes containing restaurants and shopping centers”, the generated query-focused summary includes all the matching scenes. Similarly, the query “All water bodies such as lakes, rivers, and waterfalls”, yields a short summary containing all the water bodies present in the video.
|
| 9 |
+
|
| 10 |
+
# Abstract
|
| 11 |
+
|
| 12 |
+
A generic video summary is an abridged version of a video that conveys the whole story and features the most important scenes. Yet the importance of scenes in a video is often subjective, and users should have the option of customizing the summary by using natural language to specify what is important to them. Further, existing models for fully automatic generic summarization have not exploited available language models, which can serve as an effective prior for saliency. This work introduces CLIP-It, a single framework for addressing both generic and queryfocused video summarization, typically approached separately in the literature. We propose a language-guided multimodal transformer that learns to score frames in a video based on their importance relative to one another and their correlation with a user-defined query (for query-focused summarization) or an automatically generated dense video caption (for generic video summarization). Our model can be extended to the unsupervised setting by training without ground-truth supervision. We outperform baselines and prior work by a significant margin on both standard video summarization datasets (TVSum and SumMe) and a query-focused video summarization dataset (QFVS). Particularly, we achieve large improvements in the transfer setting, attesting to our method’s strong generalization capabilities.
|
| 13 |
+
|
| 14 |
+
# 1 Introduction
|
| 15 |
+
|
| 16 |
+
An effective video summary captures the essence of the video and provides a quick overview as an alternative to viewing the whole video; it should be succinct yet representative of the entire video. Summarizing videos has many use cases - for example, viewers on YouTube may want to watch a short summary of the video to assess its relevance. While a generic summary is useful for capturing the important scenes in a video, it is even more practical if the summary can be customized by the user. As seen in Fig. 1, users should be able to indicate the concepts of the video they would like to see in the summary using natural language queries.
|
| 17 |
+
|
| 18 |
+
Generic video summarization datasets such as TVSum [36] and SumMe [7] provide ground-truth annotations in the form of frame or shot-level importance scores specified by multiple annotators. Several learning-based methods reduce the task to a frame-wise score prediction problem. Sequence labeling methods [5, 42, 43, 44, 18] model variable-range dependencies between frames but fail to capture relationships across all frames simultaneously. While attention [3] and graph based [26] methods address this partly, they disregard ordering of the input frames which is useful when predicting scores. Moreover, these methods use only visual cues to produce the summaries and cannot be customized with a natural language input. Another line of work, query-focused video summarization [32], allows the users to customize the summary by specifying a query containing two concepts (eg., food and drinks). However, in their work the query can only be chosen from a fixed set of predefined concepts which limits the flexibility for the user.
|
| 19 |
+
|
| 20 |
+
It is important to note that efforts in generic and query-focused video summarization have so far been disjoint, with no single method for both. Our key innovation is to unify these tasks in one language-guided framework. We introduce CLIP-It, a multimodal summarization model which takes two inputs, a video and a natural language text, and synthesizes a summary video conditioned on the text. In case of generic video summarization, the natural language text is a video description obtained using an off-the-shelf dense video captioning method. Alternatively, in the case of query-focused video summarization, the language input is a user-defined query. Unlike existing generic methods which only use visual cues, we show that adding language as an input leads to the “discovery” of relevant concepts and actions resulting in better summaries. Our method uses a Transformer with positional encoding, which can attend to all frames at once (unlike LSTM based methods) and also keep track of the ordering of frames (unlike graph based methods). In contrast to existing query-focused methods [32] which only allow keyword based queries, we aim to enable open-ended natural language queries for users to customize video summaries. For example, as seen in Fig. 1, using our method users can specify long and descriptive queries such as, “All water bodies such as lakes, rivers, and waterfalls” which is not possible with previous methods.
|
| 21 |
+
|
| 22 |
+
Given an input video, CLIP-It generates a video summary guided by either a user-defined natural language query or a system generated description. It uses a Language-Guided Attention head to compute a joint representation of the image and language embeddings, and a Frame-Scoring Transformer to assign scores to individual frames in the video using the fused representations. Following [43, 42], the summary video is constructed from high scoring frames by converting framelevel scores to shot-level scores and using knapsack algorithm to fit the maximum number of high scoring shots in a timed window. Fig. 1 shows an output from our method. Given an hour long video of a national park tour, we generate a 2 minute generic summary comprising of all the important scenes in the video. Given the two language queries, our method picks the matching keyframes in both cases. We can train CLIP-It without ground-truth supervision by leveraging the reconstruction and diversity losses [9, 31]. For generic video summarization, we evaluate our approach on the standard benchmarks, TVSum and SumMe. We achieve performance improvement on F1 score of nearly $3 \%$ in the supervised setting and $4 \%$ in the unsupervised setting on both datasets. We show large gains $( 5 \% )$ in the Transfer setting, where CLIP-It is trained and evaluated on disjoint sets of data. For the queryfocused scenario we evaluate on the QFVS dataset [33], where we also achieve state-of-the-art results.
|
| 23 |
+
|
| 24 |
+
To summarize our contributions, we introduce CLIP-It, a language-guided model that unifies generic and query-focused video summarization. Our approach uses language conditioning in the form of off-the-shelf video descriptions (for generic summarization) or user-defined natural language queries (for query-focused summarization). We show that the Transformer design enables effective contextualization across frames, benefiting our tasks. We also demonstrate the impact of language guidance on generic summarization. Finally, we establish the new state-of-the-art on both generic and query-focused datasets in supervised and unsupervised settings.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
Generic Video Summarization. A video summary is a short synopsis created by stitching together important clips from the original video. Early works [21, 35, 34] referred to it as Video Skimming or Dynamic Video Summarization and used hand-designed features to generate summaries. Likewise, non-parametric unsupervised methods [13, 16, 23, 19, 20, 28] used various heuristics to represent the importance of frames. Introduction of benchmark datasets such as TVSum [36] and SumMe [7] provided relevance scores for frames in videos annotated by users, resulting in multiple human generated summaries. This enabled automatic evaluation of video summarization techniques and has lead to the development of many supervised learning based methods [6, 8, 22, 26, 31, 30, 41, 42, 43, 44, 45]. These approaches capture high-level semantic information and outperform the heuristic unsupervised methods. Fully convolutional sequence networks [31] treat video summarization as a binary label prediction problem. Determinantal point processes [15] and LSTM [10] based approaches [5, 18, 42, 43, 44] model variable-range dependencies between frames. However, these are sequential and fail to capture relationships across all frames simultaneously. Attention [3] and graph based methods [26] address this issue by modeling relationships across all frames, but they disregard the ordering of frames in a video, which is also useful for summarization. Our method uses a Transformer [38] with positional encoding, which allows for joint attention across all frames while maintaining an ordering of the input sequence of frames.
|
| 29 |
+
|
| 30 |
+
Some of the above works have supervised and unsupervised variants with modifications to the objective function. Specifically, for the unsupervised variant, they use reconstruction and diversity losses which do not require ground truth. We follow prior work in terms of using the same loss functions. Other notable unsupervised approaches include an adversarial LSTM based method [22], a generative adversarial network to learn from unpaired data [30], and a cycle consistent learning objective [41].
|
| 31 |
+
|
| 32 |
+
Video-Text Summarization. Plummer et al. [27] use image-language embeddings for generating video summaries but evaluate their approach in the text domain, and not on the generic video summarization benchmarks. Furthermore, they require text to be provided as input and don’t have a mechanism to generate captions if absent. On the other hand, our method works well with off-theshelf captions and we evaluate on both generic and query-focused benchmark datasets. Chen et al. [1] jointly train a text and video summarization network but rely on ground-truth text summaries.
|
| 33 |
+
|
| 34 |
+
Query-Focused Video Summarization. Oftentimes users browsing videos on YouTube are looking for something specific so a generic summary might not suffice. In this case, there should be an option to customize the generated summary using a natural language query. Sharghi et al. [32] introduce the Query-Focused Video Summarization (QFVS) dataset for UT Egocentric [16] videos containing user-defined video summaries for a set of pre-defined concepts. Sharghi et al. [33] propose a memory network to attend over different video frames and shots with the user query as input. However, this recurrent attention mechanism precludes parallelization and limits modeling long-range dependencies, which is overcome by our Transformer architecture. Moreover, their method only works with the pre-defined set of keyword based queries in QFVS dataset. Since we use CLIP [29] to encode the language input and train our method on dense video descriptions, this allows users to define freeform queries at test time (as seen in Fig. 1). Other works [12, 39] similarly condition the summary generation on keyword based queries but haven’t released their data.
|
| 35 |
+
|
| 36 |
+
Transformers. Transformers [38] were introduced for neural machine translation and have since been applied to video-language tasks such as video-retrieval [4] and video captioning [17, 48]. In this work we adapt transformers for video summarization. We modify self-attention [38] to a LanguageGuided Attention block that accepts inputs from two modalities. Additionally, our method also relies on CLIP [29] for extracting image and text features and a Bi-Modal Transformer [11] for dense video caption generation, both of which also have transformer backbone.
|
| 37 |
+
|
| 38 |
+
# 3 CLIP-It: Language-Guided Video Summarization
|
| 39 |
+
|
| 40 |
+
CLIP-It is a unified language-guided framework for both generic and query-focused video summarization. It takes an input video and a user-defined query or a system generated dense video caption and constructs a summary by selecting key frames from the video. First, we explain the intuition behind our approach. In the case of query-focused summarization, clearly, it is necessary to model the user query as input in order to produce an appropriate summary. In the case of generic video summarization no user query is available; nonetheless, we show here that we can leverage the semantic information contained in associated natural language descriptions to guide the summarization process. Assuming we had a generic description that accompanies a video (e.g., A person is walking a dog. The person throws a ball. The dog runs after it.), we could leverage its semantic embedding to match $i t$ to the most relevant portions of the video. Such a description could be obtained automatically by generating dense video captions [11]. We first present an overview of our approach, CLIP-It, followed by a detailed description of the individual components.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 2: Overview of CLIP-It. Given an input video, CLIP-It generates a summary conditioned on either a user-defined natural language query or an automatically generated dense video caption. The Language-Guided Attention head fuses the image and language embeddings and the Frame-Scoring Transformer jointly attends to all frames to predict their relevance scores. During inference, the video summary is constructed by converting frame scores to shot scores and using Knapsack algorithm to select high scoring shots.
|
| 44 |
+
|
| 45 |
+
Overview. Our approach, CLIP-It, is outlined in $\mathrm { F i g } 2$ . Given a video, we extract $N$ frames denoted by $F _ { i }$ , $i \in [ 1 , \dots \bar { N } ]$ . We formulate the video summarization task as a per-frame binary classification problem. We embed the frames using a pretrained network $f _ { i m g }$ . If a query is provided (in the form of a natural language string), we embed the query using a pretrained network $f _ { t x t }$ . Alternatively, as seen in the figure, we use an off-the-shelf video captioning model to generate a dense video caption with $M$ sentences denoted by $C _ { j }$ , $j \in [ 1 , \bar { \dots { M } } ]$ and embed each sentence using the pretrained network $f _ { t x t }$ . Next, we compute language attended image embeddings $I ^ { * }$ using learned Language-Guided Multi-head Attention $f _ { i m g \_ t x t } ^ { * }$ . Finally, we train a Frame-Scoring Transformer which assigns scores to each frame in the video (green indicating a high score and red indicating a low score). To construct the video summary during inference, we convert frame-level scores to shot-level scores and finally, use 0/1 knapsack algorithm to pick the key shots [43]. In the following, we describe the Language-Guided Attention and the Frame-Selection Transformer modules, followed by discussing the visual and language encoders.
|
| 46 |
+
|
| 47 |
+
Language-Guided Attention. We use Language-Guided Multi-head Attention to efficiently fuse information across the video and language modalities and to infer long-term dependencies across both. Using a single attention head does not suffice as our goal is to allow all captions to attend to all frames in the video. We modify the Multi-Head Attention described in Vaswani et al. [38] to take in inputs from both modalities. We set Query $Q$ , Key $K$ , and Value $V$ as follows,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { c } { { \therefore , \nu \ - \jmath \iota x \iota \mathrm { ( } \mathrm { V } _ { \mathcal { I } } \mathrm { ) , ~ } \mathrm { w a n g e - } \mathrm { G u i d e d ~ A t t n . } ( Q , K , V ) = \mathrm { C o n c a t ( h e a d _ 1 , } . . . , \mathrm { h e a d _ h } ) W ^ { O } , } } \\ { { \mathrm { L a n g u a g e - } \mathrm { G u i d e d ~ A t t n . } ( Q , K , V ) = \mathrm { C o n c a t ( h e a d _ 1 , } . . . , \mathrm { h e a d _ h } ) W ^ { O } , } } \\ { { \mathrm { w h e r e ~ h e a d _ i = A t t e n t i o n } ( Q W _ { i } ^ { Q } , K W _ { i } ^ { K } , V W _ { i } ^ { V } ) } } \\ { { \mathrm { a n d ~ A t t e n t i o n } ( Q , K , V ) = \mathrm { s o f m a x } ( \displaystyle \frac { Q K ^ { T } } { \sqrt { d _ { k } } } ) V } } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
$\it { W _ { i } ^ { Q } }$ , $W _ { i } ^ { K }$ , and $W _ { i } ^ { V }$ are learned parameter matrices and $d _ { k }$ is the dimensions of $K$ . The output of the Language-Guided Multi-Head Attention are the attended image embeddings, denoted as $F _ { i } ^ { ' }$ .
|
| 54 |
+
|
| 55 |
+
Frame-Scoring Transformer. Finally, it is also important to ensure that we do not include redundant information, e.g., several key shots from the same event. To better model interactions across frames and contextualize them w.r.t. each other, we add a Frame-Scoring Transformer that takes image-text representations as input and outputs one score per frame. Based on the Transformer model [38], this module assigns relevance scores to the attended image embeddings $F _ { i } ^ { ' }$ . We feed $F _ { i } ^ { ' }$ to the bottom of both the encoder and decoder stacks. Similar to [38], we use positional encoding to insert information about the relative positions of the tokens in the sequence. We add positional encodings to the input embeddings at the bottom of the encoder and decoder stacks.
|
| 56 |
+
|
| 57 |
+
Image Encoding. We encode the image using a pre-trained network $f _ { i m g }$ . We experiment with the following networks: GoogleNet [37] (for a fair comparison to prior work), ResNet [8], and CLIP [29].
|
| 58 |
+
|
| 59 |
+
Text Encoding. We encode the user-defined query or the system generated dense caption using a pre-trained network $f _ { t x t }$ . In this case we tried the CLIP (ViT and RN101) model. In case of generic video summarization, we generate dense video captions for the whole video in order to condition on language and incorporate added semantics into our video summarization pipeline. We use the Bi-Modal Transformer [11] dense video captioning model that generates a multi-sentence description given a video with audio. Since there are multiple sentences in the dense video caption, we first embed each sentence of the caption using the text encoder $f _ { t x t }$ described above. They are then concatenated and fused using a multi-layer perceptron (MLP).
|
| 60 |
+
|
| 61 |
+
# 3.1 Learning
|
| 62 |
+
|
| 63 |
+
We employ 3 loss functions (classification, diversity, and reconstruction) to train our model. The supervised setting uses all 3 and the unsupervised setting uses only diversity and reconstruction losses.
|
| 64 |
+
|
| 65 |
+
Classification loss. We use a weighted binary cross entropy loss for classifying each frame:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathcal { L } _ { c } = - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } w ^ { * } [ x _ { i } ^ { * } \mathrm { l o g } ( x _ { i } ) ] + ( 1 - w ^ { * } ) [ ( 1 - x _ { i } ^ { * } ) \mathrm { l o g } ( 1 - x _ { i } ) ] ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\boldsymbol { x } _ { i } ^ { * }$ is the ground-truth label of the $i$ -th frame and $N$ is the total number of frames in the $w ^ { * }$ weif ht assigned to the class is a background frame $\boldsymbol { x } _ { i } ^ { * }$ , which is set to $\frac { \# k e y f r a m e s } { N }$ if $\boldsymbol { x } _ { i } ^ { * }$ is a keyframe and $1 - { \frac { \# k e y f r a m e s } { N } }$ $\boldsymbol { x } _ { i } ^ { * }$
|
| 72 |
+
|
| 73 |
+
For the purpose of training without any supervision, we employ two additional losses that enforce diversity in the selected keyframes. We first select keyframes $X$ based on the scores assigned by the Frame-Scoring Transformer. We pass the output features of the transformer model for the selected keyframes through a decoder network consisting of $1 \times 1$ convolution layers to obtain reconstructed feature vectors for the selected keyframes such that each keyframe feature vector is of the same dimension as its corresponding input frame-level feature vector.
|
| 74 |
+
|
| 75 |
+
Reconstruction Loss. The reconstruction loss $\mathcal { L } _ { r }$ is defined as the mean squared error between the reconstructed features and the original features corresponding to the selected keyframes, such that:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { L } _ { r } = \frac { 1 } { X } \sum _ { i \in X } | | \mathbf { x } _ { i } - \hat { \mathbf { y } } _ { i } | | _ { 2 } ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\hat { \mathbf { y } }$ denotes the reconstructed features.
|
| 82 |
+
|
| 83 |
+
Diversity Loss. We employ a repelling regularizer [45] to enforce diversity among selected keyframes. Similar to [31, 30], we compute the diversity loss, $\mathcal { L } _ { d }$ , as the pairwise cosine similarity between the selected keyframes:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathcal { L } _ { d } = \frac { 1 } { X ( X - 1 ) } \sum _ { i \in X } \sum _ { j \in X , j \neq i } \frac { \hat { \mathbf { y } } _ { i } \cdot \hat { \mathbf { y } } _ { j } } { \vert \vert \hat { \mathbf { y } } _ { i } \vert \vert _ { 2 } \cdot \vert \vert \hat { \mathbf { y } } _ { j } \vert \vert _ { 2 } } ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\hat { \mathbf { y } } _ { i }$ and $\hat { \mathbf { y } _ { j } }$ denote the reconstructed feature vectors of the $i$ -th and $j$ -th node.
|
| 90 |
+
|
| 91 |
+
The final loss function for supervised learning is then,
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathcal { L } _ { s u p } = \alpha \cdot \mathcal { L } _ { c } + \beta \cdot \mathcal { L } _ { d } + \lambda \cdot \mathcal { L } _ { r } ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $\alpha , \beta ,$ , and $\lambda$ control the trade-off between the three loss functions. We modify the loss function to extend CLIP-It to the unsupervised video summarization setting. We omit $\mathcal { L } _ { c }$ since the groundtruth summary cannot be used for supervision and represent the final loss function for unsupervised learning as:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { u n s u p } = \beta \cdot \mathcal { L } _ { d } + \lambda \cdot \mathcal { L } _ { r } ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\beta$ and $\lambda$ are balancing parameters to control the trade-off between the two terms. We include implementation details of our method in the Supp.
|
| 104 |
+
|
| 105 |
+
Table 1: Supervised. Comparing F1 Scores of our methods with supervised baselines on the SumMe [7] and TVSum [36] datasets using Standard, Augment, and Transfer data configurations.
|
| 106 |
+
|
| 107 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">SumMe</td><td colspan="3">TVSum</td></tr><tr><td>Standard AugmentTransfer Standard AugmentTransfer</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Zhang et al. (SumTransfer) [42]</td><td>40.9</td><td>41.3</td><td>38.5</td><td>-</td><td>=</td><td>1</td></tr><tr><td>Zhang et al. (LSTM) [43]</td><td>38.6</td><td>42.9</td><td>41.8</td><td>54.7</td><td>59.6</td><td>58.7</td></tr><tr><td>Mahasseni et al. (SUM-GANsup) [22]</td><td>41.7</td><td>43.6</td><td>-</td><td>56.3</td><td>61.2</td><td>=</td></tr><tr><td>Rochan et al. (SUM-FCN) [31]</td><td>47.5</td><td>51.1</td><td>44.1</td><td>56.8</td><td>59.2</td><td>58.2</td></tr><tr><td>Rochan et al. (SUM-DeepLab) [31]</td><td>48.8</td><td>50.2</td><td>45.0</td><td>58.4</td><td>59.1</td><td>57.4</td></tr><tr><td>Zhou et al. [47]</td><td>42.1</td><td>43.9</td><td>42.6</td><td>58.1</td><td>59.8</td><td>58.9</td></tr><tr><td> Zhang et al. [44]</td><td>=</td><td>44.9</td><td>1</td><td>=</td><td>63.9</td><td>1</td></tr><tr><td>Fajtl et al. [3]</td><td>49.7</td><td>51.1</td><td>-</td><td>61.4</td><td>62.4</td><td>1</td></tr><tr><td>Rochan et al. [30]</td><td>1</td><td>48.0</td><td>41.6</td><td></td><td>56.1</td><td>55.7</td></tr><tr><td>Chen et al. (V2TS) [1]</td><td>-</td><td>1</td><td>1</td><td>62.1</td><td>1</td><td>1</td></tr><tr><td>He et al. [9]</td><td>47.2</td><td>-</td><td>-</td><td>59.4</td><td>-</td><td>-</td></tr><tr><td>Park et al. (SumGraph) [26]</td><td>51.4</td><td>52.9</td><td>48.7</td><td>63.9</td><td>65.8</td><td>60.5</td></tr><tr><td>GoogleNet+bi-LSTM</td><td>38.5</td><td>42.4</td><td>40.7</td><td>53.9</td><td>59.6</td><td>58.6</td></tr><tr><td>ResNet+bi-LSTM</td><td>39.4</td><td>44.0</td><td>42.6</td><td>55.0</td><td>61.0</td><td>59.9</td></tr><tr><td>CLIP-Image+bi-LSTM</td><td>41.1</td><td>45.9</td><td>44.9</td><td>56.8</td><td>63.7</td><td>61.6</td></tr><tr><td>CLIP-Image+Video Caption+bi-LSTM</td><td>41.2</td><td>46.1</td><td>45.5</td><td>57.1</td><td>64.3</td><td>62.4</td></tr><tr><td>GoogleNet+Transformer</td><td>51.6</td><td>53.5</td><td>49.4</td><td>64.2</td><td>66.3</td><td>61.3</td></tr><tr><td>ResNet+Transformer</td><td>52.8</td><td>54.9</td><td>50.3</td><td>65.0</td><td>67.5</td><td>62.8</td></tr><tr><td>CLIP-Image+Transformer</td><td>53.5</td><td>55.3</td><td>51.0</td><td>65.5</td><td>68.1</td><td>63.4</td></tr><tr><td>CLIP-It: CLIP-Image+Video Caption+Transformer</td><td>54.2</td><td>56.4</td><td>51.9</td><td>66.3</td><td>69.0</td><td>65.5</td></tr></table>
|
| 108 |
+
|
| 109 |
+
# 4 Experiments
|
| 110 |
+
|
| 111 |
+
In this section, we describe the experimental setup and evaluation of our method on two tasks: generic video summarization and query-focused video summarization.
|
| 112 |
+
|
| 113 |
+
# 4.1 Generic Video Summarization
|
| 114 |
+
|
| 115 |
+
Generic video summarization involves generating a single general-purpose summary to describe the input video. Note that while prior works only use visual cues from the video, our method also allows for video captions as an input feature. For a fair comparison, we include ablations of our method that do not use any language cues and only the visual features used in earlier works [43].
|
| 116 |
+
|
| 117 |
+
Datasets. We evaluate our approach on two standard video summarization datasets (TVSum [36] and SumMe [7]) and on the generic summaries for UT Egocentric videos [16] provided by the QFVS dataset [33]. TVSum [36] consists of 50 videos pertaining to 10 categories (how to videos, news, documentary, etc) with 5 videos from each category, typically 1-5 minutes in length. SumMe [7] consists of 25 videos capturing multiple events such as cooking and sports, and the lengths of the videos vary from 1 to 6 minutes. In addition to training on each dataset independently, we follow prior work and augment training data with 39 videos from the YouTube dataset [2] and 50 videos from the Open Video Project (OVP) dataset [24]. YouTube dataset consists of news, sports and cartoon videos. OVP dataset consists of multiple different genres including documentary videos. These datasets are diverse in nature and come with different types of annotations, frame-level scores for TVSum and shot-level scores for SumMe. They are integrated to create the ground-truth using the procedure in [43]. The UT Egocentric dataset consists of 4 videos captured from head-mounted cameras. Each video is about 3-5 hours long, captured in a natural, uncontrolled setting and contains a diverse set of events. The QFVS dataset [33] provides ground-truth generic summaries for these 4 videos. The summaries were constructed by dividing the video into shots and asking 3 users to select the relevant shots. The final ground-truth is an average of annotations from all users.
|
| 118 |
+
|
| 119 |
+
Note. All the datasets - YouTube [2], Open Video Project (OVP) dataset [24], TVSum [36], SumMe [7], and QFVS [32] were collected by the creators (cited) and consent for any personally identifiable information (PII) was ascertained by the authors where necessary.
|
| 120 |
+
|
| 121 |
+
Data configuration for TVSum and SumMe. Following previous works [43, 42, 31, 26], we evaluate our approach in three different data settings: Standard, Augment, and Transfer. In the Standard setting, the training and test splits are from the same dataset (i.e. either TVSum or SumMe). For SumMe we use available splits, and for TVSum we randomly select $20 \%$ of the videos for testing and construct 5 different splits and report an average result on all 5 splits. For the Augment setting, the training set from one dataset (e.g., TVSum) is combined with all the data from the remaining three datasets (e.g., SumMe, OVP, and YouTube). This setting yields the best performing models due to the additional training data. The Transfer setting is the most challenging of the three. It involves training a model on three datasets and evaluating on the fourth unseen dataset.
|
| 122 |
+
|
| 123 |
+
Table 2: Unsupervised. Comparing F1 Scores of our methods with unsupervised baselines on the SumMe [7] and TVSum [36] datasets using Standard, Augment, and Transfer data configurations.
|
| 124 |
+
|
| 125 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">SumMe</td><td colspan="3">TVSum</td></tr><tr><td colspan="6">Standard AugmentTransfer Standard AugmentTransfer</td></tr><tr><td>Mahasseni et al. [22]</td><td>39.1</td><td>43.4</td><td></td><td>51.7</td><td>59.5</td><td></td></tr><tr><td>Yuan et al. [41]</td><td>41.9</td><td>1</td><td>=</td><td>57.6</td><td>1</td><td></td></tr><tr><td>Rochan et al. (SUM-FCNun sup) [31]</td><td>41.5</td><td>1</td><td>39.5</td><td>52.7</td><td>1</td><td>-</td></tr><tr><td>Rochan et al. [30]</td><td>47.5</td><td>=</td><td>41.6</td><td>55.6</td><td>=</td><td>55.7</td></tr><tr><td>He et al. [9]</td><td>46.0</td><td>47.0</td><td>44.5</td><td>58.5</td><td>58.9</td><td>57.8</td></tr><tr><td>Park et al. (SumGraph) [26]</td><td>49.8</td><td>52.1</td><td>47.0</td><td>59.3</td><td>61.2</td><td>57.6</td></tr><tr><td>GoogleNet+bi-LSTM</td><td>33.1</td><td>38.0</td><td>36.5</td><td>47.7</td><td>54.9</td><td>52.3</td></tr><tr><td>ResNet+bi-LSTM</td><td>34.5</td><td>40.1</td><td>39.6</td><td>51.0</td><td>56.2</td><td>53.8</td></tr><tr><td>CLIP-Image+bi-LSTM</td><td>35.7</td><td>41.0</td><td>41.4</td><td>52.8</td><td>58.7</td><td>56.0</td></tr><tr><td>CLIP-Image+Video Caption+bi-LSTM</td><td>36.9</td><td>42.4</td><td>42.5</td><td>53.5</td><td>59.4</td><td>57.6</td></tr><tr><td>GoogleNet+Transformer</td><td>50.0</td><td>52.7</td><td>47.6</td><td>59.9</td><td>62.1</td><td>58.4</td></tr><tr><td>ResNet+Transformer</td><td>50.8</td><td>53.9</td><td>49.3</td><td>61.1</td><td>63.0</td><td>59.9</td></tr><tr><td>CLIP-Image+Transformer</td><td>51.2</td><td>53.6</td><td>49.2</td><td>61.9</td><td>64.0</td><td>60.6</td></tr><tr><td>CLIP-It: CLIP-Image+Video Caption+Transformer</td><td>52.5</td><td>54.7</td><td>50.0</td><td>63.0</td><td>65.7</td><td>62.8</td></tr></table>
|
| 126 |
+
|
| 127 |
+
Table 3: Comparing F1 Scores for generic video summarization on the QFVS datase
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Supervised</td><td>Vid 1</td><td>Vid 2</td><td>Vid 3</td><td>Vid 4</td><td>Avg</td></tr><tr><td>SubMod [6]</td><td>49.51</td><td>51.03</td><td>64.52</td><td>35.82</td><td>50.22</td></tr><tr><td>QFVS [33]</td><td>62.66</td><td>46.11</td><td>58.85</td><td>33.50</td><td>50.29</td></tr><tr><td>CLIP-Image + bi-LSTM ResNet +Transformer</td><td>65.43</td><td>56.55</td><td>68.63</td><td>40.06</td><td>57.67</td></tr><tr><td></td><td>66.97</td><td>58.32</td><td>70.10</td><td>43.31</td><td>59.67</td></tr><tr><td>CLIP-Image + Transformer</td><td>70.8</td><td>61.67</td><td>72.43</td><td>47.48</td><td>63.11</td></tr><tr><td>CLIP-It (Gen. Caption)</td><td>74.13</td><td>63.44</td><td>75.86</td><td>50.23</td><td>65.92</td></tr><tr><td>CLIP-It (GT Caption)</td><td>84.98</td><td>71.26</td><td>82.55</td><td>61.46</td><td>75.06</td></tr><tr><td> Unsupervised</td><td>Vid 1</td><td>Vid 2</td><td>Vid 3</td><td>Vid 4</td><td>Avg</td></tr><tr><td>Quasi [46]</td><td>53.06</td><td>53.80</td><td>49.91</td><td>22.31</td><td>44.77</td></tr><tr><td>CLIP-Image + Transformer</td><td>65.44</td><td>57.21</td><td>65.10</td><td>41.63</td><td>57.35</td></tr><tr><td>CLIP-It (Gen. Caption)</td><td>67.02</td><td>59.48</td><td>66.43</td><td>44.19</td><td>59.28</td></tr><tr><td>CLIP-It (GT Caption)</td><td>73.90</td><td>66.83</td><td>75.44</td><td>52.31</td><td>67.12</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Quantitative Results. We compare our method and its ablations to supervised video summarization baselines in Tab.1. We report F1 scores on the TVSum and SumMe datasets for all three data settings. Our full method, CLIP-It (CLIP-Image $+$ Video Caption $^ +$ Transformer), described in Sec. 3, outperforms state-of-the-art by a large margin on all three settings. Particularly, in the Transfer setting we outperform the previous state-of-the-art SumGraph [26] by $5 \%$ on TVSum and $3 \%$ on SumMe, indicating that our model is better than the baselines in generalizing to out-of-distribution data.
|
| 132 |
+
|
| 133 |
+
To prove the effectiveness of each component of our model, we include comparisons to different ablations. In CLIP-Image+Transformer, we ablate the Language-Guided Attention module and directly pass the CLIP-Image features as input to the transformer. As seen, the performance drops by $2 \%$ indicating that conditioning on CLIP language embeddings leads to better summaries. Substituting the Frame-Scoring Transformer with a Bidirectional LSTM in CLIP-Image+bi-LSTM and CLIP-Image $^ +$ Video Caption+bi-LSTM again results in a performance drop, thus highlighting the need for the Transformer module in our model. For a fair comparison with the baselines, in GoogleNet+Transformer we use the same GoogleNet features provided by Zhang et al. [43] and used by all the other baselines and do not include language features. This method still outperforms Sum
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 3: Comparison of ground-truth summary to results from CLIP-Image $^ +$ Transformer and the full CLIP-It model (CLIP-Image $^ +$ Video Caption $^ +$ Transformer). The input is a recipe video. Without captions, the model assigns high scores to certain irrelevant frames such as scenes of the woman talking or eating which hurts the precision. With captions, the cross-attention mechanism ensures that frames with important actions and objects are assigned high scores.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 4: Qualitative result comparing the generic summary from CLIP-It with the ground-truth summary. The plots showing predicted and ground-truth frame-level scores are similar, indicating that frames that were given a high score in ground-truth were also assigned high scores by our model.
|
| 140 |
+
|
| 141 |
+
Graph [26]. Replacing the GoogleNet features with ResNet features results in a small performance improvement but CLIP-Image features prove to be most effective.
|
| 142 |
+
|
| 143 |
+
Tab. 2 compares F1 scores in the unsupervised setting to other unsupervised baselines. CLIP-It (CLIP-Image $+$ Video Caption+Transformer), outperforms the best performing baseline on all settings on both datasets. We again observe large performance improvements in the Transfer setting and notice that overall our unsupervised method performs almost as well as our supervised counterpart. In CLIP-Image+Transformer we ablate the language component which causes a drop in performance, thus proving that language cues are useful in the unsupervised setting as well. Other ablations yield similar results reiterating the need for each component of our method. We also follow Otani et al. [25] and report results on rank based metrics, Kendall’s $\tau$ [14] and Spearman’s $\rho$ [49] correlation coefficients in the Supp.
|
| 144 |
+
|
| 145 |
+
Table 4: Results on UT Egocentric dataset [16]
|
| 146 |
+
|
| 147 |
+
<table><tr><td>Method</td><td>F-Measure</td><td>Recall</td></tr><tr><td colspan="3">Supervised</td></tr><tr><td>Submod-V+Both et al. [27]</td><td>34.15</td><td>31.59</td></tr><tr><td>CLIP Image + Transformer</td><td>41.58</td><td>39.96</td></tr><tr><td>CLIP-It: CLIP Image + Gen. Video Caption + Transformer</td><td>44.70</td><td>43.28</td></tr><tr><td>CLIP-It: CLIP Image + GT Video Caption + Transformer</td><td>52.10</td><td>50.76</td></tr><tr><td colspan="3">Unsupervised</td></tr><tr><td>CLIP Image + Transformer</td><td>39.22</td><td>37.46</td></tr><tr><td>CLIP-It: CLIP Image + Gen.Video Caption + Transformer</td><td>42.10</td><td>40.65</td></tr><tr><td>CLIP-It: CLIP Image + GT Video Caption + Transformer</td><td>49.98</td><td>47.91</td></tr><tr><td colspan="3">Table 5: Results on TV Episodes dataset [16]</td></tr><tr><td>Method</td><td>F-Measure</td><td>Recall</td></tr><tr><td colspan="3">Supervised</td></tr><tr><td>Submod-V+Sem. Rep. et al. [27]</td><td>40.90</td><td>37.02</td></tr><tr><td>CLIP Image+ Transformer</td><td>47.82</td><td>46.02</td></tr><tr><td>CLIP-It: CLIP Image + GT Video Caption + Transformer</td><td>55.34</td><td>53.90</td></tr><tr><td colspan="3">Unsupervised</td></tr><tr><td>CLIP Image + Transformer</td><td>45.77</td><td>44.01</td></tr><tr><td>CLIP-It: CLIP Image + GT Video Caption+ Transformer</td><td>53.42</td><td>52.50</td></tr></table>
|
| 148 |
+
|
| 149 |
+
Tab. 3 shows F1 scores for the generic setting on the QFVS Dataset [33]. Following [33], we run four rounds of experiments leaving out one video for testing and one for validation, while keeping the remaining two for training. Our method, CLIP-It (Gen. Captions) outperforms both supervised and unsupervised baselines by a large margin on all four videos, and particularly on Video 4, which happens to be the most difficult for all methods. Adding captions helps significantly improve $( 2 \% )$ the summaries and outperforms the CLIP Image $^ +$ Transformer baseline. To see how well our model would perform if we had perfect captions, we also show results by using the ground-truth captions obtained from VideoSet [40]. Replacing CLIP-Image features with ResNet features causes a drop in performance. Likewise, replacing the Transformer with a bi-LSTM also hurts performance.
|
| 150 |
+
|
| 151 |
+
We include results of our method (1) without captions (2) using generated captions (3) using the ground truth captions provided by VideoSet [40] for UT Egocentric and TV Episodes datasets in Tables 4 and 5. As ground truth, we obtain 15 summaries for each video using the same greedy n-gram matching and ordered subshot selection procedures as previous work [27]. We follow the same procedure as in prior work [40, 27] for creating and evaluating text summaries from video summaries. Our method outperforms [27] in both the supervised and unsupervised settings on both datasets.
|
| 152 |
+
|
| 153 |
+
Qualitative Results. We highlight the need to use language, specifically dense video captions, for constructing generic video summaries through a qualitative example in Fig. 3. The input is a video of a woman demonstrating how to make a chicken sandwich. The ground truth summary shows the scores computed by averaging the annotations from all users as in [43] and the keyframes that received high scores. Next we show the result from the baseline CLIP-Image+Transformer, which uses only visual features and no language input. The predicted scores show that the high scoring frames in the ground truth also receive a high score by our baseline, however a lot of irrelevant frames end up receiving a high score too. Thus, when the model finally picks the keyframes it ends up selecting frames where the person is talking or eating the sandwich (shown in red) which do not correspond to the key steps in the video. Adding language guidance via generated captions helps address this problem. The last row shows the captions generated by BMT [11]. The results shown are from our full CLIP-It model. The predicted scores are more similar to ground truth scores and the highest scoring keyframes are the same as the ground truth.
|
| 154 |
+
|
| 155 |
+
Table 6: Comparing F1 Scores of different methods on the QFVS dataset.
|
| 156 |
+
|
| 157 |
+
<table><tr><td></td><td>Vid 1</td><td>Vid 2</td><td>Vid 3</td><td>Vid 4</td><td>Avg</td></tr><tr><td>SeqDPP[51</td><td>36.59</td><td>43.67</td><td>25.26</td><td>18.15</td><td>30.92</td></tr><tr><td>SH-DPP [32]</td><td>35.67</td><td>42.74</td><td>36.51</td><td>18.62</td><td>33.38</td></tr><tr><td>QFVS [33]</td><td>48.68</td><td>41.66</td><td>56.47</td><td>29.96</td><td>44.19</td></tr><tr><td>CLIP-Image + Query + bi-LSTM</td><td>54.47</td><td>48.59</td><td>62.81</td><td>38.64</td><td>51.13</td></tr><tr><td>ResNet + Query + Transformer</td><td>55.19</td><td>51.03</td><td>64.26</td><td>39.47</td><td>52.49</td></tr><tr><td>CLIP-It: CLIP-Image + Query + Transformer</td><td>57.13</td><td>53.60</td><td>66.08</td><td>41.41</td><td>54.55</td></tr></table>
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 5: Result of our method on the QFVS dataset. The first row shows some frames from the 4 hour long input video. Given the query "book and chair", Summary 1 shows some frames selected by our method. Summary 2 shows frames for the query "Sun and Tree".
|
| 161 |
+
|
| 162 |
+
Fig. 4 shows compares summaries generated by our method to the ground truth summary on a cooking video from the SumMe dataset. Predicted scores are the frame-wise scores predicted by CLIP-It and GT Scores are the scores computed from user annotations [43]. The top row (True Positives) shows high scoring keyframes which are chosen by both our method and the ground truth, and the green arrows point to the assigned scores. As we see, they are clear, distinct and represent key actions in the recipe. The bottom row (True Negatives) shows frames which are assigned a low score (shown by the red arrows) and are not part of the final summaries (both GT and predicted). E.g., the first frame is irrelevant and corresponds to a segment between key steps, while the second frame has poor lighting and its hard to tell what is being done.
|
| 163 |
+
|
| 164 |
+
# 4.2 Query-Focused Video Summarization
|
| 165 |
+
|
| 166 |
+
In Query-Focused Video Summarization, the summarization process is conditioned on an input user query, thus, multiple summaries can be obtained for the same video using different input queries.
|
| 167 |
+
|
| 168 |
+
Dataset. We evaluate our method on the QFVS dataset based on the UT Egocentric videos described earlier. The dataset consists of 46 queries for each of the four videos and user-annotated video summaries for each query.
|
| 169 |
+
|
| 170 |
+
Quantitative Results. In Tab. 6, we compare F1 scores of our method to 3 baselines, SH-DPP [32], Seq-DPP [5], and QFVS [33]. Following [33], we run four rounds of experiments leaving out one video for testing and one for validation, while keeping the remaining two for training. Our full model achieves an avg F1 score of $5 4 . 5 5 \%$ outperforming the best baseline $( 4 4 . 1 9 \% )$ by $10 \%$ . We would like to point out that our method uses more recent image features compared to the baselines. At the same time, when switching from CLIP to ResNet image embedding, we still improve significantly over the baselines. We expect the improvement to also hold with weaker features (e.g., as demonstrated with GoogleNet results in Tab. 1, 2).
|
| 171 |
+
|
| 172 |
+
Qualitative Results. Fig. 5 shows a result on the QFVS dataset for UT Egocentric videos. The input is an egocentric video shot from a head-mounted camera and spans 4 hours. It consists of multiple events from a person’s day, such as reading books, working on the laptop, walking in the streets, and so on. Summary 1 and 2 show results from our CLIP-It method when the input query is “Book and chair” and “Sun and tree” respectively. The frames shown are frames assigned high-scores by our method. As seen, given the same input video, different queries yield different summaries.
|
| 173 |
+
|
| 174 |
+
# 5 Discussion and Broader Impacts
|
| 175 |
+
|
| 176 |
+
We introduced CLIP-It, a unified language-guided framework for generic and query focused video summarization. Video summarization is a relevant problem with many use-cases, and our approach provides greater flexibility to the users, allowing them to guide summarization with open-ended natural language queries. We envision potential positive impact from improved user experience if adopted on video platforms such as YouTube. We rely on an off-the-shelf video captioning model [11] and a large-scale vision-language model (CLIP [29]) which may have encoded some inappropriate biases that could propagate to our model. Our visual inspection of the obtained summarization results did not raise any apparent concerns. However, practitioners who wish to use our approach should be mindful of the sources of bias we have outlined above depending on the specific use case they are addressing.
|
| 177 |
+
|
| 178 |
+
Acknowledgements. We thank Arun Mallya for very helpful discussions and feedback. We’d also like to thank Huijuan Xu for feedback on the draft. This work was supported in part by DoD including DARPA’s XAI, LwLL, and SemaFor programs, as well as BAIR’s industrial alliance programs.
|
| 179 |
+
|
| 180 |
+
# References
|
| 181 |
+
|
| 182 |
+
[1] Chen, B.C., Chen, Y.Y., Chen, F.: Video to text summary: Joint video summarization and captioning with recurrent neural networks. British Machine Vision Conference (BMVC) (2017) 3, 6 [2] De Avila, S.E.F., Lopes, A.P.B., da Luz Jr, A., de Albuquerque Araújo, A.: Vsumm: A mechanism designed to produce static video summaries and a novel evaluation method. Patt. Rec. Letters (2011) 6
|
| 183 |
+
[3] Fajtl, J., Sokeh, H.S., Argyriou, V., Monekosso, D., Remagnino, P.: Summarizing videos with attention. Asian Conference on Computer Vision (ACCV) (2018) 2, 3, 6 [4] Gabeur, V., Sun, C., Alahari, K., Schmid, C.: Multi-modal transformer for video retrieval. European Conference on Computer Vision (ECCV) (2020) 3 [5] Gong, B., Chao, W.L., Grauman, K., Sha, F.: Diverse sequential subset selection for supervised video summarization. Advances in Neural Information Processing Systems (NeurIPS) (2014) 2, 3, 9, 10 [6] Gygli, M., Grabner, H., Gool, L.V.: Video summarization by learning submodular mixtures of objectives. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2015) 3, 7 [7] Gygli, M., Grabner, H., Riemenschneider, H., Gool, L.V.: Creating summaries from user videos. European Conference on Computer Vision (ECCV) (2014) 2, 3, 6, 7
|
| 184 |
+
[8] He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016) 3, 5 [9] He, X., Hua, Y., Song, T., Zhang, Z., Xue, Z., Ma, R., Robertson, N., Guan, H.: Unsupervised video summarization with attentive conditional generative adversarial networks. ACM international conference on Multimedia (2019) 2, 6, 7
|
| 185 |
+
[10] Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural computation (1997) 3
|
| 186 |
+
[11] Iashin, V., Rahtu, E.: A better use of audio-visual cues: Dense video captioning with bi-modal transformer. British Machine Vision Conference (BMVC) (2020) 3, 5, 10, 11
|
| 187 |
+
[12] Kanehira, A., Gool, L.V., Ushiku, Y., Harada, T.: Viewpoint-aware video summarization. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018) 3
|
| 188 |
+
[13] Kang, H.W., Matsushita, Y., Tang, X., Chen, X.Q.: Space-time video montage. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2006) 3
|
| 189 |
+
[14] Kendall, M.G.: The treatment of ties in ranking problems. Biometrika 33(3), 239–251 (1945) 8
|
| 190 |
+
[15] Lavancier, F., Møller, J., Rubak, E.: Determinantal point process models and statistical inference. Journal of the Royal Statistical Society: Series B: Statistical Methodology (2015) 3
|
| 191 |
+
[16] Lee, Y.J., Ghosh, J., Grauman, K.: Discovering important people and objects for egocentric video summarization. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2012) 3, 6, 9
|
| 192 |
+
[17] Lei, J., Wang, L., Shen, Y., Yu, D., Berg, T., Bansal, M.: Mart: Memory-augmented recurrent transformer for coherent video paragraph captioning. Association for Computational Linguistics (2020) 3
|
| 193 |
+
[18] Li, Y., Wang, L., Yang, T., Gong, B.: How local is the local diversity? reinforcing sequential determinantal point processes with dynamic ground sets for supervised video summarization. European Conference on Computer Vision (ECCV) (2018) 2, 3
|
| 194 |
+
[19] Liu, T., Kender, J.R.: Optimization algorithms for the selection of key frame sequences of variable length. European Conference on Computer Vision (ECCV) (2002) 3
|
| 195 |
+
[20] Lu, Z., Grauman, K.: Story-driven summarization for egocentric video. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2013) 3
|
| 196 |
+
[21] Ma, Y.F., Zhang, H.J.: A model of motion attention for video skimming. International Conference on Image Processing (ICIP) (2002) 2
|
| 197 |
+
[22] Mahasseni, B., Lam, M., Todorovic, S.: Unsupervised video summarization with adversarial lstm networks. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017) 3, 6, 7
|
| 198 |
+
[23] Ngo, C.W., Ma, Y.F., Zhang, H.J.: Automatic video summarization by graph modeling. IEEE International Conference on Computer Vision (ICCV) (2003) 3
|
| 199 |
+
[24] Open video project. https://open-video.org/ 6
|
| 200 |
+
[25] Otani, M., Nakashima, Y., Rahtu, E., Heikkilä, J.: Rethinking the evaluation of video summaries. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019) 8
|
| 201 |
+
[26] Park, J., Lee, J., Kim, I.J., Sohn, K.: Sumgraph: Video summarization via recursive graph modeling. European Conference on Computer Vision (ECCV) (2020) 2, 3, 6, 7, 8
|
| 202 |
+
[27] Plummer, B.A., Brown, M., Lazebnik, S.: Enhancing video summarization via vision-language embedding. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017) 3, 9
|
| 203 |
+
[28] Potapov, D., Douze, M., Harchaoui, Z., Schmid, C.: Category-specific video summarization. European Conference on Computer Vision (ECCV) (2014) 3
|
| 204 |
+
[29] Radford, A., Kim, J.W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al.: Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020 (2021) 3, 5, 11
|
| 205 |
+
[30] Rochan, M., Wang, Y.: Video summarization by learning from unpaired data. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2019) 3, 5, 6, 7
|
| 206 |
+
[31] Rochan, M., Ye, L., Wang, Y.: Video summarization using fully convolutional sequence networks. European Conference on Computer Vision (ECCV) (2018) 2, 3, 5, 6, 7
|
| 207 |
+
[32] Sharghi, A., Gong, B., Shah, M.: Query-focused extractive video summarization. European Conference on Computer Vision (ECCV) (2016) 2, 3, 6, 9, 10
|
| 208 |
+
[33] Sharghi, A., Laurel, J.S., Gong, B.: Query-focused video summarization: Dataset, evaluation, and a memory network based approach. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2017) 2, 3, 6, 7, 9, 10
|
| 209 |
+
[34] Smith, M.A., Kanade, T.: Video skimming for quick browsing based on audio and image characterization. School of Computer Science, Carnegie Mellon University (1995) 2
|
| 210 |
+
[35] Smith, M.A., Kanade, T.: Video skimming and characterization through the combination of image and language understanding techniques. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (1997) 2
|
| 211 |
+
[36] Song, Y., Vallmitjana, J., Stent, A., Jaimes, A.: Tvsum: Summarizing web videos using titles. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2015) 2, 3, 6, 7
|
| 212 |
+
[37] Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., Rabinovich, A.: Going deeper with convolutions. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2015) 5
|
| 213 |
+
[38] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł., Polosukhin, I.: Attention is all you need. Advances in Neural Information Processing Systems (NeurIPS) (2017) 3, 4
|
| 214 |
+
[39] Wei, H., Ni, B., Yan, Y., Yu, H., Yang, X., Yao, C.: Video summarization via semantic attended networks. The Association for the Advancement of Artificial Intelligence Conference (AAAI) (2018) 3
|
| 215 |
+
[40] Yeung, S., Fathi, A., Fei-Fei, L.: Videoset: Video summary evaluation through text. arXiv preprint arXiv:1406.5824 (2014) 9
|
| 216 |
+
[41] Yuan, L., Tay, F.E., Li, P., Zhou, L., Feng, J.: Cycle-sum: Cycle-consistent adversarial lstm networks for unsupervised video summarization. The Association for the Advancement of Artificial Intelligence Conference (AAAI) (2019) 3, 7
|
| 217 |
+
[42] Zhang, K., Chao, W.L., Sha, F., Grauman, K.: Summary transfer: Examplar-based subset selection for video summarization. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016) 2, 3, 6
|
| 218 |
+
[43] Zhang, K., Chao, W.L., Sha, F., Grauman, K.: Video summarization with long short-term memory. European Conference on Computer Vision (ECCV) (2016) 2, 3, 4, 6, 7, 9, 10
|
| 219 |
+
[44] Zhang, K., Grauman, K., Sha, F.: Retrospective encoders for video summarization. European Conference on Computer Vision (ECCV) (2018) 2, 3, 6
|
| 220 |
+
[45] Zhao, B., Li, X., Lu, X.: Hierarchical recurrent neural network for video summarization. ACM international conference on Multimedia (2017) 3, 5
|
| 221 |
+
[46] Zhao, B., Xing, E.P.: Quasi real-time summarization for consumer videos. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2014) 7
|
| 222 |
+
[47] Zhou, K., Qiao, Y., Xiang, T.: Deep reinforcement learning for unsupervised video summarization with diversity-representativeness reward. The Association for the Advancement of Artificial Intelligence Conference (AAAI) (2018) 6
|
| 223 |
+
[48] Zhou, L., Zhou, Y., Corso, J.J., Socher, R., Xiong, C.: End-to-end dense video captioning with masked transformer. IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2018) 3
|
| 224 |
+
[49] Zwillinger, D., Kokoska, S.: Crc standard probability and statistics tables and formulae. CRC Press (1999) 8
|
md/train/6YL_BntJrz6/6YL_BntJrz6.md
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dirichlet Energy Constrained Learning for Deep Graph Neural Networks
|
| 2 |
+
|
| 3 |
+
Kaixiong Zhou Rice University Kaixiong.Zhou@rice.edu
|
| 4 |
+
|
| 5 |
+
Xiao Huang The Hong Kong Polytechnic University xiaohuang@comp.polyu.edu.hk
|
| 6 |
+
|
| 7 |
+
Daochen Zha Rice University Daochen.Zha@rice.edu
|
| 8 |
+
|
| 9 |
+
Rui Chen Samsung Research America rui.chen1@samsung.com
|
| 10 |
+
|
| 11 |
+
Li Li Samsung Research America li.li1@samsung.com
|
| 12 |
+
|
| 13 |
+
Soo-Hyun Choi∗ Samsung Electronics soohyunc@gmail.com
|
| 14 |
+
|
| 15 |
+
Xia Hu Rice University xia.hu@rice.edu
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Graph neural networks (GNNs) integrate deep architectures and topological structure modeling in an effective way. However, the performance of existing GNNs would decrease significantly when they stack many layers, because of the oversmoothing issue. Node embeddings tend to converge to similar vectors when GNNs keep recursively aggregating the representations of neighbors. To enable deep GNNs, several methods have been explored recently. But they are developed from either techniques in convolutional neural networks or heuristic strategies. There is no generalizable and theoretical principle to guide the design of deep GNNs. To this end, we analyze the bottleneck of deep GNNs by leveraging the Dirichlet energy of node embeddings, and propose a generalizable principle to guide the training of deep GNNs. Based on it, a novel deep GNN framework – Energetic Graph Neural Networks (EGNN) is designed. It could provide lower and upper constraints in terms of Dirichlet energy at each layer to avoid over-smoothing. Experimental results demonstrate that EGNN achieves state-of-the-art performance by using deep layers.
|
| 20 |
+
|
| 21 |
+
# 1 Introduction
|
| 22 |
+
|
| 23 |
+
Graph neural networks (GNNs) [1] are promising deep learning tools to analyze networked data, such as social networks [2, 3, 4], academic networks [5, 6, 7], and molecular graphs [8, 9, 10, 11]. Based on spatial graph convolutions, GNNs apply a recursive aggregation mechanism to update the representation of each node by incorporating representations of itself and its neighbors [12]. A variety of GNN variations have been explored for different real-world networks and applications [13, 14].
|
| 24 |
+
|
| 25 |
+
A key limitation of GNNs is that when we stack many layers, the performance would decrease significantly. Experiments show that GNNs often achieve the best performance with less than 3 layers [15, 13]. As the layer number increases, the node representations will converge to indistinguishable vectors due to the recursive neighborhood aggregation and non-linear activation [16, 17].
|
| 26 |
+
|
| 27 |
+
Such phenomenon is recognized as over-smoothing issue [18, 19, 20, 21, 22]. It prevents the stacking of many layers and modeling the dependencies to high-order neighbors.
|
| 28 |
+
|
| 29 |
+
A number of algorithms have been proposed to alleviate the over-smoothing issue and construct deep GNNs, including embedding normalization [23, 24, 25], residual connection [26, 27, 28] and random data augmentation [29, 30, 31]. However, some of them are motivated directly by techniques in convolutional neural networks (CNNs) [32], such as the embedding normalization and residual connection. Others are based on heuristic strategies, such as random embedding propagation [30] and dropping edge [29]. Most of them only achieve comparable or even worse performance compared to their shallow models. Recently, a metric of Dirichlet energy has been applied to quantify the over-smoothing [33], which is based on measuring node pair distances. With the increasing of layers, the Dirichlet energy converges to zero since node embeddings become close to each other. But there is a lack of empirical methods to leverage this metric to overcome the over-smoothing issue.
|
| 30 |
+
|
| 31 |
+
Therefore, it remains a non-trivial task to train a deep GNN architecture due to three challenges. First, the existing efforts are developed from diverse perspectives, without a generalizable principle and analysis. The abundance of these components also makes the design of deep GNNs challenging, i.e., how should we choose a suitable one or combinations for real-world scenarios? Second, even if an effective indicator of over-smoothing is given, it is hard to theoretically analyze the bottleneck and propose a generalizable principle to guide the training of deep GNNs. Third, even if theoretical guidance is given, it may be difficult to be utilized and implemented to train GNNs empirically.
|
| 32 |
+
|
| 33 |
+
To this end, in this paper, we target to develop a generalizable framework with a theoretical basis, to handle the over-smoothing issue and enable effective deep GNN architectures. In particular, we will investigate two research questions. 1) Is there a theoretical and generalizable principle to guide the architecture design and training of deep GNNs? 2) How can we develop an effective architecture to achieve state-of-the-art performance by stacking a large number of layers? Following these questions, we make three major contributions as follows.
|
| 34 |
+
|
| 35 |
+
• We propose a generalizable principle – Dirichlet energy constrained learning, to guide the training of deep GNNs by regularizing Dirichlet energy. Without proper training, the Dirichlet energy would be either too small due to the over-smoothing issue, or too large when the node embeddings are over-separating. Our principle carefully defines an appropriate range of Dirichlet energy at each layer. Being regularized within this range, a deep GNN model could be trained by jointly optimizing the task loss and energy value.
|
| 36 |
+
|
| 37 |
+
• We design a novel deep architecture – Energetic Graph Neural Networks (EGNN). It follows the proposed principle and could efficiently learn an optimal Dirichlet energy. It consists of three components, i.e., orthogonal weight controlling, lower-bounded residual connection, and shifted ReLU (SReLU) activation. The trainable weights at graph convolutional layers are orthogonally initialized as diagonal matrices, whose diagonal values are regularized to meet the upper energy limit and eliminate the over-separating. The residual connection strength is determined by the lower energy limit to avoid the over-smoothing. While the widely-used ReLU activation causes the extra loss of Dirichlet energy, the linear mapping worsens the learning ability of GNNs. We apply SReLU with a trainable shift to provide a trade-off between the non-linear and linear mappings.
|
| 38 |
+
|
| 39 |
+
• We show that the proposed principle and EGNN can well explain most of the existing techniques for deep GNNs. Empirical results demonstrate that EGNN could be easily trained to reach 64 layers and achieves surprisingly competitive performance on benchmarks.
|
| 40 |
+
|
| 41 |
+
# 2 Problem Statement
|
| 42 |
+
|
| 43 |
+
Notations. Given an undirected graph consisting of $n$ nodes, it is represented as $G = ( A , X )$ , where $A \in \mathbb { R } ^ { n \times n }$ denotes the adjacency matrix and $\boldsymbol { X } \in \mathbb { R } ^ { n \times d }$ denotes the feature matrix. Let ${ \tilde { A } } : = A + I _ { n }$ and $\tilde { D } : = D + I _ { n }$ be the adjacency and degree matrix of the graph augmented with selfloops. The augmented normalized Laplacian is then given by $\tilde { \Delta } : = I _ { n } - \tilde { P }$ , where $\bar { \tilde { P } } : = \tilde { D } ^ { - \frac { 1 } { 2 } } \tilde { A } \tilde { D } ^ { - \frac { 1 } { 2 } }$ is an augmented normalized adjacency matrix used for the neighborhood aggregation in GNN models.
|
| 44 |
+
|
| 45 |
+
Node classification task. GNNs have been adopted in many applications [6, 11, 34]. Without loss of generality, we take node classification as an example. Given a graph $G = ( A , X )$ and a set of its nodes with labels for training, the goal is to predict the labels of nodes in a test set.
|
| 46 |
+
|
| 47 |
+
We now use the graph convolutional network (GCN) [15] as a typical example, to illustrate how traditional GNNs perform the network analysis task. Formally, the layer-wise forward-propagation operation in GCN at the $k$ -th layer is defined as:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
X ^ { ( k ) } = \sigma ( \tilde { P } X ^ { ( k - 1 ) } W ^ { ( k ) } ) .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
$X ^ { ( k ) }$ and $X ^ { ( k - 1 ) }$ are node embedding matrices at layers $k$ and $k - 1$ , respectively; $W ^ { ( k ) } \in \mathbb { R } ^ { d \times d }$ denotes trainable weights used for feature transformation; $\sigma$ denotes an activation function such as ReLU; $X ^ { ( 0 ) } = X$ at the initial layer of GCN. The embeddings at the final layer are optimized with a node classification loss function, e.g., cross-entropy loss. The recursive neighborhood aggregation in Eq. (1) will make node embeddings similar to each other as the number of layer $k$ increases. This property, i.e., over-smoothing, prevents traditional GNNs from exploring neighbors many hops away. In practice, the dependencies to high-order neighbors are important to the node classification. The traditional shallow GNNs may have sub-optimal performances in the downstream tasks [16, 28].
|
| 54 |
+
|
| 55 |
+
# 3 Dirichlet Energy Constrained Learning
|
| 56 |
+
|
| 57 |
+
In this paper, we aim to develop an effective principle to alleviate the over-smoothing issue and enable deep GNNs to leverage the high-order neighbors. We first theoretically analyze the over-smoothing issue, and then provide a principle to explain the key constraint in training deep GNNs.
|
| 58 |
+
|
| 59 |
+
Node pair distance has been widely adopted to quantify the over-smoothing based on embedding similarities [19, 23]. Among the series of distance metrics, Dirichlet energy is simple and expressive for the over-smoothing analysis [33]. Thus, we adopt Dirichlet energy and formally define it as below.
|
| 60 |
+
|
| 61 |
+
Definition 1. Given node embedding matrix $X ^ { ( k ) } = [ x _ { 1 } ^ { ( k ) } , \cdots , x _ { n } ^ { ( k ) } ] ^ { \top } \in \mathbb { R } ^ { n \times d }$ learned from GCN at the $k$ -th layer, the Dirichlet energy $E ( X ^ { ( k ) } )$ is defined as follows:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
E ( { \boldsymbol { X } } ^ { ( k ) } ) = \operatorname { t r } ( { \boldsymbol { X } } ^ { ( k ) } ^ { \top } \tilde { \Delta } { \boldsymbol { X } } ^ { ( k ) } ) = \frac { 1 } { 2 } \sum a _ { i j } | | \frac { \boldsymbol { x } _ { i } ^ { ( k ) } } { \sqrt { 1 + d _ { i } } } - \frac { { \boldsymbol { x } } _ { j } ^ { ( k ) } } { \sqrt { 1 + d _ { j } } } | | _ { 2 } ^ { 2 } ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\operatorname { t r } ( \cdot )$ denotes trace of a matrix; $a _ { i j }$ is edge weight given by the $( i , j )$ -th element in matrix $A$ ; $d _ { i }$ is node degree given by the $i$ -th diagonal element in matrix $D$ . Dirichlet energy reveals the embedding smoothness with the weighted node pair distance. While a smaller value of $E ( X ^ { ( k ) } )$ is highly related to the over-smoothing, a larger one indicates that the node embeddings are over-separating even for those nodes with the same label. Considering the node classification task, one would prefer to have an appropriate Dirichlet energy at each layer to separate the nodes of different classes while keeping those of the same class close. However, under some conditions, the upper bound of Dirichlet energy is theoretically proved to converge to 0 in the limit of infinite layers [33]. In other words, all nodes converge to a trivial fixed point in the embedding space.
|
| 68 |
+
|
| 69 |
+
Based on the previous analysis, we derive the corresponding lower bound and revisit the oversmoothing/separating problem from the model design and training perspectives. To simplify the derivation process, we remove the non-linear activation $\sigma$ , and re-express GCN as: $X ^ { ( \bar { k } ) } =$ $P \cdot \cdot \cdot P X W ^ { ( 1 ) } \cdot \cdot \cdot W ^ { ( k ) }$ . The impact of non-linear function will be considered in the model design.
|
| 70 |
+
|
| 71 |
+
Lemma 1. The Dirichlet energy at the $k$ -th layer is bounded as follows:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
( 1 - \lambda _ { 1 } ) ^ { 2 } s _ { \operatorname* { m i n } } ^ { ( k ) } E ( X ^ { ( k - 1 ) } ) \leq E ( X ^ { ( k ) } ) \leq ( 1 - \lambda _ { 0 } ) ^ { 2 } s _ { \operatorname* { m a x } } ^ { ( k ) } E ( X ^ { ( k - 1 ) } ) .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
The detailed proof is provided in the Appendix. $\lambda _ { 1 }$ and $\lambda _ { 0 }$ are the non-zero eigenvalues of matrix $\tilde { \Delta }$ that are most close to values 1 and 0, respectively. $s _ { \mathrm { m i n } } ^ { ( k ) }$ and $s _ { \mathrm { m a x } } ^ { ( k ) }$ are the squares of minimum and maximum singular values of weight $W ^ { ( k ) }$ , respectively. Note that the eigenvalues of $\tilde { \Delta }$ vary with the real-world graphs, and locate within range $[ 0 , 2 )$ . We relax the above bounds as below.
|
| 78 |
+
|
| 79 |
+
Lemma 2. The lower and upper bounds of Dirichlet energy at the $k$ -th layer could be relaxed as:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
0 \leq E ( X ^ { ( k ) } ) \leq s _ { \operatorname* { m a x } } ^ { ( k ) } E ( X ^ { ( k - 1 ) } ) .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Besides the uncontrollable eigenvalues determined by the underlying graph, it is shown that the Dirichlet energy can be either too small or too large without proper design and training on weight $W ^ { ( k ) }$ . On one hand, based on the common Glorot initialization [35] and L2 regularization, we empirically find that some of the weight matrices approximate to zero in a deep GCN. The corresponding square singular values are hence close to zero in these intermediate layers. That means the Dirichlet energy will become zero at the higher layers of GCN and causes the over-smoothing issue. On the other hand, without the proper weight initialization and regularization, a large $s _ { \mathrm { m a x } } ^ { ( k ) }$ may lead to the energy explosion and the over-separating.
|
| 86 |
+
|
| 87 |
+
The Dirichlet energy plays a key role in training a deep GNN model. However, the optimal value of Dirichlet energy varies in the different layers and applications. It is hard to be specified ahead and then enforces the node representation learning. Therefore, we propose a principle – Dirichlet energy constrained learning, defined in Proposition 1. It provides appropriate lower and upper limits of Dirichlet energy. Regularized by such a given range, a deep GNN model could be trained by jointly optimizing the node classification loss and Dirichlet energy at each layer.
|
| 88 |
+
|
| 89 |
+
Proposition 1. Dirichlet energy constrained learning defines the lower & upper limits at layer $k$ as:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
c _ { \operatorname* { m i n } } E ( X ^ { ( k - 1 ) } ) \leq E ( X ^ { ( k ) } ) \leq c _ { \operatorname* { m a x } } E ( X ^ { ( 0 ) } ) .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
We apply the transformed initial feature through trainable function $f$ $\because X ^ { ( 0 ) } = f ( X ) \in \mathbb { R } ^ { n \times d }$ . Both $c _ { \mathrm { m i n } }$ and $c _ { \mathrm { m a x } }$ are positive hyperparameters. From value interval $( 0 , 1 )$ , hyperparameter $c _ { \mathrm { m i n } }$ is selected by satisfying constraint of $E ( X ^ { ( k ) } ) \ge c _ { \mathrm { m i n } } ^ { k } E ( X ^ { ( 0 ) } ) > 0$ . In such a way, the over-smoothing is overcome since the Dirichlet energies of all the layers are larger than appropriate limits related to ckmin. Compared with the initial transformed feature $X ^ { ( 0 ) }$ , the intermediate node embeddings of the same class are expected to be merged closely to have a smaller Dirichlet energy and facilitate the downstream applications. Therefore, we exploit the upper limit $c _ { \mathrm { m a x } } E ( X ^ { ( 0 ) } )$ to avoid overseparating, where $c _ { \mathrm { m a x } }$ is usually selected from $( 0 , 1 ]$ . In the experiment part, we show that the optimal energy accompanied with the minimized classification loss locates within the above range at each layer. Furthermore, hyperparameters $c _ { \mathrm { m i n } }$ and $c _ { \mathrm { m a x } }$ could be easily selected from the large and appropriate value scopes, which do not affect the model performance.
|
| 96 |
+
|
| 97 |
+
Given both the low and upper limits, an intuitive solution to search the optimal energy is to train GNNs by optimizing the following constrained problem:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r l } & { \operatorname* { m i n } \quad \mathcal { L } _ { \mathrm { t a s k } } + \gamma \sum _ { k } | | W ^ { ( k ) } | | _ { F } , } \\ & { \mathrm { s . t . } \quad c _ { \operatorname* { m i n } } E \big ( X ^ { ( k - 1 ) } \big ) \leq E \big ( X ^ { ( k ) } \big ) \leq c _ { \operatorname* { m a x } } E \big ( X ^ { ( 0 ) } \big ) , \mathrm { f o r } k = 1 , \cdots , K . } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
$\mathcal { L } _ { \mathrm { t a s k } }$ denotes the cross-entropy loss of node classification task; $K$ is layer number of GNN; $| | \cdot | | _ { F }$ denotes Frobenius norm of a matrix; and $\gamma$ is loss hyperparameter. Note that Dirichlet energy has also been adopted to regularize the node representation learning in shallow neural networks [36, 37, 38]. We instead focus on optimizing deep GNNs as shown in Eq. (6), where $K$ is often large.
|
| 104 |
+
|
| 105 |
+
# 4 Energetic Graph Neural Networks - EGNN
|
| 106 |
+
|
| 107 |
+
It is non-trivial to optimize Problem (6) due to the expensive computation of $E ( X ^ { ( k ) } )$ . Furthermore, the numerous constraints make the problem a very complex optimization hyper-planes, at which the raw task objective tends to fall into local optimums. Instead of directly optimizing Problem (6), we propose an efficient model EGNN to satisfy the constrained learning from three perspectives: weight controlling, residual connection and activation function. We introduce them one by one as follows.
|
| 108 |
+
|
| 109 |
+
# 4.1 Orthogonal Weight Controlling
|
| 110 |
+
|
| 111 |
+
According to Lemma 2, without regularizing the maximum square singular value $s _ { \mathrm { m a x } } ^ { ( k ) }$ of matrix $W ^ { ( k ) }$ , the upper bound of Dirichlet energy can be larger than the upper limit, i.e., $s _ { \mathrm { m a x } } ^ { ( k ) } E ( X ^ { ( k - 1 ) } ) >$ $c _ { \mathrm { m a x } } E ( X ^ { ( 0 ) } )$ . That means the Dirichlet energy of a layer may break the upper limit of constrained learning, and makes Problem (6) infeasible. In this section, we show how to satisfy such limit by controlling the singular values during weight initialization and model regularization.
|
| 112 |
+
|
| 113 |
+
Orthogonal initialization. Since the widely-used initialization methods (e.g., Glorot initialization) fail to restrict the scopes of singular values, we adopt the orthogonal approach that initializes trainable weight $W ^ { ( k ) }$ as a diagonal matrix with explicit singular values [39]. To restrict $s _ { \mathrm { m a x } } ^ { ( k ) }$ and meet the constrained learning, we apply an equality constraint of $s _ { \mathrm { m a x } } ^ { ( k ) } E ( X ^ { ( k - 1 ) } ) = c _ { \mathrm { m a x } } E ( X ^ { ( 0 ) } )$ at each layer. Based on this condition, we derive Proposition 2 to initialize those weights $W ^ { ( k ) }$ and their square singular values for all the layers of EGNN, and give Lemma 3 to show how we can satisfy the upper limit of constrained learning. The detailed derivation and proof are listed in Appendix.
|
| 114 |
+
|
| 115 |
+
Proposition 2. At the first layer, weight $W ^ { ( 1 ) }$ is initialized as a diagonal matrix $\sqrt { c _ { \operatorname* { m a x } } } \cdot I _ { d }$ , where $I _ { d }$ is identity matrix with dimension $d$ and the square singular values are $c _ { \mathrm { m a x } }$ . At the higher layer $k > 1$ , weight $W ^ { ( k ) }$ is initialized with an identity matrix $I _ { d }$ , where the square singular values are 1.
|
| 116 |
+
|
| 117 |
+
Lemma 3. Based on the above orthogonal initialization, at the starting point of training, the Dirichlet energy of EGNN satisfies the upper limit at each layer $k$ : $E ( X ^ { ( k ) } ) \le c _ { \mathrm { { m a x } } } E ( X ^ { ( 0 ) } )$ .
|
| 118 |
+
|
| 119 |
+
Orthogonal regularization. However, without proper regularization, the initialized weights cannot guarantee they will still satisfy the constrained learning during model training. Therefore, we propose a training loss that penalizes the distances between the trainable weights and initialized weights $\sqrt { c _ { \operatorname* { m a x } } } I _ { d }$ or $I _ { d }$ . To be specific, we modify the optimization problem (6) as follows:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\operatorname* { m i n } \mathcal { L } _ { \mathrm { t a s k } } + \gamma | | W ^ { ( 1 ) } - \sqrt { c _ { \operatorname* { m a x } } } I _ { d } | | _ { F } + \gamma \sum _ { k = 2 } ^ { K } | | W ^ { ( k ) } - I _ { d } | | _ { F } .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Comparing with the original problem (6), we instead use the weight penalization to meet the upper limit of constrained learning, and make the model training efficient. While a larger $\gamma$ highly regularizes the trainable weights around the initialized ones to satisfy the constrained learning, a smaller $\gamma$ assigns the model more freedom to adapt to task data and optimize the node classification loss. Considering the above orthogonal initialization where weight $W ^ { ( k ) }$ is diagonal and sparse, we use the simplest distance constraint in Eq. (7) to update weight at the vicinity of its initialization. The singular values of updated sparse weight will be mainly determined by the dominant diagonal values, which are potentially close to the initialized ones. Therefore, we are able to control the singular values and regularize the upper limit of Dirichlet energy even at the model training phase. In the future work, more the advanced orthogonal initialization and regularization approaches could be explored to further boost performance of deep GNNs [40, 41, 42].
|
| 126 |
+
|
| 127 |
+
# 4.2 Lower-bounded Residual Connection
|
| 128 |
+
|
| 129 |
+
Although the square singular values are initialized and regularized properly, we may still fail to guarantee the lower limit of constrained learning in some specific graphs. According to Lemma 1, the lower bound of Dirichlet energy is $( 1 - \lambda _ { 1 } ) ^ { 2 } s _ { \operatorname* { m i n } } ^ { ( k ) } E ( \bar { X ^ { ( k - 1 ) } } )$ . In the real-world applications, may exactly equal to 1 and relaxes the lower bound as zero as shown in Lemma 2. For example, in Erdos–Rényi graph with dense connections [ ˝ 43], the eigenvalues of matrix $\tilde { \Delta }$ converge to 1 with high probability [17]. Even though $s _ { \mathrm { m i n } } ^ { ( k ) } > 0$ , the Dirichlet energy can be smaller than the lower limit and leads to the over-smoothing. To tackle this problem, we adopt residual connections to the initial layer $X ^ { ( 0 ) }$ and the previous layer $X ^ { ( k - 1 ) }$ . To be specific, we define the residual graph convolutions as:
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
X ^ { ( k ) } = \sigma ( [ ( 1 - c _ { \operatorname * { m i n } } ) \tilde { P } X ^ { ( k - 1 ) } + \alpha X ^ { ( k - 1 ) } + \beta X ^ { ( 0 ) } ] W ^ { ( k ) } ) .
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
$\alpha$ and $\beta$ are residual connection strengths determined by the lower limit of constrained learning, i.e., $\alpha + \beta = c _ { \operatorname* { m i n } }$ . We are aware that the residual technique has been used before to set up deep GNNs [26, 44, 28]. However, they either apply the whole residual components, or combine an arbitrary fraction without theoretical insight. Instead, we use an appropriate residual connection according to the lower limit of Dirichlet energy. In the experiment part, we show that while a strong residual connection overwhelms information in the higher layers and reduces the classification performance, a weak one will lead to the over-smoothing. In the following, we justify that both the lower and upper limits in the constrained learning can be satisfied with the proposed lower-bounded residual connection. The detailed proofs are provided in Appendix.
|
| 136 |
+
|
| 137 |
+
Lemma 4. Suppose that $c _ { \operatorname* { m a x } } \geq c _ { \operatorname* { m i n } } / ( 2 c _ { \operatorname* { m i n } } - 1 ) ^ { 2 }$ . Based upon the orthogonal controlling and residual connection, the Dirichlet energy of initialized EGNN is larger than the lower limit at each layer $k$ , i.e., $E ( X ^ { ( k ) } ) \geq c _ { \operatorname* { m i n } } E ( X ^ { ( k - 1 ) } )$ .
|
| 138 |
+
|
| 139 |
+
Lemma 5. Suppose that $\begin{array} { r } { \sqrt { c _ { \mathrm { m a x } } } \ge \frac { \beta } { ( 1 - c _ { \mathrm { m i n } } ) \lambda _ { 0 } + \beta } } \end{array}$ . Being augmented with the orthogonal controlling and residual connection, the Dirichlet energy of initialized EGNN is smaller than the upper limit at each layer $k$ , i.e., $E ( X ^ { ( k ) } ) \le c _ { \mathrm { { m a x } } } E ( X ^ { ( 0 ) } )$ .
|
| 140 |
+
|
| 141 |
+
# 4.3 SReLU Activation
|
| 142 |
+
|
| 143 |
+
Note that the previous theoretical analysis and model design are conducted by ignoring the activation function, which is usually given by ReLU in GNN. In this section, we first theoretically discuss the impact of ReLU on the Dirichlet energy, and then demonstrate the appropriate choice of activation.
|
| 144 |
+
|
| 145 |
+
Lemma 6. We have $E ( \sigma ( X ^ { ( k ) } ) ) \leq E ( X ^ { ( k ) } )$ if activation function $\sigma$ is ReLU or Leaky-ReLU [33].
|
| 146 |
+
|
| 147 |
+
It is shown that the application of ReLU further reduces the Dirichlet energy, since the negative embeddings are non-linearly mapped to zero. Although the trainable weights and residual connections are properly designed, the declining Dirichlet energy may violate the lower limit. On the other hand, a simplified GNN with linear identity activation will have limited model learning ability although it does not change the energy value. For example, simple graph convolution (SGC) model achieves comparable performance with the traditional GCN only with careful hyperparameter tuning [45]. We propose to apply SReLU to achieve a good trade-off between the non-linear and linear activations [46, 47]. SReLU is defined element-wisely as:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\sigma ( X ^ { ( k ) } ) = \operatorname* { m a x } ( b , X ^ { ( k ) } ) ,
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
where $b$ is a trainable shift shared for each feature dimension of $X ^ { ( k ) }$ . SReLU interpolates between the non-linearity and linearity depending on shift $b$ . While the linear identity activation is approximated if $b$ is close to $\infty$ , the non-linear mapping is activated if node embedding is smaller than the specific $b$ . In our experiments, we initialize $b$ with a negative value to provide an initial trade-off, and adapt it to the given task by back-propagating the training loss.
|
| 154 |
+
|
| 155 |
+
# 4.4 Connections to Previous Work
|
| 156 |
+
|
| 157 |
+
Recently, various techniques have been explored to enable deep GNNs [16, 24, 30]. Some of them are designed heuristically from diverse perspectives, and others are analogous to CNN components without theoretical insight tailored to graph analytics. In the following, we show how our principle and EGNN explain the existing algorithms, and expect to provide reliable theoretical guidance to the future design of deep GNNs.
|
| 158 |
+
|
| 159 |
+
Embedding normalization. The general normalization layers, such as pair [23], batch [25] and group [24] normalizations, have been used to set up deep GNNs. The pair normalization (PairNorm) aims to keep the node pair distances as a constant in the different layers, and hence relieves the oversmoothing. Motivated from CNNs, the batch and group normalizations re-scale the node embeddings of a batch and a group, respectively. Similar to the operation in PairNorm, they learn to maintain the node pair distance in the node batch or group. The adopted Dirichlet energy is also a variant of the node pair distance. The existing normalization methods can be regarded as training GNN model with a constant energy constraint. However, this will prevent GNN from optimizing the energy as analyzed in Section 3. We instead regularize it within the lower and upper energy limits, and let model discover the optimum.
|
| 160 |
+
|
| 161 |
+
Dropping edge. As a data augmentation method, dropping edge (DropEdge) randomly masks a fraction of edges at each epoch [29]. It makes graph connections sparse and relieves the oversmoothing by reducing information propagation. Specially, the contribution of DropEdge could be explained from the perspective of Dirichlet energy. In Erdos–Rényi graph, eigenvalue ˝ $\lambda _ { 0 }$ converges to 1 if the graph connections are more and more dense [17]. DropEdge reduces the value of $\lambda _ { 0 }$ , and helps improve the upper bound of Dirichlet energy $( 1 - \lambda _ { 0 } ) ^ { 2 } s _ { \mathrm { m a x } } ^ { ( k ) } E ( X ^ { ( k - 1 ) } )$ to slow down the energy decreasing speed. In the extreme case where all the edges are dropped in any a graph,
|
| 162 |
+
|
| 163 |
+
Laplacian $\tilde { \Delta }$ becomes a zero matrix. As a result, we have eigenvalue $\lambda _ { 0 }$ of zero and maximize the upper bound. In practice, the dropping rate has to be determined carefully depending on various tasks. Instead, our principle assigns model freedom to optimize the Dirichlet energy within a large and appropriate range.
|
| 164 |
+
|
| 165 |
+
Residual connection. Motivated from CNNs, residual connection has been applied to preserve the previous node embeddings and relieve the over-smoothing. Especially, the embedding from the last layer is reused and combined completely in related work [26, 48, 49]. A fraction of the initial embedding is preserved in model GCNII [28] and APPNP [50]. Networks JKNet [27] and DAGNN [51] aggregate all the previous embeddings at the final layers. The existing work uses the residua connection empirically. In this work, we derive and explain the residual connection to guarantee the lower limit of Dirichlet energy. By modifying hyperparameter $c _ { \mathrm { m i n } }$ , our EGNN can easily evolve to the existing deep residual GNNs, such as GCNII and APPNP.
|
| 166 |
+
|
| 167 |
+
Model simplification. Model SGC [45] removes all the activation and trainable weights to avoid over-fitting issue, and simplifies the training of deep GNNs. It is equivalent to EGNN with $c _ { m a x } = 1$ and $b = - \infty$ , where weights $W ^ { ( k ) }$ and shifts $b$ are remained as constants. Such simplification will reduce the model learning ability. As shown in Eq. (7), we adopt loss hyperparameter $\gamma$ to learn the trade-off between maintaining the orthogonal weights or updating them to model data characteristics.
|
| 168 |
+
|
| 169 |
+
# 5 Experiments
|
| 170 |
+
|
| 171 |
+
In this section, we empirically evaluate the effectiveness of EGNN on real-world datasets. We aim to answer the following questions. Q1: How does our EGNN compare with the state-of-the-art deep GNN models? Q2: Whether or not the Dirichlet energy at each layer of EGNN satisfies the constrained learning? Q3: How does each component of EGNN affect the model performance? Q4: How do the model hyperparameters impact the performance of EGNN?
|
| 172 |
+
|
| 173 |
+
# 5.1 Experiment Setup
|
| 174 |
+
|
| 175 |
+
Datasets. Following the practice of previous work, we evaluate EGNN by performing node classification on four benchmark datasets: Cora, Pubmed [52], Coauthor-Physics [53] and Ogbn-arxiv [54]. The detailed statistics are listed in Appendix.
|
| 176 |
+
|
| 177 |
+
Baselines. We consider seven state-of-the-art baselines: GCN [15], PairNorm [23], DropEdge [29], SGC [45], JKNet [27], APPNP [50], and GCNII [28]. They are implemented based on their open repositories. The detailed descriptions of these baselines are provided in Appendix.
|
| 178 |
+
|
| 179 |
+
Implementation. We implement all the baselines using Pytorch Geometric [55] based on their official implementations. The model hyperparameters are reused according to the public papers or are fine-tuned by ourselves if the classification accuracy could be further improved. Specially, we apply max-pooling to obtain the final node representation at the last layer of JKNet. In Ogbn-arxiv, we additionally include batch normalization between the successive layers in all the considered GNN models except PairNorm. Although more tricks (e.g., label reusing and linear transformation as listed in leader board) could be applied to improve node classification in Ogbn-arxiv, we focus on comparing the original GNN models in enabling deep layer stacking. The training hyperparameters are carefully set by following the previous common setting and are listed in Appendix.
|
| 180 |
+
|
| 181 |
+
We implement our EGNN upon GCN, except for the components of weight initialization and regularization, lower-bounded residual connection and SReLU. We choose hyperparameters $c _ { \mathrm { m a x } }$ $c _ { \mathrm { m i n } }$ , $\gamma$ and $b$ based on the validation set. For the weight initialization, we set $c _ { \mathrm { m a x } }$ to be 1 for all the datasets; that is, the trainable weights are initialized as identity matrices at all the graph convolutional layers. The loss hyperparameter $\gamma$ is 20 in Cora, Pubmed and Coauthor-Physics to strictly regularize towards the orthogonal matrix; and it is $1 0 ^ { - 4 }$ in Ogbn-arxiv to improve the model’s learning ability. For the lower-bounded residual connection, we choose residual strength $c _ { \mathrm { m i n } }$ from range [0.1, 0.75] and list the details in Appendix. The trainable shift $b$ is initialized with $- 1 0$ in Cora and Pubmed; it is initialized to $- 5$ and $- 1$ in Coauthor-Physics and Ogbn-arxiv, respectively. We also study these hyperparameters in the following experiments. All the experiment results are the averages of 10 runs.
|
| 182 |
+
|
| 183 |
+
Table 1: Node classification accuracies in percentage with various depths: 2, 16, 32/64. The highest accuracy at each column is in bold.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Datasets</td><td colspan="3">Cora</td><td colspan="3">Pubmed</td><td colspan="3">Coauthors-Physics</td><td colspan="3">Ogbn-arxiv</td></tr><tr><td>Layer Num</td><td>2</td><td>16</td><td>64</td><td>2</td><td>16</td><td>64</td><td>2</td><td>16</td><td>32</td><td>2</td><td>16</td><td>32</td></tr><tr><td>GCN</td><td>82.5</td><td>22.0</td><td>21.9</td><td>79.7</td><td>37.9</td><td>38.4</td><td>92.4</td><td>13.5</td><td>13.1</td><td>70.4</td><td>70.6</td><td>68.5</td></tr><tr><td>PairNorm</td><td>74.5</td><td>44.2</td><td>14.2</td><td>73.8</td><td>68.6</td><td>60.0</td><td>86.3</td><td>84.0</td><td>83.6</td><td>67.6</td><td>70.4</td><td>69.6</td></tr><tr><td>DropEdge</td><td>82.7</td><td>23.6</td><td>25.2</td><td>79.6</td><td>45.9</td><td>40.0</td><td>92.5</td><td>85.1</td><td>35.2</td><td>70.5</td><td>70.4</td><td>67.1</td></tr><tr><td>SGC</td><td>75.7</td><td>72.1</td><td>24.1</td><td>76.1</td><td>70.2</td><td>38.2</td><td>92.2</td><td>91.7</td><td>84.8</td><td>69.2</td><td>64.0</td><td>59.5</td></tr><tr><td>JKNet</td><td>80.8</td><td>74.5</td><td>70.0</td><td>77.2</td><td>70.0</td><td>66.1</td><td>92.7</td><td>92.2</td><td>91.6</td><td>70.6</td><td>71.8</td><td>71.4</td></tr><tr><td>APPNP</td><td>82.9</td><td>79.4</td><td>79.5</td><td>79.3</td><td>77.1</td><td>76.8</td><td>92.3</td><td>92.7</td><td>92.6</td><td>68.3</td><td>65.5</td><td>60.7</td></tr><tr><td>GCNII</td><td>82.4</td><td>84.6</td><td>85.4</td><td>77.5</td><td>79.8</td><td>79.9</td><td>92.5</td><td>92.9</td><td>92.9</td><td>70.1</td><td>71.5</td><td>70.5</td></tr><tr><td>EGNN</td><td>83.2</td><td>85.4</td><td>85.7</td><td>79.2</td><td>80.0</td><td>80.1</td><td>92.6</td><td>93.1</td><td>93.3</td><td>68.4</td><td>72.7</td><td>72.7</td></tr></table>
|
| 186 |
+
|
| 187 |
+
# 5.2 Experiment Results
|
| 188 |
+
|
| 189 |
+
Node classification results. To answer research question Q1, Table 1 summarizes the test classification accuracies. Each accuracy is averaged over 10 random trials. We report the results with $2 / 1 6 / 6 4$ layers for Cora and Pubmed, and $2 / \bar { 1 } 6 / 3 2$ layers for Coauthor-Physics and Ogbn-arxiv. Due to space limit, we report the detailed results of mean accuracy and standard deviation in Appendix.
|
| 190 |
+
|
| 191 |
+
We observe that our EGNN generally outperforms all the baselines across the four datasets, especially in the deep cases $K \geq 1 6$ ). Notably, the node classification accuracy is consistently improved with the layer stacking in EGNN until $K = 3 2$ or 64, which demonstrates the benefits of deep graph neural architecture to leverage neighbors multiple hops away. While the state-of-the-art models PairNorm, DropEdge, SGC, JKNet, and APPNP alleviate the over-smoothing issue to some extend, their performances still drop with the increasing of layers. Most of their 32/64-layer models are even worse than their corresponding shallow versions. As the most competitive deep architecture in literature, GCNII augments the transformation matrix as $( 1 - \phi ) I _ { d } + \phi W ^ { ( k ) }$ , where $0 < \phi < 1$ is a hyperparameter to preserve the identity mapping and enhance the minimum singular value of the augmented weight. Instead of explicitly defining the strength of identity mapping, we propose the orthogonal weight initialization based on the upper limit of Dirichlet energy and apply the orthogonal weight regularization. Based on Eq. (7), EGNN automatically learns the optimal trade-off between identity mapping and task adaption. Furthermore, we use SReLU activation and the residual connection to theoretically control the lower limit of Dirichlet energy. The experimental results show that EGNN not only outperforms GCNII in the small graphs Cora, Pubmed and Coauthor-Physics, but also delivers significantly superior performance in the large graph Obgn-arxiv, achieving ${ \mathrm { { 3 . 1 \% } } }$ improvement over GCNII with 32 layers.
|
| 192 |
+
|
| 193 |
+
Dirichelet energy visualization. To answer research question Q2, we show the Dirichlet energy at each layer of a 64-layer EGNN in Cora and Pubmed datasets in Figure 1. To have better visualization purposes, by keeping other default hyperparameters unchanged, EGNN is trained with $c _ { \mathrm { m a x } } / c _ { \mathrm { m i n } } \quad = \quad 0 . 4 / 0 . 1 5$ and $c _ { \mathrm { m a x } } / c _ { \mathrm { m i n } } ~ = ~ 0 . 4 / 0 . 1 1$ in Cora and Pubmed, respectively. We only plot and
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 1: Dirichelet energy variation with layers in Cora (Left) and Pubmed (Right). The upper and lower denotes the energy limits.
|
| 197 |
+
|
| 198 |
+
compare with the baseline approaches of GCN and GCNII due to space limit. For other methods, the Dirichlet energy is either close to zero or overly large due to the over-smoothing issue or over-separating issue of node embeddings, respectively.
|
| 199 |
+
|
| 200 |
+
It is shown that the Dirichlet energies of EGNN are strictly constrained within the range determined by the lower and upper limits of the constrained learning. Due to the over-smoothing issue in GCN, all the node embeddings converge to zero vectors. GCNII has comparable or smaller Dirichlet energy by carefully and explicitly designing both the initial connection and identity mapping strengths. In contrast, our EGNN only gives the appropriate limits of Dirichlet energy, and let the model learn the optimal energy at each layer for a specific task. The following hyperparameter studies will show that the values of $c _ { \mathrm { m i n } }$ and $c _ { \mathrm { m a x } }$ could be easily selected from a large appropriate range.
|
| 201 |
+
|
| 202 |
+
Table 2: Ablation studies on weight initialization, lower limit $c _ { \mathrm { m i n } }$ and activation function of EGNN.
|
| 203 |
+
|
| 204 |
+
<table><tr><td rowspan="2">Component</td><td rowspan="2">Type</td><td colspan="3">Cora</td><td colspan="2">Pubmed</td><td colspan="2">Coauthors-Physics|</td><td colspan="3">Ogbn-arxiv</td></tr><tr><td>2</td><td>16</td><td>64 2</td><td>16</td><td>64 2</td><td>16</td><td>32</td><td>2</td><td>16</td><td>32</td></tr><tr><td>Weight</td><td>Glorot</td><td>77.8</td><td>40.2</td><td>23.6</td><td>68.4 62.6</td><td>60.2</td><td>92.6 81.7</td><td>73.4</td><td></td><td>68.472.8</td><td>72.7</td></tr><tr><td rowspan="3">initialization Lower limit setting</td><td>Orthogonal</td><td>83.2</td><td>85.4</td><td>85.7</td><td>79.2 80.0 80.1</td><td></td><td>92.6 93.1</td><td>93.3</td><td></td><td>68.4 72.7 72.7</td><td></td></tr><tr><td>0.</td><td>83.6</td><td>68.6</td><td>12.9</td><td>78.9 77.1</td><td>44.1</td><td>92.8 91.4</td><td>79.7</td><td>70.9</td><td>69.4</td><td>62.4</td></tr><tr><td>0.1~ 0.75</td><td>83.2</td><td>85.4</td><td>85.7</td><td>79.2 80.0 80.1</td><td></td><td>92.6 93.1</td><td>93.3</td><td>68.4</td><td>72.7 72.7</td><td></td></tr><tr><td rowspan="3">Cmin Activation</td><td>0.95</td><td>65.4</td><td>72.0</td><td>71.5</td><td>74.0 75.3</td><td>75.7</td><td>89.4 90.4</td><td>90.5</td><td>56.5</td><td>66.869.5</td><td></td></tr><tr><td>Linear</td><td>83.1</td><td>85.6 85.5</td><td></td><td>79.2 79.9</td><td>79.9</td><td>92.6 93.1</td><td>93.1</td><td></td><td>64.872.5</td><td>71.0</td></tr><tr><td>SReLU</td><td>83.2</td><td>85.4</td><td>85.7</td><td>79.2 80.0 80.1</td><td></td><td>92.6 93.1</td><td>93.3</td><td>68.4</td><td>72.7 72.7</td><td></td></tr><tr><td rowspan="2"></td><td>ReLU</td><td>83.1</td><td>85.2</td><td>85.0</td><td>79.1 79.7 79.9</td><td></td><td>92.6 93.1</td><td>93.1</td><td></td><td>68.6 72.4 72.4</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 2: The impacts of hyperparameters $b$ , $\gamma$ , $c _ { \mathrm { m i n } }$ and $c _ { \mathrm { m a x } }$ on 64-layer EGNN trained in Cora. Y-axis is test accuracy in percent.
|
| 208 |
+
|
| 209 |
+
Ablation studies of EGNN components. To demonstrate how each component affects the training of graph neural architecture and answer research question Q3, we perform the ablation experiments with EGNN on all the datasets. For the component of orthogonal weight initialization and regularization, we compare and replace them with the traditional Glorot initialization and Frobenius norm regularization as shown in Eq. (6). Considering the component of lower-bounded residual connection, we vary the lower limit hyperparameter $c _ { \mathrm { m i n } }$ from 0, $0 . 1 \sim 0 . 7 5$ and 0.95. Within the range of $0 . 1 \sim 0 . 7 5$ , the adoption of specific values is specified for each dataset in Appendix. The component of the activation function is studied from candidates of linear identity activation, SReLU, and ReLU. Table 2 reports the results of the above ablation studies.
|
| 210 |
+
|
| 211 |
+
The orthogonal weight initialization and regularization are crucial to train the deep graph neural architecture. In Cora, Pubmed, and Coauthor-Physics, Glorot initialization and Frobenius norm regularization fail to control the singular values of trainable weights, which may lead to overly large or small Dirichlet energy and affect the node classification performance. In Ogbn-arxiv, the input node features are described by dense word embeddings of a paper [56], where the trainable weights in GNN are required to capture data statistics and optimize the classification task. EGNN applies a small loss hyperparameter $\gamma$ of $1 0 ^ { - 4 }$ to let the model adapt to the given task, which is equivalent to the traditional regularization. Therefore, the two approaches have comparable performances.
|
| 212 |
+
|
| 213 |
+
An appropriate lower limit could enable the deep EGNN. While the Dirichlet energy may approach zero without the residual connection, the overwhelming residual information with $c _ { \operatorname* { m i n } } = 0 . 9 5$ prevents the higher layer from learning the new neighborhood information. Within the large and appropriate range of [0.1, 0.75], $c _ { \mathrm { m i n } }$ could be easily selected to achieve superior performance.
|
| 214 |
+
|
| 215 |
+
Activation SReLU performs slightly better than the linear identity activation and ReLU. This is because SReLU could automatically learn the trade-off between linear and non-linear activations, which prevents the significant dropping of Dirichlet energy and ensures the model learning ability.
|
| 216 |
+
|
| 217 |
+
Hyperparameter analysis. To understand the hyperparameter impacts on a 64-layer EGNN and answer research question Q4, we conduct experiments with different values of initial shift $b$ , loss factor $\gamma$ , lower limit factor $c _ { \mathrm { m i n } }$ and upper one $c _ { \mathrm { m a x } }$ . We present the hyperparameter study in Figure 2 for Cora, and show the others with similar tendencies in Appendix.
|
| 218 |
+
|
| 219 |
+
We observe that our method is not sensitive to the choices of $b$ , $\gamma$ , $c _ { \mathrm { m i n } }$ and $c _ { \mathrm { m a x } }$ in a wide range: (i) The initial shift value should be $b \leq 0$ , in order to avoid the overly nonlinear mapping and Dirichlet energy damage. (ii) It is shown that EGNN approximates the optimal performance once the loss factor $\gamma$ is larger than a specific threshold. The thresholds are 0.3 in Cora, 0.1 in Pubmed and Coauthor-Physics, and 1es-4 in Ogbn-arxiv, respectively. The threshold depends on the specific dataset: while a larger potentially works in the small dataset to strictly regularize Dirichlet energy, a smaller one would be preferred for the large dataset to capture the complex data manifold. (iii) $c _ { \mathrm { m i n } }$ within the appropriate range [0.1, 0.75] allows the model to expand neighborhood size and preserve residual information to avoid the over-smoothing. (iv) As shown in Figure 1, since energy $E ( X ^ { ( k ) } )$ at the hidden layer is much smaller than $E ( X ^ { ( 0 ) } )$ from the input layer, we could easily satisfy the upper limit with $c _ { \mathrm { m a x } }$ in a large range [0.2, 1]. Given these large hyperparameter ranges, EGNN could be easily trained with deep layers.
|
| 220 |
+
|
| 221 |
+
# 6 Conclusions
|
| 222 |
+
|
| 223 |
+
In this paper, we propose a Dirichlet energy constrained learning principle to show the importance of regularizing the Dirichlet energy at each layer within reasonable lower and upper limits. Such energy constraint is theoretically proved to help avoid the over-smoothing and over-separating issues. We then design EGNN based on our theoretical results and empirically demonstrate that the constrained learning plays a key role in guiding the design and training of deep graph neural architecture. The detailed analysis is presented to illustrate how our principle connects and combines the previous deep methods. The experiments on benchmarks show that EGNN could be easily trained to achieve superior node classification performances with deep layer stacking. We believe that the constrained learning principle will help discover deeper and more powerful GNNs in the future.
|
| 224 |
+
|
| 225 |
+
# References
|
| 226 |
+
|
| 227 |
+
[1] Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 228 |
+
[2] Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 974–983, 2018.
|
| 229 |
+
[3] Xiao Huang, Qingquan Song, Yuening Li, and Xia Hu. Graph recurrent networks with attributed random walks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 732–740, 2019.
|
| 230 |
+
[4] Wenqi Fan, Yao Ma, Qing Li, Yuan He, Eric Zhao, Jiliang Tang, and Dawei Yin. Graph neural networks for social recommendation. In The World Wide Web Conference, pages 417–426, 2019.
|
| 231 |
+
[5] Hongyang Gao, Zhengyang Wang, and Shuiwang Ji. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1416–1424, 2018.
|
| 232 |
+
[6] Hongyang Gao and Shuiwang Ji. Graph u-nets. In international conference on machine learning, pages 2083–2092. PMLR, 2019.
|
| 233 |
+
[7] Kaixiong Zhou, Qingquan Song, Xiao Huang, and Xia Hu. Auto-gnn: Neural architecture search of graph neural networks. arXiv preprint arXiv:1909.03184, 2019.
|
| 234 |
+
[8] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1263–1272. JMLR. org, 2017.
|
| 235 |
+
[9] Marinka Zitnik and Jure Leskovec. Predicting multicellular function through multi-layer tissue networks. Bioinformatics, 33(14):i190–i198, 2017.
|
| 236 |
+
[10] Federico Monti, Michael M Bronstein, and Xavier Bresson. Geometric matrix completion with recurrent multi-graph neural networks. arXiv preprint arXiv:1704.06803, 2017.
|
| 237 |
+
[11] Kaixiong Zhou, Qingquan Song, Xiao Huang, Daochen Zha, Na Zou, and Xia Hu. Multi-channel graph neural networks. arXiv preprint arXiv:1912.08306, 2019.
|
| 238 |
+
[12] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeuIPS, pages 1024–1034, 2017.
|
| 239 |
+
[13] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv, 1(2), 2017.
|
| 240 |
+
[14] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 241 |
+
[15] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. ICLR, 2017.
|
| 242 |
+
[16] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 243 |
+
[17] Kenta Oono and Taiji Suzuki. Graph neural networks exponentially lose expressive power for node classification. In International Conference on Learning Representations, 2020.
|
| 244 |
+
[18] Hoang NT and Takanori Maehara. Revisiting graph neural networks: All we have is low-pass filters. arXiv preprint arXiv:1905.09550, 2019.
|
| 245 |
+
[19] Deli Chen, Yankai Lin, Wei Li, Peng Li, Jie Zhou, and Xu Sun. Measuring and relieving the over-smoothing problem for graph neural networks from the topological view. arXiv preprint arXiv:1909.03211, 2019.
|
| 246 |
+
[20] Uri Alon and Eran Yahav. On the bottleneck of graph neural networks and its practical implications. arXiv preprint arXiv:2006.05205, 2020.
|
| 247 |
+
[21] Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. Adaptive universal generalized pagerank graph neural network. In International Conference on Learning Representations. https://openreview. net/forum, 2021.
|
| 248 |
+
[22] Wenbing Huang, Yu Rong, Tingyang Xu, Fuchun Sun, and Junzhou Huang. Tackling oversmoothing for general graph convolutional networks. arXiv e-prints, pages arXiv–2008, 2020.
|
| 249 |
+
[23] Lingxiao Zhao and Leman Akoglu. Pairnorm: Tackling oversmoothing in gnns. arXiv preprint arXiv:1909.12223, 2019.
|
| 250 |
+
[24] Kaixiong Zhou, Xiao Huang, Yuening Li, Daochen Zha, Rui Chen, and Xia Hu. Towards deeper graph neural networks with differentiable group normalization. Advances in Neural Information Processing Systems, 33, 2020.
|
| 251 |
+
[25] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. ICML, 2015.
|
| 252 |
+
[26] Guohao Li, Matthias Muller, Ali Thabet, and Bernard Ghanem. Deepgcns: Can gcns go as deep as cnns? In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9267–9276, 2019.
|
| 253 |
+
[27] 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, pages 5453–5462. PMLR, 2018.
|
| 254 |
+
[28] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. Simple and deep graph convolutional networks. arXiv preprint arXiv:2007.02133, 2020.
|
| 255 |
+
[29] Yu Rong, Wenbing Huang, Tingyang Xu, and Junzhou Huang. Dropedge: Towards deep graph convolutional networks on node classification. In International Conference on Learning Representations. https://openreview. net/forum, 2020.
|
| 256 |
+
[30] Wenzheng Feng, Jie Zhang, Yuxiao Dong, Yu Han, Huanbo Luan, Qian Xu, Qiang Yang, Evgeny Kharlamov, and Jie Tang. Graph random neural networks for semi-supervised learning on graphs. Advances in Neural Information Processing Systems, 33, 2020.
|
| 257 |
+
[31] Arman Hasanzadeh, Ehsan Hajiramezanali, Shahin Boluki, Mingyuan Zhou, Nick Duffield, Krishna Narayanan, and Xiaoning Qian. Bayesian graph neural networks with adaptive connection sampling. In International Conference on Machine Learning, pages 4094–4104. PMLR, 2020.
|
| 258 |
+
[32] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016.
|
| 259 |
+
[33] Chen Cai and Yusu Wang. A note on over-smoothing for graph neural networks. arXiv preprint arXiv:2006.13318, 2020.
|
| 260 |
+
[34] Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. arXiv preprint arXiv:1802.09691, 2018.
|
| 261 |
+
[35] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249–256, 2010.
|
| 262 |
+
[36] Chenhui Deng, Zhiqiang Zhao, Yongyu Wang, Zhiru Zhang, and Zhuo Feng. Graphzoom: A multi-level spectral approach for accurate and scalable graph embedding. arXiv preprint arXiv:1910.02370, 2019.
|
| 263 |
+
[37] Yu Chen, Lingfei Wu, and Mohammed Zaki. Iterative deep graph learning for graph neural networks: Better and robust node embeddings. Advances in Neural Information Processing Systems, 33, 2020.
|
| 264 |
+
[38] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. In Nips, volume 14, pages 585–591, 2001.
|
| 265 |
+
[39] Quoc V Le, Navdeep Jaitly, and Geoffrey E Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015.
|
| 266 |
+
[40] Asher Trockman and J Zico Kolter. Orthogonalizing convolutional layers with the cayley transform. arXiv preprint arXiv:2104.07167, 2021.
|
| 267 |
+
[41] Lei Huang, Li Liu, Fan Zhu, Diwen Wan, Zehuan Yuan, Bo Li, and Ling Shao. Controllable orthogonalization in training dnns. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6429–6438, 2020.
|
| 268 |
+
[42] Jeffrey Pennington, Samuel S Schoenholz, and Surya Ganguli. Resurrecting the sigmoid in deep learning through dynamical isometry: theory and practice. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 4788–4798, 2017.
|
| 269 |
+
[43] Paul Erdos and Alfréd Rényi. On the evolution of random graphs. ˝ Publ. Math. Inst. Hung. Acad. Sci, 5(1):17–60, 1960.
|
| 270 |
+
[44] Guohao Li, Chenxin Xiong, Ali Thabet, and Bernard Ghanem. Deepergcn: All you need to train deeper gcns. arXiv preprint arXiv:2006.07739, 2020.
|
| 271 |
+
[45] Felix Wu, Tianyi Zhang, Amauri Holanda de Souza Jr, Christopher Fifty, Tao Yu, and Kilian Q Weinberger. Simplifying graph convolutional networks. arXiv preprint arXiv:1902.07153, 2019.
|
| 272 |
+
[46] Sitao Xiang and Hao Li. On the effects of batch and weight normalization in generative adversarial networks. arXiv preprint arXiv:1704.03971, 2017.
|
| 273 |
+
[47] Haozhi Qi, Chong You, Xiaolong Wang, Yi Ma, and Jitendra Malik. Deep isometric learning for visual recognition. In International Conference on Machine Learning, pages 7824–7835. PMLR, 2020.
|
| 274 |
+
[48] Lei Chen, Le Wu, Richang Hong, Kun Zhang, and Meng Wang. Revisiting graph based collaborative filtering: A linear residual graph convolutional network approach. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 27–34, 2020.
|
| 275 |
+
[49] Kuangqi Zhou, Yanfei Dong, Kaixin Wang, Wee Sun Lee, Bryan Hooi, Huan Xu, and Jiashi Feng. Understanding and resolving performance degradation in graph convolutional networks, 2020.
|
| 276 |
+
[50] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. arXiv preprint arXiv:1810.05997, 2018.
|
| 277 |
+
[51] Meng Liu, Hongyang Gao, and Shuiwang Ji. Towards deeper graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 338–348, 2020.
|
| 278 |
+
[52] Zhilin Yang, William W Cohen, and Ruslan Salakhutdinov. Revisiting semi-supervised learning with graph embeddings. arXiv preprint arXiv:1603.08861, 2016.
|
| 279 |
+
[53] Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Günnemann. Pitfalls of graph neural network evaluation. arXiv preprint arXiv:1811.05868, 2018.
|
| 280 |
+
[54] Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
|
| 281 |
+
[55] Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop, 2019.
|
| 282 |
+
[56] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean. Distributed representations of words and phrases and their compositionality. arXiv preprint arXiv:1310.4546, 2013.
|
md/train/784_F-WCW46/784_F-WCW46.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RETHINKING SAMPLING IN 3D POINT CLOUD GENERATIVE ADVERSARIAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this paper, we examine the long-neglected yet important effects of point sampling patterns in point cloud GANs. Through extensive experiments, we show that sampling-insensitive discriminators (e.g. PointNet-Max) produce shape point clouds with point clustering artifacts while sampling-oversensitive discriminators (e.g. PointNet++, DGCNN, PointConv, KPConv) fail to guide valid shape generation. We propose the concept of sampling spectrum to depict the different sampling sensitivities of discriminators. We further study how different evaluation metrics weigh the sampling pattern against the geometry and propose several perceptual metrics forming a sampling spectrum of metrics. Guided by the proposed sampling spectrum, we discover a middle-point sampling-aware baseline discriminator, PointNet-Mix, which improves all existing point cloud generators by a large margin on sampling-related metrics. We point out that, given that recent research has been focused on the generator design, the discriminator design needs more attention. Our work provides both suggestions and tools for building future discriminators. We will release the code to facilitate future research.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Point cloud, as the most common form of 3D sensor data, has been widely used in a variety of 3D vision applications due to its compact yet expressive nature and its amenability to geometric manipulations. It is natural to consider how to generate point cloud through deep learning approaches, which has been a popular research topic recently. The previous research efforts in the community have been mainly devoted to conditional generation of point clouds with 3D supervision. The condition could either be images (Fan et al., 2017; Groueix et al., 2018; Park et al., 2019) or partial point clouds (Li et al., 2019; Yang et al., 2018).
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Figure 1: We visualize the behavior of different discriminators when judging four different chair point clouds. (a) and (b) are generated results, (c) and (d) are point clouds sampled using FPS and uniform sampling from a real chair surface. When training the discriminators on data like (d), different discriminators make distinct decisions on the point cloud realness forming a sampling spectrum ranging from sampling-insensitive, sampling-aware to sampling-oversensitive. We advocate samplingaware discriminators in the middle of the spectrum, which provide good guidance for fixing geometric flaws (a) and big sample artifacts (b) and tolerate subtle sampling differences between (c) and (d).
|
| 15 |
+
|
| 16 |
+
Generating 3D point clouds with GANs in an unsupervised manner is an important but less explored problem. 3D point cloud GAN learns to transform a random latent code into a 3D surface point cloud by playing an adversarial game. Its development is still in an early stage compared with 2D image GANs. While existing works such as (Achlioptas et al., 2018; Valsesia et al., 2018; Shu et al., 2019) have developed a variety of generators, they all use PointNet (Qi et al., 2017a) with max pooling (PointNet-Max) as their discriminator. PointNet, which is essentially a pointwise MLP followed by a global pooling operation, is too limited in capturing shape details for a successful GAN. However, advanced networks, e.g. PointNet++(Qi et al., 2017b), DGCNN(Wang et al., 2019), KPConv (Thomas et al., 2019), PointConv (Wu et al., 2019), which leverage relative positions between points and hierarchical feature extraction, may not help. From our empirical study, we find they all fail to be a functioning discriminator. Understanding their failure mechanism and improving discriminator design are hence important and urgent.
|
| 17 |
+
|
| 18 |
+
To design a better discriminator, we first need to answer the following question: what should the discriminator examine for improving the generation quality? Or, even more fundamentally, what does it mean by the quality of generated point clouds?
|
| 19 |
+
|
| 20 |
+
Since a shape point cloud are the points sampled from an object surface, its quality should be evaluated from two perspectives: the depicted surface geometry and the point sampling. Arguably, geometry plays a decisive role and should be the main focus of a discriminator. However, when the generated point clouds have a good shape, there is still a full spectrum on how much a discriminator cares about the sampling patterns. We introduce the concept of Sampling Spectrum to depict the sampling sensitivity of discriminators, as illustrated in Figure 1. A sampling-insensitive discriminator (e.g. PointNet-Max) may ignore the point density variations as long as it perceives a good overall shape. Such a discriminator could identify big geometric flaws as shown in Figure 1 (a), but turns a blind eye to highly non-uniform density distribution, e.g. point clusters in Figure 1 (b). On the other extreme, a sampling-oversensitive discriminator (e.g. PointNet $^ { + + }$ , DGCNN, KPConv) can even tell the subtle difference in sampling patterns, e.g. between furthest point sampling (FPS) in Figure 1 (c) and uniform sampling in Figure 1 (d), and hence can be very narrow-minded about what a real point cloud should look like. A sampling-aware discriminator, e.g. PointNet-Mix/Attention, which lies in the middle of the spectrum, is able to identify density-related artifacts such as point clusters in Figure 1 (b), while not being too sensitive to different sampling patterns, such as Figure 1 (c) and (d).
|
| 21 |
+
|
| 22 |
+
Resembling the sampling spectrum of discriminators, we also examine the existing point-cloud GAN evaluation metrics from the perspective of sampling sensitivity and propose several perceptual metrics forming a Sampling Spectrum of evaluation metrics. Understanding how the metrics weigh between sampling and geometry is a prerequisite for evaluating point cloud GANs. Many of the existing sampling-insensitive metrics only evaluate the geometry factor of the generated point clouds shapes, which are blind to the obvious point clustering artifacts and uneven point density. We propose novel sampling-sensitive metrics to further complete the spectrum of point-cloud GAN evaluation metrics.
|
| 23 |
+
|
| 24 |
+
Guided by the proposed sampling spectrum of discriminators and evaluation metrics, experiments show that different discriminators in the spectrum could provide very different suggestions to improve a generator according to its sampling sensitivity. Sampling-insensitive discriminators, e.g. PointNetMax, is unaware of point density variations and hence its generated point cloud inevitably suffer from clustering artifacts, while sampling-oversensitive discriminators, e.g. PointNe $^ { + + }$ , DGCNN, KPConv, PointConv, simply fail to function as the discriminators and can generate much degraded point cloud shapes. We design a diagnostic “no generator” experiment to factor out the impact from generators and reveal that the gradients of sampling-oversensitive discriminators prioritize adjusting sampling patterns over producing better shape geometry. Picking a middle-point on the sampling spectrum, we discover a simple yet effective sampling-aware discriminator, PointNet-Mix, and find that it can supervise both shape generation and point density uniformity. It improves all existing generators by a large margin on sampling-related metrics. Surprisingly, we find that even the most naive fully-connected generator, coupled with PointNet-Mix, simply beats all the start-of-the-art point cloud GANs. This discovery conveys an important message to the community: instead of focusing on the generator design, people should invest more time into discriminator and seek for more powerful sampling-aware discriminators.
|
| 25 |
+
|
| 26 |
+
# 2 POINT CLOUD GAN LANDSCAPE
|
| 27 |
+
|
| 28 |
+
In this section, we review the current state of point cloud GAN covering the generators, the discriminators, and the evaluation metrics we are examining in this work.
|
| 29 |
+
|
| 30 |
+
# 2.1 POINT CLOUD GAN GENERATORS
|
| 31 |
+
|
| 32 |
+
Recent point cloud GAN works primarily focus on the generator design. The generator takes input a random noise $\cdot$ and outputs a point cloud $\boldsymbol { p } \in \mathbb { R } ^ { N \times 3 }$ . The existing generators can be categorized into two classes: fully-connected (FC) generators and graph convolutional generators. The first point cloud GAN, r-GAN (Achlioptas et al., 2018), simply uses an FC network as its generator. GraphCNN-GAN (Valsesia et al., 2018) and TreeGAN (Shu et al., 2019) are the rest two published works in this field that use graph convolutional generators. The two methods are very similar in principle. The main difference lies in how they build graphs. GraphCNN-GAN builds a dynamic $k$ -nn graph based upon feature space distance while TreeGAN enforces a tree structure throughout its sequential graph expansion and the messages can only be passed from ancestors vertices to descendants vertices.
|
| 33 |
+
|
| 34 |
+
Deformation-based decoders (Groueix et al., 2018; Yang et al., 2018) are widely used in the point cloud auto-encoder networks for 3D shape reconstruction. The decoders leverage Multiple-layer Perceptrons (MLP) to deform template surfaces into shape surfaces taking as inputs the concatenation of template point coordinates and the latent shape feature vectors. Though the decoders can truly act as generators for point cloud GANs, they have not yet been used in unconditioned point cloud GAN literature. Recently, Mo et al. (Mo et al., 2020) use deformation-based decoder as part generators for structure-conditioned point cloud GAN.
|
| 35 |
+
|
| 36 |
+
# 2.2 POINT CLOUD GAN DISCRIMINATORS
|
| 37 |
+
|
| 38 |
+
All existing works on unconditioned point cloud GANs use PointNet with max-pooling (PointNetMax) as their discriminators. The discriminator takes input a point cloud $p \in \mathbb { R } ^ { N \times 3 }$ and outputs a score from 0 to 1. PointNet learns a function $h$ that maps each point $p _ { i }$ in the point cloud to a per-point feature $h ( p _ { i } ) \in \mathbb { R } ^ { d }$ and then extracts a permutation-invariant global feature $F \in \mathbb { R } ^ { d }$ by pooling the per-point features across all points using a symmetric function $g$ , which can be max pooling, average pooling, etc. Namely, we have $F = \overline { { g } } ( \{ \dot { h ( p _ { 1 } ) } , h ( p _ { 2 } ) , \cdots , h ( \overline { { p _ { N } } } ) \} )$ .
|
| 39 |
+
|
| 40 |
+
PointNet-Max/Avg. Though $g$ can be any symmetric function, most existing works use maxpooling. In PointNet, the authors show that max-pooling outperforms average-pooling on 3D shape classification tasks. They further show that the global feature $F$ obtained from max-pooling is determined by only a sparse subset of the points, namely critical points $\mathcal { C } _ { S }$ , bringing PointNet-Max with robustness against small data perturbation and corruption. However, this property may limit its discriminative power on telling the density variations and classifying different sampling patterns. To investigate how different aggregation operations affect the sampling sensitivity and generation quality, we study the two common choices of the symmetric function $g$ , max-pooling, and average-pooling, in this paper. We will show in Sec. 3 that using different aggregation operations makes huge differences when adapting PointNet-based networks as point cloud GAN discriminators.
|
| 41 |
+
|
| 42 |
+
PointNet-Mix. By simply concatenating the max-pooling feature and the average pool feature, we obtain another permutation-invariant feature. We name this PointNet-Mix. Formally, $F _ { \mathrm { m i x } } =$ $[ \operatorname* { m a x } \{ h ( p _ { 1 } ) , . . . , h ( p _ { N } ) \}$ ; $\arg \{ h ( p _ { 1 } ) , . . . , h ( p _ { N } ) \} ] \in \mathbb { R } ^ { 2 d }$ . The mix-pooling operation is a special choice of the symmetric function $g$ . We will show in our experiments that PointNet-Mix, though simple, surprisingly improves the performance for most point cloud GANs by a large margin on sampling-aware metrics.
|
| 43 |
+
|
| 44 |
+
PointNet-Attention. A recent point cloud upsampling work (Li et al., 2019) incorporates a selfattention module into PointNet for its discriminator and shows improved point density in the upsampled point cloud. We denote this discriminator as PointNet-Attention. The self-attention module learns three separate MLPs to transform each $h ( p _ { i } )$ into $f ( p _ { i } ) , l ( p _ { i } ) , k ( p _ { i } ) \in \mathbb { R } ^ { d }$ correspondingly. Then an attention weight matrix is formed by $W =$ SoftMax $\left( [ f ( p _ { 1 } ) , . . . , f ( p _ { N } ) ] ^ { T } [ ( l ( p _ { 1 } ) , . . . , l ( p _ { N } ) ) ] \right) \ \in$ $\mathbb { R } ^ { N \times N }$ . A weighted features is then obtained through $w ( p _ { i } ) \ = \ h ( p _ { i } ) \ + \ W ^ { T } k ( p _ { i } )$ . The final aggregated features of PointNet-Attention is a max-pooling of the weighted feature, namely $F _ { \mathrm { a t t e n t i o n } } = \operatorname* { m a x } \{ w ( p _ { 1 } ) , . . . , w ( p _ { N } ) \}$ . Note that PointNet-Attention allows the per-point features to communicate with each other according to their similarity, which is more sensitive to sampling patterns than PointNet-Max. We investigate this strategy in our paper as well.
|
| 45 |
+
|
| 46 |
+
Discriminators beyond PointNet. Recently, there have been many works (Qi et al., 2017a; Li et al., 2018; Wang et al., 2019; Hermosilla et al., 2018; Thomas et al., 2019) extending PointNet to more advanced 3D deep learning architectures on point clouds. They improve PointNet by extracting more local or hierarchical geometric features via point cloud convolutions or point cloud graph learning. Though proven to be effective on shape classification and segmentation tasks, no published work examines adapting them as point cloud GAN discriminators. In this paper, we investigate four exemplar beyond-PointNet discriminators: PointNet $^ { + + }$ (Qi et al., 2017b), DGCNN (Wang et al., 2019), KPConv (Thomas et al., 2019), PointConv (Wu et al., 2019).
|
| 47 |
+
|
| 48 |
+
# 2.3 POINT CLOUD GAN EVALUATION METRICS
|
| 49 |
+
|
| 50 |
+
Achlioptas et al. (Achlioptas et al., 2018) introduces two distance metrics in the Euclidean space for evaluating point cloud GAN: the coverage scores (COV) computing the fraction of the point clouds in $B$ that are closed to the point clouds in $A$ using either Earth Mover’s distance (EMD) or Chamfer distance (CD), and the Minimum matching distance (MMD) scores measuring the fidelity of $A$ with respect to $B$ using either EMD or CD. In the field of 2D image GAN, it is common to use perceptual metrics, such as the Frechét distance (Heusel et al., 2017) between real and fake Gaussian measures in the feature spaces, for evaluating the generated image results. Formally, Frechet Distance $= | | \mu _ { r } - \mu _ { g } | | ^ { 2 } + \operatorname { T r } ( \Sigma _ { r } + \Sigma _ { g } - 2 \left( \Sigma _ { r } \Sigma _ { g } \right) ^ { 1 / 2 } )$ , where $\mu$ and $\Sigma$ are the mean vector and the covariance matrix of the features calculated from either real or fake data distribution, and $\mathrm { T r }$ is the matrix trace. For point clouds, Shu et al. (Shu et al., 2019) proposes Frechét Point Cloud Distance (FPD), which uses the features extracted from a pre-trained PointNet-Max model. In this paper, we position the existing metrics on a sampling spectrum according to their sampling sensitivity and propose novel sampling-aware metrics to augment the spectrum.
|
| 51 |
+
|
| 52 |
+
# 3 SAMPLING SPECTRUM OF DISCRIMINATORS
|
| 53 |
+
|
| 54 |
+
While recent works propose many advanced generator improvements for point cloud GANs, we find that designing a good discriminator is of equal importance, if not more. In this section, we introduce the sampling spectrum of discriminators, on which we thoroughly examine the positions of different discriminators that explain their behaviors when training point cloud GANs.
|
| 55 |
+
|
| 56 |
+
# 3.1 SAMPLING SENSITIVITY OF DISCRIMINATORS
|
| 57 |
+
|
| 58 |
+
The sampling sensitivity of a discriminator depicts how much it responds to a change in the point density or sampling pattern of an input point cloud. We find it extremely hard to quantitatively measure this sensitivity given the difficulty of measuring changes in the sampling patterns. Naively using Euclidean metrics (e.g. CD or EMD) to measure the distance between two sampled point sets is not a solution, since given the same distance budget, the discriminator’s responses can be dramatically different depending on how the sampled points move. Instead, we can set landmarks in the continuous spectrum of sampling sensitivity by examining the discriminative power of the discriminators against different sampling patterns under a series of experiments from easy to hard. Specifically, we design two experiments to test whether a discriminator could tell clustering artifacts in point clouds and whether it could distinguish between FPS and uniform sampling patterns. Accordingly, we divide the spectrum into three regimes: sampling-insensitive/-aware/-oversensitive, as shown in Fig.1.
|
| 59 |
+
|
| 60 |
+
A sampling-insensitive discriminator does not respond to local point density changes if the overall shape remains roughly the same. This kind of discriminators can’t tell clustering artifacts, i.e. Fig.1 (b), and thus may cause the non-uniform density in the generated point clouds.
|
| 61 |
+
|
| 62 |
+
A sampling-aware discriminator can notice the significant point non-uniformity and is hence capable of supervising the generator to enforce a similar sampling distribution to the training data, while being ignorant to subtle changes when the sampling is already uniform in an intermediate scale. Such discriminator will judge Fig.1 (b) as fake but can’t tell the difference between Fig.1 (c) and (d).
|
| 63 |
+
|
| 64 |
+
A sampling-oversensitive discriminator can tell very subtle difference in the sampling patterns, e.g.
|
| 65 |
+
between FPS and uniform sampling, even if the underlying shapes are the same (Fig.1 (c) and (d)).
|
| 66 |
+
|
| 67 |
+
# 3.2 SAMPLING SENSITIVITY EXAMINATION RESULTS
|
| 68 |
+
|
| 69 |
+
We design diagnostic experiments to categorize point cloud GAN discriminators on the sampling spectrum: sampling-insensitive (PointNet-Max), sampling-aware (PointNet-Avg, PointNet-Mix, PointNet-Attention (Li et al., 2019)), and sampling-oversensitive (PointNet+ $^ { - + }$ , DGCNN, KPConv, PointConv).
|
| 70 |
+
|
| 71 |
+
The Discriminating Power against Clustering Artifacts. To examine whether the discriminators can tell clustering artifacts or not, we create a diagnostic classification dataset using the models from ShapeNet (Chang et al., 2015). Taking 100 chairs, we uniformly sample 2048 points from each shape, forming a set of real point clouds. To form a fake set of point clouds, for each chair, we first uniformly sample 1024 points, and then densely sample another 1024 points around a random position on the chair within a 0.1 radius. The real/fake point clouds are used as the labeled training dataset. We repeat the same process to generate a test dataset using a different set of 100 chairs.
|
| 72 |
+
|
| 73 |
+
<table><tr><td>Experiment</td><td>PN-Max</td><td>PN-Avg</td><td>PN-Mix</td><td>PN-Att</td><td>PN++</td><td>DGCNN</td><td>PointConv</td><td>KPConv</td></tr><tr><td>Clustering art.</td><td>56%/53%</td><td>98%/99%</td><td>97%/96%</td><td>94%/93%</td><td>100%/98%</td><td>100%/99%</td><td>100%/99%</td><td>100%/99%</td></tr><tr><td>FPS vs.uniform</td><td>50%/50%</td><td>50.3%/50%</td><td>51.5%/50%</td><td>50.1%/50%</td><td>100%/97%</td><td>100%/96%</td><td>100%/98%</td><td>100%/99%</td></tr><tr><td>ESS</td><td>0.03</td><td>0.49</td><td>0.46</td><td>0.43</td><td>0.95</td><td>0.95</td><td>0.97</td><td>0.99</td></tr></table>
|
| 74 |
+
|
| 75 |
+
Table 1: Evaluating the discriminating power of the discriminators against clustering artifacts and sutble change in sampling patterns along with their empirical sampling sensitivity (ESS). In each cell of the top two rows, the left shows the training accuracy while the right shows the test accuracy.
|
| 76 |
+
|
| 77 |
+
We supervisely train each discriminator to classify the real/fake point clouds. We train them 200 epochs until convergence. The training and test accuracies are shown in the first row of Table 1. Despite the huge density variation and the remarkable clustering artifacts, PointNet-Max is just barely better than a random guess while the rest of the discriminators are very successful in telling the fake from the real. This indicates that PointNet-Max is sampling-insensitive. Note that the discriminating power of a network towards certain artifacts is maximized under such supervised training scheme. A network will fail to identify such artifacts in an adversarial training scheme if it fails in a supervised training scheme. We will see in Sec. 5.2, point clouds generated by GAN using PointNet-Max as the discriminator indeed suffer from non-uniform density artifacts.
|
| 78 |
+
|
| 79 |
+
Our insight why PointNet-Avg/Mix can tell the artifacts but PointNet-Max fails is that the average pooling feature computes the center of the mass of the points in feature space and is hence aware to certain global non-uniform density distributions. PointNet-Attention leverages a learnable weighted averaging and is hence capable to identify the difference.
|
| 80 |
+
|
| 81 |
+
Distinguishing between FPS and Uniform Sampling. We construct another diagnostic dataset with real and fake data which are the same in their shapes but only differ in their sampling patterns. Specifically, we perform uniform sampling to generate real data and use FPS to generate fake data from 100 chairs. Figure 1 (c) and (d) illustrate the different sampling pattern outcomes.
|
| 82 |
+
|
| 83 |
+
We present the training and test accuracies in the second row of Table 1 and show that PointNet $^ { + + }$ , DGCNN, KPConv, and PointConv can perfectly distinguish the subtle difference in sampling patterns while the rest discriminators make no progress even on the training set. The experiment indicates that PointNet-Avg/Mix/Attention are sampling-aware while PointNet++, DGCNN, KPConv, and PointConv are sampling-oversensitive.
|
| 84 |
+
|
| 85 |
+
We believe, for PointNet+ $^ +$ , DGCNN, KPConv, and PointConv, their capability of distinguishing FPS from uniform sampling owes to their usage of relative point positions or edge information, which are highly sensitive to any change in sampling. We will show in Sec. 5.3 that their remarkable discriminating power on sampling patterns actually leads to the failures as functioning discriminators to train point cloud GANs.
|
| 86 |
+
|
| 87 |
+
Empirical Definition of Sampling Sensitivity Given the difficulty of measuring the change in sampling pattern, we would like to provide an empirical definition of sampling sensitivity of one discriminator according to its performance on the two experiments above: when the discriminator fails in telling clustering artifacts and telling the difference between FPS and uniform sampling pattern, its sampling sensitivity should be closed to 0; when the discriminator can tell clustering artifacts but can’t distinguish between FPS and uniform sampling, we want to assign it a sampling sensitivity closed to 0.5 ; when the discriminator can do both, we want to assign a sampling sensitivity closed to 1 to it. Based on this, we define empirical sampling sensitivity $\cdot$ as:
|
| 88 |
+
|
| 89 |
+
ESS = Acc(Tell clustering art.) $^ +$ Acc(Tell FPS from uniform sampling) $^ { - 1 }$ , where Acc denotes the test accuracy of an experiment. See Table 1 for results. Using this metric, we would form a continuous sampling sensitivity spectrum.
|
| 90 |
+
|
| 91 |
+
# 4 SAMPLING SPECTRUM OF EVALUATION METRICS
|
| 92 |
+
|
| 93 |
+
Similar to the discriminator design, it is very important to understand how different evaluation metrics weigh the differences in sampling patterns against geometry quality. Thus, we introduce the sampling spectrum of evaluation metrics, which exactly resembles the sampling spectrum of discriminators introduced in Sec. 3. On the spectrum, we have sampling-insensitive metrics that measure only the shape geometry and are ignorant of the sampling patterns, and sampling-sensitive metrics that measure both at the same time.
|
| 94 |
+
|
| 95 |
+
For perceptual metrics, i.e. Frechét distances in feature spaces, the sampling sensitivity of the metric purely depends on the sampling sensitivity of its feature extractor. Frechét distance measured in different feature spaces may respond very differently to changes in point density and sampling patterns. In this work, we examine three Frechét distance metrics that extract features using PointNetMax, PointNet-Mix, and DGCNN, respectively. We denote them as Frechét PointNet-Max Distance (FPD-Max), Frechét PointNet-Mix Distance (FPD-Mix), and Frechét DGCNN Distance (FGD). We pretrain all the three feature extraction networks on ModelNet40 (Wu et al., 2015) shape classification.
|
| 96 |
+
|
| 97 |
+
Table 2: Examining sampling sensitivity of evaluation metrics.
|
| 98 |
+
|
| 99 |
+
<table><tr><td>Data</td><td>FPD-Mix↓</td><td>FPD-Max↓</td><td>FGD↓</td><td>MMD-E↓</td><td>MMD-C↓</td><td>COV-E↑</td><td>COV-C↑</td></tr><tr><td>Uniformre-sampling</td><td>0.1153</td><td>0.0926</td><td>0.8141</td><td>0.1104</td><td>0.00145</td><td>70.69</td><td>72.16</td></tr><tr><td>Farthest point sampling</td><td>0.1700</td><td>0.1558</td><td>1.8833</td><td>0.1064</td><td>0.00137</td><td>67.74</td><td>69.36</td></tr><tr><td>Biased sampling</td><td>2.8631</td><td>0.3524</td><td>9.6719</td><td>0.2469</td><td>0.00145</td><td>23.12</td><td>71.28</td></tr></table>
|
| 100 |
+
|
| 101 |
+
To examine the sampling sensitivity of FPD-Mix/Max and FGD, we create several copies of the training split of our ShapeNet chair dataset (see Sec.5.1), each of which uses a different sampling strategy to obtain the shape point clouds. The reference one used as the ground truth is using uniform sampling. Then we consider 1) uniform sampling with a different random seed; 2) FPS; and 3) biased sampling with clustered artifacts (as described in Sec. 3.2). We use all the available metrics to evaluate their distances to the ground truth data. The results are shown in Table 2.
|
| 102 |
+
|
| 103 |
+
We observe that the Frechét distance metrics share the same sampling sensitivity of their corresponding discriminators. For example, since PointNet-Max is sampling-insensitive, FPD-Max remains very low even on biased sampling data, hence FPD-Max serves as a perceptual geometry metric, which is ignorant to sampling patterns. Similarly, we find that FPD-Mix is sampling-aware since it clearly detects the biased sampling patterns while not being able to distinguish the uniform sampling and FPS, while FGD is sampling-oversensitive in that it can tell apart FPS and uniform sampling.
|
| 104 |
+
|
| 105 |
+
For Euclidean distance metrics, results in Table 2 show that COV-EMD and MMD-EMD are samplingaware, which is intuitively reasonable since EMD enforces a one-to-one matching and is aware of the point density, while COV-CD and MMD-CD are sampling-insensitive.
|
| 106 |
+
|
| 107 |
+
# 5 EXPERIMENTS
|
| 108 |
+
|
| 109 |
+
Aware of both the sampling spectrums, we conduct experiments to further evaluate the performance of point cloud GANs under various evaluation metrics. We show that the point cloud GANs using sampling-insensitive discriminators may produce point clustering artifacts, while samplingoversensitive discriminators fail to supervise point cloud GAN training at all. We further devise a diagnostic "no-generator" experiment that factors out the generators to better illustrate our discoveries on discriminators. More interesting, we find that the simple PointNet-Mix paired of any generator, even with the most naive fully-connected one, achieves the state-of-the-art performance.
|
| 110 |
+
|
| 111 |
+
# 5.1 SETTING AND DATASETS
|
| 112 |
+
|
| 113 |
+
We provide a thorough comparison of all the discriminators investigated in Sec.3 combining with all the available generators in the published literature, including the FC generator proposed in rGAN (Achlioptas et al., 2018), and graph convolutional generators used in TreeGAN (Shu et al., 2019). We also add a deformation-based generator into the comparison given its popularity for supervised point cloud reconstruction (Groueix et al., 2018; Yang et al., 2018).
|
| 114 |
+
|
| 115 |
+
We use two datasets to evaluate the GANs. One is a single-category dataset containing point clouds sampled from all 6,778 chair meshes in ShapeNet (Chang et al., 2015). The other is a multi-category dataset combining shapes from airplane, car, chair, rifle, sofa, table, vessel categories in ShapeNet. The multi-category dataset contains 34,313 shapes in total. We uniformly sample 2048 points from each shape to form the two datasets. We follow the $8 5 \% / 5 \% / 1 0 \%$ train/validation/test split in (Achlioptas et al., 2018) and use WGAN-gp (Gulrajani et al., 2017) for the GAN training, similar to previous works (Achlioptas et al., 2018; Valsesia et al., 2018; Shu et al., 2019).
|
| 116 |
+
|
| 117 |
+
# 5.2 EVALUATING POINTNET-BASED DISCRIMINATORS WITH VARIOUS GENERATORS
|
| 118 |
+
|
| 119 |
+
We report the performance for point cloud GANs that combine PointNet-Max/Min/Attention discriminators and FC/Deform/TreeGAN/Graph-CNN generators in Table 3. We observe that GANs using PointNet-Mix as the discriminator outperform the ones using PointNet-Max/Attention across all different generators. On sampling-aware/sensitive metrics (i.e. FPD-Mix, FGD, MMD-EMD, COV-EMD), PointNet-Mix is always significantly better than PointNet-Max and is better than PointNet-Attention mainly on FPD-Mix and FGD. Regarding geometry quality evaluated using sampling-insensitive metrics (i.e. FPD-Max, MMD-CD, COV-CD), PointNet-Mix is always significantly better than PointNet-Attention on FPD-Max and COV-CD while remaining on a par with PointNet-Max.
|
| 120 |
+
|
| 121 |
+
Table 3: Evaluating PointNet-based discriminators with different generators. We observe that PointNet-Mix can significantly improve all sampling-aware/sensitive metric, including FPD-Mix, FGD, MMD-EMD, COV-EMD for all the generators. When paired with FC generator, PointNet-Mix achieves the best performance. We include PointFlow(Yang et al., 2019) and Oracle for a comparison.
|
| 122 |
+
|
| 123 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Generator</td><td rowspan=1 colspan=1>Pooling</td><td rowspan=1 colspan=1>FPD-Mix↓</td><td rowspan=1 colspan=1>FPD-Max↓</td><td rowspan=1 colspan=1>FGD↓</td><td rowspan=1 colspan=1>MMD-E↓</td><td rowspan=1 colspan=1>MMD-C↓</td><td rowspan=1 colspan=1>COV-E↑</td><td rowspan=1 colspan=1>COV-C↑</td></tr><tr><td rowspan=10 colspan=1>Chair</td><td rowspan=2 colspan=1>FCFC</td><td rowspan=2 colspan=1>MaxMix</td><td rowspan=2 colspan=1>1.5710.184</td><td rowspan=2 colspan=1>0.2110.209</td><td rowspan=1 colspan=1>7.030</td><td rowspan=1 colspan=1>0.1017</td><td rowspan=1 colspan=1>0.00164</td><td rowspan=1 colspan=1>23.56</td><td rowspan=1 colspan=1>72.75</td></tr><tr><td rowspan=1 colspan=1>2.124</td><td rowspan=1 colspan=1>0.0674</td><td rowspan=1 colspan=1>0.00196</td><td rowspan=1 colspan=1>73.64</td><td rowspan=1 colspan=1>74.96</td></tr><tr><td rowspan=7 colspan=1>FCDeformDeformDeformTreeGANTreeGANGraph-CNN</td><td rowspan=1 colspan=1>Attention</td><td rowspan=1 colspan=1>0.635</td><td rowspan=1 colspan=1>0.672</td><td rowspan=1 colspan=1>4.971</td><td rowspan=1 colspan=1>0.1156</td><td rowspan=1 colspan=1>0.00160</td><td rowspan=1 colspan=1>68.92</td><td rowspan=1 colspan=1>70.54</td></tr><tr><td rowspan=2 colspan=1>MaxMix</td><td rowspan=2 colspan=1>0.9130.534</td><td rowspan=2 colspan=1>0.2680.373</td><td rowspan=1 colspan=1>5.602</td><td rowspan=2 colspan=1>0.09080.0695</td><td rowspan=2 colspan=1>0.002010.00200</td><td rowspan=2 colspan=1>68.576.29</td><td rowspan=2 colspan=1>72.6175.11</td></tr><tr><td rowspan=1 colspan=1>2.836</td></tr><tr><td rowspan=4 colspan=1>AttentionMaxMixMax</td><td rowspan=1 colspan=1>0.696</td><td rowspan=1 colspan=1>0.755</td><td rowspan=1 colspan=1>2.987</td><td rowspan=1 colspan=1>0.1141</td><td rowspan=1 colspan=1>0.00160</td><td rowspan=1 colspan=1>68.77</td><td rowspan=1 colspan=1>69.36</td></tr><tr><td rowspan=3 colspan=1>1.4420.2931.034</td><td rowspan=1 colspan=1>0.654</td><td rowspan=2 colspan=1>7.8084.032</td><td rowspan=2 colspan=1>0.09620.0704</td><td rowspan=2 colspan=1>0.001910.00211</td><td rowspan=3 colspan=1>24,7474.8248.90</td><td rowspan=3 colspan=1>73.4978.7963.18</td></tr><tr><td rowspan=1 colspan=1>0.334</td></tr><tr><td rowspan=1 colspan=1>0.981</td><td rowspan=1 colspan=1>7.494</td><td rowspan=1 colspan=1>0.0812</td><td rowspan=1 colspan=1>0.00191</td></tr><tr><td rowspan=1 colspan=2>PointFlowOracle</td><td rowspan=1 colspan=1>1.7820.088</td><td rowspan=1 colspan=1>1.4050.093</td><td rowspan=1 colspan=1>3.2560.814</td><td rowspan=1 colspan=1>0.13350.0594</td><td rowspan=1 colspan=1>0.001900.00165</td><td rowspan=1 colspan=1>71.7679.56</td><td rowspan=1 colspan=1>71.7379.69</td></tr><tr><td rowspan=9 colspan=1>Multi-Cat</td><td rowspan=3 colspan=1>FCFCFC</td><td rowspan=2 colspan=1>MaxMix</td><td rowspan=1 colspan=1>1.553</td><td rowspan=1 colspan=1>0.354</td><td rowspan=1 colspan=1>6.981</td><td rowspan=1 colspan=1>0.0842</td><td rowspan=1 colspan=1>0.00153</td><td rowspan=1 colspan=1>35.16</td><td rowspan=1 colspan=1>64.16</td></tr><tr><td rowspan=1 colspan=1>0.255</td><td rowspan=1 colspan=1>0.285</td><td rowspan=1 colspan=1>2.550</td><td rowspan=1 colspan=1>0.0656</td><td rowspan=2 colspan=1>0.001840.00134</td><td rowspan=2 colspan=1>73.572.19</td><td rowspan=2 colspan=1>72.1669.63</td></tr><tr><td rowspan=1 colspan=1>Attention</td><td rowspan=1 colspan=1>0.414</td><td rowspan=1 colspan=1>0.453</td><td rowspan=1 colspan=1>4.234</td><td rowspan=1 colspan=1>0.1188</td></tr><tr><td rowspan=5 colspan=1>DeformDeformDeformTreeGANTreeGAN</td><td rowspan=2 colspan=1>MaxMix</td><td rowspan=1 colspan=1>1.072</td><td rowspan=1 colspan=1>0.633</td><td rowspan=1 colspan=1>3.845</td><td rowspan=1 colspan=1>0.0799</td><td rowspan=1 colspan=1>0.00179</td><td rowspan=1 colspan=1>62.5</td><td rowspan=1 colspan=1>64.5</td></tr><tr><td rowspan=1 colspan=1>0.614</td><td rowspan=1 colspan=1>0.349</td><td rowspan=1 colspan=1>2.451</td><td rowspan=1 colspan=1>0.0670</td><td rowspan=1 colspan=1>0.00191</td><td rowspan=1 colspan=1>70.83</td><td rowspan=2 colspan=1>68.8369.60</td></tr><tr><td rowspan=1 colspan=1>Attention</td><td rowspan=1 colspan=1>0.616</td><td rowspan=1 colspan=1>0.720</td><td rowspan=1 colspan=1>2.531</td><td rowspan=1 colspan=1>0.1113</td><td rowspan=1 colspan=1>0.00141</td><td rowspan=1 colspan=1>72.04</td></tr><tr><td rowspan=2 colspan=1>MaxMix</td><td rowspan=2 colspan=1>1.7140.388</td><td rowspan=1 colspan=1>0.437</td><td rowspan=1 colspan=1>6.342</td><td rowspan=1 colspan=1>0.1093</td><td rowspan=1 colspan=1>0.00158</td><td rowspan=2 colspan=1>25.3372.66</td><td rowspan=2 colspan=1>67.071.0</td></tr><tr><td rowspan=1 colspan=1>0.420</td><td rowspan=1 colspan=1>4.300</td><td rowspan=1 colspan=1>0.0699</td><td rowspan=1 colspan=1>0.00184</td></tr><tr><td rowspan=1 colspan=2>Oracle</td><td rowspan=1 colspan=1>0.131</td><td rowspan=1 colspan=1>0.177</td><td rowspan=1 colspan=1>0.673</td><td rowspan=1 colspan=1>0.06012</td><td rowspan=1 colspan=1>0.00124</td><td rowspan=1 colspan=1>77.14</td><td rowspan=1 colspan=1>77.57</td></tr></table>
|
| 124 |
+
|
| 125 |
+
In Figure 2, we present the generated point clouds for all the experiments with color-coding for the local point density. We see that the generators trained using PointNet-Max usually suffer from non-uniform density, except for the deformation generator. On the chair class, points are usually clustering around the seat area while being sparse at the back. On the contrary, PointNet-Mix enforces a globally uniform point density and hence greatly improves the visual quality of the generated point clouds. PointNet-Attention is in the between.
|
| 126 |
+
|
| 127 |
+
With PointNet-Mix, we observe that the most naive FC generator works the best outperforming the previously state-of-the-state generators on almost of metrics. This showcases the importance of being sampling-aware but not sampling-insensitive/oversensitive as a discriminator. It also suggests that future works may focus on designing more powerful sampling-aware discriminators.
|
| 128 |
+
|
| 129 |
+
# 5.3 DIAGNOSING FAILURES FOR VARIOUS DISCRIMINATORS
|
| 130 |
+
|
| 131 |
+
Observing that the discriminator forms the bottleneck of the point cloud GAN, it is important to examine whether advanced networks, e.g. PointNet+ $^ +$ (Qi et al., 2017b), DGCNN (Wang et al., 2019), KPConv (Thomas et al., 2019), PointConv (Wu et al., 2019) can outperform PointNet-based discriminator.
|
| 132 |
+
|
| 133 |
+
Surprisingly, we fail to observe any of them ever to be successful to train a GAN in our extensive experiments, in which we perform a systematic search, including varying generator architecture, changing hyperparameters (e.g. the number of layers and parameters in discriminator, learning rate), whether use batch norm, etc. During GAN training, we observe the four advanced discriminator behave very similarly: they are very discriminative in the sense that the gaps between the real and fake scores remain significantly large, but the quality of the generated point clouds stays very bad. The contradictory behaviors seem unreasonable at the first glance: how can a discriminator be very discriminative but teach nothing to the generator? Thus, we design a diagnostic "no generator" experiment to examine the underlying reasons.
|
| 134 |
+
|
| 135 |
+
No Generator Experiments. During GAN training, the gradients from discriminator output scores back-propagate to the generated point clouds and then further back-propagate to the weights of the generator to update the generator. We design a diagnostic experiment that removes the generator and examines whether the discriminator gradients are informative enough for supervising point cloud GANs.
|
| 136 |
+
|
| 137 |
+
Concretely, we take $\cdot$ real chairs as real data and we randomly initialize $M$ learnable point clouds $p \in \mathbb { R } ^ { N \times 3 }$ with i.i.d Gaussian noises $\cdot$ . For each training iteration, we sample $\cdot$ point clouds from the real dataset as the real data and sample $\cdot$ point clouds from the learnable point
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 2: Visualization of point clouds generated by different methods. We show generated point clouds in few exemplar shapes for a fair and easier comparison regarding their sampling quality and geometry quality. We color-code the local point density that ranges from sparse (dark blue) to dense (light yellow).
|
| 143 |
+
Figure 3: The diagnostic "no generator" experiment results. On the left, we show exemplar point clouds generated by different discriminators. On the right, we plot the training curves for the experiments. The $x$ - and $y$ -axis respectively represent training iterations and Wasserstein estimates.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Discriminator</td><td>FPD-Mix↓</td><td>FPD-Max↓</td><td>FGD↓</td><td>MMD-E↓</td><td>MMD-C↓</td><td>COV-E↑</td><td>COV-C↑</td></tr><tr><td>PointNet-Max</td><td>3.828</td><td>2.456</td><td>19.279</td><td>0.1039</td><td>0.00287</td><td>26</td><td>56</td></tr><tr><td>PointNet-Avg</td><td>19.640</td><td>19.604</td><td>39.793</td><td>0.1154</td><td>0.00642</td><td>32</td><td>12</td></tr><tr><td>PointNet-Mix</td><td>1.835</td><td>2.208</td><td>13.197</td><td>0.0898</td><td>0.00331</td><td>50</td><td>51</td></tr><tr><td>PointNet-Attention</td><td>1.350</td><td>1.642</td><td>12.359</td><td>0.1622</td><td>0.00271</td><td>52</td><td>48</td></tr><tr><td>PointNet++</td><td>15.081</td><td>14.187</td><td>33.958</td><td>0.1155</td><td>0.00503</td><td>19</td><td>37</td></tr><tr><td>DGCNN</td><td>10.629</td><td>9.939</td><td>14.882</td><td>0.0932</td><td>0.00396</td><td>46</td><td>48</td></tr><tr><td>KPConv</td><td>41.15</td><td>49.96</td><td>57.32</td><td>0.2695</td><td>0.01135</td><td>6</td><td>2.5</td></tr><tr><td>PointConv</td><td>27.69</td><td>27.05</td><td>46.82</td><td>0.2832</td><td>0.00721</td><td>3</td><td>8</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 4: Quantitative evaluation for the diagnostic "no generator" experiments. We see that PointNet-Max/Mix/Attention are successful while PointNetAvg/PointNet++/DGCNN/KPConv/PointConv fail.
|
| 148 |
+
|
| 149 |
+
clouds as the fake data. Then, we conduct adversarial training where the discriminator gradients directly update the location of each points in the learnable point clouds. We adopt the same training protocol and losses as experiments in Sec. 5.2. The goal of this "no generator" experiment is to see whether the discriminator can modify the point clouds to approximate the real shapes, or in other words, we factorize the impact from generator architectures and only focus whether the gradients from discriminators can guide shape generation. Here $M = 1 0 0$ , $\cdot$ , and $B = 3 2$ . We train each experiment for 10,000 epoches until convergence.
|
| 150 |
+
|
| 151 |
+
Results and Analysis. Table 4 summarizes the results and Figure 3 (left) shows exemplar generated point clouds. We clearly see that only PointNet-Max/Mix/Attention can successfully modify the learnable point clouds to get high quality shapes, while PointNet $^ { + + }$ /DGCNN/KPConv/PointConv/PointNetAvg produce much worse results. Figure 3 (right) presents the training curves of the Wasserstein estimates, which essentially describe the gap between the real and fake scores. The large score gaps for PointNet $^ { + + }$ , DGCNN and KPConv throughout the training indicate the two models are very discriminative in telling apart the fake samples from the real data. However, their gradients simply don’t help improve the learned point clouds. Note that both of them leverage relative point positions/edge information during their feature extraction, which leads to a huge amount of gradients flowing along the surface direction focusing on changing sampling patterns instead of supervising shape geometry. As a suggestion, for developing future discriminators, people may need to avoid using the relative position features. For PointNet-Avg, the failure is simply because the discriminating power is not sufficient, evident from the low Wasserstein estimates. Note that training such "no generator" experiment shares a similar flavor to the SGD sampling in introspective CNN(Jin et al., 2017).
|
| 152 |
+
|
| 153 |
+
# 6 CONCLUSION AND SUGGESTIONS FOR FUTURE DISCRIMINATOR DESIGN
|
| 154 |
+
|
| 155 |
+
In this work, we study the importance of sampling for 3D point cloud GAN design. We propose the sampling spectrum of discriminators and evaluation metrics that provide insights on the behaviors of point cloud GANs. We propose several empirical experiments for identifying the sampling sensitivity of a discriminator or an evaluation metric. Experiments indicate that, no matter what generator is employed, a sampling-insensitive discriminator, e.g. the commonly used PointNet-Max, will produce point cloud shapes with non-uniform density and clustering artifacts, while a sampling-oversensitive discriminator (e.g. PointNet+ $^ +$ , DGCNN, PointConv, KPConv) will lead to disastrous failures when adapting them to training point cloud GANs. Interestingly, a simple PointNet-Mix baseline coupled with the most naive fully-connected generator achieves the best performance, indicating that the current bottleneck of point cloud GAN is on the discriminator side. For future discriminators, we suggest they should be more discriminative in shape and aware but not oversensitive to sampling patterns. For the sanity check of any novel discriminators, one can leverage our proposed "no generator" experiment.
|
| 156 |
+
|
| 157 |
+
# REFERENCES
|
| 158 |
+
|
| 159 |
+
Panos Achlioptas, Olga Diamanti, Ioannis Mitliagkas, and Leonidas Guibas. Learning representations and generative models for 3d point clouds, 2018. URL https://openreview.net/forum? id=BJInEZsTb.
|
| 160 |
+
|
| 161 |
+
Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
|
| 162 |
+
|
| 163 |
+
Haoqiang Fan, Hao Su, and Leonidas J Guibas. A point set generation network for 3d object reconstruction from a single image. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 605–613, 2017.
|
| 164 |
+
|
| 165 |
+
Thibault Groueix, Matthew Fisher, Vladimir G Kim, Bryan C Russell, and Mathieu Aubry. A papier-mâché approach to learning 3d surface generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 216–224, 2018.
|
| 166 |
+
|
| 167 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in neural information processing systems, pp. 5767–5777, 2017.
|
| 168 |
+
|
| 169 |
+
Pedro Hermosilla, Tobias Ritschel, Pere-Pau Vázquez, Àlvar Vinacua, and Timo Ropinski. Monte carlo convolution for learning on non-uniformly sampled point clouds. In SIGGRAPH Asia 2018 Technical Papers, pp. 235. ACM, 2018.
|
| 170 |
+
|
| 171 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017.
|
| 172 |
+
|
| 173 |
+
Long Jin, Justin Lazarow, and Zhuowen Tu. Introspective classification with convolutional nets. In Advances in Neural Information Processing Systems, pp. 823–833, 2017.
|
| 174 |
+
|
| 175 |
+
Ruihui Li, Xianzhi Li, Chi-Wing Fu, Daniel Cohen-Or, and Pheng-Ann Heng. Pu-gan: a point cloud upsampling adversarial network. In Proceedings of the IEEE International Conference on Computer Vision, pp. 7203–7212, 2019.
|
| 176 |
+
|
| 177 |
+
Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, and Baoquan Chen. Pointcnn: Convolution on x-transformed points. In Advances in neural information processing systems, pp. 820–830, 2018.
|
| 178 |
+
|
| 179 |
+
Kaichun Mo, He Wang, Xinchen Yan, and Leonidas Guibas. PT2PC: Learning to generate 3d point cloud shapes from part tree conditions. arXiv preprint arXiv:2003.08624, 2020.
|
| 180 |
+
|
| 181 |
+
Jeong Joon Park, Peter Florence, Julian Straub, Richard Newcombe, and Steven Lovegrove. Deepsdf: Learning continuous signed distance functions for shape representation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 165–174, 2019.
|
| 182 |
+
|
| 183 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 652–660, 2017a.
|
| 184 |
+
|
| 185 |
+
Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet $^ { + + }$ : Deep hierarchical feature learning on point sets in a metric space. In Advances in neural information processing systems, pp. 5099–5108, 2017b.
|
| 186 |
+
|
| 187 |
+
Dong Wook Shu, Sung Woo Park, and Junseok Kwon. 3d point cloud generative adversarial network based on tree structured graph convolutions. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3859–3868, 2019.
|
| 188 |
+
|
| 189 |
+
Hugues Thomas, Charles R Qi, Jean-Emmanuel Deschaud, Beatriz Marcotegui, François Goulette, and Leonidas J Guibas. Kpconv: Flexible and deformable convolution for point clouds. In Proceedings of the IEEE International Conference on Computer Vision, pp. 6411–6420, 2019.
|
| 190 |
+
|
| 191 |
+
Diego Valsesia, Giulia Fracastoro, and Enrico Magli. Learning localized generative models for 3d point clouds via graph convolution. 2018.
|
| 192 |
+
|
| 193 |
+
Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E Sarma, Michael M Bronstein, and Justin M Solomon. Dynamic graph cnn for learning on point clouds. ACM Transactions on Graphics (TOG), 38(5): 146, 2019.
|
| 194 |
+
|
| 195 |
+
Wenxuan Wu, Zhongang Qi, and Li Fuxin. Pointconv: Deep convolutional networks on 3d point clouds. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9621–9630, 2019.
|
| 196 |
+
|
| 197 |
+
Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1912–1920, 2015.
|
| 198 |
+
|
| 199 |
+
Guandao Yang, Xun Huang, Zekun Hao, Ming-Yu Liu, Serge Belongie, and Bharath Hariharan. Pointflow: 3d point cloud generation with continuous normalizing flows. In Proceedings of the IEEE International Conference on Computer Vision, pp. 4541–4550, 2019.
|
| 200 |
+
|
| 201 |
+
Yaoqing Yang, Chen Feng, Yiru Shen, and Dong Tian. Foldingnet: Point cloud auto-encoder via deep grid deformation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 206–215, 2018.
|
md/train/9BpjtPMyDQ/9BpjtPMyDQ.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Data-Efficient Instance Generation from Instance Discrimination
|
| 2 |
+
|
| 3 |
+
Ceyuan Yang† Yujun Shen‡ Yinghao $\mathbf { X } \mathbf { u } ^ { \dag }$ Bolei Zhou† †The Chinese University of Hong Kong ‡ByteDance Inc.
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Generative Adversarial Networks (GANs) have significantly advanced image synthesis, however, the synthesis quality drops significantly given a limited amount of training data. To improve the data efficiency of GAN training, prior work typically employs data augmentation to mitigate the overfitting of the discriminator yet still learn the discriminator with a bi-classification (i.e., real vs. fake) task. In this work, we propose a data-efficient Instance Generation (InsGen) method based on instance discrimination. Concretely, besides differentiating the real domain from the fake domain, the discriminator is required to distinguish every individual image, no matter it comes from the training set or from the generator. In this way, the discriminator can benefit from the infinite synthesized samples for training, alleviating the overfitting problem caused by insufficient training data. A noise perturbation strategy is further introduced to improve its discriminative power. Meanwhile, the learned instance discrimination capability from the discriminator is in turn exploited to encourage the generator for diverse generation. Extensive experiments demonstrate the effectiveness of our method on a variety of datasets and training settings. Noticeably, on the setting of $2 K$ training images from the FFHQ dataset, we outperform the state-of-the-art approach with $2 3 . 5 \%$ FID improvement.1
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Generative Adversarial Network (GAN) [16] has become a popular paradigm to learn the distribution of the observed data. It is formulated as a two-player game, where a generator synthesizes realistic data, while a discriminator distinguishes synthesized samples from real ones. To reach equilibrium in this minimax game, it requires both the generator and the discriminator to be sufficiently trained. In other words, the synthesis capability of the generator will subsequently deteriorate given an inadequate discriminator [24, 39, 49, 51].
|
| 12 |
+
|
| 13 |
+
Recent success of GANs [22, 23, 25, 4] relies on big data to assure the sufficient training of the discriminator. Prior work [49, 24] has found that reducing the amount of training data leads to the overfitting of the discriminator, which tends to memorize the entire training set. In turn, the backpropagation from the discriminator to the generator damages the synthesis quality of the generator and potentially causes the mode collapse problem [1, 44]. Data augmentation is one of the most widely used methods to alleviate the overfitting issue in deep learning algorithms [45, 11, 10]. Some recent attempts [24, 39, 49, 51, 44] have been made to apply data augmentation to GAN training. It is found that the discriminator can be improved by augmenting not only the real images from the dataset but also the synthesized images by the generator [49, 24]. However, the learning objective of the discriminator remains as categorizing real and fake domains and a substantial performance drop can be observed given limited training data.
|
| 14 |
+
|
| 15 |
+
The domain bi-classification task could be too easy for the discriminator to gain sufficient discriminative power as an adaptive loss to train the generator, especially when the size of training set is small. In this work, we propose to improve the data efficiency in GAN training by assigning a more challenging task to the discriminator, which is to distinguish every individual image as an independent category. In this way, the discriminator is forced to improve its discriminative capability to accomplish the instance discrimination task [40]. Notably, besides distinguishing real samples, we also demand the discriminator to differentiate fake samples synthesized by the generator. Thus the discriminator can be considered to train with infinite data, preventing it from memorizing the training samples. When distinguishing synthesized data, we design a noise perturbation strategy to increase the difficulty of the task and hence make the discriminator more capable. Meanwhile, we also alter the training objectives from the generator side. Concretely, besides making the generator to fool the discriminator, we expect all the samples produced by the generator to be well identified as different instances with our instance-induced discriminator. This highly matches the goal of diverse generation, which requires every synthesis to be unique. We evaluate our method on a range of datasets and achieve appealing generation performance in terms of image quality, diversity, and data efficiency. Experiments show that our method significantly improves the baselines and outperform previous data-augmentation methods. To be specific, our method improves the FID from 15.60 to 11.92, 7.29 to 4.90, and 3.88 to 3.31 with $2 K$ , $1 0 K$ , and $7 0 K$ training images from FFHQ [23] respectively. We can even learn a large-scale GAN with only 100 in-the-wild images to produce satisfying synthesis.
|
| 16 |
+
|
| 17 |
+
Our main contributions are summarized as follows: 1) We propose a data-efficient instance generation (InsGen) method which incorporates instance discrimination as an auxiliary task in GAN training. 2) The synthesized data is used as infinite samples for improving the discriminative power of the discriminator, which in turn substantially improves the synthesis quality and diversity of the generator. 3) Under various data-regime settings, our method consistently surpasses existing alternatives by a substantial margin.
|
| 18 |
+
|
| 19 |
+
# 2 Related Work
|
| 20 |
+
|
| 21 |
+
Data Augmentation in GANs. Data augmentation makes the maximum use of available data to alleviate the overfitting of deep models that have millions of parameters. It plays an essential role in training discriminative models [45, 11, 10]. Some recent work explores how data augmentation can help the training of GANs [51, 39, 49, 24]. Zhao et al. [51] conduct empirical studies on the effects of different types of augmentations for GAN training. Tran et al. [39] make a theoretical analysis of several data augmentations. Zhao et al. [49] propose a differentiable augmentation method such that the augmenting operations can be applied to both real and synthesized data. Similarly, Karras et al. [24] design augmentations that do not leak and introduce a probability-based adaptive strategy to stabilize the training process. Different from prior work, we focus on introducing the unsupervised representation learning which also requires augmentations into GAN training. Our work shows that the recent instance discrimination task [40] can be used as an auxiliary task for the discriminator, which in turn substantially improves the synthesis quality of the generator.
|
| 22 |
+
|
| 23 |
+
Self-supervised Learning in GANs. The rationale behind self-supervised learning is to set up various pretext tasks with supervisory-free labels [14, 5, 41, 48, 13, 32, 34, 42, 34, 15, 31, 35]. Similar idea is recently introduced in GAN training as an auxiliary loss to improve the synthesis performance. For instance, Chen et al. [6] assign the rotation prediction task to the discriminator to prevent it from catastrophic forgetting, and Tran et al. [38] propose a multi-class minimax game to encourage the generator to produce diverse samples. Among all self-supervised learning approaches, contrastive learning [40, 17, 7, 18, 3] shows great potential in large-scale representation learning. Many attempts have been made to improve generative models by drawing lessons from contrastive learning, like the consistency regularization for GANs [47, 50], the patch-level contrastive learning for image-to-image translation [33], and the latent-augmented contrastive loss for conditional image synthesis [29]. Akin to supervised contrastive loss [27], some concurrent work [20, 21, 43] reformulates the conventional bi-classification task (i.e., real domain vs. fake domain) with contrastive loss. Differently, we keep the original bi-classification task of the discriminator and introduce contrastive learning as a new one. Specifically, we assign the discriminator a simple auxiliary task, which is to recognize every individual image, no matter it is real or synthesized by the generator. Such instance discrimination task helps sustain the discriminative power of the discriminator under a low-data regime, which in turn improves the synthesis performance significantly.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Illustration of the InsGen method. Besides the bi-classification task to differentiate real and fake domains, the discriminator is assigned an auxiliary task, which aims at maximally distinguishing each image instance as illustrated on the right. $\mathcal { C }$ denotes the training objective for such instance discrimination task. (a) The discriminator is asked to recognize not only every real sample $\mathbf { x } _ { i }$ but also every synthesized sample $G ( \mathbf { z } _ { i } )$ by a frozen generator. (b) With the instance-induced discriminator, the generator is encouraged to make all synthesis recognizable from each other, leading to more diverse generation.
|
| 27 |
+
|
| 28 |
+
# 3 Methodology
|
| 29 |
+
|
| 30 |
+
In this section, we introduce the proposed InsGen method. Recall that our method is built based on GAN, which is commonly formulated as a two-player game between a generator and a discriminator. They compete with each other in that the generator tries to produce as realistic data as possible while the discriminator works on recognizing synthesized data from real data. Besides the conventional bi-classification task (i.e., differentiating real and fake domains), we also require the discriminator to distinguish every individual instance. With such a challenging task, the discriminator can mitigate the overfitting problem even with limited training data. We will briefly introduce the image synthesis and instance discrimination mechanisms in Sec. 3.1, followed by our improved training pipeline in Sec. 3.2 and the practical usage of InsGen on the state-of-the-art StyleGAN2-ADA model [24] in Sec. 3.3.
|
| 31 |
+
|
| 32 |
+
# 3.1 Preliminaries
|
| 33 |
+
|
| 34 |
+
Our work is highly related to GAN [16] for image synthesis and contrastive learning [40, 17] for instance discrimination. To make the paper self-contained, we shortly describe these two algorithms in the text below.
|
| 35 |
+
|
| 36 |
+
Synthesizing Images with GANs. GAN is a popular paradigm for image generation. It typically consists of two networks: a generator $G ( \cdot )$ that learns to map a latent variable $\mathbf { z }$ to a photo-realistic image, and a discriminator $D ( \cdot )$ that aims at separating real images $\mathbf { x }$ from synthesized ones $G ( \mathbf { z } )$ These two networks compete with each other [16] and are jointly optimized with
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\begin{array} { r l } & { \mathcal { L } _ { D } = - \mathbb { E } _ { \mathbf { x } \in \mathcal { X } } [ \log ( D ( \mathbf { x } ) ) ] - \mathbb { E } _ { \mathbf { z } \in \mathcal { Z } } [ \log ( 1 - D ( G ( \mathbf { z } ) ) ) ] , } \\ & { \mathcal { L } _ { G } = - \mathbb { E } _ { \mathbf { z } \in \mathcal { Z } } [ \log ( D ( G ( \mathbf { z } ) ) ) ] , } \end{array}
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $\mathcal { Z }$ and $\mathcal { X }$ denote the pre-defined latent distribution and real data distribution respectively. After the training converges, the synthesized images are assumed to be as realistic as real ones to fool the discriminator. From this perspective, the synthesis quality highly depends on the discriminative power of the discriminator. Prior literature [24, 39, 49, 51] has affirmed that GANs will suffer from the insufficient training of the discriminator and proposed to apply a series of data augmentations $\tau ( \cdot )$ to alleviate the overfitting problem. But they do not change the learning objectives of GAN and observe drastic performance drop given limited training data.
|
| 43 |
+
|
| 44 |
+
Distinguishing Images with Contrastive Learning. It is well-known that image classification tasks usually benefit from more discriminative representations [12]. Unlike supervised training algorithms that optimize the model parameters based on annotated data, contrastive learning [40, 17, 7, 18, 3] is able to extract representative features from images in an unsupervised manner. As shown in Fig. 1a, the rationale behind is to “label” every sample as an individual class, i.e., instance discrimination. Concretely, given an image $\mathbf { x }$ , two random “views” (e.g., through different augmentations) are created as the query $\mathbf { x } _ { q }$ and the key $\mathbf { x } _ { k _ { + } }$ . This query-key pair is regarded as the positive pair while all “views” from other images, $\{ \mathbf { x } _ { k _ { i } } \} _ { i = 1 } ^ { N }$ , are treated as negative pairs with respect to the query. Here, $N$ is the total number of images in addition to the query image. Contrastive learning aims at maximizing the agreement across augmentations (i.e., $\mathbf { x } _ { q }$ and $\mathbf { x } _ { k _ { + } }$ ) and make the query as much dissimilar to a number of negative samples as possible. Accordingly, we can design a pretext task of $( N + 1 )$ -way classification and learn the model with the contrastive loss $\mathcal { C }$ i.e., InfoNCE loss [32]
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r } { { \mathbf { v } } _ { q } = F ( { \mathbf { x } } _ { q } ) , \quad { \mathbf { v } } _ { k _ { + } } = F ( { \mathbf { x } } _ { k _ { + } } ) , \quad { \mathbf { v } } _ { k _ { i } } = F ( { \mathbf { x } } _ { k _ { i } } ) , i = 1 \dots N , } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathcal { C } _ { F ( \cdot ) , \phi ( \cdot ) } ( \mathbf { x } _ { q } , \mathbf { x } _ { k _ { + } } , \{ \mathbf { x } _ { k _ { i } } \} _ { i = 1 } ^ { N } ) = - \log \frac { \exp ( \phi ( \mathbf { v } _ { q } ) ^ { T } \phi ( \mathbf { v } _ { k _ { + } } ) / \tau ) } { \sum _ { i = 0 } ^ { N } \exp ( \phi ( \mathbf { v } _ { q } ) ^ { T } \phi ( \mathbf { v } _ { k _ { i } } ) / \tau ) } ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $F ( \cdot )$ is the backbone network to extract the representation $\mathbf { v }$ from a given image $\mathbf { x }$ , and $\phi ( \cdot )$ is the head network (e.g., usually implemented with several fully-connected layers) to project the extracted feature onto a unit sphere. $\tau$ stands for the temperature, which is a hyper-parameter. Recall that the primitive goal of the discriminator in GANs can also be viewed as a bi-classification task, which is to recognize real and fake domains. In this work, we demonstrate that introducing the instance discrimination task can help enhance the discriminative power of the discriminator and in turn improve the synthesis quality of the generator significantly.
|
| 55 |
+
|
| 56 |
+
# 3.2 Generating Diverse Instances from Distinguishing Instances
|
| 57 |
+
|
| 58 |
+
In this part, we will introduce how instance discrimination is incorporated into the GAN training for data-efficient and diverse image generation. There are four essential components of our InsGen method: 1) distinguishing real images, 2) distinguishing fake images that can be sampled infinitely, 3) a noise perturbation strategy, and 4) a loop-back mechanism to encourage the generator for the diverse generation.
|
| 59 |
+
|
| 60 |
+
Distinguishing Real Images. As discussed above, the synthesis quality of GAN models not only depends on the training scheme [2, 30, 22, 4] and the architecture design of the generator [46, 23, 25], but more importantly relies on the discriminative capability of the discriminator. That is because the discriminator is the only one (compared to the generator) that can see how real data looks like and further guides the generator accordingly. To make the maximum use of the limited training data and avoid the discriminator from memorizing the entire dataset, we assign it with a more challenging task beyond domain classification, which is to recognize every independent instance from the dataset, as shown in Fig. 1a. For this purpose, we introduce a new task head $\phi ^ { r } ( \cdot )$ beyond the original bi-classification head $\phi ^ { d o m a i n } ( \cdot )$ on top of its backbone $d ( \cdot )$ and train the discriminator with an extra training objective
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathcal { C } _ { D } ^ { r } = \mathcal { C } _ { d ( \cdot ) , \phi ^ { r } ( \cdot ) } ( \mathcal { T } _ { q } ( \mathbf { x } _ { q } ) , \mathcal { T } _ { k _ { + } } ( \mathbf { x } _ { q } ) , \{ \mathcal { T } _ { k _ { i } } ( \mathbf { x } _ { k _ { i } } ) \} _ { i = 1 } ^ { N } ) .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Here, $\mathbf { x } _ { q }$ , $\{ \mathbf { x } _ { k _ { i } } \} _ { i = 1 } ^ { N }$ are all sampled from the real data distribution $\mathcal { X }$ and transformed with various differentiable augmentations $\tau ( \cdot )$ .
|
| 67 |
+
|
| 68 |
+
Distinguishing Fake Images. However, the amount of training data could be extremely few (like thousands or even hundreds) in practice. In such a case, the improvement of the discriminator gained by differentiating real instances will be also limited. On the other hand, we notice that the number of synthesized samples can be sufficiently large due to the sampling mechanism of GANs. Ideally, different latent codes $\mathbf { z } \in { \mathcal { Z } }$ should lead to different synthesis $G ( \mathbf { z } )$ . Hence, we propose to also ask the discriminator to recognize every individual fake images, as shown in Fig. 1a. Similarly, we introduce another task head $\bar { \phi } ^ { f } ( \cdot )$ into the discriminator. It is worth mentioning that we use separate task heads (i.e., $\phi ^ { r } ( \cdot )$ and $\phi ^ { f } ( \cdot ) )$ for real and fake data. That is because even though the synthesized images can be with high-quality, they still lie in a different distribution from the real ones, especially when the generator starts training from scratch. Meanwhile, the task of discriminating a real instance from a fake instance can be achieved by the native domain classification head $\phi ^ { d o m a i n } ( \cdot )$ .
|
| 69 |
+
|
| 70 |
+
Noise Perturbation. Prior work has observed the continuity of the latent space [36] such that images synthesized from the latent codes within a neighbourhood are very close to each other. Accordingly, they are more suitable to be treated as positive pairs than negative pairs. From this perspective, we introduce a noise perturbation strategy into fake image discrimination. The objective becomes
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathbf { x } _ { q } ^ { \prime } = { \mathcal { T } } _ { q } ( G ( \mathbf { z } _ { q } ) ) , \quad \mathbf { x } _ { k _ { + } } ^ { \prime } = { \mathcal { T } } _ { k _ { + } } ( G ( \mathbf { z } _ { q } + \epsilon ) ) , \quad \mathbf { x } _ { k _ { i } } ^ { \prime } = { \mathcal { T } } _ { k _ { i } } ( G ( \mathbf { z } _ { k _ { i } } ) ) ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathcal { C } _ { D } ^ { f } = \mathcal { C } _ { d ( \cdot ) , \phi ^ { f } ( \cdot ) } ( \mathbf { x } _ { q } ^ { \prime } , \mathbf { x } _ { k _ { + } } ^ { \prime } , \{ \mathbf { x } _ { k _ { i } } ^ { \prime } \} _ { i = 1 } ^ { N } ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Concretely, given a query image $\mathbf { x } _ { q } ^ { \prime }$ , the key image $\mathbf { x } _ { k + } ^ { \prime }$ is created with $\mathcal { T } _ { k _ { + } } ( G ( \mathbf { z } _ { q } + \epsilon ) )$ instead of $T _ { k _ { + } } ( G ( \mathbf { z } _ { q } ) )$ . Here, $\epsilon$ stands for the perturbation term, which is sampled from a Gaussian distribution whose variance is sufficiently smaller than that of $\mathcal { Z }$ , and $\mathcal { T } _ { q } ( \cdot )$ and $\tau _ { k + } ( \cdot )$ denote two different augmentations. Such design aims to enforce the discriminator invariant to the small perturbation, which makes the instance discrimination task more challenging.
|
| 81 |
+
|
| 82 |
+
Toward Diverse Generation. Besides utilizing the instance discrimination task to improve the discriminative power of the discriminator, we further design a loop-back mechanism to in turn use the learned instance discrimination to guide the generator. Recall that image diversity, in addition to image quality, is also an important metric to evaluate generative models. Diverse generation, which requires all generated samples to be distinguishable from each other, exactly matches our goal of instance discrimination. In other words, given a discriminator with the ability to distinguish different instances, we would like all the samples produced by the generator to be recognized as different ones. This idea is illustrated in Fig. 1b. By comparing Fig. 1a and Fig. 1b, we can see that the generator shares the same target as the discriminator yet is trained separately. Hence, the same objective function is added into the generator loss
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathbf { x } _ { k _ { + } } ^ { \prime \prime } = \mathcal { T } _ { k _ { + } } ( G ( \mathbf { z } _ { q } ) ) ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal { C } _ { G } ^ { f } = \mathcal { C } _ { d ( \cdot ) , \phi ^ { f } ( \cdot ) } ( \mathbf { x } _ { q } ^ { \prime } , \mathbf { x } _ { k _ { + } } ^ { \prime \prime } , \{ \mathbf { x } _ { k _ { i } } ^ { \prime } \} _ { i = 1 } ^ { N } ) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where the only difference is that noise perturbation is not applied during the training of the generator.
|
| 93 |
+
|
| 94 |
+
Complete Objective Function. To summarize, with the purposes of both image synthesis and instance discrimination, the discriminator and the generator in InsGen are optimized with
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { l } { { \mathcal { L } _ { D } ^ { \prime } = \mathcal { L } _ { D } + \lambda _ { D } ^ { r } \mathcal { C } _ { D } ^ { r } + \lambda _ { D } ^ { f } \mathcal { C } _ { D } ^ { f } , } } \\ { { \mathcal { L } _ { G } ^ { \prime } = \mathcal { L } _ { G } + \lambda _ { G } \mathcal { C } _ { G } ^ { f } , } } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\lambda _ { G } , \lambda _ { D } ^ { r }$ , and $\lambda _ { D } ^ { f }$ denote the weights for different terms.
|
| 101 |
+
|
| 102 |
+
# 3.3 Implementation
|
| 103 |
+
|
| 104 |
+
On top of the adversarial training pipeline in GANs, our InsGen method only inserts an extra loss output on the discriminator network for instance discrimination.Therefore, it can be easily implemented on any GAN framework. In this part, we take the state-of-the-art GAN model, StyleGAN2-ADA [24], as an example to demonstrate how InsGen is implemented in practice.
|
| 105 |
+
|
| 106 |
+
Generative Model. StyleGAN2-ADA [24] adopts the architecture of StyleGAN2 [25] and proposes the adaptive discriminator augmentation strategy for training with limited data. In particular, it designs a differentiable augmentation pipeline, consisting of 18 transformations, as well as an adaptive hyper-parameter to control the strength of these augmentations. For a fair comparison, in this work, we exactly reuse the network structure, the augmentation pipeline, the adaptive strategy of the augmenting strength, and other hyper-parameters like batch size and learning rate.
|
| 107 |
+
|
| 108 |
+
Instance Discrimination. We reuse the backbone of the discriminator to perform instance discrimination, so that the extra computing load is extremely small and the training efficiency is barely affected. We treat the last fully-connected layer in the StyleGAN2-ADA discriminator as the domain-classification head $\phi ^ { d o m a i n } \dot { ( } \cdot \dot { } )$ , while all remaining layers serve as the backbone network $d ( \cdot )$ . The real instance discrimination head $\phi ^ { r } ( \cdot )$ and the fake head $\phi ^ { f } ( \cdot )$ are both implemented with 2 fully-connected layers, followed by $\ell _ { 2 }$ normalization. Strictly following MoCo-v2 [8], an extra queue is employed for each task head to store the sample features to save computational cost. The number of samples in $\mathcal { L } _ { D } ^ { r }$ and $\mathcal { L } _ { D } ^ { f }$ is thus equal to the queue size, which usually contains around $5 \%$ data of the whole set. We also introduce the momentum encoder $D ^ { \prime }$ , whose parameters are updated with moving average scheme: $\Theta _ { D ^ { \prime } } \alpha \Theta _ { D ^ { \prime } } + ( 1 - \alpha ) \Theta _ { D }$ . Here, $\alpha = 0 . 9 9 9$ follows the same setting in MoCo-v2 [8]. The temperature $\tau$ in Eq. (4) is set as 2.
|
| 109 |
+
|
| 110 |
+
Table 1: Performance on FFHQ. FID (lower is better) is reported as the evaluation metric. $2 K ^ { \ast }$ , $\cdot 1 0 K ^ { \prime }$ , and $" 1 4 0 K "$ stand for the number of samples used for training, where $\mathsf { \Omega } ^ { \bullet } 1 4 0 K ^ { \prime } \ '$ horizontally flips the original FFHQ dataset (with $7 0 K$ samples) to double the size of data. Results with $^ *$ are also achieved with horizontally flipped data, which are slightly better than those reported in [24]. Numbers in blue color indicate our improvements over the baseline [24].
|
| 111 |
+
|
| 112 |
+
<table><tr><td>256×256 Resolution</td><td>2K</td><td>10K</td><td>140K</td></tr><tr><td>PA-GAN [44]</td><td>56.49</td><td>27.71</td><td>3.78</td></tr><tr><td>zCR [50]</td><td>71.61</td><td>23.02</td><td>3.45</td></tr><tr><td>Auxiliary rotation [6]</td><td>66.64</td><td>25.37</td><td>4.16</td></tr><tr><td>StyleGAN2 [23]</td><td>78.80</td><td>30.73</td><td>3.66</td></tr><tr><td>w/ Shallow mapping [24]</td><td>71.35</td><td>27.71</td><td>3.59</td></tr><tr><td>w/ Adaptive dropout [24]</td><td>67.23</td><td>23.33</td><td>4.16</td></tr><tr><td>w/DiffAugment [49]</td><td>24.32</td><td>7.86</td><td>1</td></tr><tr><td>w/ ADA [24]</td><td>15.60*</td><td>7.29*</td><td>3.88</td></tr><tr><td>InsGen (Ours)</td><td>11.92 (-3.68)</td><td>4.90 (−2.39)</td><td>3.31 (-0.57)</td></tr></table>
|
| 113 |
+
|
| 114 |
+
# 4 Experiments
|
| 115 |
+
|
| 116 |
+
We evaluate the proposed InsGen method on multiple benchmarks. Sec. 4.1 presents the comparison to prior literature on both FFHQ [23] and AFHQ [9] datasets. Our InsGen substantially improves the baselines under multiple data-regime settings and outperforms previous data-augmentation approaches by a significant margin. Moreover, Sec. 4.2 provides a detailed ablation study to show the importance of each component. Lastly Sec. 4.3 discusses about the limitation of data-efficiency.
|
| 117 |
+
|
| 118 |
+
# 4.1 Main Results
|
| 119 |
+
|
| 120 |
+
Datasets. We evaluate our InsGen with a number of other approaches on FFHQ [23] and AFHQ [9] datasets. FFHQ contains unique 70,000 high-resolution images $( 1 0 2 4 \times 1 0 2 4 )$ , with large variation regarding age, ethnicity, and background. All images of FFHQ are well aligned [26] and cropped. In order to conduct a fair comparison, we resize images to $2 5 6 \times 2 5 6$ . For the experiments of limited data, we follow ADA [24] to collect a subset of training data by randomly sampling. Moreover, AFHQ consists of around 5000 images per category for dogs, cats, and wild life at $5 1 2 \times 5 1 2$ resolution. Each category is regarded as a dataset and thus we train a different network on each dataset.
|
| 121 |
+
|
| 122 |
+
Training. We implement our InsGen on the official implementation of StyleGAN2-ADA. The training regularization is preserved, including path length regularization, lazy regularization, and style mixing regularization. Moreover, all parameters share the same learning rate and the minibatch standard deviation layer is adopted at the end of the discriminator. Exponential moving average of generator weights, non-saturating logistic loss with $R _ { 1 }$ regularization, and Adam optimizer [28] is also adopted. In particular, the coefficient of gradient penalty would be decreased correspondingly, according to the official implementation of ADA [24]. All the experiments are conducted on a server with 8 GPUs. Mixed-precision training is also used for faster training.
|
| 123 |
+
|
| 124 |
+
Hyper-parameters. Empirically, the loss weights $\lambda _ { G }$ , $\lambda _ { D } ^ { f }$ and $\lambda _ { D } ^ { r }$ are 0.1, 1.0 and 1.0 respectively. Besides, the training length is slightly different. For the experiments with less than $1 0 K$ images, the total number of seen images is 10 million rather than 25 million adopted by ADA [24]. Meanwhile, we decrease the loss weight of the gradient penalty due to involving an extra supervision. For example, ADA [24] adopts 1.0 for original StyleGAN2 training while we use 0.8. We also found smaller loss weight of gradient penalty is beneficial to our InsGen on the less data, e.g., 0.3 and 0.5 for $1 0 K$ and $2 K$ experiments respectively.
|
| 125 |
+
|
| 126 |
+
Evaluation Metric. We use Fréchet Inception Distance (FID) [19] as the metric for quantitative comparison metric since FID tends to reflect the human perception of synthesis quality. As mentioned in Heusel et al. [19], we always calculate the FID between 50,000 fake images and all training images, no matter how much data the training set contains. The official pre-trained Inception network is used to compute the FID.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 2: Generated images under various data regimes. The number of training images and the corresponding FID are reported. All images on FFHQ are synthesized with truncation following [24] while those on AFHQ are not.
|
| 130 |
+
|
| 131 |
+
Results on FFHQ. Tab. 1 presents the comparison on FFHQ. Akin to ADA [24], we compare against PA-GAN [44], zCR [50] and auxiliary rotation [6]. Also, StyleGAN2 together with its variants is also introduced as the baseline methods. For instance, less data is usually required when a shallower mapping network is applied. Besides, dropout [37] is also well-studied to be replaced with the augmentations as the regularization. Note that ∗ means the dataset is amplified by $2 \times$ via the horizontal flip, which is recommended in the official implementation of ADA [24]. Such that, $2 K ^ { , , }$ denotes 2,000 unique images and the dataset is enlarged to 4,000 via the flip operation, leading to a better baseline.
|
| 132 |
+
|
| 133 |
+
Although ADA [24] has already improved the performance significantly under various low-data regimes, our InsGen continues to improve the low-data image generation by a clear margin, establishing a new state-of-the-art synthesis quality with limited training images. To be specific, our method improves the FID from 15.60 to 11.92, 7.29 to 4.90, and 3.88 to 3.31 with $2 K$ , $1 0 K$ and $7 0 K$ training images from FFHQ [23] respectively. Fig. 2 presents several generated examples under various data regimes. More qualitative results are available in our supplementary material. All images on FFHQ are generated with truncation. It is also worth noting that our approach further improves the synthesis quality when the full dataset is given, even outperforming previous best one i.e., zCR [50]. Namely, the data can be further exploited when it is not the bottleneck for training.
|
| 134 |
+
|
| 135 |
+
Results on AFHQ. We also evaluate our approach on AFHQ dataset [9] which is divided into cat, dog and wild life, with the number of 5153, 4739 and 4738 images respectively. Therefore, three models are trained on them individually. Note that all models on AFHQ are trained on $5 1 2 \times 5 1 2$ images while the generated samples are resized to present. We involve StyleGAN2 [25], ContraD [20] and ADA [24] as the baseline approaches, compared to our InsGen. Quantitative and qualitative results are shown in Tab. 2 and Fig. 2 respectively.
|
| 136 |
+
|
| 137 |
+
The synthesis quality on those datasets is substantially improved by our method, which also outperforms previous data-augmentation methods. To be specific, our method improves the FID from 3.55 to 2.60, 7.40 to 5.44, and 3.05 to 1.77 on cat, dog and wild life images respectively. In particular, ContraD [20] introduced stronger augmentations to train a better discriminator via contrastive learning. One term in this method shares the similar motivation that real images could result in powerful representations. In terms of the use of synthesized samples, ContraD turned to focus on the binary classification, (i.e., real vs. fake) with some specific designs like the stop-gradient operation. Differently, our method leverages the generated images as a kind of data complement to produce a stronger representation and guide the learning of the generator. Accordingly, InsGen achieves the new state-of-the-art performances on AFHQ [9].
|
| 138 |
+
|
| 139 |
+
Table 3: Ablation Study. FID (lower is better) is reported as the evaluation metric. Here, vanilla $\mathcal { C } _ { D } ^ { f }$ means that the noise perturbation is not applied in the fake instance discrimination.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>CD</td><td>vanilla Cf</td><td>c</td><td>C</td><td>2K</td><td>10K</td><td>70K</td></tr><tr><td></td><td></td><td></td><td></td><td>15.60</td><td>7.29</td><td>3.76</td></tr><tr><td></td><td></td><td></td><td></td><td>14.15</td><td>5.98</td><td>3.56</td></tr><tr><td></td><td></td><td></td><td></td><td>13.46</td><td>5.68</td><td>3.67</td></tr><tr><td>νvv/</td><td>·</td><td>:</td><td></td><td>12.19</td><td>5.30</td><td>3.49</td></tr><tr><td></td><td>√</td><td></td><td>√</td><td>11.92</td><td>4.90</td><td>3.31</td></tr></table>
|
| 142 |
+
|
| 143 |
+
# 4.2 Ablation Study
|
| 144 |
+
|
| 145 |
+
In order to investigate the importance of each component in our InsGen, we conduct an ablation study on FFHQ [23] with the image resolution of $2 5 6 \times 2 5 6$ . FID serves as the main metric for the comparison, and the results on $2 K$ , $1 0 K$ and $7 0 K$ unique images are reported. During training each unique image go through random flip operation to obtain a stronger baseline. Tab. 3 presents the collection of various experiments in the ablation study. We choose the ADA [24] as the baseline.
|
| 146 |
+
|
| 147 |
+
How important is the instance discrimination? After performing the real image discrimination, the synthesis quality is improved, with the FID consistently decreased by -1.45, -1.31 and -0.20 in Tab. 3, no matter how many unique images the training set includes. To some extent, the discriminator would benefit from the powerful representations derived from the challenging pretext task. Accordingly, the generator is required to produce more photo-realistic images in order to confuse the discriminator.
|
| 148 |
+
|
| 149 |
+
When adding instance discrimination with fake images, performances could be further boosted. For instance, FID obtains an improvement of -0.69 and -0.30 with $2 K$ and $1 0 K$ images respectively. In particular, the gains rise as the number of real images goes down, verifying one of our motivations that the fake samples can be also regarded as data source for unsupervised representation learning.
|
| 150 |
+
|
| 151 |
+
How important is the noise perturbation? In Sec. 3.2, a noise perturbation strategy is proposed as a type of latent space augmentation for fake image discrimination. In particular, this latent space augmentation, i.e., the small movement in the latent space always leads to an obvious but semantically consistent change of the original image, which could not easily be implemented by some geometric and color transformations. Meanwhile, the discriminator is required to be invariant to such noise perturbation due to the goal of instance discrimination. Accordingly, the fake images are made best use of to result in stronger representations for the discrimination. As shown in Tab. 3, such strategy further brings consistent gains of -1.27, -0.38 and -0.18 on $2 K$ , $1 0 K$ and $7 0 K$ datasets respectively.
|
| 152 |
+
|
| 153 |
+
How important is the supervision signal for the generator? The last row of Tab. 3 shows the performances with the gradients which are back-propagated to the generator. Even if we have already obtained quite strong results, such a supervision signal on the generator could also introduce improvements under various data regimes.
|
| 154 |
+
|
| 155 |
+
The goal of instance discrimination is to distinguish every individual image according to its appearance cues [40]. Assuming this pretext task is well-performed on a fixed dataset, the semantic representation would be derived from this learning process. However, when distinguishing fake images, the fake dataset actually varies dynamically. Namely, we could accomplish this pretext task from the perspective of data, if the engine of this dynamical fake dataset, i.e., the generator could produce as many different images as possible. In general, this pretext task is exploited to encourage the diverse generation directly on the generator.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 3: Effect of the number of synthesized and real images used for instance discrimination. FID (lower is better) in log-scale is reported as the evaluation metric. We can see the consistent performance gain along with the increasing number of instances for discrimination.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 4: Training progress on FFHQ- $2 K$ . Larger value means that the image is more realistic under the view of the discriminator. Our discriminator can better and more stably differentiate real and fake data compared to ADA [24].
|
| 162 |
+
|
| 163 |
+
How important is the number of negative samples? We follow the MoCo-v2 [8] to store multiple features in a queue, in order to reduce the computational complexity. Empirically, the length of the feature queue tends to be the $5 \%$ number of the dataset. Therefore, it is 200 when we have $2 K$ unique images and enlarge them via the flip operation. However, there is no any reference number for the synthesized data. Accordingly, we collect as the same amount of fake data as that of the real.
|
| 164 |
+
|
| 165 |
+
As mentioned in Sec. 3.2, there could be much more synthesized samples than the real samples. Namely, we could leverage infinite samples for the synthesized instance discrimination. Therefore, we investigate the effect of the different number of synthesized samples i.e., the length of the feature queue, shown in Fig. 3a. Obviously, FID gradually decreases with the increasing number of synthesized samples, suggesting that involving more fake images is of great benefit to the synthesis, especially with the limited training data.
|
| 166 |
+
|
| 167 |
+
Whether the discriminative ability of the discriminator is really enhanced. As is mentioned in our work, it is challenging to gain sufficient discriminative power for the discriminator to train the generator when the size of training set is small. However, introducing instance discrimination is able to improve its discriminative capability, achieving new state-of-the-art synthesis quality. In order to investigate whether the discriminative ability is improved, we plot the logits (derived from the discriminator) of any input image during the training in Fig. 4. To be specific, the logit denotes how much the input image is identified as the real. And the number of training images are 2000.
|
| 168 |
+
|
| 169 |
+
Obviously, our method produces higher real and lower fake scores throughout the whole training progress, compared to the baseline approach ADA [24]. It indicates that the discriminator of our method performs the domain bi-classification (i.e., real vs. fake) better than that of baseline, showing stronger discriminative ability. It also verifies our motivation that a challenging pretext task which is to distinguish every individual image could indeed enhance the discriminator. Besides, the training progress is much more stable when equipped with our approach.
|
| 170 |
+
|
| 171 |
+
# 4.3 Towards the Limit of Data-efficiency
|
| 172 |
+
|
| 173 |
+
Although we have obtained the new state-of-the-art synthesis performances under the standard settings, we also wonder how much data-efficiency our InsGen could achieve. Therefore, the number of real data in the training set is further reduced to 1000, 500, 250 and 100. In order to conduct the apple-to-apple comparison, we remain to train the same model of StyleGAN2 without decreasing its generative capacity by using fewer channels or shallower mapping networks since such designs require less data. Meanwhile, the generated resolution remains $2 5 6 \times 2 5 6$ and the datasets are amplified via the horizontal flip operation as well.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 5: Qualitative results with different number of training images. The number of training images and the corresponding FID are reported. All images are synthesized with truncation following [24].
|
| 177 |
+
|
| 178 |
+
The quantitative and qualitative results are shown in Fig. 3b and Fig. 5 respectively. Obviously, FID significantly increases with the decreasing number of training images from 70K to 100. Nevertheless, our InsGen trained with only 100 unique images remains to outperform many approaches like PA-GAN in Fig. 3b with 2K images. Besides, with 500 training samples, our method is able to obtain the competitive performance to those using $1 0 \mathrm { k }$ images. Namely, our InsGen could improve the data-efficiency by more than $2 0 \times$ . Qualitative results suggest that our approach still produces meaningful images without incurring the model collapse no matter how many training images exist in the data collection.
|
| 179 |
+
|
| 180 |
+
# 5 Conclusion and Discussion
|
| 181 |
+
|
| 182 |
+
In this work, we develop a novel data-efficient Instance Generation (InsGen) method for training GANs with limited data. With the instance discrimination as an auxiliary task, our method makes the best use of both real and fake images to train the discriminator. In turn the discriminator is exploited to train the generator to synthesize as many diverse images as possible. Experiments under different data regimes show that InsGen brings a substantial improvement over the baseline in terms of both image quality and image diversity, and outperforms previous data augmentation algorithms by a large margin.
|
| 183 |
+
|
| 184 |
+
Although InsGen significantly improves the data efficiency in training generative models, it leaves some future work to do. One limitation of InsGen is that the performance gain becomes marginal when the training dataset is sufficiently large. This suggests that the discriminator can not benefit from the newly introduced instance discrimination any more. It may require a more challenging task to further improve the performance. Another limitation is that the FID score remains unsatisfying when the training data is extremely limited, say several hundred. It is worth exploring how to fully utilize the fake samples for discriminator training.
|
| 185 |
+
|
| 186 |
+
Acknowledgments. The project was supported through the Research Grants Council (RGC) of Hong Kong under ECS Grant No.24206219, GRF Grant No.14204521, CUHK FoE RSFS Grant.
|
| 187 |
+
|
| 188 |
+
# References
|
| 189 |
+
|
| 190 |
+
[1] M. Arjovsky and L. Bottou. Towards principled methods for training generative adversarial networks. Int. Conf. Learn. Represent., 2017. 1
|
| 191 |
+
|
| 192 |
+
[2] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein generative adversarial networks. In Int. Conf. Mach. Learn., 2017. 4
|
| 193 |
+
[3] P. Bachman, R. D. Hjelm, and W. Buchwalter. Learning representations by maximizing mutual information across views. In Adv. Neural Inform. Process. Syst., 2019. 2, 4
|
| 194 |
+
[4] A. Brock, J. Donahue, and K. Simonyan. Large scale gan training for high fidelity natural image synthesis. In Int. Conf. Learn. Represent., 2018. 1, 4
|
| 195 |
+
[5] M. Chen, A. Radford, R. Child, J. Wu, H. Jun, P. Dhariwal, D. Luan, and I. Sutskever. Generative pretraining from pixels. In Int. Conf. Mach. Learn., 2020. 2
|
| 196 |
+
[6] T. Chen, X. Zhai, M. Ritter, M. Lucic, and N. Houlsby. Self-supervised gans via auxiliary rotation loss. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 2, 6, 7
|
| 197 |
+
[7] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. In Int. Conf. Mach. Learn., 2020. 2, 4
|
| 198 |
+
[8] X. Chen, H. Fan, R. Girshick, and K. He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020. 5, 9
|
| 199 |
+
[9] Y. Choi, Y. Uh, J. Yoo, and J.-W. Ha. Stargan v2: Diverse image synthesis for multiple domains. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 6, 7, 8
|
| 200 |
+
[10] E. D. Cubuk, B. Zoph, D. Mane, V. Vasudevan, and Q. V. Le. Autoaugment: Learning augmentation policies from data. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 1, 2
|
| 201 |
+
[11] E. D. Cubuk, B. Zoph, J. Shlens, and Q. V. Le. Randaugment: Practical automated data augmentation with a reduced search space. In IEEE Conf. Comput. Vis. Pattern Recog. Worksh., 2020. 1, 2
|
| 202 |
+
[12] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conf. Comput. Vis. Pattern Recog., 2009. 3
|
| 203 |
+
[13] C. Doersch, A. Gupta, and A. A. Efros. Unsupervised visual representation learning by context prediction. In Int. Conf. Comput. Vis., 2015. 2
|
| 204 |
+
[14] J. Donahue and K. Simonyan. Large scale adversarial representation learning. In Adv. Neural Inform. Process. Syst., 2019. 2
|
| 205 |
+
[15] S. Gidaris, P. Singh, and N. Komodakis. Unsupervised representation learning by predicting image rotations. In Int. Conf. Learn. Represent., 2018. 2
|
| 206 |
+
[16] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. In Adv. Neural Inform. Process. Syst., 2014. 1, 3
|
| 207 |
+
[17] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick. Momentum contrast for unsupervised visual representation learning. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 2, 3, 4
|
| 208 |
+
[18] O. Henaff. Data-efficient image recognition with contrastive predictive coding. In Int. Conf. Mach. Learn., 2020. 2, 4
|
| 209 |
+
[19] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Adv. Neural Inform. Process. Syst., 2017. 6
|
| 210 |
+
[20] J. Jeong and J. Shin. Training gans with stronger augmentations via contrastive discriminator. In Int. Conf. Learn. Represent., 2021. 2, 7, 8
|
| 211 |
+
[21] M. Kang and J. Park. Contragan: Contrastive learning for conditional image generation. In Adv. Neural Inform. Process. Syst., 2020. 2
|
| 212 |
+
[22] T. Karras, T. Aila, S. Laine, and J. Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In Int. Conf. Learn. Represent., 2018. 1, 4
|
| 213 |
+
[23] T. Karras, S. Laine, and T. Aila. A style-based generator architecture for generative adversarial networks. In IEEE Conf. Comput. Vis. Pattern Recog., 2019. 1, 2, 4, 6, 7, 8
|
| 214 |
+
[24] T. Karras, M. Aittala, J. Hellsten, S. Laine, J. Lehtinen, and T. Aila. Training generative adversarial networks with limited data. In Adv. Neural Inform. Process. Syst., 2020. 1, 2, 3, 5, 6, 7, 8, 9, 10
|
| 215 |
+
[25] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila. Analyzing and improving the image quality of StyleGAN. In IEEE Conf. Comput. Vis. Pattern Recog., 2020. 1, 4, 5, 7
|
| 216 |
+
[26] V. Kazemi and J. Sullivan. One millisecond face alignment with an ensemble of regression trees. In IEEE Conf. Comput. Vis. Pattern Recog., 2014. 6
|
| 217 |
+
[27] P. Khosla, P. Teterwak, C. Wang, A. Sarna, Y. Tian, P. Isola, A. Maschinot, C. Liu, and D. Krishnan. Supervised contrastive learning. In Adv. Neural Inform. Process. Syst., 2020. 2
|
| 218 |
+
[28] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In Int. Conf. Learn. Represent., 2014. 6
|
| 219 |
+
[29] R. Liu, Y. Ge, C. L. Choi, X. Wang, and H. Li. Divco: Diverse conditional image synthesis via contrastive generative adversarial network. In IEEE Conf. Comput. Vis. Pattern Recog., 2021. 2
|
| 220 |
+
[30] T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida. Spectral normalization for generative adversarial networks. In Int. Conf. Learn. Represent., 2018. 4
|
| 221 |
+
[31] M. Noroozi and P. Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In Eur. Conf. Comput. Vis., 2016. 2
|
| 222 |
+
[32] A. v. d. Oord, Y. Li, and O. Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. 2, 4
|
| 223 |
+
[33] T. Park, A. A. Efros, R. Zhang, and J.-Y. Zhu. Contrastive learning for unpaired image-to-image translation. In Eur. Conf. Comput. Vis., 2020. 2
|
| 224 |
+
[34] D. Pathak, P. Krahenbuhl, J. Donahue, T. Darrell, and A. A. Efros. Context encoders: Feature learning by inpainting. In IEEE Conf. Comput. Vis. Pattern Recog., 2016. 2
|
| 225 |
+
[35] D. Pathak, R. Girshick, P. Dollár, T. Darrell, and B. Hariharan. Learning features by watching objects move. In IEEE Conf. Comput. Vis. Pattern Recog., 2017. 2
|
| 226 |
+
[36] A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In Int. Conf. Learn. Represent., 2016. 5
|
| 227 |
+
[37] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 2014. 7
|
| 228 |
+
[38] N.-T. Tran, V.-H. Tran, N.-B. Nguyen, L. Yang, and N.-M. Cheung. Self-supervised gan: Analysis and improvement with multi-class minimax game. In Adv. Neural Inform. Process. Syst., 2019. 2
|
| 229 |
+
[39] N.-T. Tran, V.-H. Tran, N.-B. Nguyen, T.-K. Nguyen, and N.-M. Cheung. On data augmentation for gan training. IEEE Trans. Image Process., 2021. 1, 2, 3
|
| 230 |
+
[40] Z. Wu, Y. Xiong, S. X. Yu, and D. Lin. Unsupervised feature learning via non-parametric instance discrimination. In IEEE Conf. Comput. Vis. Pattern Recog., 2018. 2, 3, 4, 8
|
| 231 |
+
[41] Y. Xu, Y. Shen, J. Zhu, C. Yang, and B. Zhou. Generative hierarchical features from synthesizing images. In IEEE Conf. Comput. Vis. Pattern Recog., 2021. 2
|
| 232 |
+
[42] C. Yang, Z. Wu, B. Zhou, and S. Lin. Instance localization for self-supervised detection pretraining. In IEEE Conf. Comput. Vis. Pattern Recog., 2021. 2
|
| 233 |
+
[43] N. Yu, G. Liu, A. Dundar, A. Tao, B. Catanzaro, L. Davis, and M. Fritz. Dual contrastive loss and attention for gans. arXiv preprint arXiv:2103.16748, 2021. 2
|
| 234 |
+
[44] D. Zhang and A. Khoreva. Pa-gan: Improving gan training by progressive augmentation. In Adv. Neural Inform. Process. Syst., 2019. 1, 6, 7
|
| 235 |
+
[45] H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz. mixup: Beyond empirical risk minimization. In Int. Conf. Learn. Represent., 2017. 1, 2
|
| 236 |
+
[46] H. Zhang, I. Goodfellow, D. Metaxas, and A. Odena. Self-attention generative adversarial networks. In Int. Conf. Mach. Learn., 2019. 4
|
| 237 |
+
[47] H. Zhang, Z. Zhang, A. Odena, and H. Lee. Consistency regularization for generative adversarial networks. In Int. Conf. Learn. Represent., 2020. 2
|
| 238 |
+
[48] R. Zhang, P. Isola, and A. A. Efros. Colorful image colorization. In Eur. Conf. Comput. Vis., 2016. 2
|
| 239 |
+
[49] S. Zhao, Z. Liu, J. Lin, J.-Y. Zhu, and S. Han. Differentiable augmentation for data-efficient gan training. In Adv. Neural Inform. Process. Syst., 2020. 1, 2, 3, 6
|
| 240 |
+
[50] Z. Zhao, S. Singh, H. Lee, Z. Zhang, A. Odena, and H. Zhang. Improved consistency regularization for gans. In Assoc. Adv. Artif. Intell., 2020. 2, 6, 7
|
| 241 |
+
[51] Z. Zhao, Z. Zhang, T. Chen, S. Singh, and H. Zhang. Image augmentations for gan training. arXiv preprint arXiv:2006.02595, 2020. 1, 2, 3
|
md/train/ALvt7nXa2q/ALvt7nXa2q.md
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Overcoming Catastrophic Forgetting in Incremental Few-Shot Learning by Finding Flat Minima
|
| 2 |
+
|
| 3 |
+
Guangyuan Shi,∗ Jiaxin Chen∗, Wenlong Zhang, Li-Ming Zhan, Xiao-Ming Wu† Department of Computing The Hong Kong Polytechnic University {guang-yuan.shi, jiax.chen, wenlong.zhang, lmzhan.zhan}@connect.polyu.hk xiao-ming.wu@polyu.edu.hk
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
This paper considers incremental few-shot learning, which requires a model to continually recognize new categories with only a few examples provided. Our study shows that existing methods severely suffer from catastrophic forgetting, a well-known problem in incremental learning, which is aggravated due to data scarcity and imbalance in the few-shot setting. Our analysis further suggests that to prevent catastrophic forgetting, actions need to be taken in the primitive stage – the training of base classes instead of later few-shot learning sessions. Therefore, we propose to search for flat local minima of the base training objective function and then fine-tune the model parameters within the flat region on new tasks. In this way, the model can efficiently learn new classes while preserving the old ones. Comprehensive experimental results demonstrate that our approach outperforms all prior state-of-the-art methods and is very close to the approximate upper bound. The source code is available at https://github.com/moukamisama/F2M.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Why study incremental few-shot learning? Incremental learning enables a model to continually learn new concepts from new data without forgetting previously learned knowledge. Rooted from real-world applications, this topic has attracted a significant amount of interest in recent years [5, 30, 31, 40, 26]. Incremental learning assumes sufficient training data is provided for new classes, which is impractical in many application scenarios, especially when the new classes are rare categories which are costly or difficult to collect. This motivates the study of incremental few-shot learning, a more difficult paradigm that aims to continually learn new tasks with only a few examples.
|
| 12 |
+
|
| 13 |
+
Challenges. The major challenge for incremental learning is catastrophic forgetting [14, 28, 35], which refers to the drastic performance drop on previous tasks after learning new tasks. This phenomenon is caused by the inaccessibility to previous data while learning on new data. Catastrophic forgetting presents a bigger challenge for incremental few-shot learning. Due to the small amount of training data in new tasks, the model tends to severely overfit on new classes while quickly forgetting old classes, resulting in catastrophic performance.
|
| 14 |
+
|
| 15 |
+
Current research. The study of incremental few-shot learning has just started [47, 41, 60, 9, 8, 34, 59]. Current works mainly borrow ideas from research in incremental learning to overcome the forgetting problem, by enforcing strong constraints on model parameters to penalize the changes of parameters [34, 28, 56], or by saving a small amount of exemplars from old classes and adding constraints on the exemplars to avoid forgetting [40, 20, 4]. However, in our empirical study, we find that an intransigent model that only trains on base classes and does not tune on new tasks consistently outperforms state-of-the-art methods, including a joint-training method [47] that uses all encountered data for training and hence suffers from severe data imbalance. This observation motivates us to address this harsh problem from a different angle.
|
| 16 |
+
|
| 17 |
+
Our solution. Unlike existing solutions that try to overcome the catastrophic forgetting problem during the process of learning new tasks, we adopt a different approach by considering this issue during the training of base classes. Specifically, we propose to search for flat local minima of the base training objective function. For any parameter vector in the flat region around the minima, the loss is small, and the base classes are supposed to be well separated. The flat local minima can be found by adding random noise to the model parameters for multiple times and jointly optimizing multiple loss functions. During the following incremental few-shot learning stage, we fine-tune the model parameters within the flat region, which can be achieved by clamping the parameters after updating them on few-shot tasks. In this way, the model can efficiently learn new classes while preserving the old ones. Our key contributions are summarized as follows:
|
| 18 |
+
|
| 19 |
+
• We conduct a comprehensive empirical study on existing incremental few-shot learning methods and discover that a simple baseline model that only trains on base classes outperforms state-of-the-art methods, which demonstrates the severity of catastrophic forgetting. • We propose a novel approach for incremental few-shot learning by addressing the catastrophic forgetting problem in the primitive stage. Through finding the flat minima region during training on base classes and fine-tuning within the region while learning on new tasks, our model can overcome catastrophic forgetting and avoid overfitting. • Comprehensive experimental results on CIFAR-100, miniImageNet, and CUB-200-2011 show that our approach outperforms all state-of-the-art methods and achieves performance that is very close to the approximate upper bound.
|
| 20 |
+
|
| 21 |
+
# 2 Related Work
|
| 22 |
+
|
| 23 |
+
Few-shot learning aims to learn to generalize to new categories with a few labeled samples in each class. Current few-shot methods mainly include optimization-based methods [12, 23, 32, 39, 45, 46, 55] and metric-based methods [13, 19, 44, 49, 52, 58, 57, 53]. Optimization-based methods can achieve fast adaptation to new tasks with limited samples by learning a specific optimization algorithm. Metric-based approaches exploit different distance metrics such as L2 distance [44], cosine similarity [49], and DeepEMD [58] in the learned metric/embedding space to measure the similarity between samples. Recently, Tian et al. [48] find that standard supervised training can learn a good metric space for unseen classes, which echoes with our observation on the proposed baseline model in Sec. 3.
|
| 24 |
+
|
| 25 |
+
Incremental learning focuses on the challenging problem of continually learning to recognize new classes in new coming data without forgetting old classes [6, 7, 10, 51]. Previous research mainly includes multi-class incremental learning [4, 38, 22, 33, 54, 51] and multi-task incremental learning [21, 31, 42]. To overcome the catastrophic forgetting problem, some attempts propose to impose strong constraints on model parameters by penalizing the changes of parameters [28, 1]. Other attempts try to enforce constraints on the exemplars of old classes by restricting the output logits [40] or penalizing the changes of embedding angles [20]. In this work, our empirical study shows that imposing strong constraints on the arriving new classes may not be a promising way to tackle incremental few-shot learning, due to the scarcity of training data for new classes.
|
| 26 |
+
|
| 27 |
+
Incremental few-shot learning [47, 41, 60, 9, 8] aims to incrementally learn from very few samples. TOPCI [47] proposes a neural gas network to learn and preserve the topology of the feature manifold formed by different classes. FSLL [34] only selects few model parameters for incremental learning and ensures the parameters are close to the optimal ones. To overcome catastrophic forgetting, IDLVQC [8] imposes constraints on the saved exemplars of each class by restricting the embedding drift, and Zhang et al. [59] propose to fix the embedding network for incremental learning. Similar to the finding of Zhang et al., we also discover that an intransigent model that simply does not adapt to new tasks can outperform prior state-of-the-art methods.
|
| 28 |
+
|
| 29 |
+
Robust optimization. It has been found that flat local minima leads to better generalization capabilities than sharp minima in the sense that a flat minimizer is more robust when the test loss is shifted due to random perturbations [18, 17, 24]. A substantial body of methods [2, 37, 11, 15] have been proposed to optimize neural networks towards flat local minima. In this paper, we show that for incremental few-shot learning, finding flat minima in the base session and tuning the model within the flat region on new tasks can significantly mitigate catastrophic forgetting.
|
| 30 |
+
|
| 31 |
+
# 3 Severity of Catastrophic Forgetting in Incremental Few-Shot Learning
|
| 32 |
+
|
| 33 |
+
# 3.1 Problem Statement
|
| 34 |
+
|
| 35 |
+
Incremental few-shot learning (IFL) aims to continually learn to recognize new classes with only few examples. Similar to incremental learning $\left( \operatorname { I L } \right)$ , an IFL model is trained by a sequence of training sessions $\{ \mathcal { D } ^ { 1 } , \cdots , \mathcal { D } ^ { t } \}$ , where $\mathcal { D } ^ { t } = \{ z _ { i } = ( x _ { i } ^ { t } , y _ { i } ^ { t } ) \} _ { i }$ is the training data of session $t$ and $\ v x _ { i } ^ { t }$ is an example of class $y _ { i } ^ { t } \in \mathcal { C } ^ { t }$ (the class set of session $t$ ). In IFL, the base session $\mathcal { D } ^ { 1 }$ usually contains a large number of classes with sufficient training data for each class, while the following sessions $\left( t \geq 2 \right)$ ) only have a small number of classes with few training samples per class, e.g., $\bar { \mathcal { D } } ^ { t }$ is often presented as an $N$ -way $K$ -shot task with small $N$ and $K$ . The key difference between $\mathrm { I L }$ and IFL is, for $\mathrm { I L }$ , sufficient training data is provided in each session. Similar to $\mathrm { I L }$ , in each training session $t$ of IFL, the model has only access to the training data $\mathcal { D } ^ { t }$ and possibly a small amount of saved exemplars from previous sessions. When the training of session $t$ is completed, the model is evaluated on test samples from all encountered classes ${ \mathcal { C } } = \textstyle \bigcup _ { i = 1 } ^ { t } { \mathcal { C } } ^ { i }$ , where it is assumed that there is no overlap between the classes of different sessions, i.e., $\forall i , j$ and $i \neq j$ , ${ \mathcal { C } } ^ { i } \cap { \mathcal { C } } ^ { j } = \emptyset$ .
|
| 36 |
+
|
| 37 |
+
Catastrophic forgetting. IFL is undoubtedly a more challenging problem than $\mathrm { I L }$ due to the data scarcity setting. IL suffers from catastrophic forgetting, a well-known phenomenon and long-standing issue, which refers to the drastic drop in test performance on previous (old) classes, caused by the inaccessibility of old data in the current training session. Unfortunately, catastrophic forgetting is an even bigger issue for IFL, because data scarcity makes it difficult to adapt well to new tasks and learn new concepts, while the adaptation process could easily lead to the forgetting of base classes. In the following, we illustrate this point by evaluating a simple baseline model for IFL.
|
| 38 |
+
|
| 39 |
+
# 3.2 A Simple Baseline Model for IFL
|
| 40 |
+
|
| 41 |
+
We consider an intransigent model that simply does not adapt to new tasks. Particularly, the model only needs to be trained in the base session $\bar { \mathcal { D } } ^ { 1 }$ and is directly used for inference in all sessions.
|
| 42 |
+
|
| 43 |
+
Training $( t = 1$ ). We train a feature extractor $f$ parameterized by $\phi$ with a fully-connected layer as classifier by minimizing the standard cross-entropy loss using the training examples of $\mathcal { D } ^ { 1 }$ . The feature extractor $f$ is fixed for the following sessions $\left( t \geq 2 \right)$ ) without any fine-tuning on new classes.
|
| 44 |
+
|
| 45 |
+
Inference (test). In each session, the inference is conducted by a simple nearest class mean (NCM) classification algorithm [36]. Specifically, all the training and test samples are mapped to the embedding space of the feature extractor $f$ , and Euclidean distance $d ( \cdot , \cdot )$ is used to measure the similarity between them. The classifier is given by
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
c _ { k } ^ { \star } = \operatorname * { a r g m i n } _ { c \in \mathcal { C } } d ( f ( x ; \phi ) , p _ { c } ) , \mathrm { ~ w h e r e ~ } p _ { c } = \frac { 1 } { N _ { c } } \sum _ { i } \mathbb { 1 } ( y _ { i } = c ) f ( x _ { i } ; \phi ) ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\mathcal { C }$ denotes all the encountered classes, $p _ { c }$ refers to the prototype of class $c$ (the mean vector of all the training samples of class $c$ in the embedding space), and $N _ { c }$ denotes the number of the training images of class $c$ . Note that we save the prototypes of all classes in ${ \mathcal { C } } ^ { t }$ for later evaluation.
|
| 52 |
+
|
| 53 |
+
The baseline model outperforms state-of-the-art IFL and IL methods. We compare the above baseline model against state-of-the-art IFL methods including FSLL [34], IDLVQC [8] and TOPIC [47], IL methods including Rebalance [20] and iCarl [40], and a joint-training method that uses all previously seen data including the base and the following few-shot tasks for training, for IFL. The performance is evaluated on miniImageNet, CIFAR-100, and CUB-200. We tune the methods re-implemented by us to the best performance. For the other methods, we use the results reported in the original papers. The experimental details are provided in Sec. 5. As shown in Fig. 1, the baseline model consistently outperforms all the compared methods including the joint-training method (which suffers from severe data imbalance) on every dataset3. The fact that an intransigent model performs best suggests that
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 1: Comparison of the proposed baseline model with state-of-the-art IFL and $\mathrm { I L }$ methods and the joint-training method.The baseline model outperforms all the other methods.
|
| 57 |
+
|
| 58 |
+
• For IFL, preserving the old (base classes) may be more critical than adapting to the new. Due to data scarcity, the performance gain on new classes is limited and cannot make up for the significant performance drop on base classes. • Prior works [47, 8, 34, 20, 40] that enforce strong constraints on model parameters or exemplars during fine-tuning on new classes cannot effectively prevent catastrophic forgetting in IFL, indicating that actions may need to be taken in the base training stage.
|
| 59 |
+
|
| 60 |
+
# 4 Overcoming Catastrophic Forgetting in IFL by Finding Flat Minima
|
| 61 |
+
|
| 62 |
+
The goal of IFL is to preserve the old while adapting to the new efficiently. The results and analysis in Sec. 3 suggest that it might be “a bit late” to try to prevent catastrophic forgetting in the few-shot learning sessions $\left( t \geq 2 \right)$ ), which motivates us to consider this problem in the base training session.
|
| 63 |
+
|
| 64 |
+
Overview of our approach. To overcome catastrophic forgetting in IFL, we propose to find a $b$ -flat $( b > 0$ ) local minima $\theta ^ { \star }$ of the base training objective function and then fine-tune the model within the flat region in later few-shot learning sessions. Specifically, for any parameter vector $\theta$ in the flat region, i.e., $\theta ^ { \star } - b \preceq \theta \preceq \theta ^ { \star } + b$ , the risk (loss) of the base classes is minimized such that the classes are well separated in the embedding space of $f _ { \theta }$ . In the later incremental few-shot learning sessions $\left( t \geq 2 \right)$ ), we fine-tune the model parameters within this region to learn new classes, i.e., to find
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\theta ^ { \prime } = \arg \operatorname* { m i n } _ { \theta } \sum _ { z \in \mathcal { D } ^ { t } } \mathcal { L } ( z ; \theta ) , \mathrm { s . t . } \theta ^ { \star } - b \preceq \theta \preceq \theta ^ { \star } + b .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
As such, the fine-tuned model $\theta ^ { \prime }$ can adapt to new classes while preserving the old ones. Also, due to the nature of few-shot learning, to avoid excessive training and overfitting, it suffices to tune the model in a relatively small region. A graphical illustration of our approach and prior arts, as well as the notions of sharp minima and flat minima, are presented in Fig. 2.
|
| 71 |
+
|
| 72 |
+
# 4.1 Searching for Flat Local Minima in the Base Training Stage
|
| 73 |
+
|
| 74 |
+
A formal definition of $b$ -flat local minima is given as follows.
|
| 75 |
+
|
| 76 |
+
Definition 1 ( $b$ -Flat Local Minima). Given a real-valued objective function $\mathcal { L } ( z ; \theta )$ , for any $b > 0$ , $\theta ^ { \star }$ is a $b$ -flat local minima of $\mathcal { L } ( z ; \theta )$ , if the following conditions are satisfied.
|
| 77 |
+
|
| 78 |
+
• Condition 1: $\mathcal { L } ( z ; \theta ^ { \star } ) = \mathcal { L } ( z ; \theta ^ { \star } + \epsilon )$ , where $- \mathbf { b } \preceq \epsilon \preceq \mathbf { b }$ and $\mathbf { b } _ { i } = b$ .
|
| 79 |
+
|
| 80 |
+
• Condition 2: there exist $\mathbf { c } _ { 1 } \prec \theta ^ { \star } - b$ and ${ \bf c } _ { 2 } \succ \theta ^ { \star } + b ,$ , s.t. $\mathcal { L } ( z ; \theta ) > \mathcal { L } ( z ; \theta ^ { \star } )$ , where $\mathbf { c } _ { 1 } \prec \theta \prec \theta ^ { \star } - b$ and $\mathcal { L } ( z ; \theta ^ { \star } ) < \mathcal { L } ( z ; \theta )$ , where $\theta ^ { \star } + b \prec \theta \prec \mathbf { c } _ { 2 }$ .
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 2: Illustration of our approach and existing solutions. indicates the incremental learning steps on new classes. $R _ { 1 }$ and $R _ { 2 }$ respectively denote the loss of base classes before and after minimizing the loss of new classes. (a) SGD finds sharp minima in the base training. Directly tuning the model on new classes will result in a severe performance drop on base classes. (b) Enforcing strong constraints on parameters by penalizing parameter changes [1, 28, 34] may still lead to a significant performance drop on base classes. (c) Finding flat local minima of base classes and clamping the parameters after trained on new classes to make them fall within the flat region can effectively mitigate catastrophic forgetting.
|
| 84 |
+
|
| 85 |
+
In practice, it is hard to find the flat local minima that strictly satisfies the above definition, which may not even exist. Hence, our goal is to find an approximately flat local minima of the base training objective function. To this end, we propose to add some small random noise to the model parameters. The noise can be added for multiple times to obtain similar but different loss functions, which will be optimized together to locate the flat minima region. The intuition is clear – the parameter vectors around the flat local minima also have small function values.
|
| 86 |
+
|
| 87 |
+
To formally state the idea, we assume that the model is parameterized by $\theta = \{ \phi , \psi \}$ , where $\phi$ denotes the parameters of the embedding network and $\psi$ denotes the parameters of the classifier. $z$ denotes a labelled training sample. Denote the loss function by $\mathcal { L } \colon \dot { \mathbb { R } } ^ { d _ { z } } \mathbb { R }$ . Our target is to minimize the expected loss function $R$ $\ ? \colon \mathbb { R } ^ { d } \mathbb { R }$ w.r.t. the joint distribution of data $z$ and noise $\epsilon$ , i.e.,
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
R ( \theta ) = \int _ { \mathbb { R } ^ { d _ { \epsilon } } } \int _ { \mathbb { R } ^ { d _ { z } } } \mathcal { L } ( z ; \phi + \epsilon , \psi ) d P ( z ) d P ( \epsilon ) = \mathbb { E } [ \mathcal { L } ( z ; \phi + \epsilon , \psi ) ] ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $P ( z )$ is the data distribution and $P ( \epsilon )$ is the noise distribution, and $z$ and $\epsilon$ are independent. Since it is impossible to minimize the expected loss, we minimize its estimation, the empirical loss, which is given by
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathcal { L } ( \theta ) = \frac { 1 } { M } \sum _ { j = 1 } ^ { M } \mathcal { L } _ { \mathrm { b a s e } } ( z ; \phi + \epsilon _ { j } , \psi ) , \mathrm { w h e r e }
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { \mathrm { b a s e } } ( z ; \phi + \epsilon _ { j } , \psi ) = \frac { 1 } { | \mathcal { D } ^ { 1 } | } \sum _ { z \in \mathcal { D } ^ { 1 } } \mathcal { L } _ { c e } ( z ; \phi + \epsilon _ { j } , \psi ) + \lambda \frac { 1 } { | \mathcal { C } ^ { 1 } | } \sum _ { c \in \mathcal { C } ^ { 1 } } \| p _ { c } - p _ { c } ^ { * } \| _ { 2 } ^ { 2 } ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\epsilon _ { j }$ is a noise vector sampled from $P ( \epsilon )$ , $M$ is the sampling times, $\mathcal { L } _ { c e } ( z ; \phi + \epsilon _ { j } , \psi )$ refers to the cross-entropy loss of a training sample $z$ , and $p _ { c }$ and $p _ { c } ^ { * }$ are the class prototypes before and after injecting noise respectively. The first term of $\mathcal { L } _ { b a s e }$ is designed to find the flat region where the parameters $\phi$ of the embedding network can well separate the base classes. The second term enforces the class prototypes fixed within such region, which is designed to solve the prototype drift problem [54, 8] (the class prototypes change after updating the network) in later incremental learning sessions such that the saved base class prototypes can be directly used for evaluation in later sessions.
|
| 104 |
+
|
| 105 |
+
# 4.2 Incremental Few-shot Learning within the Flat Region
|
| 106 |
+
|
| 107 |
+
In the incremental few-shot learning sessions $\left( t \geq 2 \right)$ ), we fine-tune the parameters $\phi$ of the embedding network within the flat region to learn new classes. It is worth noting that while the flat region might be relatively small, it is enough for incremental few-shot learning. Because only few training samples are provided for each new class, to prevent overfitting in few-shot learning, excessive training should be avoided and only a small number of update iterations should be applied.
|
| 108 |
+
|
| 109 |
+
# Algorithm 1: F2M
|
| 110 |
+
|
| 111 |
+
Input: the flat region bound $b$ , randomly initialized $\theta = \{ \phi , \psi \}$ , the step sizes $\alpha$ and $\beta$ .
|
| 112 |
+
// Training over base classes $t = 1$
|
| 113 |
+
for epoch $k = 1 , 2 , \dots$ do for $j = 1 , 2 , . . . , M$ do Sample a noise vector $\epsilon _ { j } \sim P ( \epsilon )$ , s.t. $- \mathbf { b } \preceq \epsilon _ { j } \preceq \mathbf { b }$ ; Add the noise to the parameters of the embedding network, i.e., $\theta = \{ \phi + \epsilon _ { j } , \psi \}$ ; Compute the base loss $\mathcal { L } _ { b a s e }$ with Eq. 4; Reset the parameters, i.e., $\theta = \{ \phi , \psi \}$ ; end Update $\theta = \theta - \alpha \nabla { \mathcal { L } } ( \theta )$ with the loss $\mathcal { L }$ defined in Eq. 3.
|
| 114 |
+
end
|
| 115 |
+
Normalize and save the prototype of each base class;
|
| 116 |
+
// Incremental learning $t \geq 2$
|
| 117 |
+
Combine the training data $\mathcal { D } ^ { t }$ and the exemplars saved in previous few-shot sessions $2 \leq t _ { e } < t$ ;
|
| 118 |
+
for epoch $k = 1 , 2 , . .$ . do Compute the metric-based classification loss ${ \mathcal { L } } _ { m }$ by Eq. 5; Update $\phi = \phi - \beta \nabla \mathcal { L } _ { m } ( z ; \phi )$ ; Clamp the parameters $\phi$ to ensure they fall in the flat minima region;
|
| 119 |
+
end
|
| 120 |
+
Randomly select and save a few exemplars from the training data $\mathcal { D } ^ { t }$ ;
|
| 121 |
+
Normalize and save the prototype of each new class;
|
| 122 |
+
Output: Model parameters $\theta = \{ \phi , \psi \}$ .
|
| 123 |
+
|
| 124 |
+
We employ a metric-based classification algorithm with Euclidean distance to fine-tune the parameters. The loss function is defined as
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\mathcal { L } _ { m } ( z ; \phi ) = - \sum _ { z \in \mathcal { D } } \sum _ { c \in \mathcal { C } } \mathbb { 1 } ( y = c ) \log \big ( \frac { e ^ { - d ( p _ { c } , f ( x ; \phi ) ) } } { \sum _ { c _ { k } \in \mathcal { C } } e ^ { - d ( p _ { c _ { k } } , f ( x ; \phi ) ) } } \big ) , z
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $d ( \cdot , \cdot )$ denotes Euclidean distance, $p _ { c }$ is the prototype of class $c$ , $\textstyle { \mathcal { C } } = \bigcup _ { i = 1 } ^ { t } { \mathcal { C } } ^ { i }$ refers to all encountered classes, and ${ \mathcal { D } } = { \mathcal { D } } ^ { t } \cup { \mathcal { P } }$ denotes the union of the current training data $\mathcal { D } ^ { t }$ and the exemplar set $\mathcal { P } = \{ P _ { 2 } , . . . , P _ { t - 1 } \}$ , where $P _ { t _ { e } } ( 2 \leq t _ { e } < t )$ is the set of saved exemplars in session $t _ { e }$ . Note that the prototypes of new classes are computed by Eq. 1, and those of base classes are saved in the base session. After updating the embedding network parameters, we clamp them to ensure that they fall within the flat region, i.e. $\phi ^ { \star } - b \preceq \phi \preceq \phi ^ { \star } + b$ , where $\phi ^ { \star }$ denotes the optimal parameter vector learned in the base session. After fine-tuning, we evaluate the model using the nearest class mean classifier as in Eq. 1, with previously saved prototypes and newly computed ones. The whole training process is described in Algorithm 1. Note that to calibrate the estimates of the classifier, we normalize all prototypes to make those of base classes and those of new classes have the same norm.
|
| 131 |
+
|
| 132 |
+
# 4.3 Convergence Analysis
|
| 133 |
+
|
| 134 |
+
Our aim is to find a flat region within which all parameter vectors work well. We then minimize the expected loss w.r.t. the joint distribution of noise $\epsilon$ and data $z$ . To approximate this expected loss, we sample from $P ( \epsilon )$ for multiple times in each iteration and optimize the objective function using stochastic gradient descent (SGD). Here, we provide theoretical guarantees for our method. Given the non-convex loss function in Eq. 3, we prove the convergence of our proposed method. The proof idea is inspired by the convergence analysis of SGD [3, 27].
|
| 135 |
+
|
| 136 |
+
Formally, in each batch $k$ , let $z _ { k }$ denote the batch data, $\{ \epsilon _ { j } \} _ { j = 1 } ^ { M }$ be the sampled noises, and $\alpha _ { k }$ be the step size. In the base training session, we update the model parameters as follows:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\theta _ { k + 1 } = \theta _ { k } - \frac { \alpha _ { k } } { M } \sum _ { j = 1 } ^ { M } \nabla \mathcal { L } _ { \mathrm { b a s e } } \big ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } \big ) = \theta _ { k } - \frac { \alpha _ { k } } { M } \sum _ { j = 1 } ^ { M } g \big ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } \big ) ,
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $g ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } ) = \nabla { \mathcal { L } } _ { \mathrm { b a s e } } ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } )$ is the gradient. To formally analyze the convergence of our algorithm, we define the following assumptions.
|
| 143 |
+
|
| 144 |
+
Assumption 4.1 (L-smooth risk function). The expected loss function $R : \mathbb { R } ^ { d } \mathbb { R }$ (Eq. 2) is continuously differentiable and $L$ -smooth with constant $L > 0$ such that
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\| \nabla R ( \theta ) - \nabla R ( \theta ^ { \prime } ) \| _ { 2 } \leq L \| \theta - \theta ^ { \prime } \| .
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
This assumption is significant for the convergence analysis of gradient-based optimization algorithms, since it limits how fast the gradient of the loss function can change w.r.t. the parameter vector.
|
| 151 |
+
|
| 152 |
+
Assumption 4.2. The expected loss function satisfies the following conditions:
|
| 153 |
+
|
| 154 |
+
• Condition 1: $R$ is bounded below by a scalar $R ^ { \star }$ , given the sequence of parameters $\{ \theta _ { k } \}$
|
| 155 |
+
|
| 156 |
+
• Condition 2: For all $k \in \mathbb N$ and $j \in [ 1 , M ]$ ,
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\begin{array} { r } { \mathbb { E } _ { z _ { k } , \epsilon _ { j } } \big [ g \big ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } \big ) \big ] = \nabla R ( \theta _ { k } ) . } \end{array}
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
• Condition $^ 3$ : There exist scalars $m _ { 1 } \geq 0$ and $m _ { 2 } \geq 0 ,$ , for all $k \in \mathbb N$ and $j \in [ 1 , M ]$ ,
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\begin{array} { r } { \mathbb { V } _ { z _ { k } , \epsilon _ { j } } [ g ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } ) ] \le m _ { 1 } + m _ { 2 } \| \nabla R ( \theta _ { k } ) \| _ { 2 } ^ { 2 } . } \end{array}
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
$\mathbb { E } _ { z _ { k } , \epsilon _ { j } } [ \cdot ]$ denotes the expectation w.r.t. the joint distribution of random variables $z _ { k }$ and $\epsilon _ { j }$ , and $\mathbb { V } _ { z _ { k } , \epsilon _ { j } } [ \cdot ]$ denotes the variance. Condition 1 ensures that the expected loss $R$ is bounded by a minimum value $R ^ { \star }$ during the updates, which is a natural and practical assumption. Condition 2 assumes that the gradient $g ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } )$ is an unbiased estimate of $\nabla R ( \theta _ { k } )$ . This is a strict assumption made to simplify the proof, but it can be easily relaxed to a general and easily-met condition that there exist $\mu _ { 1 } \geq \mu _ { 2 } > 0$ satisfying $\| \mathbb { E } _ { z _ { k } , \epsilon _ { j } } [ \bar { g ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } ) } ] \| _ { 2 } \leq \mu _ { 1 } \| \nabla \bar { R ( \theta _ { k } ) } \| _ { 2 }$ and $\nabla R ( \theta _ { k } ) ^ { T } \mathbb { E } _ { z _ { k } , \epsilon _ { j } } [ g ( \underline { { z _ { k } } } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } ) ] \geq \mu _ { 2 } \| \nabla R ( \theta _ { k } ) \| _ { 2 } ^ { 2 }$ . Therefore, the convergence can be proved in a similar way using the techniques presented in the Appendix. Condition 3 assumes the variance of the gradient $g ( z _ { k } ; \phi _ { k } + \epsilon _ { j } , \psi _ { k } )$ cannot be arbitrarily large, which is also reasonable in practice. To facilitate later analysis, similar to [43], we restrict the step sizes as follows.
|
| 169 |
+
|
| 170 |
+
Assumption 4.3. The learning rates satisfy:
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\sum _ { k = 1 } ^ { \infty } \alpha _ { k } = \infty , \ \sum _ { k = 1 } ^ { \infty } \alpha _ { k } ^ { 2 } < \infty .
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
This assumption can be easily met, since in practice the learning rate $\alpha _ { k }$ is usually far less than 1 and decreases w.r.t. $k$ . Based on the above assumptions, we can derive the following theorem.
|
| 177 |
+
|
| 178 |
+
Theorem 4.1. Under assumptions 4.1, 4.2 and 4.3, we further assume that the risk function $R$ is twice differentiable, and that $\| \nabla R ( \theta ) \| _ { 2 } ^ { 2 }$ is $L _ { 2 }$ -smooth with constant $L _ { 2 } > 0$ , then we have
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\operatorname* { l i m } _ { k \to \infty } \mathbb { E } [ \| \nabla R ( \theta _ { k } ) \| _ { 2 } ^ { 2 } ] = 0 .
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
This theorem establishes the convergence of our algorithm. The proof is provided in Appendix A.1.
|
| 185 |
+
|
| 186 |
+
# 5 Experiments
|
| 187 |
+
|
| 188 |
+
In this section, we empirically evaluate our proposed method for incremental few-shot learning and demonstrate its effectiveness by comparison with state-of-the-art methods.
|
| 189 |
+
|
| 190 |
+
# 5.1 Experimental Setup
|
| 191 |
+
|
| 192 |
+
Datasets. For CIFAR-100 and miniImageNet, we randomly select 60 classes as the base classes and the remaining 40 classes as the new classes. In each incremental learning session, we construct 5-way 5-shot tasks by randomly picking 5 classes and sampling 5 examples for each class. For CUB-200-2011 with 200 classes, we select 100 classes as the base classes and 100 classes as the new ones. We test 10-way 5-shot tasks on this dataset.
|
| 193 |
+
|
| 194 |
+
Baselines. We compare our method F2M with 8 methods: the Baseline proposed in Sec. 3, a jointtraining method that uses all previously seen data including the base and the following few-shot tasks for training, the classifier re-training method (cRT) [25] for long-tailed classification trained with all encountered data, iCaRL [40], Rebalance [20], TOPIC [47], FSLL [34], and IDLVQ-C [8]. For a fair comparison, we re-implement cRT [25], iCaRL [40], Rebalance [20], FSLL [34], and the joint-training method and tune them to their best performance. We also provide the results reported in the original papers for comparison. The results of TOPIC [47] and IDLVQ-C [8] are copied from the original papers. Note that for IL, joint-training is naturally the upper bound of incremental learning algorithms, however, for IFL, joint-training is not a good approximation of the upper bound because data imbalance makes the model perform significantly poorer on new classes (long-tailed classes). To address the data imbalance issue, we re-implement the cRT method as the approximate upper bound.
|
| 195 |
+
|
| 196 |
+
Table 1: Classification accuracy on CIFAR-100 for 5-way 5-shot incremental learning. ∗ indicates our re-implementation.
|
| 197 |
+
|
| 198 |
+
<table><tr><td rowspan="2">Method</td><td colspan="9">sessions</td><td rowspan="2">The gap with cRT</td></tr><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td></tr><tr><td>cRT[25]*</td><td>65.18</td><td>63.89</td><td>60.20</td><td>57.23</td><td>53.71</td><td>50.39</td><td>48.77</td><td>47.29</td><td>45.28</td><td>=</td></tr><tr><td>Joint-training*</td><td>65.18</td><td>61.45</td><td>57.36</td><td>53.68</td><td>50.84</td><td>47.33</td><td>44.79</td><td>42.62</td><td>40.08</td><td>-5.20</td></tr><tr><td>Baseline</td><td>65.18</td><td>61.67</td><td>58.61</td><td>55.11</td><td>51.86</td><td>49.43</td><td>47.60</td><td>45.64</td><td>43.83</td><td>-1.45</td></tr><tr><td>iCaRL[40]*</td><td>66.52</td><td>57.26</td><td>54.27</td><td>50.62</td><td>47.33</td><td>44.99</td><td>43.14</td><td>41.16</td><td>39.49</td><td>-5.79</td></tr><tr><td>Rebalance [20]*</td><td>66.66</td><td>61.42</td><td>57.29</td><td>53.02</td><td>48.85</td><td>45.68</td><td>43.06</td><td>40.56</td><td>38.35</td><td>-6.93</td></tr><tr><td>FSLL [34]*</td><td>65.18</td><td>56.24</td><td>54.55</td><td>51.61</td><td>49.11</td><td>47.27</td><td>45.35</td><td>43.95</td><td>42.22</td><td>-3.08</td></tr><tr><td>iCaRL[40]</td><td>64.10</td><td>53.28</td><td>41.69</td><td>34.13</td><td>27.93</td><td>25.06</td><td>20.41</td><td>15.48</td><td>13.73</td><td>-31.55</td></tr><tr><td>Rebalance [20]</td><td>64.10</td><td>53.05</td><td>43.96</td><td>36.97</td><td>31.61</td><td>26.73</td><td>21.23</td><td>16.78</td><td>13.54</td><td>-31.74</td></tr><tr><td>TOPIC [47]</td><td>64.10</td><td>55.88</td><td>47.07</td><td>45.16</td><td>40.11</td><td>36.38</td><td>33.96</td><td>31.55</td><td>29.37</td><td>-15.91</td></tr><tr><td>FSLL [34]</td><td>64.10</td><td>55.85</td><td>51.71</td><td>48.59</td><td>45.34</td><td>43.25</td><td>41.52</td><td>39.81</td><td>38.16</td><td>-7.12</td></tr><tr><td>FSLL+SS [34]</td><td>66.76</td><td>55.52</td><td>52.20</td><td>49.17</td><td>46.23</td><td>44.64</td><td>43.07</td><td>41.20</td><td>39.57</td><td>-5.71</td></tr><tr><td>F2M</td><td>64.71</td><td>62.05</td><td>59.01</td><td>55.58</td><td>52.55</td><td>49.96</td><td>48.08</td><td>46.28</td><td>44.67</td><td>-0.61</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Table 2: Classification accuracy on miniImageNet for 5-way 5-shot incremental learning. ∗ indicates our re-implementation.
|
| 201 |
+
|
| 202 |
+
<table><tr><td rowspan="2">Method</td><td colspan="9">sessions</td><td rowspan="2">The gap with cRT</td></tr><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td></tr><tr><td>cRT[25]*</td><td>67.30</td><td>64.15</td><td>60.59</td><td>57.32</td><td>54.22</td><td>51.43</td><td>48.92</td><td>46.78</td><td>44.85</td><td>=</td></tr><tr><td>Joint-training*</td><td>67.30</td><td>62.34</td><td>57.79</td><td>54.08</td><td>50.93</td><td>47.65</td><td>44.64</td><td>42.61</td><td>40.29</td><td>-4.56</td></tr><tr><td>Baseline</td><td>67.30</td><td>63.18</td><td>59.62</td><td>56.33</td><td>53.28</td><td>50.50</td><td>47.96</td><td>45.85</td><td>43.88</td><td>-0.97</td></tr><tr><td>iCaRL [40]*</td><td>67.35</td><td>59.91</td><td>55.64</td><td>52.60</td><td>49.43</td><td>46.73</td><td>44.13</td><td>42.17</td><td>40.29</td><td>-4.56</td></tr><tr><td>Rebalance [20]*</td><td>67.91</td><td>63.11</td><td>58.75</td><td>54.83</td><td>50.68</td><td>47.11</td><td>43.88</td><td>41.19</td><td>38.72</td><td>-6.13</td></tr><tr><td>FSLL [34]*</td><td>67.30</td><td>59.81</td><td>57.26</td><td>54.57</td><td>52.05</td><td>49.42</td><td>46.95</td><td>44.94</td><td>42.87</td><td>-1.11</td></tr><tr><td>iCaRL[40]</td><td>61.31</td><td>46.32</td><td>42.94</td><td>37.63</td><td>30.49</td><td>24.00</td><td>20.89</td><td>18.80</td><td>17.21</td><td>-27.64</td></tr><tr><td>Rebalance [20]</td><td>61.31</td><td>47.80</td><td>39.31</td><td>31.91</td><td>25.68</td><td>21.35</td><td>18.67</td><td>17.24</td><td>14.17</td><td>-30.68</td></tr><tr><td>TOPIC [47]</td><td>61.31</td><td>50.09</td><td>45.17</td><td>41.16</td><td>37.48</td><td>35.52</td><td>32.19</td><td>29.46</td><td>24.42</td><td>-20.43</td></tr><tr><td>FSLL [34]</td><td>66.48</td><td>61.75</td><td>58.16</td><td>54.16</td><td>51.10</td><td>48.53</td><td>46.54</td><td>44.20</td><td>42.28</td><td>-2.57</td></tr><tr><td>FSLL+SS[34]</td><td>68.85</td><td>63.14</td><td>59.24</td><td>55.23</td><td>52.24</td><td>49.65</td><td>47.74</td><td>45.23</td><td>43.92</td><td>-0.93</td></tr><tr><td>IDLVQ-C[8]</td><td>64.77</td><td>59.87</td><td>55.93</td><td>52.62</td><td>49.88</td><td>47.55</td><td>44.83</td><td>43.14</td><td>41.84</td><td>-3.01</td></tr><tr><td>F2M</td><td>67.28</td><td>63.80</td><td>60.38</td><td>57.06</td><td>54.08</td><td>51.39</td><td>48.82</td><td>46.58</td><td>44.65</td><td>-0.20</td></tr></table>
|
| 203 |
+
|
| 204 |
+
Experimental details. The experiments are conducted with NVIDIA GPU RTX3090 on CUDA 11.0. We randomly split each dataset into multiple tasks (sessions). For each dataset (with a fixed split), we run each algorithm for 10 times and report the mean accuracy. We adopt ResNet18 [16] as the backbone network. For data augmentation, we use standard random crop and horizontal flip. In the base training stage, we select the last 4 or 8 convolution layers to inject noise, because these layers output higher-level feature representations. The flat region bound $b$ is set as 0.01. We set the number of times for noise sampling as $M = 2 \sim 4$ , since a larger $M$ will increase the training time. In each incremental few-shot learning session, the total number of training epochs is 6, and the learning rate is 0.02. To verify the correctness of our implementation, we conduct experiments on incremental learning and compare our results to those reported on CIFAR-100 in Appendix A.3. More experiment details are provided in Appendix A.2.
|
| 205 |
+
|
| 206 |
+
Table 3: Classification accuracy on CUB-200-2011 for 10-way 5-shot incremental learning.∗ indicates our re-implementation.
|
| 207 |
+
|
| 208 |
+
<table><tr><td rowspan="2">Method</td><td colspan="10">sessions</td><td rowspan="2">The gap with cRT</td></tr><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td></tr><tr><td>cRT[25]*</td><td>80.83</td><td>78.51</td><td>76.12</td><td>73.93</td><td>71.46</td><td>68.96</td><td>67.73</td><td>66.75</td><td>64.22</td><td>62.53</td><td>61.08</td><td></td></tr><tr><td>Joint-training*</td><td>80.83</td><td>77.57</td><td>74.11</td><td>70.75</td><td>68.52</td><td>65.97</td><td>64.58</td><td>62.22</td><td>60.18</td><td>58.49</td><td>56.78</td><td>-4.30</td></tr><tr><td>Baseline</td><td>80.87</td><td>77.15</td><td>74.46</td><td>72.26</td><td>69.47</td><td>67.18</td><td>65.62</td><td>63.68</td><td>61.30</td><td>59.72</td><td>58.12</td><td>-2.96</td></tr><tr><td>iCaRL [40]*</td><td>79.58</td><td>67.63</td><td>64.17</td><td>61.80</td><td>58.10</td><td>55.51</td><td>53.34</td><td>50.89</td><td>48.62</td><td>47.34</td><td>45.60</td><td>-15.48</td></tr><tr><td>Rebalance [20]*</td><td>80.94</td><td>70.32</td><td>62.96</td><td>57.19</td><td>51.06</td><td>46.70</td><td>44.03</td><td>40.15</td><td>36.75</td><td>34.88</td><td>32.09</td><td>-28.99</td></tr><tr><td>FSLL [34]*</td><td>80.83</td><td>77.38</td><td>72.37</td><td>71.84</td><td>67.51</td><td>65.30</td><td>63.75</td><td>61.16</td><td>59.05</td><td>58.03</td><td>55.82</td><td>-5.26</td></tr><tr><td>iCaRL [40]</td><td>68.68</td><td>52.65</td><td>48.61</td><td>44.16</td><td>36.62</td><td>29.52</td><td>27.83</td><td>26.26</td><td>24.01</td><td>23.89</td><td>21.16</td><td>-39.92</td></tr><tr><td>Rebalance [20]</td><td>68.68</td><td>57.12</td><td>44.21</td><td>28.78</td><td>26.71</td><td>25.66</td><td>24.62</td><td>21.52</td><td>20.12</td><td>20.06</td><td>19.87</td><td>-41.21</td></tr><tr><td>TOPIC[47]</td><td>68.68</td><td>62.49</td><td>54.81</td><td>49.99</td><td>45.25</td><td>41.40</td><td>38.35</td><td>35.36</td><td>32.22</td><td>28.31</td><td>26.28</td><td>-34.80</td></tr><tr><td>FSLL [34]</td><td>72.77</td><td>69.33</td><td>65.51</td><td>62.66</td><td>61.10</td><td>58.65</td><td>57.78</td><td>57.26</td><td>55.59</td><td>55.39</td><td>54.21</td><td>-6.87</td></tr><tr><td>FSLL+SS [34]</td><td>75.63</td><td>71.81</td><td>68.16</td><td>64.32</td><td>62.61</td><td>60.10</td><td>58.82</td><td>58.70</td><td>56.45</td><td>56.41</td><td>55.82</td><td>-5.26</td></tr><tr><td>IDLVQ-C [8]</td><td>77.37</td><td>74.72</td><td>70.28</td><td>67.13</td><td>65.34</td><td>63.52</td><td>62.10</td><td>61.54</td><td>59.04</td><td>58.68</td><td>57.81</td><td>-3.27</td></tr><tr><td>F2M</td><td>81.07</td><td>78.16</td><td>75.57</td><td>72.89</td><td>70.86</td><td>68.17</td><td>67.01</td><td>65.26</td><td>63.36</td><td>61.76</td><td>60.26</td><td>-0.82</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 4: Comparison of the flatness of the local minima found by the Baseline and our F2M.
|
| 211 |
+
|
| 212 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Indicator I</td><td colspan="2">Variance g2</td></tr><tr><td>Training Set</td><td>Testing Set</td><td>Training Set</td><td>Testing Set</td></tr><tr><td>Baseline</td><td>0.2993</td><td>0.4582</td><td>0.1451</td><td>0.2395</td></tr><tr><td>F2M</td><td>0.0506</td><td>0.0800</td><td>0.0296</td><td>0.0334</td></tr></table>
|
| 213 |
+
|
| 214 |
+
# 5.2 Comparison with the State-of-the-Art
|
| 215 |
+
|
| 216 |
+
F2M outperforms the state-of-the-art methods. The main results on CIFAR-100, miniImageNet and CUB-200-2011 are presented in Table 1, Table 2 and Table 3 respectively. Based on the experiment results, we have the following observations: 1) The Baseline introduced in Sec. 3 outperforms the state-of-the-art approaches on all incremental sessions. 2) As expected, cRT consistently outperforms the Baseline up to $1 \%$ to $3 \%$ by considering the data imbalance problem and applying proper techniques to tackle the long-tailed classification problem to improve performance. Hence, it is reasonable to use cRT as the approximate upper bound of IFL. 3) Our F2M outperforms the state-ofthe-art methods and the Baseline. Moreover, the performance of F2M is very close to the approximate upper bound, i.e., the gap with cRT is only $0 . 2 \%$ in the last session on miniImageNet. The results show that even with strong constraints [20, 40, 34] and saved examplars of base classes [20, 40, 8], current methods cannot effectively address the catastrophic forgetting problem. In contrast, finding flat minima seems a promising approach to overcome this harsh problem.
|
| 217 |
+
|
| 218 |
+
# 5.3 Ablation Study and Analysis
|
| 219 |
+
|
| 220 |
+
Analysis on the flatness of local minima. Here, we verify that our method can find a more flat local minima than the Baseline. For a found local minima $\theta ^ { \star }$ , we measure its flatness as follows. We sample the noise for 1000 times. For each time, we inject the sampled noise to $\theta ^ { \star }$ and calculate the loss $\mathcal { L } _ { i }$ . to measure the flatness. Then, we adopt the indicator I = 11000 P1000i=1 $\mathcal { L } ^ { * }$ denotes the loss of $\begin{array} { r } { I = \frac { 1 } { 1 0 0 0 } \sum _ { i = 1 } ^ { 1 0 0 0 } ( \mathcal { L } _ { i } - \mathcal { L } ^ { * } ) ^ { 2 } } \end{array}$ $\theta ^ { \star }$ , and $\overline { { \mathcal { L } } }$ 1000denotes the average loss of and variance $\begin{array} { r } { \sigma ^ { 2 } = \frac { 1 } { 1 0 0 0 } \sum _ { i = 1 } ^ { 1 0 0 0 } ( \mathcal { L } _ { i } - \overline { { \mathcal { L } } } ) ^ { 2 } } \end{array}$ $\{ \mathcal { L } _ { i } \} _ { i = 1 } ^ { 1 0 0 0 }$ . The values of the indicator and variance of F2M and the Baseline are presented in Table 4, which clearly demonstrate that our method can find a more flat local minima.
|
| 221 |
+
|
| 222 |
+
Ablation study on the designs of our method. Here, we study the effectiveness of each design of our method, including adding noise to the model parameters for finding $b$ -flat local minima (FM) during the base training session, the prototype fixing term (PF) used in the base training objective (Eq. 4), parameter clamping (PC) during incremental learning, and prototype normalization (PN). We conduct an ablation study by removing each component in turn and report the experimental results in Table 5.
|
| 223 |
+
|
| 224 |
+
Finding b-flat local minima. Standard supervised training with SGD as the optimizer tends to converge to a sharp local minima. It leads to a significant drop in performance because the loss changes quickly in the neighborhood of the sharp local minima. As shown in Table 5, even with parameter clamping during incremental learning, the performance still drops significantly. In contrast, restricting the parameters in a small flat region can mitigate the forgetting problem.
|
| 225 |
+
|
| 226 |
+
Table 5: Ablation study of our F2M on CIFAR-100. PD refers to the performance dropping rate.
|
| 227 |
+
|
| 228 |
+
<table><tr><td rowspan="2">FM</td><td rowspan="2">PF</td><td rowspan="2">PC</td><td rowspan="2">PN</td><td colspan="10">sessions</td><td rowspan="2">PD↓</td></tr><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td></tr><tr><td rowspan="4">广</td><td></td><td></td><td></td><td>65.18</td><td>60.83</td><td>53.13</td><td>43.57</td><td>23.75</td><td>10.76</td><td>08.26</td><td>07.24</td><td>06.45</td><td>58.73</td></tr><tr><td></td><td>√</td><td></td><td>65.18</td><td>59.48</td><td>56.77</td><td>52.99</td><td>50.09</td><td>47.80</td><td>45.92</td><td>44.20</td><td>42.55</td><td>22.63</td></tr><tr><td>√</td><td></td><td>√</td><td>64.71</td><td>59.54</td><td>53.03</td><td>45.09</td><td>41.68</td><td>39.04</td><td>38.64</td><td>37.19</td><td>36.01</td><td>28.70</td></tr><tr><td></td><td>√</td><td>√</td><td>64.55</td><td>61.27</td><td>58.33</td><td>54.82</td><td>51.60</td><td>49.22</td><td>47.48</td><td>45.78</td><td>44.08</td><td>20.47</td></tr><tr><td>√</td><td>√</td><td>√</td><td></td><td>64.71</td><td>61.75</td><td>58.80</td><td>55.33</td><td>52.27</td><td>49.75</td><td>47.72</td><td>46.01</td><td>44.43</td><td>20.28</td></tr><tr><td>√</td><td></td><td>√</td><td>√</td><td>64.71</td><td>61.99</td><td>58.99</td><td>55.58</td><td>52.55</td><td>49.96</td><td>48.08</td><td>46.28</td><td>44.67</td><td>20.04</td></tr></table>
|
| 229 |
+
|
| 230 |
+
Table 6: Study of the flat region bound $b$ for 5-way 5-shot incremental learning on CIFAR-100. The top 3 results in each row are in boldface.
|
| 231 |
+
|
| 232 |
+
<table><tr><td rowspan="2">Session</td><td colspan="6">The hyperparameter b</td></tr><tr><td>0.0025</td><td>0.005</td><td>0.01</td><td>0.02</td><td>0.04</td><td>0.08</td></tr><tr><td>Session 1(60 bases classes)</td><td>64.85</td><td>64.67</td><td>64.81</td><td>64.71</td><td>63.30</td><td>62.25</td></tr><tr><td>Session 9 (All 100 classes)</td><td>44.16</td><td>44.54</td><td>44.58</td><td>44.67</td><td>43.75</td><td>43.04</td></tr><tr><td>Session 9 (60 base classes)</td><td>59.58</td><td>59.69</td><td>59.73</td><td>59.44</td><td>58.38</td><td>57.21</td></tr><tr><td>Session 9 (40 new classes)</td><td>21.03</td><td>21.81</td><td>21.86</td><td>22.52</td><td>21.80</td><td>21.77</td></tr></table>
|
| 233 |
+
|
| 234 |
+
Prototype fixing. Without fixing the prototypes after injecting noise to selected layers during the process of finding local minima, i.e. removing the second term of Eq. 4, it is still possible to tune the model within the flat region to well separate base classes. However, the saved prototypes of base classes will become less accurate because the embeddings of the base samples suffer from semantic drift [54]. As shown in Table 5, it results in a performance drop of nearly $0 . 6 \%$ .
|
| 235 |
+
|
| 236 |
+
Parameter clamping. Parameter clamping restricts the model parameters to the $b$ -flat region after incremental few-shot learning. Outside the $b$ -flat region, the performance drops quickly. It can be seen from Table 5 that removing parameter clamping leads to a significant drop in performance.
|
| 237 |
+
|
| 238 |
+
Prototype normalization. As mentioned in Sec. 4.2, we normalize the class prototypes to calibrate the estimates of the class mean classifier. The results in Table 5 show the effectiveness of normalization, which helps to further improve the performance.
|
| 239 |
+
|
| 240 |
+
Study of the flat region bound $b$ . We study the effect of the flat region bound $b$ for 5-way 5-shot incremental learning on CIFAR-100. We report the test accuracy in session 1 (base session) and session 9 (last session) w.r.t. different $b$ in Table 6. It can be seen that the best results are achieved for $b \in [ 0 . 0 0 5 , 0 . 0 2 ]$ . A larger $b$ (e.g., 0.04 or 0.08) leads to a significant performance drop on base classes, even for those in session 1, indicating that there may not exist a large flat region around a good local minima. Meanwhile, a smaller $b$ (e.g., 0.0025) results in a performance decline on new classes, due to the overly small capacity of the flat region. This illustrates the trade-off effect of $b$ .
|
| 241 |
+
|
| 242 |
+
# 6 Conclusion
|
| 243 |
+
|
| 244 |
+
We have proposed a novel approach to overcome catastrophic forgetting in incremental few-shot learning by finding flat local minima of the objective function in the base training stage and then fine-tuning the model within the flat region on new tasks. Extensive experiments on benchmark datasets show that our model can effectively mitigate catastrophic forgetting and adapt to new classes. A limitation of our method is that it may not be suitable for medium- or high-shot tasks, since the flat region is relatively small, which limits the model capacity. However, it is still possible to adapt our core idea for incremental learning. For example, one can search for a less flat but wider local minima region in the base training stage and tune the model within this region during incremental learning sessions, where previous techniques such as elastic weight consolidation (EWC) [28] can be used to constraint the model parameters. This could be an interesting direction for future research.
|
| 245 |
+
|
| 246 |
+
# Acknowledgments and Disclosure of Funding
|
| 247 |
+
|
| 248 |
+
We would like to thank the anonymous reviewers for their insightful and helpful comments. This research was supported by the grant of DaSAIL project P0030935 funded by PolyU/UGC.
|
| 249 |
+
|
| 250 |
+
References
|
| 251 |
+
[1] Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), pages 139–154, 2018.
|
| 252 |
+
[2] Carlo Baldassi, Fabrizio Pittorino, and Riccardo Zecchina. Shaping the learning landscape in neural networks around wide flat minima. Proc. Natl. Acad. Sci. USA, 117(1):161–170, 2020.
|
| 253 |
+
[3] Léon Bottou, Frank E Curtis, and Jorge Nocedal. Optimization methods for large-scale machine learning. Siam Review, 60(2):223–311, 2018.
|
| 254 |
+
[4] Francisco M Castro, Manuel J Marín-Jiménez, Nicolás Guil, Cordelia Schmid, and Karteek Alahari. End-to-end incremental learning. In Proceedings of the European conference on computer vision (ECCV), pages 233–248, 2018.
|
| 255 |
+
[5] Arslan Chaudhry, Puneet K Dokania, Thalaiyasingam Ajanthan, and Philip HS Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. In Proceedings of the European Conference on Computer Vision (ECCV), pages 532–547, 2018.
|
| 256 |
+
[6] Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. In International Conference on Learning Representations, 2018.
|
| 257 |
+
[7] Hung-Jen Chen, An-Chieh Cheng, Da-Cheng Juan, Wei Wei, and Min Sun. Mitigating forgetting in online continual learning via instance-aware parameterization. Advances in Neural Information Processing Systems, 33, 2020.
|
| 258 |
+
[8] Kuilin Chen and Chi-Guhn Lee. Incremental few-shot learning via vector quantization in deep embedded space. In International Conference on Learning Representations, 2021.
|
| 259 |
+
[9] Ali Cheraghian, Shafin Rahman, Pengfei Fang, Soumava Kumar Roy, Lars Petersson, and Mehrtash Harandi. Semantic-aware knowledge distillation for few-shot class-incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2534–2543, 2021.
|
| 260 |
+
[10] Prithviraj Dhar, Rajat Vikram Singh, Kuan-Chuan Peng, Ziyan Wu, and Rama Chellappa. Learning without memorizing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 261 |
+
[11] Gintare Karolina Dziugaite and Daniel M. Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. In Gal Elidan, Kristian Kersting, and Alexander T. Ihler, editors, Proceedings of the Thirty-Third Conference on Uncertainty in Artificial Intelligence, UAI 2017, Sydney, Australia, August 11-15, 2017. AUAI Press, 2017.
|
| 262 |
+
[12] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, pages 1126–1135. PMLR, 2017.
|
| 263 |
+
[13] Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4367–4375, 2018.
|
| 264 |
+
[14] Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empirical investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013.
|
| 265 |
+
|
| 266 |
+
[15] Haowei He, Gao Huang, and Yang Yuan. Asymmetric valleys: Beyond sharp and flat local minima. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alché- Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 2549–2560, 2019.
|
| 267 |
+
|
| 268 |
+
[16] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 269 |
+
|
| 270 |
+
[17] Geoffrey E. Hinton and Drew van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Lenny Pitt, editor, Proceedings of the Sixth Annual ACM Conference on Computational Learning Theory, COLT 1993, Santa Cruz, CA, USA, July 26-28, 1993, pages 5–13. ACM, 1993.
|
| 271 |
+
|
| 272 |
+
[18] Sepp Hochreiter and Jürgen Schmidhuber. Simplifying neural nets by discovering flat minima. In Gerald Tesauro, David S. Touretzky, and Todd K. Leen, editors, Advances in Neural Information Processing Systems 7, [NIPS Conference, Denver, Colorado, USA, 1994], pages 529–536. MIT Press, 1994.
|
| 273 |
+
|
| 274 |
+
[19] Ruibing Hou, Hong Chang, Bingpeng Ma, Shiguang Shan, and Xilin Chen. Cross attention network for few-shot classification. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, pages 4003–4014, 2019.
|
| 275 |
+
|
| 276 |
+
[20] Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and Dahua Lin. Learning a unified classifier incrementally via rebalancing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 831–839, 2019.
|
| 277 |
+
|
| 278 |
+
[21] Wenpeng Hu, Zhou Lin, Bing Liu, Chongyang Tao, Zhengwei Tao, Jinwen Ma, Dongyan Zhao, and Rui Yan. Overcoming catastrophic forgetting for continual learning via model adaptation. In International Conference on Learning Representations, 2018.
|
| 279 |
+
|
| 280 |
+
[22] Xinting Hu, Kaihua Tang, Chunyan Miao, Xian-Sheng Hua, and Hanwang Zhang. Distilling causal effect of data in class-incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3957–3966, 2021.
|
| 281 |
+
|
| 282 |
+
[23] Muhammad Abdullah Jamal and Guo-Jun Qi. Task agnostic meta-learning for few-shot learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11719–11727, 2019.
|
| 283 |
+
|
| 284 |
+
[24] Yiding Jiang\*, Behnam Neyshabur\*, Hossein Mobahi, Dilip Krishnan, and Samy Bengio. Fantastic generalization measures and where to find them. In International Conference on Learning Representations, 2020.
|
| 285 |
+
|
| 286 |
+
[25] Bingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan, Albert Gordo, Jiashi Feng, and Yannis Kalantidis. Decoupling representation and classifier for long-tailed recognition. In International Conference on Learning Representations, 2019.
|
| 287 |
+
|
| 288 |
+
[26] Ronald Kemker and Christopher Kanan. Fearnet: Brain-inspired model for incremental learning. In International Conference on Learning Representations, 2018.
|
| 289 |
+
|
| 290 |
+
[27] J. Kiefer and J. Wolfowitz. Stochastic estimation of the maximum of a regression function. Annals of Mathematical Statistics, 23:462–466, 1952.
|
| 291 |
+
|
| 292 |
+
[28] James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521–3526, 2017.
|
| 293 |
+
|
| 294 |
+
[29] Alex Krizhevsky et al. Learning multiple layers of features from tiny images. 2009.
|
| 295 |
+
|
| 296 |
+
[30] Ilja Kuzborskij, Francesco Orabona, and Barbara Caputo. From n to $\mathrm { n } + 1$ : Multiclass transfer incremental learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3358–3365, 2013.
|
| 297 |
+
|
| 298 |
+
[31] Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935–2947, 2017.
|
| 299 |
+
[32] Yaoyao Liu, Bernt Schiele, and Qianru Sun. An ensemble of epoch-wise empirical bayes for few-shot learning. In European Conference on Computer Vision, pages 404–421. Springer, 2020.
|
| 300 |
+
[33] Yaoyao Liu, Yuting Su, An-An Liu, Bernt Schiele, and Qianru Sun. Mnemonics training: Multiclass incremental learning without forgetting. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12245–12254, 2020.
|
| 301 |
+
[34] Pratik Mazumder, Pravendra Singh, and Piyush Rai. Few-shot lifelong learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 2337–2345, 2021.
|
| 302 |
+
[35] Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pages 109–165. Elsevier, 1989.
|
| 303 |
+
[36] Thomas Mensink, Jakob Verbeek, Florent Perronnin, and Gabriela Csurka. Distance-based image classification: Generalizing to new classes at near-zero cost. IEEE transactions on pattern analysis and machine intelligence, 35(11):2624–2637, 2013.
|
| 304 |
+
[37] Fabrizio Pittorino, Carlo Lucibello, Christoph Feinauer, Gabriele Perugini, Carlo Baldassi, Elizaveta Demyanenko, and Riccardo Zecchina. Entropic gradient descent algorithms and wide flat minima. In International Conference on Learning Representations, 2021.
|
| 305 |
+
[38] Jathushan Rajasegaran, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Mubarak Shah. itaml: An incremental task-agnostic meta-learning approach. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13588–13597, 2020.
|
| 306 |
+
[39] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. 2016.
|
| 307 |
+
[40] Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 2001–2010, 2017.
|
| 308 |
+
[41] Mengye Ren, Renjie Liao, Ethan Fetaya, and Richard S Zemel. Incremental few-shot learning with attention attractor networks. In Proceedings of the 33rd International Conference on Neural Information Processing Systems, pages 5275–5285, 2019.
|
| 309 |
+
[42] Matthew Riemer, Ignacio Cases, Robert Ajemian, Miao Liu, Irina Rish, Yuhai Tu, and Gerald Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. In International Conference on Learning Representations, 2018.
|
| 310 |
+
[43] H. Robbins. A stochastic approximation method. Annals of Mathematical Statistics, 22:400–407, 2007.
|
| 311 |
+
[44] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 4080–4090, 2017.
|
| 312 |
+
[45] Qianru Sun, Yaoyao Liu, Zhaozheng Chen, Tat-Seng Chua, and Bernt Schiele. Meta-transfer learning through hard tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
|
| 313 |
+
[46] Qianru Sun, Yaoyao Liu, Tat-Seng Chua, and Bernt Schiele. Meta-transfer learning for fewshot learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 403–412, 2019.
|
| 314 |
+
[47] Xiaoyu Tao, Xiaopeng Hong, Xinyuan Chang, Songlin Dong, Xing Wei, and Yihong Gong. Few-shot class-incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12183–12192, 2020.
|
| 315 |
+
[48] Yonglong Tian, Yue Wang, Dilip Krishnan, Joshua B Tenenbaum, and Phillip Isola. Rethinking few-shot image classification: a good embedding is all you need? In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part XIV 16, pages 266–282. Springer, 2020.
|
| 316 |
+
[49] Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 3637–3645, 2016.
|
| 317 |
+
[50] Peter Welinder, Steve Branson, Takeshi Mita, Catherine Wah, Florian Schroff, Serge Belongie, and Pietro Perona. Caltech-ucsd birds 200. 2010.
|
| 318 |
+
[51] Qianru Sun Yaoyao Liu, Bernt Schiele. Adaptive aggregation networks for class-incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 319 |
+
[52] Han-Jia Ye, Hexiang Hu, and De-Chuan Zhan. Learning adaptive classifiers synthesis for generalized few-shot learning. International Journal of Computer Vision, pages 1–24, 2021.
|
| 320 |
+
[53] Han-Jia Ye, Hexiang Hu, De-Chuan Zhan, and Fei Sha. Few-shot learning via embedding adaptation with set-to-set functions. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8808–8817, 2020.
|
| 321 |
+
[54] Lu Yu, Bartlomiej Twardowski, X. Liu, Luis Herranz, Kai Wang, Yong mei Cheng, Shangling Jui, and Joost van de Weijer. Semantic drift compensation for class-incremental learning. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6980–6989, 2020.
|
| 322 |
+
[55] Zhongqi Yue, Hanwang Zhang, Qianru Sun, and Xian-Sheng Hua. Interventional few-shot learning. Advances in Neural Information Processing Systems, 33, 2020.
|
| 323 |
+
[56] Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In International Conference on Machine Learning, pages 3987–3995. PMLR, 2017.
|
| 324 |
+
[57] Chi Zhang, Yujun Cai, Guosheng Lin, and Chunhua Shen. Deepemd: Differentiable earth mover’s distance for few-shot learning. arXiv e-prints, pages arXiv–2003, 2020.
|
| 325 |
+
[58] Chi Zhang, Yujun Cai, Guosheng Lin, and Chunhua Shen. Deepemd: Few-shot image classification with differentiable earth mover’s distance and structured classifiers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12203–12213, 2020.
|
| 326 |
+
[59] Chi Zhang, Nan Song, Guosheng Lin, Yun Zheng, Pan Pan, and Yinghui Xu. Few-shot incremental learning with continually evolved classifiers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12455–12464, 2021.
|
| 327 |
+
[60] Hanbin Zhao, Yongjian Fu, Mintong Kang, Q Tian, F Wu, and X Li. Mgsvf: Multi-grained slow vs. fast framework for few-shot class-incremental learning. arXiv preprint arXiv:2006.15524.
|
| 328 |
+
|
| 329 |
+
# Checklist
|
| 330 |
+
|
| 331 |
+
1. For all authors...
|
| 332 |
+
|
| 333 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 334 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 6.
|
| 335 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 336 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 337 |
+
|
| 338 |
+
2. If you are including theoretical results...
|
| 339 |
+
|
| 340 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 4.3.
|
| 341 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] See Appendix A.1.
|
| 342 |
+
|
| 343 |
+
3. If you ran experiments...
|
| 344 |
+
|
| 345 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The link to the source code is provided in the abstract.
|
| 346 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 5.1 and Appendix A.2.
|
| 347 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Appendix A.3.
|
| 348 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 5.1
|
| 349 |
+
|
| 350 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 351 |
+
|
| 352 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We have cited [29, 49, 50].
|
| 353 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 354 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 355 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 356 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 357 |
+
|
| 358 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 359 |
+
|
| 360 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 361 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 362 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/BJedHRVtPB/BJedHRVtPB.md
ADDED
|
@@ -0,0 +1,451 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PSEUDO-LIDAR++: ACCURATE DEPTH FOR 3D OBJECT DETECTION IN AUTONOMOUS DRIVING
|
| 2 |
+
|
| 3 |
+
Yurong $\mathbf { V o u } ^ { * 1 }$ , Yan Wang∗1, Wei-Lun Chao∗2, Divyansh Garg1, Geoff Pleiss1, Bharath Hariharan1, Mark Campbell1, and Kilian Q. Weinberger1 1Cornell University, Ithaca, NY 2The Ohio State University, Columbus, OH {yy785, yw763, dg595, gp346, bh497, mc288, kqw4}@cornell.edu chao.209@osu.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Detecting objects such as cars and pedestrians in 3D plays an indispensable role in autonomous driving. Existing approaches largely rely on expensive LiDAR sensors for accurate depth information. While recently pseudo-LiDAR has been introduced as a promising alternative, at a much lower cost based solely on stereo images, there is still a notable performance gap. In this paper we provide substantial advances to the pseudo-LiDAR framework through improvements in stereo depth estimation. Concretely, we adapt the stereo network architecture and loss function to be more aligned with accurate depth estimation of faraway objects — currently the primary weakness of pseudo-LiDAR. Further, we explore the idea to leverage cheaper but extremely sparse LiDAR sensors, which alone provide insufficient information for 3D detection, to de-bias our depth estimation. We propose a depthpropagation algorithm, guided by the initial depth estimates, to diffuse these few exact measurements across the entire depth map. We show on the KITTI object detection benchmark that our combined approach yields substantial improvements in depth estimation and stereo-based 3D object detection — outperforming the previous state-of-the-art detection accuracy for faraway objects by $4 0 \%$ . Our code is available at https://github.com/mileyan/Pseudo_Lidar_V2.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Safe driving in autonomous cars requires accurate 3D detection and localization of cars, pedestrians and other objects. This in turn requires accurate depth information, which can be obtained from LiDAR (Light Detection And Ranging) sensors. Although highly precise and reliable, LiDAR sensors are notoriously expensive: a 64-beam model can cost around $\$ 75,000$ (USD)1. The alternative is to measure depth through inexpensive commodity cameras. However, in spite of recent dramatic progress in stereo-based 3D object detection brought by pseudo-LiDAR (Wang et al., 2019a), a significant performance gap remains especially for faraway objects (which we want to detect early to allow time for reaction). The trade-off between affordability and safety creates an ethical dilemma.
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Figure 1: An illustration of our proposed depth estimation and correction method. The green box is the ground truth location of the car in the KITTI dataset. The red points are obtained with a stereo disparity network. Purple points, obtained with our stereo depth network (SDN), are much closer to the truth. After depth propagation (blue points) with a few (yellow) LiDAR measurements the car is squarely inside the green box. (One floor square is $1 \mathrm { m } \times 1 \mathrm { m } .$ )
|
| 15 |
+
|
| 16 |
+
In this paper we propose a possible solution to this remaining challenge that combines insights from both perspectives. We observe that the higher 3D object localization error of stereo-based systems, compared to LiDAR-based ones, stems entirely from the higher error in depth estimation (after the 3D point cloud is obtained the two approaches are identical (Wang et al., 2019a)). Importantly, this error is not random but systematic: we observe that stereo methods do indeed detect objects with high reliability, yet they estimate the depth of the entire object as either too far or too close. See Figure 1 for an illustration: the red stereo points capture the car but are shifted by about $2 \mathrm { m }$ completely outside the ground-truth location (green box). If we can de-bias these depth estimates it should be possible to obtain accurate 3D localization even for distant objects without exorbitant costs.
|
| 17 |
+
|
| 18 |
+
We start by revisiting the depth estimation routine embedded at the heart of state-of-the-art stereobased 3D detection approach (Wang et al., 2019a). A major contributor to the systematic depth bias comes from the fact that depth is typically not computed directly. Instead, one first estimates the disparity — the horizontal shift of a pixel between the left and right images — and then inverts it to obtain pixel-wise depth. While the use of deep neural networks has largely improved disparity estimation (Chang & Chen, 2018; Cheng et al., 2018; Mayer et al., 2016; Wang et al., 2019b), designing and learning the networks to optimize the accuracy of disparity estimation simply overemphasizes nearby objects due to the reciprocal transformation. For instance, a unit disparity error (in pixels) for a 5-meter-away object means a $1 0 \mathrm { c m }$ error in depth: the length of a side mirror. The same disparity error for a 50-meter-away object, however, becomes a $5 . 8 \mathrm { { m } }$ error in depth: the length of an entire car. Penalizing both errors equally means that the network spends more time correcting subtle errors on nearby objects than gross errors on faraway objects, resulting in degraded depth estimates and ultimately poor detection and localization for faraway objects. We thus propose to adapt the stereo network architecture and loss function for direct depth estimation. Concretely, the cost volume that fuses the left-right images and the subsequent 3D convolutions are the key components in stereo networks. Taking the central assumption of convolutions — all neighborhoods can be operated in an identical manner — we propose to construct the cost volume on the grid of depth rather than disparity, enabling 3D convolutions and the loss function to perform exactly on the right scale for depth estimation. We refer to our network as stereo depth network (SDN). See Figure 1 for a comparison of 3D points obtained with SDN (purple) and disparity estimation (red).
|
| 19 |
+
|
| 20 |
+
Although our SDN improves the depth estimates significantly, stereo images are still inherently 2D and it is unclear if they can ever match the accuracy and reliability of a true 3D LiDAR sensor. Although LiDAR sensors with 32 or 64 beams are expensive, LiDAR sensors with only 4 beams are two orders of magnitude cheaper2 and thus easily affordable. The 4 laser beams are very sparse and ill-suited to capture 3D object shapes by themselves, but if paired with stereo images they become the ideal tool to de-bias our dense stereo depth estimates: a single high-precision laser beam may inform us how to correct the depth of an entire car or pedestrian in its path. To this end, we present a novel depth-propagation algorithm, inspired by graph-based manifold learning (Weinberger et al., 2005; Roweis & Saul, 2000; Xiaojin & Zoubin, 2002). In a nutshell, we connect our estimated 3D stereo point cloud locally by a nearest neighbor graph, such that points corresponding to the same object will share many local paths with each other. We match the few but exact LiDAR measurements first with pixels (irrespective of depth) and then with their corresponding 3D points to obtain accurate depth estimates for several nodes in the graph. Finally, we propagate this exact depth information along the graph using a label diffusion mechanism — resulting in a dense and accurate depth map at negligible cost. In Figure 1 we see that the few (yellow) LiDAR measurements are sufficient to position almost all final (blue) points of the entire car within the green ground truth box.
|
| 21 |
+
|
| 22 |
+
We conduct extensive empirical studies of our approaches on the KITTI object detection benchmark (Geiger et al., 2012; 2013) and achieve remarkable results. With solely stereo images, we outperform the previous state of the art (Wang et al., 2019a) by $1 0 \%$ . Further adding a cheap 4-beam LiDAR brings another $2 7 \%$ relative improvement — on some metrics, our approach is nearly on par with those based on a 64-beam LiDAR but can potentially save $9 5 \%$ in cost.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND
|
| 25 |
+
|
| 26 |
+
3D object detection. Most work on 3D object detection operates on 3D point clouds from LiDAR as input (Li, 2017; Li et al., 2016; Meyer et al., 2019b; Yang et al., 2018a; Du et al., 2018; Shi et al., 2019; Engelcke et al., 2017; Yan et al., 2018; Lang et al., 2019). Frustum PointNet (Qi et al., 2018) applies PointNet (Qi et al., 2017a;b) to the points directly, while Voxelnet (Zhou & Tuzel, 2018) quantizes them into 3D grids. For street scenes, several work finds that processing points from the bird’s-eye view can already capture object contours and locations (Chen et al., 2017; Yang et al., 2018b; Ku et al., 2018). Images have also been used, but mainly to supplement LiDAR (Meyer et al., 2019a; Xu et al., 2018; Liang et al., 2018; Chen et al., 2017; Ku et al., 2018). Early work based solely on images — mostly built on the 2D frontal-view detection pipeline (Ren et al., 2015; He et al., 2017; Lin et al., 2017) — fell far behind in localizing objects in 3D (Li et al., 2019a; Xiang et al., 2015; 2017; Chabot et al., 2017; Mousavian et al., 2017; Chen et al., 2015; Xu & Chen, 2018; Chen et al., 2016; Pham & Jeon, 2017; Chen et al., 2018)3.
|
| 27 |
+
|
| 28 |
+
Pseudo-LiDAR. This gap has been reduced significantly recently with the introduction of the pseudoLiDAR framework proposed in (Wang et al., 2019a). This framework applies a drastically different approach from previous image-based 3D object detectors. Instead of directly detecting the 3D bounding boxes from the frontal view of a scene, pseudo-LiDAR begins with image-based depth estimation, predicting the depth $Z ( u , v )$ of each image pixel $( u , v )$ . The resulting depth map $Z$ is then back-projected into a 3D point cloud: a pixel $( u , v )$ will be transformed to $( x , y , z )$ in 3D by
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
\boldsymbol { z } = \boldsymbol { Z } ( \boldsymbol { u } , \boldsymbol { v } ) , \qquad \boldsymbol { x } = \frac { ( \boldsymbol { u } - \boldsymbol { c } _ { U } ) \times \boldsymbol { z } } { f _ { U } } , \qquad \boldsymbol { y } = \frac { ( \boldsymbol { v } - \boldsymbol { c } _ { V } ) \times \boldsymbol { z } } { f _ { V } } ,
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
where $( c _ { U } , c _ { V } )$ is the camera center and $f _ { U }$ and $f _ { V }$ are the horizontal and vertical focal length. The 3D point cloud is then treated exactly as LiDAR signal — any LiDAR-based 3D detector can be applied seamlessly. By taking the state-of-the-art algorithms from both ends (Chang & Chen, 2018; Ku et al., 2018; Qi et al., 2018), pseudo-LiDAR obtains the highest image-based performance on the KITTI object detection benchmark (Geiger et al., 2012; 2013). Our work builds upon this framework.
|
| 35 |
+
|
| 36 |
+
Stereo disparity estimation. Pseudo-LiDAR relies heavily on the quality of depth estimation. Essentially, if the estimated pixel depths match those provided by LiDAR, pseudo-LiDAR with any LiDAR-based detector should be able to achieve the same performance as that obtained by applying the same detector to the LiDAR signal. According to (Wang et al., 2019a), depth estimation from stereo pairs of images (Mayer et al., 2016; Yamaguchi et al., 2014; Chang & Chen, 2018) are more accurate than that from monocular (i.e., single) images (Fu et al., 2018; Godard et al., 2017) for 3D object detection. We therefore focus on stereo depth estimation, which is routinely obtained from estimating disparity between images.
|
| 37 |
+
|
| 38 |
+
A disparity estimation algorithm takes a pair of left-right images $I _ { l }$ and $I _ { r }$ as input, captured from a pair of cameras with a horizontal offset (i.e., baseline) $b$ . Without loss of generality, we assume that the algorithm treats the left image, $I _ { l }$ , as reference and outputs a disparity map $D$ recording the horizontal disparity to $I _ { r }$ for each pixel $( u , v )$ . Ideally, $I _ { l } ( u , v )$ and $I _ { r } ( u , v + D ( u , v ) )$ will picture the same 3D location. We can therefore derive the depth map $Z$ via the following transform,
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
Z ( u , v ) = \frac { f _ { U } \times b } { D ( u , v ) } ( f _ { U } \mathrm { : \ h o r i z o n t a l \ f o c a l \ l e n g t h } ) .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
A common pipeline of disparity estimation is to first construct a 4D disparity cost volume $C _ { \mathrm { d i s p } }$ in which $C _ { \mathrm { d i s p } } ( u , v , d , : )$ is a feature vector that captures the pixel difference between $I _ { l } ( u , v )$ and $I _ { r } ( u , v + d )$ . It then estimates the disparity $D ( u , v )$ for each pixel $( u , v )$ according to the cost volume $C _ { \mathrm { d i s p } }$ . One basic algorithm is to build a 3D cost volume with $C _ { \mathrm { d i s p } } ( u , v , d ) = \| I _ { l } ( u , v ) - I _ { r } ( u , v + d ) \| _ { 2 }$ and determine $D ( u , v )$ as ar $\begin{array} { r } { \operatorname* { m i n } _ { d } C _ { \mathrm { d i s p } } ( u , v , d ) } \end{array}$ . Advanced algorithms exploit more robust features in constructing $C _ { \mathrm { d i s p } }$ and perform structured prediction for $D$ . In what follows, we give an introduction of PSMNet (Chang & Chen, 2018), a state-of-the-art algorithm used in (Wang et al., 2019a).
|
| 45 |
+
|
| 46 |
+
PSMNet begins with extracting deep feature maps $h _ { l }$ and $h _ { r }$ from $I _ { l }$ and $I _ { r }$ , respectively. It then constructs $C _ { \mathrm { d i s p } } ( u , v , d , : )$ by concatenating features of $h _ { l } ( u , v )$ and $h _ { r } ( u , v + d )$ , followed by layers of 3D convolutions. The resulting 3D tensor $S _ { \mathrm { d i s p } }$ , with the feature channel size ending up being one, is then used to derive the pixel disparity via the following weighted combination,
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 3: Disparity cost volume (left) vs. depth cost volume (right). The figure shows the 3D points obtained from LiDAR (yellow) and stereo (purple) corresponding to a car in KITTI, seen from the bird’seye view (BEV). Points from the disparity cost volume are stretched out and noisy; while points from the depth cost volume capture the car contour faithfully.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 4: Depth estimation errors. We compare depth estimation error on 3,769 KITTI validation images, taking 64-beam LiDAR depths as ground truths. We separate pixels according to their true depths (z). See the text and appendix for details.
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
D ( u , v ) = \sum _ { d } \mathrm { s o f t m a x } ( - S _ { \mathrm { d i s p } } ( u , v , d ) ) \times d ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where softmax is performed along the $3 ^ { \mathrm { r d } }$ dimension of $S _ { \mathrm { d i s p } }$ . PSMNet can be learned end-to-end, including the image feature extractor and 3D convolution kernels, to minimize the disparity error
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\sum _ { ( u , v ) \in \mathcal { A } } \ell ( D ( u , v ) - D ^ { \star } ( u , v ) ) ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\ell$ is the smooth L1 loss, $D ^ { \star }$ is the ground truth map, and $\mathcal { A }$ contains pixels with ground truths.
|
| 65 |
+
|
| 66 |
+
# 3 STEREO DEPTH NETWORK (SDN)
|
| 67 |
+
|
| 68 |
+
A stereo network designed and learned to minimize the disparity error (cf. Equation 4) may over-emphasize nearby objects with smaller depths and therefore perform poorly in estimating depths for faraway objects. To see this, note that Equation 2 implies that for a given error in disparity $\delta D$ , the error in depth $\delta Z$ increases quadratically with depth:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
Z \propto \frac { 1 } { D } \Rightarrow \delta Z \propto \frac { 1 } { D ^ { 2 } } \delta D \Rightarrow \delta Z \propto Z ^ { 2 } \delta D .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
The middle term is obtained by differentiating $Z ( D )$ w.r.t. $D$ . In particular, using the settings on the KITTI dataset (Geiger et al., 2012; 2013), a single pixel error in disparity implies only a $0 . 1 \mathrm { m }$ error in depth at a depth of 5 meters, but a $5 . 8 \mathrm { { m } }$ error at a depth of 50 meters. See Figure 2 for a mapping from disparity to depth.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 2: The disparity-todepth transform. We set $f _ { U } =$ 721 (in pixels) and $b ~ = ~ 0 . 5 4$ (in meters) in Equation 2, which are the typical values used in the KITTI dataset.
|
| 78 |
+
|
| 79 |
+
Depth Loss. We propose two changes to adapt stereo networks for direct depth estimation. First, we learn stereo networks to directly optimize the depth loss
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\sum _ { ( u , v ) \in \mathcal { A } } \ell ( Z ( u , v ) - Z ^ { \star } ( u , v ) ) .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
$Z$ and $Z ^ { \star }$ can be obtained from $D$ and $D ^ { \star }$ using Equation 2. The change from the disparity loss to the depth loss corrects the disproportionally strong emphasis on tiny depth errors of nearby objects — a necessary but still insufficient change to overcome the problems of disparity estimation.
|
| 86 |
+
|
| 87 |
+
Depth Cost Volume. To facilitate accurate depth learning (rather than disparity) we need to further address the internals of the depth estimation pipeline. A crucial source of error is the 3D convolutions within the 4D disparity cost volume, where the same kernels are applied for the entire cost volume. This is highly problematic as it implicitly assumes that the effect of a convolution is homogeneous throughout — which is clearly violated by the reciprocal depth to disparity relation (Figure 2). For example, it may be completely appropriate to locally smooth two neighboring pixels with disparity 85 and 86 (changing the depth by a few cm to smooth out a surface), whereas applying the same kernel for two pixels with disparity 5 and 6 could easily move the 3D points by $1 0 \mathrm { m }$ or more.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 5: The whole pipeline of improved stereo depth estimation: (top) the stereo depth network (SDN) constructs a depth cost volume from left-right images and is optimized for direct depth estimation; (bottom) the graph-based depth correction algorithm (GDC) refines the depth map by leveraging sparser LiDAR signal. The gray arrows indicates the observer’s view point. We superimpose the (green) ground-truth 3D box of a car, the same one in Figure 1. The corrected points (blue; bottom right) are perfectly located inside the ground truth box.
|
| 91 |
+
|
| 92 |
+
Taking this insight and the central assumption of convolutions — all neighborhoods can be operated upon in an identical manner — into account, we propose to instead construct the depth cost volume $C _ { \mathrm { d e p t h } }$ , in which $C _ { \mathrm { d e p t h } } ( u , v , z , : )$ will encode features describing how likely the depth $Z ( u , v )$ of pixel $( u , v )$ is $z$ . The subsequent 3D convolutions will then operate on the grid of depth, rather than disparity, affecting neighboring depths identically, independent of their location. The resulting 3D tensor $S _ { \mathrm { d e p t h } }$ is then used to predict the pixel depth similar to Equation 3
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
Z ( u , v ) = \sum _ { z } \operatorname { s o f t m a x } ( - S _ { \mathrm { d e p t h } } ( u , v , z ) ) \times z .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
We construct the new depth volume, $C _ { \mathrm { d e p t h } }$ , based on the intuition that $C _ { \mathrm { d e p t h } } ( u , v , z , : )$ and $C _ { \mathrm { d i s p } } \left( \boldsymbol { u } , \boldsymbol { v } , \frac { f _ { U } \times \boldsymbol { b } } { z } , : \right)$ should lead to equivalent “cost”. To this end, we apply a bilinear interpolation to construct $C _ { \mathrm { d e p t h } }$ from $C _ { \mathrm { d i s p } }$ using the depth-to-disparity transform in Equation 2. Specifically, we consider disparity in the range of $[ 0 , 1 9 1 ]$ following PSMNet (Chang & Chen, 2018), and consider depth in the range of $[ 1 \mathrm { m } , 8 0 \mathrm { m } ]$ and set the grid of depth in $C _ { \mathrm { d e p t h } }$ to be 1m. Figure 5 (top) depicts our stereo depth network (SDN) pipeline. Crucially, all convolution operations are operated on $C _ { \mathrm { d e p t h } }$ exclusively. Figure 4 compares the median values of absolute depth estimation errors using the disparity cost volume (i.e., PSMNet) and the depth cost volume (SDN) (see subsection D.5 for detailed numbers). As expected, for faraway depth, SDN leads to drastically smaller errors with only marginal increases in the very near range (which disparity based methods over-optimize). See the appendix for the detailed setup and more discussions.
|
| 99 |
+
|
| 100 |
+
# 4 DEPTH CORRECTION
|
| 101 |
+
|
| 102 |
+
Our SDN significantly improves depth estimation and more precisely renders the object contours (see Figure 3). However, there is a fundamental limitation in stereo because of the discrete nature of pixels: the disparity, being the difference in the horizontal coordinate between corresponding pixels, has to be quantized at the level of individual pixels while the depth is continuous. Although the quantization error can be alleviated with higher resolution images, the computational depth prediction cost scales cubically with resolution— pushing the limits of GPUs in autonomous vehicles.
|
| 103 |
+
|
| 104 |
+
We therefore explore a hybrid approach by leveraging a cheap LiDAR with extremely sparse (e.g., 4 beams) but accurate depth measurements to correct this bias. We note that such sensors are too sparse to capture object shapes and cannot be used alone for detection. However, by projecting the LiDAR points into the image plane we obtain exact depths on a small portion of “landmark” pixels.
|
| 105 |
+
|
| 106 |
+
We present a graph-based depth correction (GDC) algorithm that effectively combines the dense stereo depth that has rendered object shapes and the sparse accurate LiDAR measurements. Conceptually, we expect the corrected depth map to have the following properties: globally, landmark pixels associated with LiDAR points should possess the exact depths; locally, object shapes captured by neighboring 3D points, back-projected from the input depth map (cf. Equation 1), should be preserved. Figure 5 (bottom) illustrates the algorithm.
|
| 107 |
+
|
| 108 |
+
Input Matching. We take as input the two point clouds from LiDAR (L) and Pseudo-LiDAR (PL) by stereo depth estimation. The latter is obtained by converting pixels $( u , v )$ with depth $z$ to 3D points $( x _ { u } , y _ { v } , z )$ . First, we characterize the local shapes by the directed K-nearest-neighbor (KNN) graph in the PL point cloud (using accelerated KD-Trees (Shevtsov et al., 2007)) that connects each 3D point to its KNNs with appropriate weights. Similarly, we can project the 3D LiDAR points onto pixel locations $( u , v )$ and match them to corresponding 3D stereo points. Without loss of generality, we assume that we are given “ground truth” LiDAR depth for the first $n$ points and no ground truth for the remaining $m$ points. We refer to the 3D stereo depth estimates as $Z \in \mathbb { R } ^ { n + m }$ and the LiDAR depth ground-truth as $G \in \mathbb { R } ^ { n }$ .
|
| 109 |
+
|
| 110 |
+
Edge weights. To construct the KNN graph in 3D we ignore the LiDAR information on the first $n$ points and only use their predicted stereo depth in $Z$ . Let ${ \mathcal { N } } _ { i }$ denote the set of $k$ neighbors of the $i ^ { t h }$ point. Further, let $\bar { W } \in \mathbb { R } ^ { ( n + m ) \times ( n + m ) }$ denote the weight matrix, where $W _ { i j }$ denotes the edge-weight between points $i$ and $j$ . Inspired by prior work in manifold learning (Roweis & Saul, 2000; Weinberger et al., 2005) we choose the weights to be the coefficients that reconstruct the depth of any point from the depths of its neighbors in ${ \mathcal { N } } _ { i }$ . We can solve for these weights with the following constrained quadratic optimization problem:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
W = \arg \operatorname* { m i n } _ { W } \| Z - W Z \| _ { 2 } ^ { 2 } , \qquad \mathrm { s . t . } \ W \mathbf { 1 } = \mathbf { 1 } \ \mathrm { a n d } \ W _ { i j } = 0 \ i \mathbf { f } \ j \not \in \mathcal { N } _ { i } .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Here $\mathbf { 1 } \in \mathbb { R } ^ { n + m }$ denotes the all-ones vector. As long as we pick $k > 3$ and the points are in general position there are infinitely many solutions that satisfy $Z = W Z$ , and we pick the solution with the minimum $L _ { 2 }$ norm (obtained with slight $L _ { 2 }$ regularization).
|
| 117 |
+
|
| 118 |
+
Depth Correction. Let us denote the corrected depth values as $Z ^ { \prime } \in \mathbb { R } ^ { n + m }$ , with $Z ^ { \prime } = [ Z _ { L } ^ { \prime } ; Z _ { P L } ^ { \prime } ]$ and $Z _ { L } ^ { \prime } \in \mathbb { R } ^ { n }$ and $Z _ { P L } ^ { \prime } \in \mathbb { R } ^ { m }$ , where $Z _ { L } ^ { \prime }$ are the depth values of points with LiDAR ground-truth and $Z _ { P L } ^ { \prime }$ otherwise. For the $n$ points with LiDAR measurements we update the depth to the (ground truth) values $Z _ { L } ^ { \prime } = G$ . We then solve for $Z _ { P L } ^ { \prime }$ given $G$ and the weighted KNN graph encoded in $W$ Concretely, we update the remaining depths $Z _ { P L } ^ { \prime }$ such that the depth of any point $i$ can still be be reconstructed with high fidelity as a weighted sum of its KNNs’ depths using the learned weights $W$ ; i.e. if point $i : 1 \leq i \leq n$ is moved to its new depth $G _ { i }$ , then its neighbors in ${ \mathcal { N } } _ { i }$ must also be corrected such that $\begin{array} { r } { G _ { i } \approx \sum _ { j \in \mathcal { N } _ { i } } W _ { i j } Z _ { j } ^ { \prime } } \end{array}$ . Further, the neighbors’ neighbors must be corrected and the depth of the few $n$ points propagates across the entire graph. We can solve for the final $Z ^ { \prime }$ directly with another quadratic optimization:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r } { Z ^ { \prime } = \arg \operatorname* { m i n } _ { \boldsymbol { Z } ^ { \prime } } \| \boldsymbol { Z } ^ { \prime } - \boldsymbol { W } \boldsymbol { Z } ^ { \prime } \| ^ { 2 } , \qquad \mathrm { s . t . } \ : Z _ { 1 : n } ^ { \prime } = G . } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
To illustrate the correction process, imagine the simplest case where the depth of only a single point $\ R = 1$ ) is updated to $G _ { 1 } = Z _ { 1 } + \delta$ . A new optimal depth for Equation 8 is to move all the remaining points similarly, i.e. $Z ^ { \prime } = Z + { \bf 1 } \delta$ : as $Z = W Z$ and $W \mathbf { 1 } = \mathbf { 1 }$ we must have $W ( Z + { \bf 1 } \delta ) = Z + { \bf 1 } \bar { \delta }$ In the setting with $n > 1$ , the least-squares loss ensures a soft diffusion between the different LiDAR depth estimates. Both optimization problems in Equation 7 and Equation 8 can be solved exactly and efficiently with sparse matrix solvers. We summarize the procedure as an algorithm in the appendix.
|
| 125 |
+
|
| 126 |
+
From the view of graph-based manifold learning, our GDC algorithm is reminiscent of locally linear embeddings (Roweis & Saul, 2000) with landmarks to guide the final solution (Weinberger et al., 2005). Figure 1 illustrates vividly how the initial 3D point cloud from SDN (purple) of a car in the KITTI dataset is corrected with a few sparse LiDAR measurements (yellow). The resulting points (blue) are right inside the ground-truth box and clearly show the contour of the car. Figure 4 shows the additional improvement from the GDC (blue) over the pure SDN depth estimates (see subsection D.5 for detailed numbers). The error (calculated only on non-landmark pixels) is corrected over the entire image where many regions have no LiDAR measurements. This is because that the pseudo-LiDAR point cloud is sufficiently dense and we choose $k$ to be large enough (in practice, we use $k = 1 0$ )
|
| 127 |
+
|
| 128 |
+
Table 1: 3D object detection results on KITTI validation. We report $\mathrm { A P _ { B E V } } / \mathrm { A P _ { 3 D } }$ (in $\%$ ) of the car category, corresponding to average precision of the bird’s-eye view and 3D object detection. We arrange methods according to the input signals: M for monocular images, S for stereo images, L for 64-beam LiDAR, and L# for sparse 4-beam LiDAR. PL stands for PSEUDO-LIDAR. Our PSEUDO-LIDAR $+ + \left( P L + + \right)$ with enhanced depth estimation — SDN and GDC— are in blue. Methods with 64-beam LiDAR are in gray. Best viewed in color.
|
| 129 |
+
|
| 130 |
+
<table><tr><td rowspan="2">Detection algo</td><td rowspan="2">Input</td><td colspan="3">IoU= 0.5</td><td colspan="3">IoU= 0.7</td></tr><tr><td>Easy</td><td>Moderate</td><td>Hard</td><td>Easy</td><td>Moderate</td><td>Hard</td></tr><tr><td>3DOP</td><td>S</td><td>55.0/46.0</td><td>41.3/34.6</td><td>34.6/30.1</td><td>12.6/6.6</td><td>9.5/5.1</td><td>7.6/4.1</td></tr><tr><td>MLF-STEREO</td><td>S</td><td>=</td><td>53.7 /47.4</td><td></td><td></td><td>19.5 /9.8</td><td>=</td></tr><tr><td>S-RCNN</td><td>S</td><td>87.1/ 85.8</td><td>74.1/ 66.3</td><td>58.9 /57.2</td><td>68.5 / 54.1</td><td>48.3 /36.7</td><td>41.5 /31.1</td></tr><tr><td>PL: AVOD</td><td>S</td><td>89.0 / 88.5</td><td>77.5 /76.4</td><td>68.7 /61.2</td><td>74.9 /61.9</td><td>56.8 /45.3</td><td>49.0/39.0</td></tr><tr><td>PL: PIXOR*</td><td>S</td><td>89.0/ -</td><td>75.2/-</td><td>67.3/-</td><td>73.9 /-</td><td>54.0/ -</td><td>46.9 / -</td></tr><tr><td>PL: P-RCNN</td><td>S</td><td>88.4/ 88.0</td><td>76.6 /73.7</td><td>69.0 / 67.8</td><td>73.4 / 62.3</td><td>56.0 /44.9</td><td>52.7 /41.6</td></tr><tr><td>PL++: AVOD</td><td>S</td><td>89.4/ 89.0</td><td>79.0 / 77.8</td><td>70.1/ 69.1</td><td>77.0 / 63.2</td><td>63.7 /46.8</td><td>56.0 / 39.8</td></tr><tr><td>PL++: PIXOR*</td><td>S</td><td>89.9 / -</td><td>78.4/ -</td><td>74.7/ -</td><td>79.7/-</td><td>61.1/ -</td><td>54.5/ -</td></tr><tr><td>PL++: P-RCNN</td><td>S</td><td>89.8 / 89.7</td><td>83.8 / 78.6</td><td>77.5 / 75.1</td><td>82.0 / 67.9</td><td>64.0 / 50.1</td><td>57.3 / 45.3</td></tr><tr><td>PL++: AVOD</td><td>L#+ S</td><td>90.2/90.1</td><td>87.7 / 86.9</td><td>79.8 / 79.2</td><td>86.8 / 70.7</td><td>76.6 / 56.2</td><td>68.7 / 53.4</td></tr><tr><td>PL++: PIXOR*</td><td>L#+S</td><td>95.1/ -</td><td>85.1/ -</td><td>78.3/ -</td><td>84.0/ -</td><td>71.0/ -</td><td>65.2/-</td></tr><tr><td>PL++: P-RCNN</td><td>L#+S</td><td>90.3 / 90.3</td><td>87.7 /86.9</td><td>84.6 / 84.2</td><td>88.2 / 75.1</td><td>76.9 / 63.8</td><td>73.4 / 57.4</td></tr><tr><td>AVOD</td><td>L+M</td><td>90.5/90.5</td><td>89.4/89.2</td><td>88.5/88.2</td><td>89.4/82.8</td><td>86.5/73.5</td><td>79.3/67.1</td></tr><tr><td>PIXOR*</td><td>L+M</td><td>94.2/-</td><td>86.7/-</td><td>86.1/-</td><td>85.2/-</td><td>81.2/-</td><td>76.1/-</td></tr><tr><td>P-RCNN</td><td>L</td><td>97.3/97.3</td><td>89.9 / 89.8</td><td>89.4 /89.3</td><td>90.2 /89.2</td><td>87.9 /78.9</td><td>85.5/77.9</td></tr></table>
|
| 131 |
+
|
| 132 |
+
such that the KNN graph is typically connected (or consists of few large connected components). See subsection D.6 for more analysis. For objects such as cars the improvements through GDC are far more pronounced, as these typically are touched by the four LiDAR beams and can be corrected effectively.
|
| 133 |
+
|
| 134 |
+
# 5 EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
# 5.1 SETUP
|
| 137 |
+
|
| 138 |
+
We refer to our combined method (SDN and GDC) for 3D object detection as PSEUDO-LIDAR $^ { + + }$ $( { \mathrm { P L } } + +$ in short). To analyze the contribution of each component, we evaluate SDN and GDC independently and jointly across several settings. For GDC we set $k = 1 0$ and consider adding signal from a (simulated) 4-beam LiDAR, unless stated otherwise.
|
| 139 |
+
|
| 140 |
+
Dataset, Metrics, and Baselines. We evaluate on the KITTI dataset (Geiger et al., 2013; 2012), which contains 7,481 and 7,518 images for training and testing. We follow (Chen et al., 2015) to separate the 7,481 images into 3,712 for training and 3,769 validation. For each (left) image, KITTI provides the corresponding right image, the 64-beam Velodyne LiDAR point cloud, the camera calibration matrices, and the bounding boxes. We focus on 3D object detection and bird’s-eye-view (BEV) localization and report results on the validation set. Specifically, we focus on the “car” category, following Chen et al. (2017) and Xu et al. (2018). We report average precision (AP) with IoU (Intersection over Union) thresholds at 0.5 and 0.7. We denote AP for the 3D and BEV tasks by $\mathrm { A P } _ { 3 \mathrm { D } }$ and $\mathsf { A P } _ { \mathrm { B E V } }$ . KITTI defines the easy, moderate, and hard settings, in which objects with 2D box heights smaller than or occlusion/truncation levels larger than certain thresholds are disregarded. We compare to four stereo-based detectors: PSEUDO-LIDAR (PL in short) (Wang et al., 2019a), 3DOP (Chen et al., 2015), S-RCNN (Li et al., 2019b), and MLF-STEREO (Xu & Chen, 2018).
|
| 141 |
+
|
| 142 |
+
Stereo depth network (SDN). We use PSMNET (Chang & Chen, 2018) as the backbone for our stereo depth estimation network (SDN). We follow Wang et al. (2019a) to pre-train SDN on the synthetic Scene Flow dataset (Mayer et al., 2016) and fine-tune it on the 3,712 training images of KITTI. We obtain the depth ground truth by projecting the corresponding LiDAR points onto images. We also train a PSMNET in the same way for comparison, which minimizes disparity error.
|
| 143 |
+
|
| 144 |
+
3D object detection. We apply three algorithms: AVOD (Ku et al., 2018), PIXOR (Yang et al., 2018b), and P-RCNN (Shi et al., 2019). All utilize information from LiDAR and/or monocular images. We use the released implementations of AVOD (specifically, AVOD-FPN) and P-RCNN. We implement PIXOR ourselves with a slight modification to include visual information (denoted as $\mathrm { P I X O R } ^ { \star }$ ). We train all models on the 3,712 training data from scratch by replacing the LiDAR points with pseudo-LiDAR data generated from stereo depth estimation. See the appendix for details.
|
| 145 |
+
|
| 146 |
+
Table 2: Results on the car category on the test set. We compare $\mathrm { P L } { + } { + }$ (blue) and 64-beam LiDAR (gray), using P-RCNN, and report $\mathsf { A P } _ { \mathrm { B E V } }$ / $\mathsf { A P } _ { 3 \mathrm { D } }$ at $\mathrm { I o U } { = } 0 . 7$ .
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Input signal</td><td>Easy</td><td>Moderate</td><td>Hard</td></tr><tr><td>PL++ (SDN)</td><td>75.5/60.4</td><td>57.2/44.6</td><td>53.4/38.5</td></tr><tr><td>PL++ (SDN + GDC)</td><td>83.8/68.5</td><td>73.5/54.7</td><td>66.5 /51.2</td></tr><tr><td>LiDAR</td><td>89.5 / 85.9</td><td>85.7/75.8</td><td>79.1/68.3</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 3: Ablation study on depth estimation. We report APBEV / $\mathsf { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) of the car category at $\mathrm { I o U } { = } 0 . 7$ on KITTI validation. DL: depth loss.
|
| 151 |
+
|
| 152 |
+
<table><tr><td rowspan=1 colspan=1>Stereo depth</td><td rowspan=1 colspan=1>Easy</td><td rowspan=1 colspan=1>Moderate</td><td rowspan=1 colspan=1>Hard</td></tr><tr><td rowspan=1 colspan=1>PSMNETPSMNET+DLSDN</td><td rowspan=1 colspan=1>73.4/62.380.1/ 65.582.0 / 67.9</td><td rowspan=1 colspan=1>56.0/44.961.9 /46.864.0 / 50.1</td><td rowspan=1 colspan=1>52.7/41.656.0/43.057.3 /45.3</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Table 4: Ablation study on leveraging sparse LiDAR. We report $\mathsf { A P } _ { \mathrm { B E V } }$ / $\mathsf { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) of the car category at $\mathrm { I o U } { = } 0 . 7$ on KITTI validation. L#: 4-beam LiDAR signal alone. $\mathrm { S D N + L \# } .$ : pseudo-LiDAR with depths of landmark pixels replaced by 4-beam LiDAR. The best result of each column is in bold font.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Stereo depth</td><td>Easy</td><td>Moderate</td><td>Hard</td></tr><tr><td>SDN L#</td><td>82.0/67.9 73.2 /56.1</td><td>64.0/50.1 71.3 /53.1</td><td>57.3/45.3 70.5 / 51.5</td></tr><tr><td>SDN +L#</td><td>86.3 /72.0</td><td>73.0 /56.1</td><td>67.4 / 54.1</td></tr><tr><td>SDN +GDC</td><td>88.2 /75.1</td><td>76.9 / 63.8</td><td>73.4 / 57.4</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Table 5: Results of pedestrians (top) and cyclists (bottom) on KITTI validation. We apply FPOINTNET Qi et al. (2018) and report $\mathsf { A P } _ { \mathrm { B E V } }$ / $\mathrm { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) at $\mathrm { I o U } { = } 0 . 5$ , following Wang et al. (2019a).
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Stereo depth</td><td>Easy</td><td>Moderate</td><td>Hard</td></tr><tr><td>PSMNET SDN SDN +GDC</td><td>41.3/33.8 48.7 /40.9 63.7 / 53.6</td><td>34.9/27.4 40.4 /32.9 53.8 /44.4</td><td>30.1/24.0 34.9 /28.8 46.8 /38.1</td></tr><tr><td>PSMNET SDN SDN +GDC</td><td>47.6/41.3 49.3/44.6 65.7 / 60.8</td><td>29.9/25.2 30.4 /28.7 45.8 /40.8</td><td>27.0/24.9 28.6 /26.4 42.8 /38.0</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Sparser LiDAR. We simulate sparser LiDAR signal with fewer beams by first projecting the 64-beam LiDAR points onto a 2D plane of horizontal and vertical angles. We quantize the vertical angles into 64 levels with an interval of $0 . 4 ^ { \circ }$ , which is close to the SPEC of the 64-beam LiDAR. We keep points fallen into a subset of beams to mimic the sparser signal. See the appendix for details.
|
| 163 |
+
|
| 164 |
+
# 5.2 EXPERIMENTAL RESULTS
|
| 165 |
+
|
| 166 |
+
Results on the KITTI val set. We summarize the main results on KITTI object detection in Table 1. Several important trends can be observed: 1) Our $\mathrm { P L } { + + }$ with enhanced depth estimations by SDN and GDC yields consistent improvement over PL across all settings; 2) $\mathrm { P L } { + + }$ with GDC refinement of 4-beam LiDAR (Input: $\mathrm { L } \# + \mathrm { S } $ ) performs significantly better than $\mathrm { P L } { + + }$ with only stereo inputs (Input: S); 3) PL experiences a substantial drop in accuracy from IoU at 0.5 to 0.7 for the hard setting. This suggests that while PL detects faraway objects, it mislocalizes them, likely placing them at the wrong depth. This causes the object to be considered a missed detection at higher overlap thresholds. Interestingly, here is where we experience the largest gain — from PL: P-RCNN $( \mathrm { A P _ { B E V } = 5 2 . 7 } )$ ) to $\mathrm { P L } { + + }$ : P-RCNN $\langle \mathrm { A P } _ { \mathrm { B E V } } = 7 3 . 4 )$ with input as $\mathrm { L } \# + \mathrm { S }$ . Note that the majority of the gain comes from GDC, as $\mathrm { P L } { + + }$ with the stereo-only version only improving the score to $5 7 . 3 \mathrm { A P } _ { \mathrm { B E V } }$ . 4) The gap between $\mathrm { P L } { + + }$ and LiDAR is at most $1 3 \%$ $\mathsf { A P } _ { \mathrm { B E V } }$ , even at the hard setting under IoU at 0.7. 5) For IoU at 0.5, with the aid of only 4 LiDAR beams, $\mathrm { P L } { + + }$ $\mathrm { S D N + G D C ) }$ achieves results comparable to models with 64-beam LiDAR signals.
|
| 167 |
+
|
| 168 |
+
Results on the KITTI test set. Table 2 summarizes results on the car category on the KITTI test set. We see a similar gap between our methods and LiDAR as on the validation set, suggesting that our improvement is not particular to the validation data. Our approach without LiDAR refinement (pure SDN) is placed at the top position among all the image-based algorithms on the KITTI leaderboard.
|
| 169 |
+
|
| 170 |
+
In the following, we conduct a series of experiments to analyze the performance gain by our approaches and discuss several key observations. We mainly experiment with P-RCNN: we find that the results with AVOD and $\mathrm { P I X O R ^ { \star } }$ follow similar trends and thus include them in the appendix.
|
| 171 |
+
|
| 172 |
+
Depth loss and depth cost volume. To turn a disparity network (e.g., PSMNET) into SDN, there are two changes: 1) change the disparity loss into the depth loss; 2) change the disparity cost volume into the depth cost volume. In Table 3, we uncover the effect of these two changes separately. On the $\mathrm { A P _ { B E V } / A P _ { 3 D } }$ (moderate) metric, the depth loss gives us a $6 \% / 2 \%$ improvement and the depth cost volume brings another $2 \sim 3 \%$ gain4.
|
| 173 |
+
|
| 174 |
+
Impact of sparse LiDAR beams. We leverage 4-beam LiDAR to correct stereo depth using GDC. However, it is possible that gains in 3D object detection come entirely from the new LiDAR sensor and that the stereo estimates are immaterial. In Table 4, we study this question by comparing the detection results against those of models using 1) sole 4-beam LiDAR point clouds and 2) pseudo-LiDAR point clouds with depths of landmark pixels replaced by 4-beam LiDAR: i.e., in depth correction, we only correct depths of the landmark pixels without propagation. It can be seen that 4-beam LiDAR itself performs fairly well on locating faraway objects but cannot capture nearby objects precisely, while simply replacing pseudo-LiDAR with LiDAR at the landmark pixels prevents the model from detecting faraway object accurately. In contrast, our proposed GDC method effectively combines the merits of the two signals, achieving superior performance than using them alone.
|
| 175 |
+
|
| 176 |
+
Pedestrian and cyclist detection. For a fair comparison to (Wang et al., 2019a), we apply FPOINTNET (Qi et al., 2018) for detecting pedestrians and cyclists. Table 5 shows the results: our methods significantly boosts the performance.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 6: Qualitative Comparison. We show the detection results on a KITTI validation scene by P-RCNN with different input point clouds. We visualize them from both frontal-view images and bird’s-eye view (BEV) point maps. Ground-truth boxes are in green and predicted bounding boxes are in red. The observer is at the left-hand side of the BEV map looking to the right. In other words, ground truth boxes on the right are more faraway (i.e., deeper) from the observer, and hence hard to localize. Best viewed in color.
|
| 180 |
+
|
| 181 |
+
Qualitative visualization. In Figure 6, we show an qualitative comparison of detection results on a randomly chosen scene in the KITTI object validation set, using P-RCNN (with confidence $> 0 . 9 5 ,$ ) with different input signals. Specifically, we show the results from the frontal-view images and the bird’s-eye view (BEV) point clouds. In the BEV map, the observer is on the left-hand side looking to the right. It can be seen that the point clouds generated by PSEUDO-LIDAR $^ { + + }$ (SDN alone or SDN $+ \mathrm { G D C } )$ align better with LiDAR than that generated by PSEUDO-LIDAR (PSMNET). For nearby objects (i.e., bounding boxes close to the left in the BEV map), we see that P-RCNN with any point cloud performs fairly well in localization. However, for faraway objects (i.e., bounding boxes close to the right), PSEUDO-LIDAR with depth estimated from PSMNET predicts objects (red boxes) that are deviated from the ground truths (green boxes). Moreover, the noisy PSMNET points also leads to false negatives. In contrast, the detected boxes by our PSEUDO-LIDAR $^ { + + }$ , either with SDN alone or with SDN $+ \mathrm { G D C }$ , align pretty well with the ground truth boxes, justifying our targeted improvement in estimating faraway depths.
|
| 182 |
+
|
| 183 |
+
Additional results, analyses, qualitative visualization and discussions. We provide results of PSEUDO-LIDAR $^ { + + }$ with fewer LiDAR beams, comparisons to depth completion methods, analysis on depth quality and detection accuracy, run time, failure cases, and more qualitative results in the appendix. With simple optimizations, GDC runs in 90 ms/frame using a single GPU (7.7 ms for KD-tree construction and search).
|
| 184 |
+
|
| 185 |
+
# 6 CONCLUSION
|
| 186 |
+
|
| 187 |
+
In this paper we made two contributions to improve the 3D object detection in autonomous vehicles without expensive LiDAR. First, we identify the disparity estimation as a main source of error for stereo-based systems and propose a novel approach to learn depth directly end-to-end instead of through disparity estimates. Second, we advocate that one should not use expensive LiDAR sensors to learn the local structure and depth of objects. Instead one can use commodity stereo cameras for the former and a cheap sparse LiDAR to correct the systematic bias in the resulting depth estimates. We provide a novel graph propagation algorithm that integrates the two data modalities and propagates the sparse yet accurate depth estimates using two sparse matrix solvers. The resulting system, PSEUDO-LIDAR $^ { + + }$ $\mathbf { \nabla } \cdot ( \mathbf { S } \mathbf { D } \mathbf { N } + \mathbf { G } \mathbf { D } \mathbf { C } )$ , performs almost on par with 64-beam LiDAR systems for $\$ 75,000$ but only requires 4 beams and two commodity cameras, which could be obtained with a total cost of less than $\$ 1,000$ .
|
| 188 |
+
|
| 189 |
+
# ACKNOWLEDGMENTS
|
| 190 |
+
|
| 191 |
+
This research is supported by grants from the National Science Foundation NSF (III-1618134, III1526012, IIS-1149882, IIS-1724282, and TRIPODS-1740822), the Office of Naval Research DOD (N00014-17-1-2175), the Bill and Melinda Gates Foundation, and the Cornell Center for Materials Research with funding from the NSF MRSEC program (DMR-1719875). We are thankful for generous support by Zillow and SAP America Inc.
|
| 192 |
+
|
| 193 |
+
# REFERENCES
|
| 194 |
+
|
| 195 |
+
Florian Chabot, Mohamed Chaouch, Jaonary Rabarisoa, Céline Teulière, and Thierry Chateau. Deep manta: A coarse-to-fine many-task network for joint 2d and 3d vehicle analysis from monocular image. In CVPR, 2017.
|
| 196 |
+
|
| 197 |
+
Jia-Ren Chang and Yong-Sheng Chen. Pyramid stereo matching network. In CVPR, 2018.
|
| 198 |
+
|
| 199 |
+
Xiaozhi Chen, Kaustav Kundu, Yukun Zhu, Andrew G Berneshawi, Huimin Ma, Sanja Fidler, and Raquel Urtasun. 3d object proposals for accurate object class detection. In NIPS, 2015.
|
| 200 |
+
|
| 201 |
+
Xiaozhi Chen, Kaustav Kundu, Ziyu Zhang, Huimin Ma, Sanja Fidler, and Raquel Urtasun. Monocular 3d object detection for autonomous driving. In CVPR, 2016.
|
| 202 |
+
|
| 203 |
+
Xiaozhi Chen, Huimin Ma, Ji Wan, Bo Li, and Tian Xia. Multi-view 3d object detection network for autonomous driving. In CVPR, 2017.
|
| 204 |
+
|
| 205 |
+
Xiaozhi Chen, Kaustav Kundu, Yukun Zhu, Huimin Ma, Sanja Fidler, and Raquel Urtasun. 3d object proposals using stereo imagery for accurate object class detection. IEEE TPAMI, 40(5):1259–1272, 2018.
|
| 206 |
+
|
| 207 |
+
Xinjing Cheng, Peng Wang, and Ruigang Yang. Depth estimation via affinity learned with convolutional spatial propagation network. In ECCV, 2018.
|
| 208 |
+
|
| 209 |
+
Xinxin Du, Marcelo H Ang Jr, Sertac Karaman, and Daniela Rus. A general pipeline for 3d detection of vehicles. In ICRA, 2018.
|
| 210 |
+
|
| 211 |
+
Martin Engelcke, Dushyant Rao, Dominic Zeng Wang, Chi Hay Tong, and Ingmar Posner. Vote3deep: Fast object detection in 3d point clouds using efficient convolutional neural networks. In ICRA, 2017.
|
| 212 |
+
|
| 213 |
+
Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, and Dacheng Tao. Deep ordinal regression network for monocular depth estimation. In CVPR, pp. 2002–2011, 2018.
|
| 214 |
+
|
| 215 |
+
Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In CVPR, 2012.
|
| 216 |
+
|
| 217 |
+
Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: The kitti dataset. The International Journal of Robotics Research, 32(11):1231–1237, 2013.
|
| 218 |
+
|
| 219 |
+
Clément Godard, Oisin Mac Aodha, and Gabriel J Brostow. Unsupervised monocular depth estimation with left-right consistency. In CVPR, 2017.
|
| 220 |
+
|
| 221 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 222 |
+
|
| 223 |
+
Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask r-cnn. In ICCV, 2017.
|
| 224 |
+
|
| 225 |
+
Jason Ku, Melissa Mozifian, Jungwook Lee, Ali Harakeh, and Steven Waslander. Joint 3d proposal generation and object detection from view aggregation. In IROS, 2018.
|
| 226 |
+
|
| 227 |
+
Alex H Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, and Oscar Beijbom. Pointpillars: Fast encoders for object detection from point clouds. In CVPR, 2019.
|
| 228 |
+
|
| 229 |
+
Bo Li. 3d fully convolutional network for vehicle detection in point cloud. In IROS, 2017.
|
| 230 |
+
|
| 231 |
+
Bo Li, Tianlei Zhang, and Tian Xia. Vehicle detection from 3d lidar using fully convolutional network. In Robotics: Science and Systems, 2016.
|
| 232 |
+
|
| 233 |
+
Buyu Li, Wanli Ouyang, Lu Sheng, Xingyu Zeng, and Xiaogang Wang. Gs3d: An efficient 3d object detection framework for autonomous driving. In CVPR, 2019a.
|
| 234 |
+
|
| 235 |
+
Peiliang Li, Xiaozhi Chen, and Shaojie Shen. Stereo r-cnn based 3d object detection for autonomous driving. In CVPR, 2019b.
|
| 236 |
+
|
| 237 |
+
Ming Liang, Bin Yang, Shenlong Wang, and Raquel Urtasun. Deep continuous fusion for multi-sensor 3d object detection. In ECCV, 2018.
|
| 238 |
+
|
| 239 |
+
Tsung-Yi Lin, Piotr Dollár, Ross B Girshick, Kaiming He, Bharath Hariharan, and Serge J Belongie. Feature pyramid networks for object detection. In CVPR, volume 1, pp. 4, 2017.
|
| 240 |
+
|
| 241 |
+
Fangchang Ma, Guilherme Venturelli Cavalheiro, and Sertac Karaman. Self-supervised sparse-todense: self-supervised depth completion from lidar and monocular camera. In ICRA, 2019.
|
| 242 |
+
|
| 243 |
+
Nikolaus Mayer, Eddy Ilg, Philip Hausser, Philipp Fischer, Daniel Cremers, Alexey Dosovitskiy, and Thomas Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In CVPR, 2016.
|
| 244 |
+
|
| 245 |
+
Gregory P Meyer, Jake Charland, Darshan Hegde, Ankit Laddha, and Carlos Vallespi-Gonzalez. Sensor fusion for joint 3d object detection and semantic segmentation. arXiv preprint arXiv:1904.11466, 2019a.
|
| 246 |
+
|
| 247 |
+
Gregory P Meyer, Ankit Laddha, Eric Kee, Carlos Vallespi-Gonzalez, and Carl K Wellington. Lasernet: An efficient probabilistic 3d object detector for autonomous driving. In CVPR, 2019b.
|
| 248 |
+
|
| 249 |
+
Arsalan Mousavian, Dragomir Anguelov, John Flynn, and Jana Košecká. 3d bounding box estimation using deep learning and geometry. In CVPR, 2017.
|
| 250 |
+
|
| 251 |
+
Cuong Cao Pham and Jae Wook Jeon. Robust object proposals re-ranking for object detection in autonomous driving using convolutional neural networks. Signal Processing: Image Communication, 53:110–122, 2017.
|
| 252 |
+
|
| 253 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In CVPR, 2017a.
|
| 254 |
+
|
| 255 |
+
Charles R Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J Guibas. Frustum pointnets for 3d object detection from rgb-d data. In CVPR, 2018.
|
| 256 |
+
|
| 257 |
+
Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In NIPS, 2017b.
|
| 258 |
+
|
| 259 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, 2015.
|
| 260 |
+
|
| 261 |
+
Sam T Roweis and Lawrence K Saul. Nonlinear dimensionality reduction by locally linear embedding. science, 2000.
|
| 262 |
+
|
| 263 |
+
Maxim Shevtsov, Alexei Soupikov, and Alexander Kapustin. Highly parallel fast kd-tree construction for interactive ray tracing of dynamic scenes. In Computer Graphics Forum, volume 26, pp. 395–404. Wiley Online Library, 2007.
|
| 264 |
+
|
| 265 |
+
Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Pointrcnn: 3d object proposal generation and detection from point cloud. In CVPR, 2019.
|
| 266 |
+
|
| 267 |
+
Siddharth Srivastava, Frederic Jurie, and Gaurav Sharma. Learning 2d to 3d lifting for object detection in 3d for autonomous vehicles. In IROS, 2019.
|
| 268 |
+
|
| 269 |
+
Paden Tomasello, Sammy Sidhu, Anting Shen, Matthew W Moskewicz, Nobie Redmon, Gataryi Joshi, Romi Phadte, Paras Jain, and Forrest Iandola. Dscnet: Replicating lidar point clouds with deep sensor cloning. arXiv preprint arXiv:1811.07070, 2018.
|
| 270 |
+
|
| 271 |
+
Luz Abril Torres-Mendez and Gregory Dudek. Statistical inference and synthesis in the image domain for mobile robot environment modeling. In IROS, 2004.
|
| 272 |
+
|
| 273 |
+
Tsun-Hsuan Wang, Fu-En Wang, Juan-Ting Lin, Yi-Hsuan Tsai, Wei-Chen Chiu, and Min Sun. Plugand-play: Improve depth estimation via sparse data propagation. arXiv preprint arXiv:1812.08350, 2018.
|
| 274 |
+
|
| 275 |
+
Yan Wang, Wei-Lun Chao, Divyansh Garg, Bharath Hariharan, Mark Campbell, and Kilian Q. Weinberger. Pseudo-lidar from visual depth estimation: Bridging the gap in 3d object detection for autonomous driving. In CVPR, 2019a.
|
| 276 |
+
|
| 277 |
+
Yan Wang, Zihang Lai, Gao Huang, Brian H Wang, Laurens van der Maaten, Mark Campbell, and Kilian Q Weinberger. Anytime stereo image depth estimation on mobile devices. In ICRA, 2019b.
|
| 278 |
+
|
| 279 |
+
Kilian Q. Weinberger, Benjamin Packer, and Lawrence K. Saul. Nonlinear dimensionality reduction by semidefinite programming and kernel matrix factorization. In AISTATS, 2005.
|
| 280 |
+
|
| 281 |
+
Yu Xiang, Wongun Choi, Yuanqing Lin, and Silvio Savarese. Data-driven 3d voxel patterns for object category recognition. In CVPR, 2015.
|
| 282 |
+
|
| 283 |
+
Yu Xiang, Wongun Choi, Yuanqing Lin, and Silvio Savarese. Subcategory-aware convolutional neural networks for object proposals and detection. In WACV, 2017.
|
| 284 |
+
|
| 285 |
+
Zhu Xiaojin and Ghahramani Zoubin. Learning from labeled and unlabeled data with label propagation. Tech. Rep., Technical Report CMU-CALD-02–107, Carnegie Mellon University, 2002.
|
| 286 |
+
|
| 287 |
+
Bin $\mathrm { X u }$ and Zhenzhong Chen. Multi-level fusion based 3d object detection from monocular images. In CVPR, 2018.
|
| 288 |
+
|
| 289 |
+
Danfei Xu, Dragomir Anguelov, and Ashesh Jain. Pointfusion: Deep sensor fusion for 3d bounding box estimation. In CVPR, 2018.
|
| 290 |
+
|
| 291 |
+
Koichiro Yamaguchi, David McAllester, and Raquel Urtasun. Efficient joint segmentation, occlusion labeling, stereo and flow estimation. In ECCV, 2014.
|
| 292 |
+
|
| 293 |
+
Yan Yan, Yuxing Mao, and Bo Li. Second: Sparsely embedded convolutional detection. Sensors, 18 (10):3337, 2018.
|
| 294 |
+
|
| 295 |
+
Bin Yang, Ming Liang, and Raquel Urtasun. Hdnet: Exploiting hd maps for 3d object detection. In Conference on Robot Learning, pp. 146–155, 2018a.
|
| 296 |
+
|
| 297 |
+
Bin Yang, Wenjie Luo, and Raquel Urtasun. Pixor: Real-time 3d object detection from point clouds. In CVPR, 2018b.
|
| 298 |
+
|
| 299 |
+
Yanchao Yang, Alex Wong, and Stefano Soatto. Dense depth posterior (ddp) from single image and sparse range. In CVPR, 2019.
|
| 300 |
+
|
| 301 |
+
Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3d object detection. In CVPR, 2018.
|
| 302 |
+
|
| 303 |
+
# Appendix
|
| 304 |
+
|
| 305 |
+
We provide details omitted in the main text.
|
| 306 |
+
|
| 307 |
+
• Appendix A: details on constructing the depth cost volume (section 3 of the main paper).
|
| 308 |
+
• Appendix B: detailed implementation of the GDC algorithm (section 4 of the main paper).
|
| 309 |
+
• Appendix C: additional details of experimental setups (subsection 5.1 of the main paper).
|
| 310 |
+
• Appendix D: additional results, analyses, and discussions (subsection 5.2 of the main paper).
|
| 311 |
+
|
| 312 |
+
# A DEPTH COST VOLUME
|
| 313 |
+
|
| 314 |
+
With Equation 2, we know where each grid $( u , v , z )$ in $C _ { \mathrm { d e p t h } }$ corresponds to in $C _ { \mathrm { d i s p } }$ (may not be on a grid). We can then obtain features for each grid in $\dot { C } _ { \mathrm { d e p t h } }$ (i.e., $C _ { \mathrm { d e p t h } } ( u , v , z , : ) )$ by bilinear interpolation over features on grids of $C _ { \mathrm { d i s p } }$ around the non-grid location (i.e., $\left( u , v , { \frac { f _ { U } \times b } { z } } \right) )$ . We applied the “grid_sample” function in PyTorch for bilinear interpolation.
|
| 315 |
+
|
| 316 |
+
We use PSMNET (Chang & Chen, 2018) as the backbone for our stereo depth estimation network (SDN). The only change is to construct the depth cost volume before performing 3D convolutions.
|
| 317 |
+
|
| 318 |
+
# B GRAPH-BASED DEPTH CORRECTION (GDC) ALGORITHM
|
| 319 |
+
|
| 320 |
+
Here we present the GDC algorithm in detail (see algorithm 1). The two steps described in the main paper can be easily turned into two (sparse) linear systems and then solved by using Lagrange multipliers. For the first step (i.e., Equation 7), we solve the same problem as in the main text but we switch the objective to minimizing the $L _ { 2 }$ -norm of $W$ and set $Z - W Z = 0$ as a constraint5. For the second step (i.e., Equation 8), we use the Conjugate Gradient (CG) to iteratively solve the sparse linear system.
|
| 321 |
+
|
| 322 |
+
Algorithm 1: Graph-based depth correction (GDC). “;” stands for column-wise concatenation.
|
| 323 |
+
|
| 324 |
+
Input: Stereo depth map $Z \in \mathbb { R } ^ { ( n + m ) \times 1 }$ , the corresponding pseudo-LiDAR (PL) point cloud $P \in \mathbb { R } ^ { ( n + m ) \times 3 }$ , and LiDAR depths $G \in \mathbb { R } ^ { n \times 1 }$ on the first the $n$ pixels.
|
| 325 |
+
Output: Corrected depth map $Z ^ { \prime } \in \mathbb { R } ^ { ( n + m ) \times 1 }$
|
| 326 |
+
function $\mathrm { G D C } ( Z , P , { \bar { G } } , K )$ Solve: $W = \mathop { \mathrm { a r g } } \operatorname* { m i n } _ { W \in \mathbb { R } ^ { ( n + m ) \times ( n + m ) } } \| W \| ^ { 2 }$ s.t. $Z - W \cdot Z = 0 $ , $W _ { i j } = 0$ if $j \notin \mathcal { N } _ { i }$ (i.e., the set of neighbors of the $i ^ { t h }$ point) according to $P$ , $\textstyle \sum _ { j } W _ { i j } = 1$ for $\forall i = 1 , \ldots , n + m$ . Solve: $\begin{array} { r } { Z _ { P L } ^ { \prime } = \arg \operatorname* { m i n } _ { Z _ { P L } ^ { \prime } \in \mathbb { R } ^ { m \times 1 } } \| [ G ; Z _ { P L } ^ { \prime } ] - W [ G ; Z _ { P L } ^ { \prime } ] \| ^ { 2 } } \end{array}$ return $[ G ; Z _ { P L } ^ { \prime } ]$
|
| 327 |
+
end
|
| 328 |
+
|
| 329 |
+
# C EXPERIMENTAL SETUP
|
| 330 |
+
|
| 331 |
+
# C.1 SPARSE LIDAR GENERATION
|
| 332 |
+
|
| 333 |
+
In this section, we explain how we generate sparser LiDAR with fewer beams from a 64-beam LiDAR point cloud from KITTI dataset in detail. For every point $( x _ { i } , y _ { i } , z _ { i } ) \in \mathbb { R } ^ { 3 }$ of the point cloud in one
|
| 334 |
+
|
| 335 |
+
scene (in LiDAR coordinate system ( $x$ : front, $y$ : left, $z .$ : up, and $( 0 , 0 , 0 )$ is the location of the LiDAR sensor)), we compute the elevation angle $\theta _ { i }$ to the LiDAR sensor as
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\theta _ { i } = \arg \cos \left( \frac { \sqrt { x _ { i } ^ { 2 } + y _ { i } ^ { 2 } } } { \sqrt { x _ { i } ^ { 2 } + y _ { i } ^ { 2 } + z _ { i } ^ { 2 } } } \right) .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
We order the points by their elevation angles and slice them into separate lines by step $0 . 4 ^ { \circ }$ , starting from $- 2 3 . 6 ^ { \circ }$ (close to the Velodyne 64-beam LiDAR SPEC). We select LiDAR points whose elevation angles fall within $[ - 2 . 4 ^ { \circ } , - 2 . 0 ^ { \circ } ) \cup [ - 0 . 8 ^ { \circ } , - 0 . 4 ^ { \circ } )$ to be the 2-beam LiDAR signal, and similarly $\left[ - 2 . 4 ^ { \circ } , - 2 . 0 ^ { \circ } \right) \cup \left[ - 1 . 6 ^ { \circ } , - 1 . 2 ^ { \circ } \right) \cup \left[ - 0 . 8 ^ { \circ } , - 0 . 4 ^ { \circ } \right) \cup \left[ 0 . 0 ^ { \circ } , 0 . 4 ^ { \circ } \right)$ to be the 4-beam LiDAR signal. We choose them in such a way that consecutive lines has a $0 . 8 ^ { \circ }$ interval, following the SPEC of the “cheap” 4-beam LiDAR ScaLa. We visualize these sparsified LiDAR point clouds from the bird’s-eye view on one example scene in Figure 7.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 7: Bird’s-eye views of sparsified LiDAR on an example scene. The observer is on the bottom side looking up. We filter out points invisible from the left image. (One floor square is $1 0 \mathrm { m } \times 1 0 \mathrm { m } .$ )
|
| 345 |
+
|
| 346 |
+
# C.2 3D OBJECT DETECTION ALGORITHMS
|
| 347 |
+
|
| 348 |
+
In this section, we provide more details about the way we train 3D object detection models on pseudo-LiDAR point clouds. For AVOD, we use the same model as in (Wang et al., 2019a). For P-RCNN, we use the implementation provided by the authors. Since the P-RCNN model exploits the sparse nature of LiDAR point clouds, when training it with pseudo-LiDAR input, we will first sparsify the point clouds into 64 beams using the method described in subsection C.1. For $\mathrm { P I X O R ^ { \star } }$ , we implement the same base model structure and data augmentation specified by Yang et al. (2018b), but without the “decode fine-tune” step and focal loss. Inspired by the trick in (Liang et al., 2018), we add another image feature (ResNet-18 by He et al. (2016)) branch along the LiDAR branch, and concatenate the corresponding image features onto the LiDAR branch at each stage. We train $\mathrm { P I X O R ^ { \star } }$ using RMSProp with momentum 0.9, learning rate $1 0 ^ { - 5 }$ (decay by 10 after 50 and 80 epochs) for 90 epochs. The BEV evaluation results are similar to the reported results (see Table 1).
|
| 349 |
+
|
| 350 |
+
D ADDITIONAL RESULTS, ANALYSES, AND DISCUSSIONS
|
| 351 |
+
|
| 352 |
+
# D.1 ABLATION STUDY
|
| 353 |
+
|
| 354 |
+
In Table 6 and Table 7 we provide more experimental results aligned with experiments in subsection 5.2 of the main paper. We conduct the same experiments on two other models, AVOD and $\mathrm { P I X O R ^ { \star } }$ , and observe similar trends of improvements brought by learning with the depth loss (from PSMNET to PSMNET $+ \mathrm { D L }$ ), constructing the depth cost volume (from PSMNET $+ \mathrm { D L }$ to SDN), and applying GDC to correct the bias in stereo depth estimation (comparing SDN $\mathrm { \Omega } + \mathrm { G D C }$ with SDN).
|
| 355 |
+
|
| 356 |
+
We note that, in Table 7, results of AVOD (or $\mathrm { P I X O R } ^ { \star }$ ) with $\mathrm { S D N + L \# }$ are worse than those with L# at the moderate and hard settings. This observation is different from that in Table 4, where P-RCNN with $\mathrm { S D N + L \# }$ outperforms P-RCNN with L# in 5 out of 6 comparisons. We hypothesize that this is because P-RCNN takes sparsified inputs (see subsection C.2) while AVOD and $\mathrm { P I X O R } ^ { \star }$ take dense inputs. In the later case, the four replaced LiDAR beams in $\mathrm { S D N + L \# }$ will be dominated by the dense stereo depths so that $\mathrm { S D N + L \# }$ is worse than L#.
|
| 357 |
+
|
| 358 |
+
# D.2 USING FEWER LIDAR BEAMS
|
| 359 |
+
|
| 360 |
+
In $\mathrm { P L } { + + }$ (i.e., $\mathrm { S D N + G D C } )$ , we use 4-beam LiDAR to correct the predicted point cloud. In Table 8, we investigate using fewer (and also potentially cheaper) LiDAR beams for depth correction. We observe that even with 2 beams, GDC can already manage to combine the two signals and yield a better performance than using 2-beam LiDAR or pseudo-LiDAR alone.
|
| 361 |
+
|
| 362 |
+
Table 6: Ablation study on stereo depth estimation. We report APBEV / $\mathrm { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) of the car category at $\mathrm { I o U } { = } 0 . 7$ on the KITTI validation set. DL stands for depth loss.
|
| 363 |
+
|
| 364 |
+
<table><tr><td rowspan="2">Depth Estimation</td><td colspan="3">PIXOR*</td><td colspan="3">AVOD</td></tr><tr><td>Easy</td><td>Moderate</td><td>Hard</td><td>Easy</td><td>Moderate</td><td>Hard</td></tr><tr><td>PSMNET PSMNET+DL SDN</td><td>73.9/- 75.8/ - 79.7/-</td><td>54.0/- 56.2/ - 61.1/-</td><td>46.9/- 51.9 / - 54.5/ -</td><td>74.9 / 61.9 75.7 / 60.5 77.0/ 63.2 63.7 /46.8</td><td>56.8 /45.3 57.1/ 44.8</td><td>49.0/39.0 49.2 /38.4 56.0 /39.8</td></tr></table>
|
| 365 |
+
|
| 366 |
+
Table 7: Ablation study on leveraging sparse LiDAR. We report $\mathsf { A P } _ { \mathrm { B E V } }$ / $\mathsf { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) of the car category at $\mathrm { I o U } { = } 0 . 7$ on the KITTI validation set. L# stands for 4-beam LiDAR signal. SDN +L# means we replace the depth of a portion of pseudo-LiDAR points (i.e., landmark pixels) by L#.
|
| 367 |
+
|
| 368 |
+
<table><tr><td rowspan="2">Depth Estimation</td><td colspan="3">PIXOR*</td><td colspan="3">AVOD</td></tr><tr><td>Easy</td><td>Moderate</td><td>Hard</td><td>Easy</td><td>Moderate</td><td>Hard</td></tr><tr><td>SDN</td><td>79.7/-</td><td>61.1/-</td><td>54.5/ -</td><td>77.0/63.2</td><td>63.7 /46.8</td><td>56.0/39.8</td></tr><tr><td>L#</td><td>72.0 / -</td><td>64.7 / -</td><td>63.6 / -</td><td>77.0 / 62.1</td><td>68.8/54.7</td><td>67.1/ 53.0</td></tr><tr><td>SDN +L#</td><td>75.6/ -</td><td>59.4 / -</td><td>53.2 / -</td><td>84.1/66.0</td><td>67.0 / 53.1</td><td>58.8 /46.4</td></tr><tr><td>SDN +GDC</td><td>84.0 /-</td><td>71.0 / -</td><td>65.2 / -</td><td>86.8/70.7</td><td>76.6/56.2</td><td>68.7 /53.4</td></tr></table>
|
| 369 |
+
|
| 370 |
+
Table 8: Ablation study on the sparsity of LiDAR. We report APBEV / $\mathrm { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) of the car category at $\mathrm { I o U } { = } 0 . 7$ on the KITTI validation set. L# stands for using sparse LiDAR signal alone. The number in brackets indicates the number of beams in use.
|
| 371 |
+
|
| 372 |
+
<table><tr><td rowspan=2 colspan=1>Depth Estimation</td><td rowspan=1 colspan=3>P-RCNN</td><td rowspan=1 colspan=3>PIXOR*</td></tr><tr><td rowspan=1 colspan=1>Easy</td><td rowspan=1 colspan=1>Moderate</td><td rowspan=1 colspan=1>Hard</td><td rowspan=1 colspan=1>Easy</td><td rowspan=1 colspan=1>Moderate</td><td rowspan=1 colspan=1>Hard</td></tr><tr><td rowspan=1 colspan=1>SDN</td><td rowspan=1 colspan=1>82.0/ 67.9</td><td rowspan=1 colspan=1>64.0/50.1</td><td rowspan=1 colspan=1>57.3/45.3</td><td rowspan=1 colspan=1>79.77-</td><td rowspan=1 colspan=1>61.1/-</td><td rowspan=1 colspan=1>54.5/ -</td></tr><tr><td rowspan=1 colspan=1>L# (2)L#(4)</td><td rowspan=1 colspan=1>69.2/46.373.2 / 56.1</td><td rowspan=1 colspan=1>62.8/41.971.3 / 53.1</td><td rowspan=1 colspan=1>61.3/40.070.5 / 51.5</td><td rowspan=1 colspan=1>66.8/-72.0/-</td><td rowspan=1 colspan=1>55.5/ -64.7/-</td><td rowspan=1 colspan=1>53.3/ -63.6/-</td></tr><tr><td rowspan=1 colspan=1>SDN + GDC (2)SDN + GDC (4)</td><td rowspan=1 colspan=1>87.2/73.388.2/75.1</td><td rowspan=1 colspan=1>72.0 / 56.676.9 / 63.8</td><td rowspan=1 colspan=1>67.1/ 54.173.4 /57.4</td><td rowspan=1 colspan=1>82.0/-84.0/-</td><td rowspan=1 colspan=1>65.3/-71.0/-</td><td rowspan=1 colspan=1>61.7/-65.2/ -</td></tr></table>
|
| 373 |
+
|
| 374 |
+
Table 9: Comparison of GDC and PNP for 3D object detection. We report $\mathsf { A P } _ { \mathrm { B E V } }$ / $\mathsf { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) of the car category at $\mathrm { I o U } { = } 0 . 7$ on the KITTI validation set, using SDN $^ +$ PNP or $\mathrm { S D N + G D C }$ for depth estimation and P-RCNN or $\mathrm { P I X O R } ^ { \star }$ for detection.
|
| 375 |
+
|
| 376 |
+
<table><tr><td rowspan="2">Input signal</td><td colspan="3">P-RCNN</td><td colspan="3">PIXOR*</td></tr><tr><td>Easy</td><td>Moderate</td><td>Hard</td><td>Easy</td><td>Moderate</td><td>Hard</td></tr><tr><td>SDN+PNP</td><td>86.3/72.1</td><td>73.3/ 58.9</td><td>67.2/54.2</td><td>79.1/-</td><td>64.2/-</td><td>54.0/-</td></tr><tr><td>SDN +GDC</td><td>88.2 /75.1</td><td>76.9 / 63.8</td><td>73.4/57.4</td><td>84.0/-</td><td>71.0 / -</td><td>65.2/ -</td></tr></table>
|
| 377 |
+
|
| 378 |
+
# D.3 DEPTH CORRECTION VS. DEPTH COMPLETION
|
| 379 |
+
|
| 380 |
+
We compare our GDC algorithm for depth correction to depth completion algorithms, which aim to “densify” LiDAR data beyond the beam lines (Wang et al., 2018; Tomasello et al., 2018; Ma et al., 2019; Yang et al., 2019; Cheng et al., 2018; Torres-Mendez & Dudek, $2 0 0 4 ) ^ { 6 }$ . We note that most depth completion approaches take as input a 64-beam LiDAR and a single image, while our focus is on fusing a much sparser 4-beam LiDAR and stereo depths. As such, the two problems are not
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 8: Comparison of GDC and PNP for depth correction. We report the median of absolute errors on the KITTI validation set. See text for details.
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 9: Median depth estimation errors w.r.t. the shortest distances to 4-beam LiDAR points on KITTI validation set.
|
| 387 |
+
|
| 388 |
+
Table 10: Comparison of 3D object detection using the naive and optimized implementation of GDC. We report $\mathsf { A P } _ { \mathrm { B E V } }$ / $\mathsf { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) of the car category at $\mathrm { I o U } { = } 0 . 7$ on the KITTI validation set, using P-RCNN for detection.
|
| 389 |
+
|
| 390 |
+
<table><tr><td></td><td>Easy</td><td>Moderate</td><td>Hard</td></tr><tr><td>Naive</td><td>88.2/75.1</td><td>76.9 / 63.8</td><td>73.4 / 57.4</td></tr><tr><td>Optimized</td><td>87.6 /75.0</td><td>76.3 / 63.4</td><td>73.1 / 57.0</td></tr></table>
|
| 391 |
+
|
| 392 |
+
commensurate. Also, our GDC algorithm is a general, simple, inference-time approach that requires no training, unlike prior learning-based approaches to depth completion.
|
| 393 |
+
|
| 394 |
+
Here we empirically compare to PNP (Wang et al., 2018), a recently proposed depth completion algorithm compatible with any (even stereo) depth estimation network, similar to GDC. We use SDN for initial depth estimation, and evaluate GDC and PNP by randomly selecting a fraction of LiDAR points as provided ground truths and calculating the median absolute depth errors on the remaining LiDAR points. As shown in Figure 8, GDC outperforms PNP by a large margin. Table 9 shows a further comparison to PNP on 3D object detection. We apply PNP and GDC respectively to correct the depth estimates obtained from SDN, train a P-RCNN or $\mathrm { P I X O R } ^ { \star }$ using the resulting pseudo-LiDAR points on the KITTI training set, and compare the detection results on the KITTI validation set. In either case, $\mathrm { S D N + G D C }$ outperforms $\mathrm { S D N + P N P }$ by a notable margin.
|
| 395 |
+
|
| 396 |
+
# D.4 RUN TIME
|
| 397 |
+
|
| 398 |
+
With the following optimizations for implementation,
|
| 399 |
+
|
| 400 |
+
1. Sub-sampling pseudo-LiDAR points: keeping at most one point within a cubic of size $0 . 1 \mathrm { m ^ { 3 } }$
|
| 401 |
+
2. Limiting the pseudo-LiDAR points for depth correction: keeping only those whose elevation angles are within $[ - 3 . 0 ^ { \circ } , 0 . \bar { 4 } ^ { \circ } )$ (the range of 4-beam LiDAR plus $0 . 6 ^ { \circ }$ ; see subsection C.1 for details)
|
| 402 |
+
3. After performing GDC for depth correction, combining the corrected pseudo-LiDAR points with those outsides the elevation angles of $[ - 3 . 0 ^ { \circ } , 0 . \bar { 4 ^ { \circ } } )$
|
| 403 |
+
|
| 404 |
+
GDC runs in 90 ms/frame using a single GPU (7.7ms for KD-tree construction and search, $4 6 . 5 \mathrm { m s }$ for solving $W$ , and $2 6 . 9 \mathrm { m s }$ for solving $Z _ { P L } ^ { \prime } )$ with negligible performance difference (see Table 10). For consistency, all results reported in the main paper are based on the naive implementation. Further speedups can be achieved by CUDA programming for GPUs.
|
| 405 |
+
|
| 406 |
+
# D.5 STEREO DEPTH VS. DETECTION
|
| 407 |
+
|
| 408 |
+
We quantitatively evaluate the stereo depths by median errors in Figure 4 of the main text (numerical values are listed in Table 11). In Table 12 we further show mean errors with standard deviation (the large standard deviation likely results from outliers such as occluded pixels around object boundaries).
|
| 409 |
+
|
| 410 |
+
Table 11: Median depth estimation errors over various depth ranges (numerical values of Figure 4).
|
| 411 |
+
|
| 412 |
+
<table><tr><td rowspan="2">Signal</td><td colspan="7">range (m)</td></tr><tr><td>0-10</td><td>10-20</td><td>20-30</td><td>30-40</td><td>40-50</td><td>50-60</td><td>60-70</td></tr><tr><td>PSMNet</td><td>0.04</td><td>0.11</td><td>0.36</td><td>0.83</td><td>1.24</td><td>1.98</td><td>2.43</td></tr><tr><td>SDN</td><td>0.07</td><td>0.12</td><td>0.30</td><td>0.60</td><td>0.89</td><td>1.31</td><td>1.73</td></tr><tr><td>SDN + GDC</td><td>0.07</td><td>0.12</td><td>0.27</td><td>0.51</td><td>0.74</td><td>1.03</td><td>1.53</td></tr></table>
|
| 413 |
+
|
| 414 |
+
Table 12: Mean depth estimation errors (with standard deviation) over various depth ranges.
|
| 415 |
+
|
| 416 |
+
<table><tr><td rowspan="2">Signal</td><td colspan="7">range (m)</td></tr><tr><td>0-10</td><td>10-20</td><td>20-30</td><td>30-40</td><td>40-50</td><td>50-60</td><td>60-70</td></tr><tr><td>PSMNet</td><td>0.18±0.93</td><td>0.36±1.20</td><td>0.97±2.32</td><td>2.02±4.05</td><td>2.94±5.64</td><td>4.61±8.03</td><td>6.03±10.32</td></tr><tr><td>SDN</td><td>0.21±0.89</td><td>0.35±1.16</td><td>0.87±2.31</td><td>1.80±4.22</td><td>2.67±6.00</td><td>4.27±8.78</td><td>5.82±11.23</td></tr><tr><td>SDN + GDC</td><td>0.21±0.90</td><td>0.35±1.17</td><td>0.84±2.34</td><td>1.74±4.27</td><td>2.59±6.06</td><td>4.14±8.85</td><td>5.72±11.29</td></tr></table>
|
| 417 |
+
|
| 418 |
+
For both tables, we divide pixels into beams according to their truth depths, and evaluate on pixels not on the 4-beam LiDAR. The improvement of SDN $^ +$ GDC) over PSMNET becomes larger as we consider pixels farther away. Table 13 further demonstrates the relationship between depth quality and detection accuracy: SDN $( + \mathrm { G D C } )$ significantly outperforms PSMNET for detecting faraway cars. We note that, for very faraway cars (i.e., $5 0 \mathrm { - } 7 0 \mathrm { m } )$ ), the number of training object instances are extremely small, which suggests that the very poor performance might partially cause by over-fitting.
|
| 419 |
+
|
| 420 |
+
Further, we apply the same evaluation procedure but group the errors by the shortest distance between each PSEUDO-LIDAR point and the 4-beam LiDAR points in Figure 9. We can see that the closer the PSEUDO-LIDAR points are to the 4-beam LiDAR points, the bigger improvement GDC can bring.
|
| 421 |
+
|
| 422 |
+
D.6 CONNECTED COMPONENTS IN KNN GRAPHS OF PSEUDO-LIDAR POINTS BY SDN
|
| 423 |
+
|
| 424 |
+
Here, we provide empirical analysis on the relationship between the $k$ we choose in building the Knearest-neighbor graph of PSEUDO-LIDAR points by SDN and the number of connected components of that graph. We show the results on KITTI validation set in Figure 11. It can be seen that with $k \geq 9$ , the average number of connected components in the graph is smaller than 2.
|
| 425 |
+
|
| 426 |
+
# D.7 FAILURE CASES AND WEAKNESS
|
| 427 |
+
|
| 428 |
+
There is still a gap between our approach and LiDAR for faraway objects (see Table 13). We further analyze $\mathsf { A P } _ { \mathrm { B E V } }$ at different IoU in Figure 10. For low IoU (0.2-0.5), SDN $( + \mathrm { G D C } )$ is on par with LiDAR, but the gap increases significantly at high IoU thresholds. This suggests that the predominant gap between our approach and LiDAR is because of mislocalization, perhaps due to residual inaccuracies in depth.
|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
Figure 10: IoU vs. $\mathbf { A P _ { B E V } }$ on KITTI validation set on the car category (moderate).
|
| 432 |
+
|
| 433 |
+

|
| 434 |
+
Figure 11: $k$ vs. average number of connected components in KNN graphs of PSEUDO-LIDAR points by SDN.
|
| 435 |
+
|
| 436 |
+
Table 13: 3D object detection at various depth ranges. We compare different input signals. We report $\mathrm { A P _ { B E V } } \ I$ $\mathsf { A P } _ { 3 \mathrm { D } }$ (in $\%$ ) of the car category at $\mathrm { I o U } { = } 0 . 7$ on the KITTI validation set, using P-RCNN for detection. In the last two rows we show the number of car objects in KITTI object train and validation sets within different ranges.
|
| 437 |
+
|
| 438 |
+
<table><tr><td rowspan=1 colspan=1>Input signal</td><td rowspan=1 colspan=1>0-30 m</td><td rowspan=1 colspan=1>30-50 m</td><td rowspan=1 colspan=1>50-70 m</td></tr><tr><td rowspan=1 colspan=1>PSMNETSDNSDN +GDCLIDAR</td><td rowspan=1 colspan=1>65.6/54.068.6 / 56.784.7 /67.888.5 /84.0</td><td rowspan=1 colspan=1>15.8/ 6.927.4 / 11.349.9 / 31.569.9 / 51.5</td><td rowspan=1 colspan=1>0.0/0.00.7/0.02.5 /1.08.9/3.4</td></tr><tr><td rowspan=1 colspan=1>#OBJECTS-TRAIN# OBJECTS-VAL</td><td rowspan=1 colspan=1>69037379</td><td rowspan=1 colspan=1>37683542</td><td rowspan=1 colspan=1>7639</td></tr></table>
|
| 439 |
+
|
| 440 |
+
# D.8 QUALITATIVE RESULTS
|
| 441 |
+
|
| 442 |
+
In Figure 6,12,13 and Figure 14, we show detection results using P-RCNN (with confidence $> 0 . 9 5$ ) with different input signals on four randomly chosen scenes in the KITTI object validation set. Specifically, we show the results from the frontal-view images and the bird’s-eye view (BEV) point clouds. In the BEV map, the observer is on the left-hand side looking to the right. It can be seen that the point clouds generated by PSEUDO-LIDAR $^ { + + }$ (SDN alone or $\mathrm { 5 D N + G D C }$ ) align better with LiDAR than those generated by PSEUDO-LIDAR (PSMNET). For nearby objects (i.e., bounding boxes close to the left in the BEV map), we see that P-RCNN with any point cloud performs fairly well in localization. However, for faraway objects (i.e., bounding boxes close to the right), PSEUDO-LIDAR with depth estimated from PSMNET predicts objects (red boxes) deviated from the ground truths (green boxes). Moreover, the noisy PSMNET points also leads to several false positives or negatives. In contrast, the detected boxes by our PSEUDO-LIDAR $^ { + + }$ , either with SDN alone or with SDN $+ \mathrm { G D C }$ , align pretty well with the ground truth boxes, justifying our targeted improvement in estimating faraway depths. In Figure 12, we see one failure case for both PSEUDO-LIDAR and PSEUDO-LIDAR $^ { + + }$ : the most faraway car is missed, while LiDAR signal can still detect it, suggesting that for very faraway objects stereo-based methods may still have limitation.
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
Figure 12: Qualitative Comparison. We show the detection results on a KITTI validation scene by P-RCNN with different input point clouds. We visualize them from both frontal-view images and bird’s-eye view (BEV) point maps. Ground-truth boxes are in green and predicted bounding boxes are in red. The observer is at the left-hand side of the BEV map looking to the right. In other words, ground truth boxes on the right are more faraway (i.e., deeper) from the observer, and hence hard to localize. Best viewed in color.
|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
Figure 13: Qualitative Comparison $\cdot$ another example. The same setup as in Figure 12
|
| 449 |
+
|
| 450 |
+

|
| 451 |
+
Figure 14: Qualitative Comparison $\cdot$ another example. The same setup as in Figure 12
|
md/train/BJij4yg0Z/BJij4yg0Z.md
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A BAYESIAN PERSPECTIVE ON GENERALIZATION AND STOCHASTIC GRADIENT DESCENT
|
| 2 |
+
|
| 3 |
+
Samuel L. Smith∗ & Quoc V. Le Google Brain {slsmith, qvl}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We consider two questions at the heart of machine learning; how can we predict if a minimum will generalize to the test set, and why does stochastic gradient descent find minima that generalize well? Our work responds to Zhang et al. (2016), who showed deep neural networks can easily memorize randomly labeled training data, despite generalizing well on real labels of the same inputs. We show that the same phenomenon occurs in small linear models. These observations are explained by the Bayesian evidence, which penalizes sharp minima but is invariant to model parameterization. We also demonstrate that, when one holds the learning rate fixed, there is an optimum batch size which maximizes the test set accuracy. We propose that the noise introduced by small mini-batches drives the parameters towards minima whose evidence is large. Interpreting stochastic gradient descent as a stochastic differential equation, we identify the “noise scale” $\begin{array} { r } { \overline { { g } } = \epsilon ( \frac { N } { B } - 1 ) \approx } \end{array}$ $\epsilon N / B$ , where $\epsilon$ is the learning rate, $N$ the training set size and $B$ the batch size. Consequently the optimum batch size is proportional to both the learning rate and the size of the training set, $B _ { o p t } \propto \epsilon N$ . We verify these predictions empirically.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
This paper shows Bayesian principles can explain many recent observations in the deep learning literature, while also discovering practical new insights. Zhang et al. (2016) trained deep convolutional networks on ImageNet and CIFAR10, achieving excellent accuracy on both training and test sets. They then took the same input images, but randomized the labels, and found that while their networks were now unable to generalize to the test set, they still memorized the training labels. They claimed these results contradict learning theory, although this claim is disputed (Kawaguchi et al., 2017; Dziugaite & Roy, 2017). Nonetheless, their results beg the question; if our models can assign arbitrary labels to the training set, why do they work so well in practice? Meanwhile Keskar et al. (2016) observed that if we hold the learning rate fixed and increase the batch size, the test accuracy usually falls. This striking result shows improving our estimate of the full-batch gradient can harm performance. Goyal et al. (2017) observed a linear scaling rule between batch size and learning rate in a deep ResNet, while Hoffer et al. (2017) proposed a square root rule on theoretical grounds.
|
| 12 |
+
|
| 13 |
+
Many authors have suggested “broad minima” whose curvature is small may generalize better than “sharp minima” whose curvature is large (Chaudhari et al., 2016; Hochreiter & Schmidhuber, 1997). Indeed, Dziugaite & Roy (2017) argued the results of Zhang et al. (2016) can be understood using “nonvacuous” PAC-Bayes generalization bounds which penalize sharp minima, while Keskar et al. (2016) showed stochastic gradient descent (SGD) finds wider minima as the batch size is reduced. However Dinh et al. (2017) challenged this interpretation, by arguing that the curvature of a minimum can be arbitrarily increased by changing the model parameterization. In this work we show:
|
| 14 |
+
|
| 15 |
+
• The results of Zhang et al. (2016) are not unique to deep learning; we observe the same phenomenon in a small “over-parameterized” linear model. We demonstrate that this phenomenon is straightforwardly understood by evaluating the Bayesian evidence in favor of each model, which penalizes sharp minima but is invariant to the model parameterization.
|
| 16 |
+
|
| 17 |
+
• SGD integrates a stochastic differential equation whose “noise scale” $g \approx \epsilon N / B$ , where $\epsilon$ is the learning rate, $N$ training set size and $B$ batch size. Noise drives SGD away from sharp minima, and therefore there is an optimal batch size which maximizes the test set accuracy. This optimal batch size is proportional to the learning rate and training set size1.
|
| 18 |
+
|
| 19 |
+
We describe Bayesian model comparison in section 2. In section 3 we replicate the observations of Zhang et al. (2016) in a linear model, and show they are explained by the Bayesian evidence. In section 4 we show there is an optimum batch size which maximizes the test set accuracy, and in section 5 we derive scaling rules between the optimum batch size, learning rate, training set size and momentum coefficient. Throughout this work, “generalization gap” refers to the gap in test accuracy between small and large batch SGD training, not the gap in accuracy between training and test sets.
|
| 20 |
+
|
| 21 |
+
# 2 BAYESIAN MODEL COMPARISON
|
| 22 |
+
|
| 23 |
+
Bayesian model comparison was first applied to neural networks in MacKay (1992). We provide a brief tutorial here, since the theory is central to the remainder of the paper. For simplicity we first consider a classification model $M$ with a single parameter $\omega$ , training inputs $x$ and training labels $y$ . We can infer a posterior probability distribution over the parameter by applying Bayes theorem,
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\begin{array} { r c l } { P ( \omega | y , x ; M ) } & { = } & { \frac { P ( y | \omega , x ; M ) P ( \omega ; M ) } { P ( y | x ; M ) } } \end{array}
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
The likelihood, $\begin{array} { r c l c l } { P ( y | \omega , x ; M ) } & { = } & { \prod _ { i } P ( y _ { i } | \omega , x _ { i } ; M ) } & { = } & { e ^ { - H ( \omega ; M ) } } \end{array}$ , where $\begin{array} { r l } { H ( \omega ; M ) } & { { } = } \end{array}$ $\begin{array} { r } { - \sum _ { i } \ln \left( P ( y _ { i } | \omega , x _ { i } ; \dot { M } ) \right) } \end{array}$ denotes the cross-entropy of unique categorical labels. We typically use a Gaussian prior, $P ( \omega ; M ) = \sqrt { \lambda / 2 \pi } e ^ { - \lambda \omega ^ { 2 } / 2 }$ , and therefore the posterior probability density of the parameter given the training data, $P ( \omega | y , x ; M ) \propto \sqrt { \lambda / 2 \pi } e ^ { - C ( \omega ; M ) }$ , where $C ( \omega ; M ) =$ $H ( \omega ; M ) + \lambda \omega ^ { 2 } / 2$ denotes the L2 regularized cross entropy, or “cost function”, and $\lambda$ is the regularization coefficient. The value $\omega _ { 0 }$ which minimizes the cost function lies at the maximum of this posterior. To predict an unknown label $y _ { t }$ of a new input $x _ { t }$ , we should compute the integral,
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\begin{array} { r c l } { P ( y _ { t } | x _ { t } , y , x ; M ) } & { = } & { \displaystyle \int d \omega P ( y _ { t } | \omega , x _ { t } ; M ) P ( \omega | y , x ; M ) } \\ & { = } & { \displaystyle \frac { \int d \omega P ( y _ { t } | \omega , x _ { t } ; M ) e ^ { - C ( \omega ; M ) } } { \int d \omega e ^ { - C ( \omega ; M ) } } . } \end{array}
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
However these integrals are dominated by the region near $\omega _ { 0 }$ , and since $P ( y _ { t } | \omega , x _ { t } ; M )$ is smooth we usually approximate $P ( y _ { t } | x _ { t } , x , y ; M ) \approx P ( y _ { t } | \omega _ { 0 } , x _ { t } ; M )$ . Having minimized $C ( \omega ; M )$ to find $\omega _ { 0 }$ , we now wish to compare two different models and select the best one. The probability ratio,
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\frac { P ( M _ { 1 } | y , x ) } { P ( M _ { 2 } | y , x ) } = \frac { P ( y | x ; M _ { 1 } ) } { P ( y | x ; M _ { 2 } ) } \frac { P ( M _ { 1 } ) } { P ( M _ { 2 } ) } .
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
The second factor on the right is the prior ratio, which describes which model is most plausible. To avoid unnecessary subjectivity, we usually set this to 1. Meanwhile the first factor on the right is the evidence ratio, which controls how much the training data changes our prior beliefs. Germain et al. (2016) showed that maximizing the evidence (or “marginal likelihood”) minimizes a PAC-Bayes generalization bound. To compute it, we evaluate the normalizing constant of equation 1,
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { r c l } { { P ( y | x ; M ) } } & { { = } } & { { \displaystyle \int d \omega P ( y | \omega , x ; M ) P ( \omega ; M ) } } \\ { { } } & { { = } } & { { \displaystyle \sqrt { \frac { \lambda } { 2 \pi } } \int d \omega e ^ { - C ( \omega ; M ) } . } } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Notice that the evidence is computed by integrating out the parameters; and consequently it is invariant to the model parameterization. Since this integral is dominated by the region near the minimum $\omega _ { 0 }$ , we can estimate the evidence by Taylor expanding $C ( \omega ; M ) \approx \dot { C } ( \omega _ { 0 } ) + \dot { C } ^ { \prime \prime } ( \omega _ { 0 } ) ( \omega - \omega _ { 0 } ) ^ { 2 } / 2 .$ ,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r c l } { P ( y | x ; M ) } & { \approx } & { { { e } ^ { - C ( \omega _ { 0 } ) } } \displaystyle \sqrt { \frac { \lambda } { 2 \pi } } \int d \omega { e } ^ { - C ^ { \prime \prime } ( \omega _ { 0 } ) ( \omega - \omega _ { 0 } ) ^ { 2 } / 2 } } \\ & { = } & { \exp \bigg \{ - \bigg ( C ( \omega _ { 0 } ) + \frac { 1 } { 2 } \ln \left( C ^ { \prime \prime } ( \omega _ { 0 } ) / \lambda \right) \bigg ) \bigg \} . } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
1Equivalently, there is an optimal learning rate proportional to the batch size and the training set size.
|
| 54 |
+
|
| 55 |
+
Within this “Laplace” approximation, the evidence is controlled by the value of the cost function at the minimum, and by the logarithm of the ratio of the curvature about this minimum compared to the regularization constant. Thus far we have considered models of a single parameter; in realistic models with many parameters $P ( y | x ; M ) \approx \lambda ^ { \frac { p } { 2 } } e ^ { - C ( \omega _ { 0 } ) } / | \nabla \nabla C ( \omega ) | _ { \omega _ { 0 } } ^ { 1 / 2 }$ , where $| \nabla \nabla C ( \omega ) | _ { \omega _ { 0 } }$ is the determinant of the Hessian, and $p$ denotes the number of model parameters (Kass & Raftery, 1995). The determinant of the Hessian is simply the product of its eigenvalues, $( \prod _ { i = 1 } ^ { p } \lambda _ { i } )$ , and thus,
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
P ( y | x ; M ) \approx \exp \Bigg \{ - \left( C ( \omega _ { 0 } ) + \frac { 1 } { 2 } \sum _ { i = 1 } ^ { p } \ln ( \lambda _ { i } / \lambda ) \right) \Bigg \} .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
The contribution $( \lambda ^ { \frac { p } { 2 } } / | \nabla \nabla C ( \omega ) | _ { \omega _ { 0 } } ^ { 1 / 2 } )$ is often called the “Occam factor”, because it enforces Occam’s razor; when two models describe the data equally well, the simpler model is usually better (Gull, 1988). Minima with low curvature are simple, because the parameters do not have to be finetuned to fit the data. Intuitively, the Occam factor describes the fraction of the prior parameter space consistent with the data. Since this fraction is always less than one, we propose to approximate equation 9 away from local minima by only performing the summation over eigenvalues $\lambda _ { i } \geq \lambda$ . The evidence can be reframed in the language of information theory, whereby Occam’s factor penalizes the amount of information the model must learn about the parameters to accurately model the training data (Hinton & Van Camp, 1993; Achille & Soatto, 2017; Shwartz-Ziv & Tishby, 2017).
|
| 62 |
+
|
| 63 |
+
In this work, we will compare the evidence against a null model which assumes the labels are entirely random, assigning equal probability to each class. This unusual model has no parameters, and so the evidence is controlled by the likelihood alone, $P ( y | x ; N U L L ) = ( 1 / n ) ^ { N } \stackrel { - } { = } e ^ { - N \ln { ( n ) } }$ , where $n$ denotes the number of model classes and $N$ the number of training labels. Thus the evidence ratio,
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\frac { P ( y | x ; M ) } { P ( y | x ; N U L L ) } = e ^ { - E ( \omega _ { 0 } ) } ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Where $\begin{array} { r } { E ( \omega _ { 0 } ) = C ( \omega _ { 0 } ) + ( 1 / 2 ) \sum _ { i } \ln ( \lambda _ { i } / \lambda ) - N \ln ( n ) } \end{array}$ is the log evidence ratio in favor of the null model. Clearly, we should only assign any confidence to the predictions of our model if $E ( \omega _ { 0 } ) < 0$ .
|
| 70 |
+
|
| 71 |
+
The evidence supports the intuition that broad minima generalize better than sharp minima, but unlike the curvature it does not depend on the model parameterization. Dinh et al. (2017) showed one can increase the Hessian eigenvalues by rescaling the parameters, but they must simultaneously rescale the regularization coefficients, otherwise the model changes. Since Occam’s factor arises from the log ratio, $\ln \left( \lambda _ { i } / \lambda \right)$ , these two effects cancel out2. It is difficult to evaluate the evidence for deep networks, as we cannot compute the Hessian of millions of parameters. Additionally, neural networks exhibit many equivalent minima, since we can permute the hidden units without changing the model. To compute the evidence we must carefully account for this “degeneracy”. We argue these issues are not a major limitation, since the intuition we build studying the evidence in simple cases will be sufficient to explain the results of both Zhang et al. (2016) and Keskar et al. (2016).
|
| 72 |
+
|
| 73 |
+
# 3 BAYES THEOREM AND GENERALIZATION
|
| 74 |
+
|
| 75 |
+
Zhang et al. (2016) showed that deep neural networks generalize well on training inputs with informative labels, and yet the same model can drastically overfit on the same input images when the labels are randomized; perfectly memorizing the training set. To demonstrate that these observations are not unique to deep networks, let’s consider a far simpler model; logistic regression. We form a small balanced training set comprising 800 images from MNIST, of which half have true label $\mathbf { \vec { \Delta } } ^ { 6 } 0 ^ { 9 }$ and half true label “1”. Our test set is also balanced, comprising 5000 MNIST images of zeros and 5000 MNIST images of ones. There are two tasks. In the first task, the labels of both the training and test sets are randomized. In the second task, the labels are informative, matching the true MNIST labels. Since the images contain 784 pixels, our model has just 784 weights and 1 bias.
|
| 76 |
+
|
| 77 |
+
We show the accuracy of the model predictions on both the training and test sets in figure 1. When trained on the informative labels, the model generalizes well to the test set, so long as it is weakly regularized. However the model also perfectly memorizes the random labels, replicating the observations of Zhang et al. (2016) in deep networks. No significant improvement in model performance is observed as the regularization coefficient increases. For completeness, we also evaluate the mean margin between training examples and the decision boundary. For both random and informative labels, the margin drops significantly as we reduce the regularization coefficient. When weakly regularized, the mean margin is roughly $5 0 \%$ larger for informative labels than for random labels.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 1: Prediction accuracy and mean training set margin as a function of regularization coefficient, for a logistic regression trained on random (a) and informative (b) labels of the same inputs. The weakly regularized model generalizes well on informative labels but memorizes random labels.
|
| 81 |
+
|
| 82 |
+
Now consider figure 2, where we plot the mean cross-entropy of the model predictions, evaluated on both training and test sets, as well as the Bayesian log evidence ratio defined in the previous section. Looking first at the random label experiment in figure 2a, while the cross-entropy on the training set vanishes when the model is weakly regularized, the cross-entropy on the test set explodes. Not only does the model make random predictions, but it is extremely confident in those predictions. As the regularization coefficient is increased the test set cross-entropy falls, settling at $\ln 2$ , the crossentropy of assigning equal probability to both classes. Now consider the Bayesian evidence, which we evaluate on the training set. The log evidence ratio is large and positive when the model is weakly regularized, indicating that the model is exponentially less plausible than assigning equal probabilities to each class. As the regularization parameter is increased, the log evidence ratio falls, but it is always positive, indicating that the model can never be expected to generalize well.
|
| 83 |
+
|
| 84 |
+
Now consider figure 2b (informative labels). Once again, the training cross-entropy falls to zero when the model is weakly regularized, while the test cross-entropy is high. Even though the model makes accurate predictions, those predictions are overconfident. As the regularization coefficient increases, the test cross-entropy falls below $\ln 2$ , indicating that the model is successfully generalizing to the test set. Now consider the Bayesian evidence. The log evidence ratio is large and positive when the model is weakly regularized, but as the regularization coefficient increases, the log evidence ratio drops below zero, indicating that the model is exponentially more plausible than assigning equal probabilities to each class. As we further increase the regularization, the log evidence ratio rises to zero while the test cross-entropy rises to $\ln 2$ . Test cross-entropy and Bayesian evidence are strongly correlated, with minima at the same regularization strength.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: The cross-entropy and log evidence ratio, evaluated on random (a) or informative (b) labels. The evidence, evaluated on the training set, is strongly correlated with the test cross-entropy.
|
| 88 |
+
|
| 89 |
+
Bayesian model comparison has explained our results in a logistic regression. Meanwhile, Krueger et al. (2017) showed the largest Hessian eigenvalue also increased when training on random labels in deep networks, implying the evidence is falling. We conclude that Bayesian model comparison is quantitatively consistent with the results of Zhang et al. (2016) in linear models where we can compute the evidence, and qualitatively consistent with their results in deep networks where we cannot. Dziugaite & Roy (2017) recently demonstrated the results of Zhang et al. (2016) can also be understood by minimising a PAC-Bayes generalization bound which penalizes sharp minima.
|
| 90 |
+
|
| 91 |
+
# 4 BAYES THEOREM AND STOCHASTIC GRADIENT DESCENT
|
| 92 |
+
|
| 93 |
+
We showed above that generalization is strongly correlated with the Bayesian evidence, a weighted combination of the depth of a minimum (the cost function) and its breadth (the Occam factor). Consequently Bayesians often add isotropic Gaussian noise to the gradient (Welling & Teh, 2011). In appendix A, we show this drives the parameters towards broad minima whose evidence is large. The noise introduced by small batch training is not isotropic, and its covariance matrix is a function of the parameter values, but empirically Keskar et al. (2016) found it has similar effects, driving the SGD away from sharp minima. This paper therefore proposes Bayesian principles also account for the “generalization gap”, whereby the test set accuracy often falls as the SGD batch size is increased (holding all other hyper-parameters constant). Since the gradient drives the SGD towards deep minima, while noise drives the SGD towards broad minima, we expect the test set performance to show a peak at an optimal batch size, which balances these competing contributions to the evidence.
|
| 94 |
+
|
| 95 |
+
We were unable to observe a generalization gap in linear models (since linear models are convex there are no sharp minima to avoid). Instead we consider a shallow neural network with 800 hidden units and RELU hidden activations, trained on MNIST without regularization. We use SGD with a momentum parameter of 0.9. Unless otherwise stated, we use a constant learning rate of 1.0 which does not depend on the batch size or decay during training. Furthermore, we train on just 1000 images, selected at random from the MNIST training set. This enables us to compare small batch to full batch training. We emphasize that we are not trying to achieve optimal performance, but to study a simple model which shows a generalization gap between small and large batch training.
|
| 96 |
+
|
| 97 |
+
In figure 3, we exhibit the evolution of the test accuracy and test cross-entropy during training. Our small batches are composed of 30 images, randomly sampled from the training set. Looking first at figure 3a, small batch training takes longer to converge, but after a thousand gradient updates a clear generalization gap in model accuracy emerges between small and large training batches. Now consider figure 3b. While the test cross-entropy for small batch training is lower at the end of training; the cross-entropy of both small and large training batches is increasing, indicative of over-fitting. Both models exhibit a minimum test cross-entropy, although after different numbers of gradient updates. Intriguingly, we show in appendix B that the generalization gap between small and large batch training shrinks significantly when we introduce L2 regularization.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 3: The evolution during training of the test accuracy (a), and the test set cross-entropy (b). Full batches are composed of 1000 images, while small batches comprise 30 images.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 4: The test accuracy for a range of batch sizes, during training (a) and after 10000 steps (b).
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 5: a) The test set accuracy as a function of batch size, for a range of learning rates $\epsilon$ . The performance peak shifts to the right as we increase $\epsilon$ , but the overall performance falls once $\epsilon \gtrsim 3$ . b) The best observed batch size is proportional to the learning rate across two orders of magnitude.
|
| 107 |
+
|
| 108 |
+
From now on we focus on the test set accuracy (since this converges as the number of gradient updates increases). In figure 4a, we exhibit training curves for a range of batch sizes between 1 and 1000. We find that the model cannot train when the batch size $B \lessapprox \bar { 1 0 }$ . In figure 4b we plot the mean test set accuracy after 10000 training steps. A clear peak emerges, indicating that there is indeed an optimum batch size which maximizes the test accuracy, consistent with Bayesian intuition. The results of Keskar et al. (2016) focused on the decay in test accuracy above this optimum batch size.
|
| 109 |
+
|
| 110 |
+
# 5 STOCHASTIC DIFFERENTIAL EQUATIONS AND THE SCALING RULES
|
| 111 |
+
|
| 112 |
+
We showed above that the test accuracy peaks at an optimal batch size, if one holds the other SGD hyper-parameters constant. We argued that this peak arises from the tradeoff between depth and breadth in the Bayesian evidence. However it is not the batch size itself which controls this tradeoff, but the underlying scale of random fluctuations in the SGD dynamics. We now identify this SGD “noise scale”, and use it to derive three scaling rules which predict how the optimal batch size depends on the learning rate, training set size and momentum coefficient. A gradient update,
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { r c l } { \Delta \omega } & { = } & { - \displaystyle \frac { \epsilon } { N } \left( \frac { d C } { d \omega } + \left( \frac { d \hat { C } } { d \omega } - \frac { d C } { d \omega } \right) \right) , } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 6: a) The test accuracy as a function of batch size, for a range of training set sizes. To reduce noise, we average each curve over five experiments. The performance peak shift to the right as we increase the size of the training set. Unsurprisingly, the overall model performance also improves. b) The best observed batch size is proportional to the size of the training set once $N \gtrsim 2 0 0 0 \bar { 0 }$ .
|
| 120 |
+
|
| 121 |
+
where is the learning rate, N the training set size, dCdω $\begin{array} { r } { \frac { d C } { d \omega } = \sum _ { i = 1 } ^ { N } \frac { d C _ { i } } { d \omega } } \end{array}$ the true gradient, and $\begin{array} { r } { \frac { d \hat { C } } { d \omega } = } \end{array}$ NB PBi=1 dCidω the estimated gradient evaluated on a mini-batch. The expected gradient of a single example, $\begin{array} { r } { \left. \frac { d C _ { i } } { d \omega } \right. = \frac { 1 } { N } \frac { d C } { d \omega } } \end{array}$ , while $\begin{array} { r } { \left. \frac { d C _ { i } } { d \omega } \frac { d C _ { j } } { d \omega } \right. = \left( \frac { 1 } { N } \frac { d C } { d \omega } \right) ^ { 2 } + F ( \omega ) \delta _ { i j } . \mathrm { ~ } F ( \omega } \end{array}$ is a matrix describing the gradient covariances, which are a functheorem and model the gradient error $\begin{array} { r } { \alpha = ( \frac { d \hat { C } } { d \omega } - \frac { d C } { d \omega } ) } \end{array}$ nt par with alues. n rando approximation briefly in appendix C). It is easy to show that $\langle \alpha \rangle = 0$ $\begin{array} { r } { \langle \alpha ^ { 2 } \rangle = N ( \frac { N } { B } - 1 ) F ( \omega ) } \end{array}$ . Typically $N \gg B$ , such that $\langle \alpha ^ { 2 } \rangle \approx N ^ { 2 } F ( \omega ) / B$ . To continue, we interpret equation 11 as the discrete update of a stochastic differential equation (Li et al., 2017; Gardiner, 1985),
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\frac { d \omega } { d t } = - \frac { d C } { d \omega } + \eta ( t ) ,
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
Where $t$ is a continuous variable, $\eta ( t )$ represents noise, $\langle \eta ( t ) \rangle = 0$ and $\langle \eta ( t ) \eta ( t ^ { \prime } ) \rangle = g F ( \omega ) \delta ( t { - } t ^ { \prime } )$ . The constant $g$ controls the scale of random fluctuations in the dynamics. To relate this differential equation to the SGD, we compute a gradient update $\begin{array} { r } { \Delta \omega = \int _ { 0 . } ^ { \epsilon / N } \frac { d \omega } { d t } d t = - \frac { \epsilon } { N } \frac { d C } { d \omega } + \int _ { 0 } ^ { \epsilon / N } \eta ( t ) d t } \end{array}$ Finally, to measure $\mathbf { g }$ , we equate the variance in this gradient update to the variance in equation 11,
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\begin{array} { r c l } { \displaystyle \left( \frac { \epsilon } { N } \right) ^ { 2 } \langle \alpha ^ { 2 } \rangle } & { = } & { \displaystyle \epsilon ^ { 2 } ( \frac { N } { B } - 1 ) F ( \omega ) / N } \\ { \displaystyle } & { = } & { \displaystyle \langle ( \int _ { 0 } ^ { \epsilon / N } d t \eta ( t ) ) ^ { 2 } \rangle = \int _ { 0 } ^ { \epsilon / N } d t \int _ { 0 } ^ { \epsilon / N } d t ^ { \prime } \langle \eta ( t ) \eta ( t ^ { \prime } ) \rangle = \epsilon g F ( \omega ) / N . } \end{array}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
Rearranging, the SGD noise scale $\begin{array} { r } { g = \epsilon ( \frac { N } { B } - 1 ) \approx \epsilon N / B } \end{array}$ . The noise scale falls when the batch size increases, consistent with our earlier observation of an optimal batch size $B _ { o p t }$ while holding the other hyper-parameters fixed. Notice that one would equivalently observe an optimal learning rate if one held the batch size constant. A similar analysis of the SGD was recently performed by Mandt et al. (2017), although their treatment only holds near local minima where the covariances $F ( \omega )$ are stationary. Our analysis holds throughout training, which is necessary since Keskar et al. (2016) found that the beneficial influence of noise was most pronounced at the start of training.
|
| 134 |
+
|
| 135 |
+
When we vary the learning rate or the training set size, we should keep the noise scale fixed, which implies that $B _ { o p t } \propto \epsilon N$ . In figure 5a, we plot the test accuracy as a function of batch size after $( 1 0 0 0 0 / \epsilon )$ training steps, for a range of learning rates. Exactly as predicted, the peak moves to the right as $\epsilon$ increases. Additionally, the peak test accuracy achieved at a given learning rate does not begin to fall until $\epsilon \sim 3$ , indicating that there is no significant discretization error in integrating the stochastic differential equation below this point. Above this point, the discretization error begins to dominate and the peak test accuracy falls rapidly. In figure 5b, we plot the best observed batch size as a function of learning rate, observing a clear linear trend, $B _ { o p t } \propto \epsilon$ . The error bars indicate the distance from the best observed batch size to the next batch size sampled in our experiments.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 7: a) The test set accuracy as a function of batch size for a range of momentum coefficients. As expected, the peak moves to the right as the momentum coefficient increases. b) The best observed batch size for a range of momentum coefficients. The green curve exhibits the scaling rule.
|
| 139 |
+
|
| 140 |
+
This scaling rule allows us to increase the learning rate with no loss in test accuracy and no increase in computational cost, simply by simultaneously increasing the batch size. We can then exploit increased parallelism across multiple GPUs, reducing model training times (Goyal et al., 2017). A similar scaling rule was independently proposed by Jastrzebski et al. (2017) and Chaudhari & Soatto (2017), although neither work identifies the existence of an optimal noise scale. A number of authors have proposed adjusting the batch size adaptively during training (Friedlander & Schmidt, 2012; Byrd et al., 2012; De et al., 2017), while Balles et al. (2016) proposed linearly coupling the learning rate and batch size within this framework. In Smith et al. (2017), we show empirically that decaying the learning rate during training and increasing the batch size during training are equivalent.
|
| 141 |
+
|
| 142 |
+
In figure 6a we exhibit the test set accuracy as a function of batch size, for a range of training set sizes after 10000 steps $\mathbf { \epsilon } \cdot \mathbf { \epsilon } = 1$ everywhere). Once again, the peak shifts right as the training set size rises, although the generalization gap becomes less pronounced as the training set size increases. In figure 6b, we plot the best observed batch size as a function of training set size; observing another linear trend, $B _ { o p t } \propto N$ . This scaling rule could be applied to production models, progressively growing the batch size as new training data is collected. We expect production datasets to grow considerably over time, and consequently large batch training is likely to become increasingly common.
|
| 143 |
+
|
| 144 |
+
Finally, in appendix $\mathrm { D }$ we extend our analysis to SGD with momentum, identifying the noise scale, $\begin{array} { r } { g \approx \frac { \epsilon N ^ { \mathrm { ~ \scriptsize ~ \cdots ~ } } } { B ( 1 - m ) } } \end{array}$ , where $m$ denotes the momentum coefficient. Notice that this reduces to the noise scale of conventional SGD as $m 0$ . When $m > 0$ , we obtain an additional scaling rule $B _ { o p t } \propto$ $1 / ( 1 - m )$ . This scaling rule predicts that the optimal batch size will increase when the momentum coefficient is increased. In figure 7a we plot the test set performance as a function of batch size after 10000 gradient updates ( $\mathbf { \epsilon } _ { \epsilon } = 1$ everywhere), for a range of momentum coefficients. In figure 7b, we plot the best observed batch size as a function of the momentum coefficient, and fit our results to the scaling rule above; obtaining remarkably good agreement. We propose a simple heuristic for tuning the batch size, learning rate and momentum coefficient in appendix E.
|
| 145 |
+
|
| 146 |
+
# 6 CONCLUSIONS
|
| 147 |
+
|
| 148 |
+
Just like deep neural networks, linear models which generalize well on informative labels can memorize random labels of the same inputs. These observations are explained by the Bayesian evidence, which is composed of the cost function and an “Occam factor”. The Occam factor penalizes sharp minima but it is invariant to changes in model parameterization. Mini-batch noise drives SGD away from sharp minima, and therefore there is an optimum batch size which maximizes the test accuracy. Interpreting SGD as the discretization of a stochastic differential equation, we predict this optimum batch size should scale linearly with both the learning rate and the training set size, $B _ { o p t } \propto \epsilon N$ . We derive an additional scaling rule, $B _ { o p t } \propto 1 / ( 1 - \stackrel { \textstyle - } { m } )$ , between the optimal batch size and the momentum coefficient. We verify these scaling rules empirically and discuss their implications.
|
| 149 |
+
|
| 150 |
+
# ACKNOWLEDGMENTS
|
| 151 |
+
|
| 152 |
+
We thank Pieter-Jan Kindermans, Prajit Ramachandran, Jascha Sohl-Dickstein, Jon Shlens, Kevin Murphy, Samy Bengio, Yasaman Bahri and Saeed Saremi for helpful comments on the manuscript.
|
| 153 |
+
|
| 154 |
+
# REFERENCES
|
| 155 |
+
|
| 156 |
+
Alessandro Achille and Stefano Soatto. On the emergence of invariance and disentangling in deep representations. arXiv preprint arXiv:1706.01350, 2017.
|
| 157 |
+
|
| 158 |
+
Lukas Balles, Javier Romero, and Philipp Hennig. Coupling adaptive batch sizes with learning rates. arXiv preprint arXiv:1612.05086, 2016.
|
| 159 |
+
|
| 160 |
+
Richard H Byrd, Gillian M Chin, Jorge Nocedal, and Yuchen Wu. Sample size selection in optimization methods for machine learning. Mathematical programming, 134(1):127–155, 2012.
|
| 161 |
+
|
| 162 |
+
Pratik Chaudhari and Stefano Soatto. Stochastic gradient descent performs variational inference, converges to limit cycles for deep networks. arXiv preprint arXiv:1710.11029, 2017.
|
| 163 |
+
|
| 164 |
+
Pratik Chaudhari, Anna Choromanska, Stefano Soatto, and Yann LeCun. Entropy-SGD: Biasing gradient descent into wide valleys. arXiv preprint arXiv:1611.01838, 2016.
|
| 165 |
+
|
| 166 |
+
Soham De, Abhay Yadav, David Jacobs, and Tom Goldstein. Automated inference with adaptive batches. In Artificial Intelligence and Statistics, pp. 1504–1513, 2017.
|
| 167 |
+
|
| 168 |
+
Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. arXiv preprint arXiv:1703.04933, 2017.
|
| 169 |
+
|
| 170 |
+
Gintare Karolina Dziugaite and Daniel M Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. arXiv preprint arXiv:1703.11008, 2017.
|
| 171 |
+
|
| 172 |
+
Michael P Friedlander and Mark Schmidt. Hybrid deterministic-stochastic methods for data fitting. SIAM Journal on Scientific Computing, 34(3):A1380–A1405, 2012.
|
| 173 |
+
|
| 174 |
+
Crispin W Gardiner. Handbook of Stochastic Methods, volume 4. Springer Berlin, 1985.
|
| 175 |
+
|
| 176 |
+
Pascal Germain, Francis Bach, Alexandre Lacoste, and Simon Lacoste-Julien. PAC-bayesian theory meets bayesian inference. In Advances in Neural Information Processing Systems, pp. 1884– 1892, 2016.
|
| 177 |
+
|
| 178 |
+
Priya Goyal, Piotr Dollar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, An- ´ drew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 179 |
+
|
| 180 |
+
Stephen F Gull. Bayesian inductive inference and maximum entropy. In Maximum-entropy and Bayesian methods in science and engineering, pp. 53–74. Springer, 1988.
|
| 181 |
+
|
| 182 |
+
Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the sixth annual conference on Computational learning theory, pp. 5–13. ACM, 1993.
|
| 183 |
+
|
| 184 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Flat minima. ¨ Neural Computation, 9(1):1–42, 1997.
|
| 185 |
+
|
| 186 |
+
Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. arXiv preprint arXiv:1705.08741, 2017.
|
| 187 |
+
|
| 188 |
+
Stanisław Jastrzebski, Zachary Kenton, Devansh Arpit, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amos Storkey. Three factors influencing minima in SGD. arXiv preprint arXiv:1711.04623, 2017.
|
| 189 |
+
|
| 190 |
+
Robert E Kass and Adrian E Raftery. Bayes factors. Journal of the american statistical association, 90(430):773–795, 1995.
|
| 191 |
+
|
| 192 |
+
Kenji Kawaguchi, Leslie Pack Kaelbling, and Yoshua Bengio. Generalization in deep learning. arXiv preprint arXiv:1710.05468, 2017.
|
| 193 |
+
|
| 194 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
|
| 195 |
+
|
| 196 |
+
David Krueger, Nicolas Ballas, Stanislaw Jastrzebski, Devansh Arpit, Maxinder S Kanwal, Tegan Maharaj, Emmanuel Bengio, Asja Fischer, and Aaron Courville. Deep nets don’t learn via memorization. ICLR Workshop, 2017.
|
| 197 |
+
|
| 198 |
+
Qianxiao Li, Cheng Tai, and E Weinan. Stochastic modified equations and adaptive stochastic gradient algorithms. In International Conference on Machine Learning, pp. 2101–2110, 2017.
|
| 199 |
+
|
| 200 |
+
David JC MacKay. A practical bayesian framework for backpropagation networks. Neural computation, 4(3):448–472, 1992.
|
| 201 |
+
|
| 202 |
+
Stephan Mandt, Matthew D Hoffman, and David M Blei. Stochastic gradient descent as approximate bayesian inference. arXiv preprint arXiv:1704.04289, 2017.
|
| 203 |
+
|
| 204 |
+
Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017.
|
| 205 |
+
|
| 206 |
+
Samuel L. Smith, Pieter-Jan Kindermans, and Quoc V. Le. Don’t decay the learning rate, increase the batch size. arXiv preprint arXiv:1711.00489, 2017.
|
| 207 |
+
|
| 208 |
+
Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 681–688, 2011.
|
| 209 |
+
|
| 210 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 211 |
+
|
| 212 |
+
# A BAYESIAN POSTERIOR SAMPLING AND LANGEVIN DYNAMICS
|
| 213 |
+
|
| 214 |
+
Instead of minimizing the cost function, Bayesian usually prefer to sample parameter values from the posterior (MacKay, 1992),
|
| 215 |
+
|
| 216 |
+
$$
|
| 217 |
+
P ( \omega | y , x ; M ) \propto e ^ { - C ( \omega ; M ) } ,
|
| 218 |
+
$$
|
| 219 |
+
|
| 220 |
+
where $C ( \omega ; M )$ is the regularized summed cost function, as shown in section 2 of the main text. It is well known that one can sample this posterior by simulating the overdamped Langevin equation (Gardiner, 1985), which is described by the stochastic differential equation,
|
| 221 |
+
|
| 222 |
+
$$
|
| 223 |
+
\frac { d \omega } { d t } = - \frac { d C } { d \omega } + \eta ( t ) ,
|
| 224 |
+
$$
|
| 225 |
+
|
| 226 |
+
where $t$ is a continuous variable, and $\eta ( t )$ describes Gaussian noise with mean $\langle \eta ( t ) \rangle = 0$ and variance $\langle \eta ( t ) \eta ( t ^ { \prime } ) \rangle = 2 T I \delta ( t - t ^ { \prime } )$ . The matrix $I$ denotes the identity, while $T$ is the “temperature”. Notice this Langevin equation is extremely similar to the stochastic differential equation of SGD, discussed in section 5 of the main text. Indeed, if the gradient covariances $F ( \omega )$ were stationary and proportional to the identity, then the SGD would integrate an overdamped Langevin equation with temperature proportional to the SGD noise scale $g$ . As $t \to \infty$ , the probability of sampling any particular parameter vector $\omega$ from the Langevin equation, $P ( \omega , t \infty ) \propto e ^ { - C / \dot { T } }$ .
|
| 227 |
+
|
| 228 |
+
We obtain posterior samples if $T = 1$ . In order to draw posterior samples in practice, we repeatedly integrate the Langevin equation (at temperature $T = 1$ ), over a finite step $t \to t + \epsilon / N$ ,
|
| 229 |
+
|
| 230 |
+
$$
|
| 231 |
+
\begin{array} { r c l } { \Delta \omega } & { = } & { - \displaystyle \frac { \epsilon } { N } \frac { d C } { d \omega } + \int _ { t } ^ { t + \frac { \epsilon } { N } } \eta ( t ) d t } \\ & { = } & { \displaystyle - \frac { \epsilon } { N } \frac { d C } { d \omega } + \alpha , } \end{array}
|
| 232 |
+
$$
|
| 233 |
+
|
| 234 |
+
where $\alpha$ denotes a Gaussian random variable with mean $\langle \alpha \rangle = 0$ and variance $\langle \alpha ^ { 2 } \rangle \ : = \ : 2 \epsilon I / N$ , which introduces isotropic noise to the gradient update as described in section 4 of the main text. Note that, since $C ( \omega ; M )$ denotes the summed cost function, we chose to scale our step size by the training set size $N$ . This also matches our treatment of SGD in section 5 of the main text. The larger the step size $\epsilon$ , the greater the discretization error, but if $\epsilon$ is sufficiently small and we iterate equation 17 sufficiently many times, we will obtain valid samples from the posterior.
|
| 235 |
+
|
| 236 |
+
Since the probability of sampling any given parameter vector $\omega$ is proportional to the posterior, the probability of sampling a parameter vector belonging to any given local minimum is proportional to the integral of the posterior over the bowl of attraction $D$ which surrounds that minimum.
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
P ( \omega \in D , t \infty ) \propto \int _ { D } d \omega \ e ^ { - C ( \omega ; M ) } .
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
Meanwhile we showed in section 2 of the main text that the evidence in favor of a model is proportional to the integral of the posterior over all parameter space.
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
P ( y | x ; M ) \propto \int d \omega e ^ { - C ( \omega ; M ) } .
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
As we discussed, this evidence is dominated by the contributions to the integral near local minima. In a convex model, there is only one such minimum; which allows us to accurately estimate the model evidence. Meanwhile, in non-convex models, there are many such minima, and so we can instead define the evidence as a sum over local evidences in favor of each minimum,
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
P ( y | x ; M ) = \sum _ { i } P ( y | x , \omega \in D _ { i } ; M ) ,
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
where we define the evidence in favor of a minimum as the integral over the local bowl of attraction,
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
P ( y | x , \omega \in D ; M ) \propto \int _ { D } d \omega \ e ^ { - C ( \omega ; M ) } .
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
Since the combined bowls of attraction of all the minima perfectly tile the entire parameter space, equations 19 and 20 are equivalent. Meanwhile, equating equations 18 and 21 we find that, when one performs Bayesian posterior sampling, the probability of sampling the parameter vector from a local minimum is proportional to the evidence in favor of that minimum. This demonstrates that bayesian posterior samples are biased in favor of local minima whose evidence is large, which explains why a single posterior sample $\omega _ { p }$ often achieves lower test error than the cost function minimum $\omega _ { 0 }$ .
|
| 261 |
+
|
| 262 |
+
# B THE EFFECT OF REGULARIZATION ON THE GENERALIZATION GAP
|
| 263 |
+
|
| 264 |
+
In the experiments of section 4 of the main text, the L2 regularization coefficient $\lambda = 0$ . In figure 8, we plot the evolution of the training curves when $\lambda = 0 . 1$ , for both small batch and full batch training. Excluding the regularization parameter, these experiments are identical to figure 3. To our surprise, regularized full batch training took longer to converge than small batch training. In another surprise, regularization significantly reduced the size of the generalization gap. While large batch regularized training achieves slightly lower test set accuracy than unregularized small batch training, it also achieves lower test cross-entropy. The test cross-entropy of our regularized models does not degrade after many gradient updates, removing the need for early stopping.
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 8: The mean test accuracy (a) and the mean test cross-entropy (b) of a regularized model during training. While full batch training takes longer to converge, it achieves similar performance at long times. The noise inherent in small batch training causes the performance to fluctuate.
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 9: The gradient distribution of a randomly selected parameter in the softmax layer, when measured over a single training example (a), and when averaged over mini-batches of 30 images (b).
|
| 271 |
+
|
| 272 |
+
# C THE GAUSSIAN APPROXIMATION TO THE MINI-BATCH ERROR
|
| 273 |
+
|
| 274 |
+
In section 5 of the main text, we approximated the difference between the full batch gradient and the mini-batch gradient estimate, $\begin{array} { r } { \alpha = ( \frac { d \hat { C } } { d \omega } - \frac { d C } { d \omega } ) } \end{array}$ , by a Gaussian random variable. This enabled us to derive the scaling rules, which we verified empirically. We motivated this assumption by reference to the central limit theorem, which states that the gradient error will tend towards Gaussian noise as $\{ N \to \infty , B \to \infty , B \ll N \}$ , so long as the distribution of gradients over individual training examples does not have heavy tails. In practice neither $\mathbf { N }$ nor B is infinite, and the gradient distribution may be heavy tailed, especially when gradients are sparse. Nonetheless the central limit theorem tends to be surprisingly robust in practice, and is consequently widely used.
|
| 275 |
+
|
| 276 |
+
It is beyond the scope of this work to perform a thorough study of the gradient noise distribution in deep networks. However as a brief proof of principle, we present the distribution of the gradient immediately after random initialization in figure 9, for the shallow neural network discussed in sections 4 and 5 of the main text. In figure 9a, we present the distribution over the individual training examples, of the gradient of a single matrix element in the softmax output layer, chosen randomly. The distribution is double peaked and clearly not Gaussian. However in figure 7b, we plot the distribution of the gradient of the same matrix element, when averaged over randomly sampled mini-batches of 30 images (without replacement). A single peak emerges, and while the distribution is still slightly skewed, it is clearly already approaching the Gaussian limit. We conclude that the Gaussian approximation is likely to be reasonable for commonly used mini-batch sizes.
|
| 277 |
+
|
| 278 |
+
# D DERIVING THE SCALING RULES FOR SGD WITH MOMENTUM
|
| 279 |
+
|
| 280 |
+
Momentum simulates a generalized Langevin equation (with structured fluctuations),
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\frac { d ^ { 2 } \omega } { d t ^ { 2 } } = - \lambda \frac { d \omega } { d t } - \frac { d C } { d \omega } + \eta ( t ) .
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
$\lambda$ is the “damping coefficient” and $\eta ( t )$ describes Gaussian noise, whose statistics $\langle \eta ( t ) \rangle = 0$ and $\langle \eta ( t ) \eta ( t ^ { \prime } ) \rangle = \bar { g } \lambda \bar { F } ( w ) \delta ( t - t ^ { \prime } )$ . As before, the coefficient $g$ describes the scale of random fluctuations in the dynamics, and $F ( \omega )$ describes the gradient covariances between parameters. We include a factor of $\lambda$ in the noise variance to satisfy the fluctuation-dissipation theorem, which states that we can vary the damping coefficient without changing the probability of sampling any particular configuration of parameters in the limit $t \to \infty$ , if we proportionally increase the noise variance.
|
| 287 |
+
|
| 288 |
+
To relate this Langevin equation to the usual momentum equations, we first re-express it as two coupled first order differential equations,
|
| 289 |
+
|
| 290 |
+
$$
|
| 291 |
+
\begin{array} { r c l } { \displaystyle \frac { d p } { d t } } & { = } & { \displaystyle - \lambda p - \frac { d C } { d \omega } + \eta ( t ) , } \\ { \displaystyle \frac { d \omega } { d t } } & { = } & { p . } \end{array}
|
| 292 |
+
$$
|
| 293 |
+
|
| 294 |
+
Integrating over a single step $\Delta t / N$ ,
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\begin{array} { r c l } { { \Delta p } } & { { = } } & { { \displaystyle - ( \lambda \Delta t / N ) p - \frac { \Delta t } { N } \frac { d C } { d \omega } + \eta , } } \\ { { \Delta \omega } } & { { = } } & { { p \Delta t / N . } } \end{array}
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
Where now $\langle \eta \rangle = 0$ and $\langle \eta ^ { 2 } \rangle = g \Delta t \lambda F ( w ) / N$ . We define the accumulation $A = p / \Delta t$ ,
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
\begin{array} { r c l } { \Delta A } & { = } & { - ( \lambda \Delta t / N ) A - \displaystyle \frac { 1 } { N } \frac { d C } { d \omega } + \frac { \eta } { \Delta t } , } \\ { \Delta \omega } & { = } & { ( \Delta t ) ^ { 2 } A / N . } \end{array}
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
These equations can be compared to the TensorFlow update equations for momentum,
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { r c l } { { \Delta A } } & { { = } } & { { ( m - 1 ) A - \displaystyle \frac { 1 } { N } \left( \displaystyle \frac { d C } { d \omega } + \alpha \right) , } } \\ { { \Delta \omega } } & { { = } } & { { \epsilon A . } } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
Where $\begin{array} { r } { \alpha = \left( \frac { d \hat { C } } { d \omega } - \frac { d C } { d \omega } \right) } \end{array}$ denotes the error in the gradient update. As discussed in the main text, we can approximate this error as Gaussian noise with statistics $\langle \alpha \rangle = 0$ and $\langle \alpha ^ { 2 } \rangle \approx N ^ { 2 } F ( \omega ) / B$ . Equations 27 and 28 match equations 29 and 30 if the step size $\dot { \epsilon } = ( \Delta t ) ^ { 2 } / N$ , and the momentum parameter $m = ( 1 - \lambda \Delta t / N )$ . Finally we equate the noise by setting $\langle \alpha ^ { 2 } \rangle / N ^ { 2 } = \langle \eta ^ { 2 } \rangle / ( \Delta t ) ^ { 2 }$ , and solve for the noise scale $g$ to obtain,
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\begin{array} { l l l } { { g } } & { { \approx } } & { { \displaystyle \frac { \Delta t N } { B \lambda } = \frac { ( \Delta t ) ^ { 2 } } { B ( 1 - m ) } } } \\ { { } } & { { = } } & { { \displaystyle \frac { \epsilon N } { B ( 1 - m ) } . } } \end{array}
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
As observed in the main text, if we wish to keep the scale of random fluctuations constant, then we should scale the batch size $B \propto \epsilon N$ . We also predict an additional scaling relation between the batch size and the momentum parameter, $B \propto \mathsf { \bar { 1 } } / ( 1 - m )$ . Note that one can also interpret $\epsilon _ { e f f } = \epsilon / ( 1 - m )$ as the “effective learning rate”.
|
| 319 |
+
|
| 320 |
+
# E HOW TO ACHIEVE LARGE BATCH TRAINING
|
| 321 |
+
|
| 322 |
+
Here we propose a simple heuristic for tuning the batch size, learning rate and momentum parameter; in order to maximize both test accuracy and batch size (enabling parallel training across many machines). Note that this is only worthwhile if one expects to retrain a model many times.
|
| 323 |
+
|
| 324 |
+
1. Set the learning rate to 0.1 and the momentum coefficient to 0.9. Run experiments at a range of batch sizes on a logarithmic scale, and identify the optimal batch size which maximizes the validation set accuracy. If training is not stable, reduce the learning rate, and repeat. 2. Repeatedly increase the batch size by a factor of 3, while scaling the learning rate $\epsilon \propto B$ , until the validation set accuracy starts to fall. Then repeatedly increase the batch size by a factor of 3, while scaling the momentum coefficient $( 1 - \dot { m } ) \propto 1 / B$ , until either the validation set accuracy falls or the batch size reaches the limits of your hardware. 3. Having identified the final learning rate and momentum parameter, retune the batch size on a linear scale in the local neighborhood of the current batch size.
|
| 325 |
+
|
| 326 |
+
We believe that this simple procedure will increase the test accuracy, reduce the cost of tuning hyperparameters, and significantly reduce the final number of gradient updates required to train a model.
|
md/train/BJlguT4YPr/BJlguT4YPr.md
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SCALABLE NEURAL METHODS FOR REASONING WITH A SYMBOLIC KNOWLEDGE BASE
|
| 2 |
+
|
| 3 |
+
William W. Cohen & Haitian Sun & R. Alex Hofer & Matthew Siegler Google, Inc {wcohen,haitiansun,rofer,msiegler}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We describe a novel way of representing a symbolic knowledge base (KB) called a sparse-matrix reified $K B$ . This representation enables neural KB inference modules that are fully differentiable, faithful to the original semantics of the KB, expressive enough to model multi-hop inferences, and scalable enough to use with realistically large KBs. The sparse-matrix reified KB can be distributed across multiple GPUs, can scale to tens of millions of entities and facts, and is orders of magnitude faster than naive sparse-matrix implementations. The reified KB enables very simple end-to-end architectures to obtain competitive performance on several benchmarks representing two families of tasks: KB completion, and learning semantic parsers from denotations.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
There has been much prior work on using neural networks to generalize the contents of a KB (Xiong et al., 2017; Bordes et al., 2013; Dettmers et al., 2018), typically by constructing low-dimensional embeddings of the entities and relations in the KB, which are then used to score potential triples as plausible or implausible elements of the KB. We consider here the related but different problem of incorporating a symbolic KB into a neural system, so as to inject knowledge from an existing KB directly into a neural model. More precisely, we consider the problem of designing neural KB inference modules that are (1) fully differentiable, so that any loss based on their outputs can be backpropagated to their inputs; (2) accurate, in that they are faithful to the original semantics of the KB; (3) expressive, so they can perform non-trivial inferences; and (4) scalable, so that realistically large KBs can be incorporated into a neural model.
|
| 12 |
+
|
| 13 |
+
To motivate the goal of incorporating a symbolic KB into a neural network, consider the task of learning neural semantic parsers from denotations. Many questions—e.g., what’s the most recent movie that Quentin Tarantino directed? or which nearby restaurants have vegetarian entrees and take reservations?—are best answered by knowledge-based question-answering (KBQA) methods, where an answer is found by accessing a KB. Within KBQA, a common approach is neural semantic parsing—i.e., using neural methods to translate a natural-language question into a structured query against the KB (Zhong et al., 2017; Finegan-Dollak et al., 2018; Shaw et al., 2019), which is subsequently executed with a symbolic KB query engine. While this approach can be effective, it requires training data pairing natural-language questions with structured queries, which is difficult to obtain. Hence researchers have also considered learning semantic parsers from denotations (Berant et al., 2013; Yih et al., 2015), where training data consists of pairs $( q , A )$ , where $q$ is a natural-language question and $A$ is the desired answer. Typically $A$ is a set of KB entities—e.g., if $q$ is the first sample question above, $A$ would be1 the singleton set containing Once Upon a Time in Hollywood.
|
| 14 |
+
|
| 15 |
+
Learning semantic parsers from denotations is difficult because the end-to-end process to be learned includes a non-differentiable operation—i.e., reasoning with the symbolic KB that contains the answers. To circumvent this difficulty, prior systems have used three different approaches. Some have used heuristic search to infer structured queries from denotations (Pasupat & Liang, 2016; Dasigi et al., 2019): this works in some cases but often an answer could be associated with many possible structured queries, introducing noise. Others have supplemented gradient approaches with $x$ : an entity $X$ : weighted set of entities x: vector encoding $X$ $N _ { E }$ : # entities in KB $r$ : an relation $R$ : weighted set of relations r: vector encoding $R$ $N _ { R }$ : # relations in KB ${ { \bf { M } } _ { r } }$ : matrix for $r$ ${ \bf { M } } _ { R }$ : weighted sum of ${ { \bf { M } } _ { r } }$ ’s, see Eq 1 $f o l l o w ( \mathbf { x } , \mathbf { r } )$ : see Eq 2 $N _ { T }$ : # triples in KB $\mathbf { M } _ { s u b j }$ $\mathbf { \tau } _ { s u b j } , \mathbf { M } _ { o b j } , \mathbf { M } _ { r e l }$ : the reified KB, encoded as matrices mapping triple id $\ell$ to subject, object, and relation ids
|
| 16 |
+
|
| 17 |
+
Table 1: Summary of notation used in the paper. (This excludes notation used in defining models for the KB completion and QA tasks of Section 3.)
|
| 18 |
+
|
| 19 |
+
reinforcement learning (e.g., (Misra et al., 2018)). Some systems have also “neuralized” KB reasoning, but to date only over small KBs: this approach is natural when answers are naturally constrained to depend on a small set of facts (e.g., a single table (Zhong et al., 2017; Gupta & Lewis, 2018)), but more generally requires coupling a learner with some (non-differentiable) mechanism to retrieve an appropriate small question-dependent subset of the KB as in (Sun et al., 2018; 2019).
|
| 20 |
+
|
| 21 |
+
In this paper, we introduce a novel scheme for incorporating reasoning on a large question-independent KB into a neural network, by representing a symbolic KB with an encoding called a sparse-matrix reified KB. A sparse-matrix reified KB is very compact, can be distributed across multiple GPUs if necessary, and is well-suited to modern GPU architecture. For KBs with many relations, a reified KB can be up to four orders of magnitude faster than alternative implementations (even alternatives based on sparse-matrix representations), and in our experiments we demonstrate scalability to a KB with over 13 million entities and nearly 44 million facts. This new architectural component leads to radically simpler architectures for neural semantic parsing from denotations—architectures based on a single end-to-end differentiable process, rather than cascades of retrieval and neural processes.
|
| 22 |
+
|
| 23 |
+
We show that very simple instantiations of these architectures are still highly competitive with the state of the art for several benchmark tasks. To our knowledge these models are the first fully end-to-end neural parsers from denotations that have been applied to these benchmark tasks. We also demonstrate that these architectures scale to long chains of reasoning on synthetic tasks, and demonstrate similarly simple architectures for a second task, KB completion.
|
| 24 |
+
|
| 25 |
+
# 2 NEURAL REASONING WITH A SYMBOLIC KB
|
| 26 |
+
|
| 27 |
+
# 2.1 BACKGROUND
|
| 28 |
+
|
| 29 |
+
KBs, entities, and relations. A KB consists of entities and relations. We use $x$ to denote an entity and $r$ to denote a relation. Each entity has an integer index between 1 and $N _ { E }$ , where $N _ { E }$ is the number of entities in the KB, and we write $x _ { i }$ for the entity that has index $i$ . A relation is a set of entity pairs, and represents a relationship between entities: for instance, if $x _ { i }$ represents “Quentin Tarantino” and $x _ { j }$ represents “Pulp Fiction” then $( x _ { i } , x _ { j } )$ would be an member of the relation director_of. A relation $r$ can thus be represented as a subset of $\left\{ 1 , \dots , N _ { E } \right\} \times \left\{ 1 , \dots , N _ { E } \right\}$ . Finally a KB consists a set of relations and a set of entities.
|
| 30 |
+
|
| 31 |
+
Weighted sets as $^ { 6 6 } k$ -hot” vectors. Our differentiable operations are based on weighted sets, where each element $x$ of weighted set $X$ is associated with a non-negative real number. It is convenient to define this weight to be zero for all $x \not \in X$ , while for $x \in X$ , a weight less than 1 is a confidence that the set contains $x$ , and weights more than 1 make $X$ a multiset. If all elements of $X$ have weight 1, we say $X$ is a hard set. A weighted set $X$ can be encoded as an entity-set vector $\mathbf { x } \in \mathbb { R } ^ { N _ { E } }$ , where the $i$ -th component of $\mathbf { X }$ is the weight of $x _ { i }$ in $X$ . If $X$ is a hard entity set, then this will be a “ $k$ -hot” vector, for $k = | X |$ . The set of indices of $\mathbf { X }$ with non-zero values is called the support of $\dot { \boldsymbol { x } }$ .
|
| 32 |
+
|
| 33 |
+
Sets of relations, and relations as matrices Often we would like to reason about sets of relations2, so we also assume every relation $r$ in a KB is associated with an entity and hence an integer index. We write $r _ { k }$ for the relation with index $k$ , and we assume that relation entities are listed first in the index of entities, so the index $k$ for $r _ { k }$ is between 1 and $N _ { R }$ , where $N _ { R }$ is the number of relations in the KB. We use $R$ for a set of relations, e.g., $R = \{ w r i t e r \_ o f , d i r e c t o r \_ o f \}$ might be such a set, and use $\mathbf { r }$ for a vector encoding of a set. A relation $r$ can be encoded as a relation matrix $\mathbf { M } _ { r } \in \mathbb { R } ^ { N _ { E } \times N _ { E } }$ , where the value for $\mathbf { M } _ { r } [ i , j ]$ is (in general) the weight of the assertion $r ( x _ { i } , x _ { j } )$ in the KB. In the experiments of this paper, all KB relations are hard sets, so $\mathbf { M } _ { r } [ i , j ] \in \{ 0 , 1 \}$ .
|
| 34 |
+
|
| 35 |
+
Sparse vs. dense matrices for relations. Scalably representing a large KB requires careful consideration of the implementation. One important issue is that for all but the smallest KBs, a relation matrix must be implemented using a sparse matrix data structure, as explicitly storing all $N _ { E } ^ { 2 }$ values is impractical. For instance, consider a KB containing 10,000 movie entities and 100,000 person entities. A relationship like writer_of would have only a few tens of thousands of facts (since most movies have only one or two writers), but a dense matrix would have 1 billion values.
|
| 36 |
+
|
| 37 |
+
We thus model relations as sparse matrices. Let $N _ { r }$ be the number of entity pairs in the relation $r$ : common sparse matrix data structures require space $O ( N _ { r } )$ . One common sparse matrix data structure is a sparse coordinate pair $( C O O )$ encoding: with a COO encoding, each KB fact requires storing only two integers and one float.
|
| 38 |
+
|
| 39 |
+
Our implementations are based on Tensorflow (Abadi et al., 2016), which offers limited support for sparse matrices. In particular, driven by the limitations of GPU architecture, Tensorflow only supports matrix multiplication between a sparse matrix COO and a dense matrix, but not between two sparse matrices, or between sparse higher-rank tensors and dense tensors.
|
| 40 |
+
|
| 41 |
+
Entity types. It is often possible to easily group entities into disjoint sets by some notion of “type”: for example, in a movie domain, all entities might be either of the type “movie”, “person”, or “movie studio”. It is straightforward to extend the formalism above to typed sets of entities, and doing this can lead to some useful optimizations. We use these optimizations below where appropriate: in particular, relation-set vectors r are of dimension $N _ { R }$ , not $N _ { E }$ , in the sections below. The full formal extension to typed entities and relations is given in Appendix A.
|
| 42 |
+
|
| 43 |
+
# 2.2 REASONING IN A KB
|
| 44 |
+
|
| 45 |
+
The relation-set following operation. Note that relations can also be viewed as labeled edges in a knowledge graph, the vertices of which are entities. Adopting this view, we define the $r$ - neighbors of an entity $x _ { i }$ to be the set of entities $x _ { j }$ that are connected to $x _ { i }$ by an edge labeled $r$ , i.e., $r$ - ${ \cdot } n e i g h b o r s ( x ) \equiv \left\{ x _ { j } : ( x _ { i } , x _ { j } ) \in r \right\}$ . Extending this to relation sets, we define
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
R \neg n e i g h b o r s ( X ) \equiv \left\{ x _ { j } : \exists r \in R , x _ { i } \in X \mathrm { ~ s o ~ t h a t ~ } ( x _ { i } , x _ { j } ) \in r \right\}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Computing the $R$ -neighbors of an entity is a single-step reasoning operation: e.g., the answer to the question q =“what movies were produced or directed by Quentin Tarantino” is precisely the set $R$ -neighbors $( X )$ for $R = \{ p r o d u c e r \_ o f , w r i t e r \_ o f \}$ and $X = \{ Q u e n t i n \_ T a r a n t i n o \}$ . “Multi-hop” reasoning operations require nested $R$ -neighborhoods, e.g. if $R ^ { \prime } = \{ a c t o r { \_ } o f \}$ then $R ^ { \prime }$ -neighbors $R$ - neighbors $( X )$ ) is the set of actors in movies produced or directed by Quentin Tarantino.
|
| 52 |
+
|
| 53 |
+
We would like to approximate the $R$ -neighbors computation with differentiable operations that can be performed on the vectors encoding the sets $X$ and $R$ . Let $\mathbf { X }$ encode a weighted set of entities $X$ , and let r encode a weighted set of relations. We first define $\mathbf { M } _ { R }$ to be a weighted mixture of the relation matrices for all relations in $R$ i.e.,
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbf { M } _ { R } \equiv ( \sum _ { k = 1 } ^ { N _ { R } } \mathbf { r } [ k ] \cdot \mathbf { M } _ { r _ { k } } )
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
We then define the relation-set following operation for $\boldsymbol { x }$ and $r$ as:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
f o l l o w ( \mathbf { x } , \mathbf { r } ) \equiv \mathbf { x } \mathbf { M } _ { R } = \mathbf { x } ( \sum _ { k = 1 } ^ { N _ { R } } \mathbf { r } [ k ] \cdot \mathbf { M } _ { r _ { k } } )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
As we will show below, this differentiable numerical relation-set following operation can be used as a neural component to perform certain types of logical reasoning. In particular, $\operatorname { E q } 2$ corresponds closely to the logical $R$ -neighborhood operation, as shown by the claim below.
|
| 66 |
+
|
| 67 |
+
Claim 1 The support of follow $\scriptstyle ( \mathbf { x } , \pmb { r } )$ is exactly the set of $R$ -neighbors( $X )$ .
|
| 68 |
+
|
| 69 |
+
A proof and the implications of this are discussed in Appendix B.
|
| 70 |
+
|
| 71 |
+
# 2.3 SCALABLE RELATION-SET FOLLOWING WITH A REIFIED KB
|
| 72 |
+
|
| 73 |
+
Baseline implementations. Suppose the KB contains $N _ { R }$ relations, $N _ { E }$ entities, and $N _ { T }$ triples. Typically $\hat { N _ { R } } < \hat { N _ { E } } < \hat { N _ { T } } \ll \hat { N _ { E } ^ { 2 } }$ . As noted above, we implement each ${ { \bf { M } } _ { r } }$ as a sparse COO matrix,
|
| 74 |
+
|
| 75 |
+
<table><tr><td rowspan="2">Strategy</td><td rowspan="2">Definition</td><td rowspan="2">Batch?</td><td rowspan="2">Space complexity</td><td colspan="3"># Operations</td></tr><tr><td>sp-dense matmul</td><td>dense +or ⊙</td><td>sparse +</td></tr><tr><td>naive mixing</td><td>Eq 1-2</td><td>no</td><td>O(Nr+NE+NR)</td><td>1</td><td>0</td><td>NR</td></tr><tr><td>late mixing</td><td>Eq3</td><td>yes</td><td>O(NT +bNE +bNR)</td><td>NR</td><td>NR</td><td>0</td></tr><tr><td>reified KB</td><td>Eq 4</td><td>yes</td><td>O(bNr+bNE)</td><td>3</td><td>1</td><td>0</td></tr></table>
|
| 76 |
+
|
| 77 |
+
Table 2: Complexity of implementations of relation-set following, where $N _ { T }$ is the number of KB triples, $N _ { E }$ the number of entities, $N _ { R }$ the number of relations, and $b$ is batch size.
|
| 78 |
+
|
| 79 |
+
so collectively these matrices require space $O ( N _ { T } )$ . Each triple appears in only one relation, so $\mathbf { M } _ { R }$ in Eq 1 is also size $O ( N _ { T } )$ . Since sparse-sparse matrix multiplication is not supported in Tensorflow we implement $\mathbf { x M } _ { R }$ using dense-sparse multiplication, so $\mathbf { X }$ must be a dense vector of size $O ( N _ { E } )$ , as is the output of relation-set following. Thus the space complexity of $f o l l o w ( \mathbf { x } , \mathbf { r } )$ is $O ( N _ { T } + N _ { E } + N _ { R } )$ , if implemented as suggested by $\operatorname { E q } 2$ . We call this the naive mixing implementation, and its complexity is summarized in Table 2.
|
| 80 |
+
|
| 81 |
+
Because Tensorflow does not support general sparse tensor contractions, it is not always possible to extend sparse-matrix computations to minibatches. Thus we also consider a variant of naive mixing called late mixing, which mixes the output of many single-relation following steps, rather than mixing the KB itself:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
f o l l o w ( \mathbf { x } , \mathbf { r } ) = \sum _ { k = 1 } ^ { N _ { R } } ( \mathbf { r } [ k ] \cdot \mathbf { x } \mathbf { M } _ { r _ { k } } )
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Unlike naive mixing, late mixing can be extended easily to a minibatches (see Appendix C). Let $b$ be the batch size and $\mathbf { X }$ be a minibatch of $b$ examples $\left[ \mathbf { x } _ { 1 } ; \ldots ; \mathbf { x } _ { b } \right]$ : then this approach leads to $N _ { R }$ matrices $\mathbf { X M } _ { k }$ , each of size $O ( b N _ { E } )$ . However, they need not all be stored at once, so the space complexity becomes $O ( b N _ { E } + b N _ { R } + N _ { T } )$ . An additional cost of late mixing is that we must now sum up $N _ { R }$ dense matrices.
|
| 88 |
+
|
| 89 |
+
A reified knowledge base. While semantic parses for natural questions often use small sets of relations (often singleton ones), in learning there is substantial uncertainty about what the members of these small sets should be. Furthermore, realistic wide-coverage KBs have many relations—typically hundreds or thousands. This leads to a situation where, at least during early phases of learning, it is necessary to evaluate the result of mixing very large sets of relations. When many relations are mixed, late mixing becomes quite expensive (as experiments below show).
|
| 90 |
+
|
| 91 |
+
An alternative is to represent each KB assertion $r _ { k } ( x _ { i } , x _ { j } )$ as a tuple $( i , j , k )$ where $i , j , k$ are the indices of $x _ { i } , x _ { j }$ , and $r _ { k }$ . There are $N _ { T }$ such triples, so for $\ell = 1 , \ldots , N _ { T }$ , let $( i _ { \ell } , j _ { \ell } , k _ { \ell } )$ denote the $\ell \cdot$ -th triple. We define these sparse matrices:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathbf { M } _ { s u b j } [ \ell , m ] \equiv \left\{ \begin{array} { l l } { 1 \mathrm { ~ i f ~ } m = i \ell } & \mathbf { M } _ { o b j } [ \ell , m ] \equiv \left\{ \begin{array} { l l } { 1 \mathrm { ~ i f ~ } m = j \ell } & { \mathbf { M } _ { r e l } [ \ell , m ] \equiv \left\{ \begin{array} { l l } { 1 \mathrm { ~ i f ~ } m = k _ { \ell } } \\ { 0 \mathrm { ~ e l s e ~ } } & { } \end{array} \right. \right. } \end{array} \right. \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Conceptually, $\mathbf { M } _ { s u b j }$ maps the index $\ell$ of the $\ell$ -th triple to its subject entity; $\mathbf { M } _ { o b j }$ maps $\ell$ to the object entity; and ${ { \bf { M } } _ { r e l } }$ maps $\ell$ to the relation. We can now implement the relation-set following as below, where $\odot$ is Hadamard product:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
f o l l o w \mathbf { ( x , r ) } = ( \mathbf { x M } _ { s u b j } ^ { T } \odot \mathbf { r M } _ { r e l } ^ { T } ) \mathbf { M } _ { o b j }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Notice that $\mathbf { x M } _ { s u b j } ^ { T }$ are the triples with an entity in $\mathbf { X }$ as their subject, $\mathbf { r } \mathbf { M } _ { r e l } ^ { T }$ are the triples with a relation in $\mathbf { r }$ , and the Hadamard product is the intersection of these. The final multiplication by $\mathbf { M } _ { o b j }$ finds the object entities of the triples in the intersection. These operations naturally extend to minibatches (see Appendix). The reified KB has size $O ( N _ { T } )$ , the sets of triples that are intersected have size $O ( b N _ { T } )$ , and the final result is size $O ( b N _ { E } )$ , giving a final size of $O ( b N _ { T } + b N _ { E } )$ , with no dependence on $N _ { R }$ .
|
| 104 |
+
|
| 105 |
+
Table 2 summarizes the complexity of these three mathematically equivalent but computationally different implementions. The analysis suggests that the reified KB is preferable if there are many relations, which is the case for most realistic ${ \mathrm { K B s } } ^ { 3 }$ .
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 1: Left and middle: inference time in queries/sec on a synthetic KB as size and number of relations is varied. Queries/sec is given as zero when GPU memory of 12Gb is exceeded. Right: speedups of reified KBs over the baseline implementations.
|
| 109 |
+
|
| 110 |
+
Distributing a large reified KB. The reified KB representation is quite compact, using only six integers and three floats for each KB triple. However, since GPU memory is often limited, it is important to be able to distribute a KB across multiple GPUs. Although to our knowledge prior implementations of distributed matrix operations (e.g., (Shazeer et al., 2018)) do not support sparse matrices, sparse-dense matrix multiplication can be distributed across multiple machines. We thus implemented a distributed sparse-matrix implementation of reified $K B s$ . We distibuted the matrices that define a reified KB “horizontally”, so that different triple ids $\ell$ are stored on different GPUs. Details are provided in Appendix D.
|
| 111 |
+
|
| 112 |
+
# 3 EXPERIMENTS
|
| 113 |
+
|
| 114 |
+
# 3.1 SCALABILITY
|
| 115 |
+
|
| 116 |
+
Like prior work (Cohen et al., 2017; De Raedt et al., 2007), we used a synthetic KB based on an $n$ -by- $\mathbf { \nabla } \cdot n$ grid to study scalability of inference. Every grid cell is an entity, related to its immediate neighbors via relations north, south, east, and west. The KB for an $n$ -by- $^ n$ grid thus has $O ( n ^ { 2 } )$ entities and $O ( n ^ { 2 } )$ triples. We measured the time to compute the 2-hop inference follow $( f o l l o w ( \mathbf { x } , \mathbf { r } ) , \mathbf { r } )$ for minibatches of $b = 1 2 8$ one-hot vectors, and report it as queries per second (qps) on a single GPU (e.g., $\mathrm { \ q p s { = } 1 } 2 8 0$ would mean a single minibatch requires $1 0 0 \mathrm { m s }$ ). We also compare to a key-value memory network (Miller et al., 2016), using an embedding size of 64 for entities and relations, where there is one memory entry for every triple in the KB. Further details are given in Appendix E.
|
| 117 |
+
|
| 118 |
+
The results are shown Figure 1 (left and middle), on a log-log scale because some differences are very large. With only four relations (the leftmost plot), late mixing is about $3 \mathbf { x }$ faster than the reified KB method, and about $2 5 0 \mathrm { x }$ faster than the naive approach. However, for more than around 20 relations, the reified KB is faster (middle plot). As shown in the rightmost plot, the reified KB is $5 0 \mathrm { x }$ faster than late mixing with 1000 relations, and nearly $1 2 { , } 0 0 0 \mathrm { x }$ faster than the naive approach.
|
| 119 |
+
|
| 120 |
+
With this embedding size, the speed of the key-value network is similar to the reified KB for only four relations, however it is about $7 \mathbf { x }$ slower for 50 relations and 10k entities. Additionally, the space needed to store a triple is much larger in a key-value network than the reified KB, so memory is exhausted when the KB exceeds 200,000 entities (with four relations), or when the KB exceeds 100 relations (with 10,000 entities.) The reified KB scales much better, and can handle $1 0 \mathrm { x }$ as many entities and $2 0 \mathrm { x }$ as many relations.
|
| 121 |
+
|
| 122 |
+
# 3.2 MODELS USING REIFIED KBS
|
| 123 |
+
|
| 124 |
+
As discussed below in Section 4, the reified KB is closely related to key-value memory networks, so it can be viewed as a more efficient implementation of existing neural modules, optimized for reasoning with symbolic KBs. However, being able to include an entire KB into a model can lead to a qualitative difference in model complexity, since it is not necessary to build machinery to retrieve from the KB. To illustrate this, below we present simple models for several tasks, each using the reified KB in different ways, as appropriate to the task. We consider two families of tasks: learning semantic parsers from denotations over a large KB, and learning to complete a KB.
|
| 125 |
+
|
| 126 |
+
KBQA for multi-hop questions. MetaQA (Zhang et al., 2018) consists of 1.2M questions, evenly distributed into one-hop, two-hop, and three-hop questions. (E.g, the question “who acted in a movie directed by Quentin Tarantino?” is a two-hop question.) The accompanying KB (Miller et al., 2016) contains 43k entities and 186k triples. Past work treated one-hop, two-hop and three-hop questions separately, and the questions are labeled with the entity ids for the “seed entities” that begin the reasoning chains (e.g., the question above would be tagged with the id of the entity for Quentin Tarantino).
|
| 127 |
+
|
| 128 |
+
Using a reified KB for reasoning means the neural model only needs to predict the relations used at each stage in the reasoning process. For each step of inference we thus compute relation sets $\mathbf { r } ^ { t }$ using a differentiable function of the question, and then chain them together with relation-set following steps. Letting $\mathbf { x } ^ { 0 }$ be the set of entities associated with $q$ , the model we use is:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\mathrm { f o r } t = 1 , 2 , 3 ; ~ { \bf r } ^ { t } = f ^ { t } ( q ) ; ~ { \bf x } ^ { t } = f o l l o w ( { \bf x } ^ { t - 1 } , { \bf r } ^ { t } )
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where follow $\left( \mathbf { x } ^ { t - 1 } , \mathbf { r } ^ { t } \right)$ is implemented with a reified KB as described in Eq. 4.
|
| 135 |
+
|
| 136 |
+
To predict an answer on a $T$ -hop subtask, we compute the softmax of the appropriate set $\mathbf { x } ^ { T }$ . We used cross entropy loss of this set against the desired answer, represented as a uniform distribution over entities in the target set. Each function $f ^ { t } ( q )$ is a different linear projection of a common encoding for $q$ , specifically a mean-pooling of the tokens in $q$ encoded with a pre-trained 128-dimensional word2vec model (Mikolov et al., 2013). The full KB was loaded into a single GPU in our experiments.
|
| 137 |
+
|
| 138 |
+
It is interesting to contrast this simple model with the one proposed by Zhang et al. (2018). The “module for logic reasoning” they propose in Section 3.4 is fairly complex, with a description that requires a figure, three equations, and a page of text; furthermore, training this model requires constructing an example-dependent subgraph for each training instance. In our model, the “logic reasoning” (and all interaction with the KB) has been encapsulated completely in the $\ell o l l o w ( \mathbf { x } , \mathbf { r } )$ operation—which, as we will demonstrate below, can be re-used for many other problems. Encapsulating all KB reasoning with a single scalable differentiable neural module greatly simplifies modeling: in particular, the problem of learning a structured KB query has been reduced to learning a few differentiable functions of the question, one for each reasoning “hop”. The learned functions are also interpretable: they are mixtures of relation identifiers which correspond to soft weighted sets of relations, which in turn softly specify which KB relation should be used in each stage of the reasoning process. Finally, optimization is simple, as the loss on predicted denotations can be back-propagated to the relation-prediction functions.
|
| 139 |
+
|
| 140 |
+
A similar modeling strategy is used in all the other models presented below.
|
| 141 |
+
|
| 142 |
+
KBQA on FreeBase. WebQuestionsSP (Yih et al., 2016) contains 4737 natural language questions, all of which are answerable using FreeBase (Bollacker et al., 2008), a large open-domain KB. Each question $q$ is again labeled with the entities $\mathbf { X }$ that appear in it.
|
| 143 |
+
|
| 144 |
+
FreeBase contains two kinds of nodes: real-world entities, and compound value types (CVTs), which represent non-binary relationships or events (e.g., a movie release event, which includes a movie id, a date, and a place.) Real-world entity nodes can be related to each other or to a CVT node, but CVT nodes are never directly related to each other. In this dataset, all questions can be answered with 1- or 2-hop chains, and all 2-hop reasoning chains pass through a CVT entity; however, unlike MetaQA, the number of hops is not known. Our model thus derives from $q$ three relation sets and then uniformly mixes both potential types of inferences:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\begin{array} { r l } & { \mathbf { r } _ { \mathrm { E E } } = f _ { \mathrm { E E } } ( q ) ; \mathbf { r } _ { \mathrm { E C V T } } = f _ { \mathrm { E C V T } } ( q ) ; \mathbf { r } _ { \mathrm { C V T E } } = f _ { \mathrm { C V T E } } ( q ) } \\ & { \qquad \hat { \mathbf { a } } = f o l l o w ( f o l l o w ( \mathbf { x } , \mathbf { r } _ { \mathrm { E C V T } } ) , \mathbf { r } _ { \mathrm { C V T E } } ) + f o l l o w ( \mathbf { x } , \mathbf { r } _ { \mathrm { E E } } ) } \end{array}
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
We again apply a softmax to $\hat { \mathbf { a } }$ and use cross entropy loss, and $f _ { \mathrm { E \to E } }$ , $f _ { \mathrm { E C V T } }$ , and $f _ { \mathrm { C V T E } }$ are again linear projections of a word2vec encoding of $q$ . We used a subset of Freebase with 43.7 million facts and 12.9 million entities, containing all facts in Freebase within 2-hops of entities mentioned in any question, excluding paths through some very common entities. We split the KB across three 12-Gb GPUs, and used a fourth GPU for the rest of the model.
|
| 151 |
+
|
| 152 |
+
This dataset is a good illustration of the scalability issues associated with prior approaches to including a KB in a model, such as key-value memory networks. A key-value network can be trained to implement something similar to relation-set following, if it stores all the KB triples in memory. If we assume 64-float embeddings for the 12.9M entities, the full KB of 43.7M facts would be 67Gb in size, which is impractical. Additionally performing a softmax over the 43.7M keys would be prohibitively expensive, as shown by the experiments of Figure 1. This is the reason why in standard practice with key-value memory networks for KBs, the memory is populated with a heuristically subset of the KB, rather than the full KB. We compare experimentally to this approach in Table 3.
|
| 153 |
+
|
| 154 |
+
Knowledge base completion. Following Yang et al. (2017) we treat KB completion as an inference task, analogous to KBQA: a query $q$ is a relation name and a head entity $\mathbf { X }$ , and from this we predict a set of tail entities. We assume the answers are computed with the disjunction of multiple inference chains of varying length. Each inference chain has a maximum length of $T$ and we build $N$ distinct inference chains in total, using this model (where $\mathbf { x } _ { i } ^ { 0 } = \mathbf { x }$ for every chain $\romannumeral 1$ ):
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\mathrm { o r } i = 1 , \dots , N \mathrm { ~ a n d ~ } t = 1 , \dots , T ; \quad \mathbf { r } _ { i } ^ { t } = f _ { i } ^ { t } ( q ) ; \quad \mathbf { x } _ { i } ^ { t } = f o l l o w ( \mathbf { x } _ { i } ^ { t - 1 } , \mathbf { r } _ { i } ^ { t } ) + \mathbf { x } _ { i } ^ { t - 1 }
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
The final output is a softmax of the mix of all the $\mathbf { x } _ { i } ^ { T }$ ’s: i.e., we let $\begin{array} { r } { \hat { \mathbf { a } } = s o f t m a x ( \sum _ { i \in \{ 1 \ldots N \} } \mathbf { x } _ { i } ^ { T } ) } \end{array}$ . The update $\mathbf { x } _ { i } ^ { t + 1 } = f o l l o w ( \mathbf { x } _ { i } ^ { t } , \mathbf { r } _ { i } ^ { t } ) + \mathbf { x } _ { i } ^ { t }$ gives the model access to outputs of all chains of length less than $t$ (for more intuition see Appendix E.) The encoding of $q$ is based on a lookup table, and each $f _ { i } ^ { t }$ is a learned linear transformation of $q$ ’s embedding.4
|
| 161 |
+
|
| 162 |
+
An encoder-decoder architecture for varying inferential structures. To explore performance on more complex reasoning tasks, we generated simple artificial natural-language sentences describing longer chains of relationships on a 10-by-10 grid. For this task we used an encoder-decoder model which emits chains of relation-set following operations. The question is encoded with the final hidden state of an LSTM, written here $ { \mathbf { h } } ^ { 0 }$ . We then generate a reasoning chain of length up to $T$ using a decoder LSTM. At iteration $t$ , the decoder emits a scalar probability of “stopping”, $p ^ { t }$ , and a distribution over relations to follow $\mathbf { r } ^ { t }$ , and then, as we did for the KBQA tasks, sets $\mathbf { \bar { x } } ^ { t } = f o l l o w ( \mathbf { x } ^ { t - 1 } , \mathbf { r } ^ { t } )$ . Finally the decoder updates its hidden state to $\mathbf { h } ^ { t }$ using an LSTM cell that “reads” the “input” $\mathbf { r } ^ { i - 1 }$ . For each step $t$ , the model thus contains the steps
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
p ^ { t } = f _ { p } ( \mathbf { h } ^ { t - 1 } ) ; ~ \mathbf { r } ^ { t } = f _ { r } ( \mathbf { h } ^ { t - 1 } ) ; ~ \mathbf { x } ^ { t } = f o l l o w ( \mathbf { x } ^ { t - 1 } , \mathbf { r } ^ { t } ) ; ~ \mathbf { h } ^ { t } = \mathrm { L S T M } ( \mathbf { h } ^ { t - 1 } , \mathbf { r } ^ { t - 1 } )
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
The final predicted location is a mixture of all the $\mathbf { X } _ { t }$ ’s weighted by the probability of stopping $p _ { t }$ at iteration $t$ , i.e., $\begin{array} { r } { \hat { \mathbf { a } } = s o f t m a x ( \sum _ { t = 1 } ^ { T } \mathbf { x } ^ { t } \cdot p ^ { t } \prod _ { t ^ { \prime } < t } ( 1 - p ^ { t ^ { \prime } } ) ) } \end{array}$ . The function $f _ { r }$ is a softmax over a linear projection, and $f _ { p }$ is a logistic function. In the experiments, we trained on 360,000 sentences requiring between 1 and $T$ hops and tested on an additional 12,000 sentences.
|
| 169 |
+
|
| 170 |
+
Experimental results. We next consider the performance of these models relative to strong baselines for each task. We emphasize our goal here is not to challenge the current state of the art on any particular benchmark, and clearly there are many ways the models of this paper could be improved. (For instance, our question encodings are based on word2vec, rather than contextual encodings (Devlin et al., 2018), and likewise relations are predicted with simple linear classifiers, rather than, say, attention queries over some semantically meaningful space, such as might be produced with language models or KB embedding approaches (Bordes et al., 2013)). Rather, our contribution is to present a generally useful scheme for including symbolic KB reasoning into a model, and we have thus focused on describing simple, easily understood models that do this for several tasks. However, it is important to confirm experimentally that the reified KB models “work”—e.g., that they are amenable to use of standard optimizers, etc.
|
| 171 |
+
|
| 172 |
+
Performance (using Hits $@ .$ 1) of our models on the KBQA tasks is shown in Table 3. For the nonsynthetic tasks we also compare to a Key-Value Memory Network (KV-Mem) baseline (Miller et al., 2016). For the smaller MetaQA dataset, KV-Mem is initialized with all facts within 3 hops of the query entities, and for WebQuestionsSP it is initialized by a random-walk process seeded by the query entities (see (Sun et al., 2018; Zhang et al., 2018) for details). ReifKB consistently outperforms the baseline, dramatically so for longer reasoning chains. The synthetic grid task shows that there is very little degradation as chain length increases, with $\mathrm { H i t s } @ 1$ for 10 hops still $8 9 . 7 \%$ . It also illustrates the ability to predict entities in a KB, as well as relations.
|
| 173 |
+
|
| 174 |
+
We also compare these results to two much more complex architectures that perform end-to-end question answering in the same setting used here: VRN (Zhang et al., 2018), GRAFT-Net (Sun et al., 2018), and PullNet (Sun et al., 2019). All three systems build question-dependent subgraphs of the
|
| 175 |
+
|
| 176 |
+
Table 3: Hits $@ 1$ on the KBQA datasets. Results for KV-Mem and VRN on MetaQA are from (Zhang et al., 2018); results for GRAFT-Net, PullNet and KV-Mem on WebQSP are from (Sun et al., 2018) and (Sun et al., 2019).
|
| 177 |
+
|
| 178 |
+
<table><tr><td></td><td>ReifKB (ours)</td><td>ReifKB +mask</td><td>KV-Mem (baseline)</td><td>VRN</td><td>GRAFT- Net</td><td>PullNet</td><td colspan="2">non-differentiable components of architectures</td></tr><tr><td>WebQSP MetaQA</td><td>52.7</td><td></td><td>46.7</td><td></td><td>67.8</td><td>68.1</td><td>KV-Mem</td><td>initial memory retrieval</td></tr><tr><td>1-hop</td><td>96.2</td><td></td><td>95.8</td><td>97.5</td><td>97.0</td><td>97.0</td><td></td><td></td></tr><tr><td>2-hop</td><td>81.1</td><td>95.4</td><td>25.1</td><td>89.9</td><td>94.8</td><td>99.9</td><td>VRN</td><td>question-specific</td></tr><tr><td>3-hop</td><td>72.3</td><td>79.7</td><td>10.1</td><td>62.5</td><td>77.2</td><td>91.4</td><td>GRAFTNet</td><td>subgraph retrieval</td></tr><tr><td>Grid 5-hop</td><td>98.4</td><td></td><td></td><td></td><td></td><td></td><td>PullNet</td><td>all iterative retrievals</td></tr><tr><td>10-hop</td><td>89.7</td><td></td><td></td><td></td><td></td><td>1</td><td>ReifKB(ours)</td><td>none</td></tr></table>
|
| 179 |
+
|
| 180 |
+
KB, and then use graph CNN-like methods (Kipf & Welling, 2016) to “reason” with these graphs. Although not superior, ReifKB model is competitive with these approaches, especially on the most difficult 3-hop setting.
|
| 181 |
+
|
| 182 |
+
A small extension to this model is to mask the seed entities out of the answers (see Appendix E). This model (given as ReifKB $^ +$ mask) has better performance than GRAFT-Net on 2-hop and 3-hop questions.
|
| 183 |
+
|
| 184 |
+
For KB completion, we evaluated the model on the NELL-995 dataset (Xiong et al., 2017) which is paired with a KB with $1 5 4 \mathrm { k }$ facts, $7 5 \mathrm { k }$ entities, and 200 relations. On the left of Table 4 we compare our model with three popular embedding approaches (results are from Das et al. (2017)). The reified KB model outperforms DistMult (Yang et al., 2014), is slightly worse than ConvE (Dettmers et al., 2018), and is comparable to ComplEx (Trouillon et al., 2017).
|
| 185 |
+
|
| 186 |
+
The competitive performance of the ReifKB model is perhaps surprising, since it has many fewer parameters than the baseline models—only one float and two integers per KB triple, plus a small number of parameters to define the $f _ { i } ^ { t }$ functions for each relation. The ability to use fewer parameters is directly related to the fact that our model directly uses inference on the existing symbolic $K B$ in its model, rather than having to learn embeddings that approximate this inference. Or course, since the KB is incomplete, some learning is still required, but learning is quite different: the system learns logical inference chains in the incomplete KB that approximate a target relation. In this setting for KBC, the ability to perform logical inference “out of the box” appears to be very advantageous.
|
| 187 |
+
|
| 188 |
+
Another relative disadvantage of KB embedding methods is that KB embeddings are generally transductive—they only make predictions for entities seen in training. As a non-transductive baseline, we also compared to the MINERVA model, which uses reinforcement learning (RL) methods to learn how to traverse a KB to find a desired answer. Although RL methods are less suitable as “neural modules”, MINERVA is arguably a plausible competitor to end-to-end learning with a reified KB.
|
| 189 |
+
|
| 190 |
+
MINERVA slightly outperforms our simple KB completion model on the NELL-995 task. However, unlike our model, MINERVA is trained to find a single answer, rather than trained to infer a set of answers. To explore this difference, we compared to MINERVA on the grid task under two conditions: (1) the KB relations are the grid directions north, south, east and west, so the output of the target chain is always a single grid location, and (2) the KB relations also include a “vertical move” (north or south) and a “horizontal move” (east or west), so the result of the target chain can be a set of locations. As expected MINERVA’s performance drops dramatically in the second case, from $9 9 . 3 \%$
|
| 191 |
+
|
| 192 |
+
Table 4: Left: Hits $@ 1$ and Hits $@ 1 0$ for KB completion on NELL 995. Starred KB completion methods are transductive, and do not generalize to entities not seen in training. Right: Comparison to MINERVA on several tasks for Hits $@ 1$ .
|
| 193 |
+
|
| 194 |
+
<table><tr><td rowspan="2"></td><td colspan="2">NELL-995</td><td rowspan="2">NELL-995</td><td rowspan="2">ReifKB (Ours) 64.1</td><td rowspan="2">MINERVA 66.3</td></tr><tr><td>H@1</td><td>H@10</td></tr><tr><td>ReifKB (Ours)</td><td>64.1</td><td>82.4</td><td>Grid with seed entity</td><td></td><td></td></tr><tr><td>DistMult*</td><td>61.0</td><td>79.5</td><td>10-hop NSEW</td><td>98.9</td><td>99.3</td></tr><tr><td>ComplEx*</td><td>61.2</td><td>82.7</td><td>10-hop NSEW-VH</td><td>73.6</td><td>34.4</td></tr><tr><td>ConvE*</td><td>67.2</td><td>86.4</td><td>MetaQA 3-hop</td><td>72.3</td><td>41.7</td></tr></table>
|
| 195 |
+
|
| 196 |
+
Table 5: Left, time to run 10K examples for KBs of different size. Right, time for 10k examples vs Hits $@ 1$ performance for ReifKB compared to three baselines on MetaQA-3hop questions.
|
| 197 |
+
|
| 198 |
+
<table><tr><td colspan="4"></td><td colspan="4">●Reif KB● KV-mem● GRAFT-Net●PulINet</td></tr><tr><td></td><td>NELL-995</td><td>MetaQA-3hop</td><td>WebQuestionsSP</td><td>100</td><td></td><td></td><td></td></tr><tr><td>#Facts</td><td>154,213</td><td>196,453</td><td>43,724,175</td><td>75</td><td></td><td></td><td></td></tr><tr><td>#Entities</td><td>75,492</td><td>43,230</td><td>12,942,798</td><td>50</td><td rowspan="3"></td><td rowspan="3"></td><td rowspan="3"></td></tr><tr><td>#Relations</td><td>200</td><td>9</td><td>616</td><td>25</td></tr><tr><td>Time (seconds)</td><td>44.3</td><td>72.6</td><td>1820</td><td>0 250 500</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Hits $@ 1$ to $34 . 4 \%$ , while our model’s performance is more robust. MetaQA answers can also be sets, so we also modified MetaQA so that MINERVA could be used (by making the non-entity part of the sentence the “relation” input and the seed entity the “start node” input) and noted a similarly poor performance for MINERVA. These results are shown on the right of Table 4.
|
| 201 |
+
|
| 202 |
+
In Tables 5 we compare the training time of our model with minibatch size of 10 on NELL-995, MetaQA, and WebQuestionsSP. With over 40 million facts and nearly 13 million entities from Freebase, it takes less than 10 minutes to run one epoch over WebQuestionsSP (with 3097 training examples) on four P100 GPUs. In the accompanying plot, we also summarize the tradeoffs between accuracy and training time for our model and three baselines on the MetaQA 3-hop task. (Here ideal performance is toward the upper left of the plot). The state-of-the-art PullNet Sun et al. (2019) system, which uses a learned method to incrementally retrieve from the KB, is about 15 times slower than the reified KB system. GRAFT-Net is only slightly less accurate, but also only slightly faster: recall that GRAFT-Net uses a heuristically selected subset (of up to 500 triples) from the KB for each query, while our system uses the full KB. Here the full KB is about 400 times as large as the question-specific subset used by GRAFT-Net. A key-value memory baseline including the full KB is nearly three times as slow as our system, while also performing quite poorly.
|
| 203 |
+
|
| 204 |
+
# 4 RELATED WORK
|
| 205 |
+
|
| 206 |
+
The relation-set following operation using reified KBs is implemented in an open-source package called NQL, for neural query language. NQL implements a broader range of operations for manipulating KBs, which are described in a companion paper (Cohen et al., 2019). This paper focuses on implementation and evaluation of the relation-set following operation with different KB representations, issues not covered in the companion paper.
|
| 207 |
+
|
| 208 |
+
TensorLog (Cohen et al., 2017), a probabilistic logic which also can be compiled to Tensorflow, and hence is another differentiable approach to neuralizing a KB. TensorLog is also based on sparse matrices, but does not support relation sets, making it unnatural to express the models shown in this paper, and does not use the more efficient reified KB representation. The differentiable theorem prover (DTP) is another differentiable logic (Rocktäschel & Riedel, 2017), but DPT appears to be much less scalable: it has not been applied to KBs larger than a few thousand triples. The Neural ILP system (Yang et al., 2017) uses approaches related to late mixing together with an LSTM controller to perform KB completion and some simple QA tasks, but it is a monolithic architecture focused on rule-learning, while in contrast we propose a re-usable neural component, which can be used in as a component in many different architectures, and a scalable implementation of this. It has also been reported that neural ILP does not scale to the size of the NELL995 task (Das et al., 2017).
|
| 209 |
+
|
| 210 |
+
The goals of this paper are related to KB embedding methods, but distinct. In KB embedding, models are generally fully differentiable, but it is not considered necessary (or even desirable) to accurately match the behavior of inference in the original KB. Being able to construct a learned approximation of a symbolic KB is undeniably useful in some contexts, but embedded KBs also have many disadvantages. In particular, they are much larger than a reified KB, with many more learned parameters—typically a long dense vector for every KB entity. Embedded models are typically evaluated by their ability to score a single triple accurately, and many models are not capable of executing multi-step KB inferences efficiently; further, models that do allow multi-step inference are known to produce cascaded errors on long reasoning chains (Guu et al., 2015; Hamilton et al., 2018). In contrast we focus on accurate models of reasoning in a symbolic KB, which requires consideration of novel scalability issues associated with sparse matrice representations.
|
| 211 |
+
|
| 212 |
+
Mathematically, our definition of relation-set following is much like the bilinear model for path following from Guu et al. (2015); however, we generalize this to path queries that include weighted sets of relations, allowing the relations in paths to be learned. Similar differences apply to the work of Hamilton et al. (2018), which extends the work of Guu et al. (2015) to include intersection operations. The vector representation used here for weighted sets in a reified KB makes intersection trivial to implement, as intersection corresponds to Hadamard product. Conveniently set union also corresponds to vector sum, and the complement of $X$ is ${ \bf 1 } - { \bf x }$ , which is perhaps why only a single additional neural operation is needed to support the KB reasoning tasks needed for the five benchmark tasks considered here.
|
| 213 |
+
|
| 214 |
+
Neural architectures like memory networks (Weston et al., 2014), or other architectures that use attention over some data structure approximating assertions (Andreas et al., 2016; Gupta & Lewis, 2018) can be used to build soft versions of relation-set following: however, they also do not scale well to large KBs, so they are typically used either with a non-differentiable ad hoc retrieval mechanism, or else in cases where a small amount of information is relevant to a question (Weston et al., 2015; Zhong et al., 2017). Similarly graph CNNs (Kipf & Welling, 2016) also can be used for reasoning, and often do use sparse matrix multiplication, but again existing implementations have not been scaled to tens of millions of triples/edges or millions of entities/graph nodes. Additionally, while graph CNNs have been used for reasoning tasks, the formal connection between them and logical reasoning remains unclear, whereas there is a precise connection between relation-set following and inference.
|
| 215 |
+
|
| 216 |
+
Reinforcement learning (RL) methods have been used to learn mappings from natural-language questions to non-differentiable logical representations (Liang et al., 2016; 2018) and have also been applied to KB completion tasks (Das et al., 2017; Xiong et al., 2017). Above we compared experimentally to MINERVA, one such method; however, the gradient-based approaches enabled by our methods are generally preferred as being easier to implement and tune on new problems, and easier to combine in a modular way with other architectural elements.
|
| 217 |
+
|
| 218 |
+
# 5 CONCLUSIONS
|
| 219 |
+
|
| 220 |
+
We introduced here a novel way of representing a symbolic knowledge base (KB) called a sparsematrix reified KB. This representation enables neural modules that are fully differentiable, faithful to the original semantics of the KB, expressive enough to model multi-hop inferences, and scalable enough to use with realistically large KBs. In a reified KB, all KB relations are represented with three sparse matrices, which can be distributed across multiple GPUs, and symbolic reasoning on realistic KBs with many relations is much faster than with naive implementations—more than four orders of magnitude faster on synthetic-data experiments compared to naive sparse-matrix implementations.
|
| 221 |
+
|
| 222 |
+
This new architectural component leads to radically simpler architectures for neural semantic parsing from denotations and KB completion—in particular, they make it possible to learn neural KBQA models in a completely end-to-end way, mapping from text to KB entity sets, for KBs with tens of millions of triples and entities and hundreds of relations.
|
| 223 |
+
|
| 224 |
+
# ACKNOWLEDGMENTS
|
| 225 |
+
|
| 226 |
+
The authors are greatful to comments and suggestions from Fernando Peireira, Bhuwan Dhingra, and many other colleagues on earlier versions of this work.
|
| 227 |
+
|
| 228 |
+
# REFERENCES
|
| 229 |
+
|
| 230 |
+
Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In 12th {USENIX} Symposium on Operating Systems Design and Implementation ({OSDI} 16), pp. 265–283, 2016.
|
| 231 |
+
|
| 232 |
+
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 39–48, 2016.
|
| 233 |
+
|
| 234 |
+
Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on freebase from question-answer pairs. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1533–1544, 2013.
|
| 235 |
+
|
| 236 |
+
Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD international conference on Management of data, pp. 1247–1250. AcM, 2008.
|
| 237 |
+
|
| 238 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in neural information processing systems, pp. 2787–2795, 2013.
|
| 239 |
+
|
| 240 |
+
William W Cohen, Fan Yang, and Kathryn Rivard Mazaitis. Tensorlog: Deep learning meets probabilistic DBs. arXiv preprint arXiv:1707.05390, 2017.
|
| 241 |
+
|
| 242 |
+
William W. Cohen, Matthew Siegler, and R. Alex Hofer. Neural query language: A knowledge base query language for Tensorflow. CoRR, abs/1905.06209, 2019. URL http://arxiv.org/ abs/1905.06209.
|
| 243 |
+
|
| 244 |
+
Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, Luke Vilnis, Ishan Durugkar, Akshay Krishnamurthy, Alex Smola, and Andrew McCallum. Go for a walk and arrive at the answer: Reasoning over paths in knowledge bases using reinforcement learning. arXiv preprint arXiv:1711.05851, 2017.
|
| 245 |
+
|
| 246 |
+
Pradeep Dasigi, Matt Gardner, Shikhar Murty, Luke Zettlemoyer, and Eduard Hovy. Iterative search for weakly supervised semantic parsing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 2669–2680, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1273. URL https: //www.aclweb.org/anthology/N19-1273.
|
| 247 |
+
|
| 248 |
+
Luc De Raedt, Angelika Kimmig, and Hannu Toivonen. Problog: A probabilistic Prolog and its application in link discovery. In IJCAI, volume 7, pp. 2462–2467. Hyderabad, 2007.
|
| 249 |
+
|
| 250 |
+
Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. Convolutional 2d knowledge graph embeddings. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 251 |
+
|
| 252 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 253 |
+
|
| 254 |
+
Catherine Finegan-Dollak, Jonathan K Kummerfeld, Li Zhang, Karthik Ramanathan, Sesh Sadasivam, Rui Zhang, and Dragomir Radev. Improving text-to-SQL evaluation methodology. arXiv preprint arXiv:1806.09029, 2018.
|
| 255 |
+
|
| 256 |
+
Nitish Gupta and Mike Lewis. Neural compositional denotational semantics for question answering. CoRR, abs/1808.09942, 2018. URL http://arxiv.org/abs/1808.09942.
|
| 257 |
+
|
| 258 |
+
Kelvin Guu, John Miller, and Percy Liang. Traversing knowledge graphs in vector space. arXiv preprint arXiv:1506.01094, 2015.
|
| 259 |
+
|
| 260 |
+
Will Hamilton, Payal Bajaj, Marinka Zitnik, Dan Jurafsky, and Jure Leskovec. Embedding logical queries on knowledge graphs. In Advances in Neural Information Processing Systems, pp. 2026– 2037, 2018.
|
| 261 |
+
|
| 262 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 263 |
+
|
| 264 |
+
Chen Liang, Jonathan Berant, Quoc Le, Kenneth D Forbus, and Ni Lao. Neural symbolic machines: Learning semantic parsers on freebase with weak supervision. arXiv preprint arXiv:1611.00020, 2016.
|
| 265 |
+
|
| 266 |
+
Chen Liang, Mohammad Norouzi, Jonathan Berant, Quoc V Le, and Ni Lao. Memory augmented policy optimization for program synthesis and semantic parsing. In Advances in Neural Information Processing Systems, pp. 9994–10006, 2018.
|
| 267 |
+
|
| 268 |
+
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.
|
| 269 |
+
|
| 270 |
+
Alexander H. Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. CoRR, abs/1606.03126, 2016. URL http://arxiv.org/abs/1606.03126.
|
| 271 |
+
|
| 272 |
+
Dipendra Misra, Ming-Wei Chang, Xiaodong He, and Wen-tau Yih. Policy shaping and generalized update equations for semantic parsing from denotations. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2442–2452, 2018.
|
| 273 |
+
|
| 274 |
+
Panupong Pasupat and Percy Liang. Inferring logical forms from denotations. arXiv preprint arXiv:1606.06900, 2016.
|
| 275 |
+
|
| 276 |
+
Tim Rocktäschel and Sebastian Riedel. End-to-end differentiable proving. In Advances in Neural Information Processing Systems, pp. 3788–3800, 2017.
|
| 277 |
+
|
| 278 |
+
Peter Shaw, Philip Massey, Angelica Chen, Francesco Piccinno, and Yasemin Altun. Generating logical forms from graph representations of text and entities. arXiv preprint arXiv:1905.08407, 2019.
|
| 279 |
+
|
| 280 |
+
Noam Shazeer, Youlong Cheng, Niki Parmar, Dustin Tran, Ashish Vaswani, Penporn Koanantakool, Peter Hawkins, HyoukJoong Lee, Mingsheng Hong, Cliff Young, Ryan Sepassi, and Blake A. Hechtman. Mesh-tensorflow: Deep learning for supercomputers. CoRR, abs/1811.02084, 2018. URL http://arxiv.org/abs/1811.02084.
|
| 281 |
+
|
| 282 |
+
Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Kathryn Mazaitis, Ruslan Salakhutdinov, and William W Cohen. Open domain question answering using early fusion of knowledge bases and text. EMNLP, 2018.
|
| 283 |
+
|
| 284 |
+
Haitian Sun, Tania Bedrax-Weiss, and William W Cohen. Pullnet: Open domain question answering with iterative retrieval on knowledge bases and text. arXiv preprint arXiv:1904.09537, 2019.
|
| 285 |
+
|
| 286 |
+
Théo Trouillon, Christopher R Dance, Éric Gaussier, Johannes Welbl, Sebastian Riedel, and Guillaume Bouchard. Knowledge graph completion via complex tensor factorization. The Journal of Machine Learning Research, 18(1):4735–4772, 2017.
|
| 287 |
+
|
| 288 |
+
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. arXiv preprint arXiv:1410.3916, 2014.
|
| 289 |
+
|
| 290 |
+
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.
|
| 291 |
+
|
| 292 |
+
Wenhan Xiong, Thien Hoang, and William Yang Wang. Deeppath: A reinforcement learning method for knowledge graph reasoning. arXiv preprint arXiv:1707.06690, 2017.
|
| 293 |
+
|
| 294 |
+
Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. arXiv preprint arXiv:1412.6575, 2014.
|
| 295 |
+
|
| 296 |
+
Fan Yang, Zhilin Yang, and William W Cohen. Differentiable learning of logical rules for knowledge base reasoning. In Advances in Neural Information Processing Systems, pp. 2319–2328, 2017.
|
| 297 |
+
|
| 298 |
+
Wen-tau Yih, Ming-Wei Chang, Xiaodong He, and Jianfeng Gao. Semantic parsing via staged query graph generation: Question answering with knowledge base. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, pp. 1321–1331, 2015.
|
| 299 |
+
|
| 300 |
+
Wen-tau Yih, Matthew Richardson, Chris Meek, Ming-Wei Chang, and Jina Suh. The value of semantic parse labeling for knowledge base question answering. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pp. 201–206, 2016.
|
| 301 |
+
|
| 302 |
+
Yuyu Zhang, Hanjun Dai, Zornitsa Kozareva, Alexander J Smola, and Le Song. Variational reasoning for question answering with knowledge graph. In AAAI, 2018.
|
| 303 |
+
|
| 304 |
+
Victor Zhong, Caiming Xiong, and Richard Socher. Seq2sql: Generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103, 2017.
|
| 305 |
+
|
| 306 |
+
# A ADDITIONAL BACKGROUND AND EXTENSIONS
|
| 307 |
+
|
| 308 |
+
KBs, entities, and relations, and types. In the more general case, a KB consists of entities, relations, and types. Again use $x$ to denote an entity and $r$ to denote a relation. We also assume each entity $x$ has a type, written $t y p e ( x )$ , and let $N _ { \tau }$ denote the number of entities of type $\tau$ . Each entity $x$ in type $\tau$ has a unique index $i n d e x _ { \tau } ( x )$ , which is an integer between 1 and $N _ { \tau }$ . We write $x _ { \tau , i }$ for the entity that has index $i$ in type $\tau$ , or $x _ { i }$ if the type is clear from context.
|
| 309 |
+
|
| 310 |
+
Every relation $r$ has a subject type $\tau _ { s u b j }$ and an object type $\tau _ { o b j }$ , which constrain the types of $x$ and $x ^ { \prime }$ for any pair $( x , x ^ { \prime } ) \in r$ . Hence $r$ can be encoded as a subset of $\{ 1 , \dots , N _ { \tau _ { s u b j } } \} \times \{ 1 , \dots , N _ { \tau _ { o b j } } \}$ Relations with the same subject and object types are called type-compatible.
|
| 311 |
+
|
| 312 |
+
Our differentiable operations are based on typed weighted sets, where again each element $x$ of weighted set $X$ is associated with a non-negative real number, written $\omega \| x \in X ]$ , and we define $\omega \bar { \left\| { \boldsymbol { x } } \in { \boldsymbol { X } } \right\| } \equiv 0$ for all $x \not \in X$ . A set $X$ has a type $t y p e ( X ) = \tau$ , and all members of $X$ must be entities of type $\tau$ .
|
| 313 |
+
|
| 314 |
+
We also assume every relation $r$ in a KB is associated with an entity $x _ { r }$ , and hence, an index and a type. Sets of relations $R$ are allowed only if all members are type-compatible. For example $R = \{ w r i t e r \_ o f , d i r e c t o r \_ o f \}$ might be a set of type-compatible relations.
|
| 315 |
+
|
| 316 |
+
A weighted set $X$ of type $\tau$ can be encoded as an entity-set vector $\mathbf { x } \in \mathbb { R } ^ { N _ { \tau } }$ , where the $i$ -th component of $\mathbf { X }$ is the weight of the $i$ -th entity of that type in the set $X$ : e.g., $\mathbf { x } [ i n d e x _ { \tau } ( x ) ] = { \boldsymbol { \omega } } [ x \in X ]$ . We also use $t y p e ( \mathbf { x } )$ to denote the type $\tau$ of the set encoded by $\mathbf { X }$ .
|
| 317 |
+
|
| 318 |
+
A relation $r$ with subject type $\tau _ { 1 }$ and object type $\tau _ { 2 }$ can be encoded as a relation matrix ${ \mathbf { M } } _ { r } \in { \mathbf { \Omega } }$ $\mathbb { R } ^ { N _ { \tau _ { 1 } } \times N _ { \tau _ { 2 } } }$ .
|
| 319 |
+
|
| 320 |
+
Background on sparse matrices. A COO encoding consists of a $N _ { r } \times 2$ matrix $\mathbf { I n d } _ { r }$ containing pairs of entity indices, and a parallel vector $\mathbf { w } _ { r } \in \mathbb { R } ^ { \widetilde { N } _ { r } }$ containing the weights of the corresponding entity pairs. In this encoding, if $( i , j )$ is row $k$ of Ind, then $\mathbf { M } _ { r } [ i , j ] = \mathbf { w } _ { r } [ k ]$ , and if $( i , j )$ does not appear in $\mathbf { I n d } _ { r }$ , then $\mathbf { M } [ i , j ]$ is zero.
|
| 321 |
+
|
| 322 |
+
Extension to soft KBs. In the paper, we assume the non-zero weights in a relation matrix ${ { \bf { M } } _ { r } }$ are all equal to 1.0. This can be relaxed: if assertions in a KB are associated with confidences, then this confidence can be stored in ${ { \bf { M } } _ { r } }$ . In this case, the reified KB must be extended to encode the weight for a triple: we find it convenient to redefine ${ { \bf { M } } _ { r e l } }$ to hold that weight. In particular if the weight for the the $\ell$ -th triple $r _ { k } ( x _ { i } , x _ { j } )$ is $w _ { \ell }$ , then we let
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\mathbf { M } _ { r e l } [ \ell , m ] \equiv { \left\{ \begin{array} { l l } { w _ { \ell } \ \mathrm { i f } \ m = k _ { \ell } } \\ { 0 \ \mathrm { e l s e } } \end{array} \right. }
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
# B PROOF OF CLAIM 1
|
| 329 |
+
|
| 330 |
+
Claim 1 The support of follow $\scriptstyle ( \mathbf { x } , \pmb { r } )$ is exactly the set of R-neighbors( $X )$ .
|
| 331 |
+
|
| 332 |
+
To better understand this claim, let $\mathbf { z } = f o l l o w ( \mathbf { x } , \mathbf { r } )$ . The claim states $\mathbf { z }$ can approximate the $R$ neighborhood of any hard sets $R , X$ by setting to zero the appropriate components of $\mathbf { X }$ and $\mathbf { r }$ . It is also clear that $\mathbf { z } [ j ]$ decreases when one decreases the weights in r of the relations that link $x _ { j }$ to entities in $X$ , and likewise, $\mathbf { z } [ j ]$ decreases if one decreases the weights of the entities in $X$ that are linked to $x _ { j }$ via relations in $R$ , so there is a smooth, differentiable path to reach this approximation.
|
| 333 |
+
|
| 334 |
+
More formally, consider first a matrix ${ { \bf { M } } _ { r } }$ encoding a single binary relation $r$ , and consider the vector $\mathbf { x } ^ { \prime } = \mathbf { x } \mathbf { M } _ { r }$ . As weighted sets, $X$ and $r$ have non-negative entries, so clearly for all $i$ ,
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\mathbf { x } ^ { \prime } [ j ] \neq 0 \mathrm { ~ i f f ~ } \exists j : \mathbf { M } _ { r } [ i , j ] \neq 0 \land \mathbf { x } [ i ] \neq 0
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
and so if $\mathbf { r }$ is a one-hot vector for the set $\{ r \}$ , then the support of $f o l l o w ( \mathbf { x } , \mathbf { r } )$ is exactly the set $r$ -neighbors $( X )$ . Finally note that the mixture $\mathbf { M } _ { R }$ has the property that ${ \bf M } _ { R } [ i ( e _ { 1 } ) , i ( e _ { 2 } ) ] > 0$ exactly when $e _ { 1 }$ is related to $e _ { 2 }$ by some relation $r \in R$ .
|
| 341 |
+
|
| 342 |
+
The major problem with naive mixing is that, in the absence of general sparse tensor contractions, it is difficult to adapt to mini-batches—i.e., a setting in which $\mathbf { X }$ and $\mathbf { r }$ are replaced with matrices $\mathbf { X }$ and $\mathbf { R }$ with minibatch size $b$ . An alternative strategy is late mixing, which mixes the output of many single-relation following steps, rather than mixing the KB itself:
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
f o l l o w ( { \mathbf { X } } , { \mathbf { R } } ) = \sum _ { k = 1 } ^ { N _ { R } } ( { \mathbf { R } } [ : , k ] \cdot { \mathbf { X } } { \mathbf { M } } _ { k } )
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
Here $\mathbf { R } [ : , k ]$ , the $k$ -th column of $\mathbf { R }$ , is “broadcast” to element of the matrix $\mathbf { X M } _ { k }$ . As noted in the body of the text, while there are $N _ { R }$ matrices $\mathbf { X M } _ { k }$ , each of size $O ( b N _ { E } )$ , they need not all be stored at once, so the space complexity becomes $O ( b N _ { E } + b N _ { R } + N _ { T } )$ ; however we must now sum up $N _ { R }$ dense matrices.
|
| 349 |
+
|
| 350 |
+
The implementation of relation-set following for the reified KB can be straightforwardedly extended to a minibatch:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
f o l l o w ( \mathbf { X } , \mathbf { R } ) = ( \mathbf { X } \mathbf { M } _ { s u b j } ^ { T } \odot \mathbf { R } \mathbf { M } _ { r e l } ^ { T } ) \mathbf { M } _ { o b j }
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
# D DISTRIBUTED MATRIX MULTIPLICATION
|
| 357 |
+
|
| 358 |
+
Matrix multiplication $\mathbf { x M }$ was distributed as follows: $\mathbf { X }$ can be split into a “horizontal stacking” of $m$ submatrices, which we write as $\left[ \mathbf { x } _ { 1 } ; \ldots ; \mathbf { x } _ { m } \right]$ , and $\mathbf { M }$ can be similarly partitioned into $m ^ { 2 }$ submatrices. We then have the result that
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\mathbf { x M } = [ \mathbf { x } _ { 1 } ; \mathbf { x } _ { 2 } ; \ldots ; \mathbf { x } _ { m } ] \left[ { \begin{array} { c c c c } { \mathbf { M } _ { 1 , 1 } } & { \mathbf { M } _ { 1 , 2 } } & { \ldots } & { \mathbf { M } _ { 1 , m } } \\ { \vdots } & { \vdots } & { } & { \vdots } \\ { \mathbf { M } _ { m , 1 } } & { \mathbf { M } _ { m , 2 } } & { \ldots } & { \mathbf { M } _ { m , m } } \end{array} } \right] = \left[ ( \sum _ { i = 1 } ^ { m } \mathbf { x } _ { 1 } \mathbf { M } _ { i , 1 } ) ; \ldots ; ( \sum _ { i = 1 } ^ { m } \mathbf { x } _ { m } \mathbf { M } _ { i , m } ) \right]
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
This can be computed without storing either $\mathbf { X }$ or $\mathbf { M }$ on a single machine, and mathematically applies to both dense and sparse matrices. In our experiments we distibuted the matrices that define a reified KB “horizontally”, so that different triple ids $\ell$ are stored on different GPUs.
|
| 365 |
+
|
| 366 |
+
Specifically, we shard the “triple index” dimension $N _ { T }$ of matrices $\mathbf { M } _ { s u b j }$ , ${ { \bf { M } } _ { r e l } }$ and $\mathbf { M } _ { o b j }$ in Eq. 4 to perform a distributed relation-set following on the reified KB. Let $\mathbf { M } _ { s u b j , i }$ be the $\overrightarrow { \imath } ^ { \prime }$ th shard of matrix $\mathbf { M } _ { s u b j }$ , and thus $\mathbf { M } _ { s u b j } = [ \mathbf { M } _ { s u b j , 1 } ^ { T } ; . . . ; \mathbf { M } _ { s u b j , m } ^ { T } ] _ { . } ^ { T } \in \mathbb { R } ^ { N _ { T } \times N _ { E } }$ . $\mathbf { M } _ { o b j }$ and ${ { \bf { M } } _ { r e l } }$ are represented in the similar way. A distributed relation-set following is computed as a combination of relation-set following results on all shards of the KB.
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\begin{array} { l } { f o l l o w ( \mathbf { x } , \mathbf { r } ) = ( \mathbf { x } \mathbf { M } _ { s u b j } ^ { T } \odot \mathbf { r } \mathbf { M } _ { r e l } ^ { T } ) \mathbf { M } _ { o b j } } \\ { \quad \quad = \left( [ \mathbf { x } \mathbf { M } _ { s u b j , 1 } ^ { T } ; \dots ; \mathbf { x } \mathbf { M } _ { s u b j , m } ^ { T } ] \odot [ \mathbf { r } \mathbf { M } _ { r e l , 1 } ^ { T } ; \dots ; \mathbf { r } \mathbf { M } _ { r e l , m } ^ { T } ] \right) \left[ \begin{array} { c } { \mathbf { M } _ { o b j , 1 } } \\ { \vdots } \\ { \mathbf { M } _ { o b j , m } } \end{array} \right] } \\ { \quad \quad = \displaystyle \sum _ { i = 1 } ^ { m } ( \mathbf { x } \mathbf { M } _ { s u b j , i } ^ { T } \odot \mathbf { r } \mathbf { M } _ { r e l , i } ^ { T } ) \mathbf { M } _ { o b j , i } } \end{array}
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
This method can be easily extended to a mini-batch of examples $\mathbf { X }$ .
|
| 373 |
+
|
| 374 |
+
# E EXPERIMENTAL DETAILS
|
| 375 |
+
|
| 376 |
+
Reproducing experiments. To reproduce these experiments, first download and install the Google language package5. Many of the experiments in this paper can be reproduced using scripts stored in the some subdirectory of the source directory language/nql/demos: for example, the scalability experiments of Figure 1 can be performed using scripts in language/nql/demos/gridworld_scaling/.
|
| 377 |
+
|
| 378 |
+
Grid experiments. In the grid experiments, the entity vector $\mathbf { X }$ is a randomly-chosen singleton set, and the relation vector r weights relations roughly uniformly—more specifically, each relation has weight $1 { + } \epsilon$ where $\epsilon$ is a drawn uniformly at random between 0 and 0.001.6 We vary the number of relations by inventing $m$ new relation names and assigning existing grid edges to each new relation. These experiments were conducted on a Titan $\mathrm { X p }$ GPU with 12Gb of memory.
|
| 379 |
+
|
| 380 |
+
For key-value networks, the key is the concatenation of a relation and a subject entity, and the value is the object entity. We considered only the run-time for queries on an untrained randomly-initialized network (since run-time performance on a trained network would be the same); however, it should be noted that considerable time that might be needed to train the key-value memory to approximate the KB. (In fact, it is not obvious under what conditions a KB can be approximated well by the key-value memory.)
|
| 381 |
+
|
| 382 |
+
We do not show results on the grid task for smaller minibatch sizes, but both reified and late mixing are about $4 0 \mathrm { x }$ slower with $b = 1$ than with $b = 1 2 8$ .
|
| 383 |
+
|
| 384 |
+
WebQuestionsSP experiments. For efficiency, on this problem we exploit the type structure of the problem (see Appendix A). Our model uses two types of nodes, CVT and entity nodes. The model also uses three types of relations: relations mapping entities to entities, relations mapping entities to CVT nodes; and relations mapping CVT nodes to entity nodes.
|
| 385 |
+
|
| 386 |
+
MetaQA experiments. An example of a 2-hop question in MetaQA could be “Who co-starred with Robert Downey Jr. in their movies?”, and the answer would be a set of actor entities, e.g., “Chris Hemsworth”, “Thomas Stanley”, etc. Triples in the knowledge base are represented as (subject, relation, object) triples, e.g., (“Robert Downey Jr.”, “act_in”, “Avengers: Endgame”), (“Avengers: Endgame”, “stars”, “Thomas Stanley”), etc. The quoted strings here all indicate KB entities.
|
| 387 |
+
|
| 388 |
+
We also observed that in the MetaQA 2-hop and 3-hop questions, the questions often exclude the seed entities (e.g., “other movies with the same director as Pulp Fiction”). This can be modeled by masking out seed entities from the predictions after the second hop (ReifKB $^ +$ mask in the table).
|
| 389 |
+
|
| 390 |
+
Timing on MetaQA and other natural problems. The raw data for the bubble plot of Table 5 is below.
|
| 391 |
+
|
| 392 |
+
<table><tr><td>Time (seconds)</td><td>Accuracy (hits@1)</td><td>Method</td></tr><tr><td>72.6</td><td>79.7</td><td>ReifKB</td></tr><tr><td>189.8</td><td>10.1</td><td>KV-mem</td></tr><tr><td>28.9</td><td>77.2</td><td>GRAFT-Net</td></tr><tr><td>1131.0</td><td>91.4</td><td>PullNet</td></tr></table>
|
| 393 |
+
|
| 394 |
+
Discussion of the KB completion model. The KB completion model is
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
t = 1 , \dots , T \colon \ \mathbf { r } _ { i } ^ { t } = f _ { i } ^ { t } ( q ) ; \ \mathbf { x } _ { i } ^ { t } = f o l l o w ( \mathbf { x } _ { i } ^ { t - 1 } , \mathbf { r } _ { i } ^ { t } ) + \mathbf { x } _ { i } ^ { t - 1 }
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
It may not be immediately obvious why we used
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
\mathbf { x } _ { i } ^ { t } = f o l l o w ( \mathbf { x } _ { i } ^ { t - 1 } , \mathbf { r } _ { i } ^ { t } ) + \mathbf { x } _ { i } ^ { t - 1 }
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
instead of the simpler
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\mathbf { x } _ { i } ^ { t } = f o l l o w ( \mathbf { x } _ { i } ^ { t - 1 } , \mathbf { r } _ { i } ^ { t } )
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
In the main text, we say that this “gives the model access to outputs of all chains of length less than $t ^ { \ast }$ This statement is probably easiest to understand by considering a concete example. Let us simplify notation slightly by dropping the subscripts and writing follow $( \mathbf { x } _ { i } ^ { t - 1 } , \mathbf { r } _ { i } ^ { t } )$ as $f ^ { t } ( \mathbf { \bar { x } } ^ { t - 1 } )$ . Now expand the definition of $\mathbf { x } ^ { t }$ for a few small values of $t$ , using the linearity of the definition of relation-set
|
| 413 |
+
|
| 414 |
+
following where appropriate to simplify:
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
{ \begin{array} { r c l } { \mathbf { x } ^ { 1 } } & { = } & { f ^ { 1 } ( \mathbf { x } ^ { 0 } ) + \mathbf { x } ^ { 0 } } \\ { \mathbf { x } ^ { 2 } } & { = } & { f ^ { 2 } ( \mathbf { x } ^ { 1 } ) + \mathbf { x } ^ { 1 } } \\ & { = } & { f ^ { 2 } \left( \left( f ^ { 1 } ( \mathbf { x } ^ { 0 } ) + \mathbf { x } ^ { 0 } \right) + \left( \left( f ^ { 1 } ( \mathbf { x } ^ { 0 } ) + \mathbf { x } ^ { 0 } \right) \right. \right. } \\ & { = } & { \left. f ^ { 2 } ( f ^ { 1 } ( \mathbf { x } ^ { 0 } ) ) + f ^ { 2 } ( \mathbf { x } ^ { 0 } ) + f ^ { 1 } ( \mathbf { x } ^ { 0 } ) + \mathbf { x } ^ { 0 } \right. } \\ { \mathbf { x } ^ { 3 } } & { = } & { f ^ { 3 } ( \mathbf { x } ^ { 2 } ) + \mathbf { x } ^ { 2 } } \\ & { = } & { f ^ { 3 } \left( \left( f ^ { 2 } ( f ^ { 1 } ( \mathbf { x } ^ { 0 } ) \right) + f ^ { 2 } ( \mathbf { x } ^ { 0 } ) + f ^ { 1 } ( \mathbf { x } ^ { 0 } ) + \mathbf { x } ^ { 0 } \right) + f ^ { 2 } ( f ^ { 1 } ( \mathbf { x } ^ { 0 } ) ) + f ^ { 2 } ( \mathbf { x } ^ { 0 } ) + f ^ { 1 } ( \mathbf { x } ^ { 0 } ) + \mathbf { x } ^ { 0 } } \\ & { = } & { f ^ { 3 } { \big ( } f ^ { 2 } ( f ^ { 1 } ( \mathbf { x } ^ { 0 } ) { \big ) \big ) } + f ^ { 3 } { \big ( } f ^ { 2 } ( \mathbf { x } ^ { 0 } ) { \big ) } + f ^ { 3 } { \big ( } f ^ { 1 } ( \mathbf { x } ^ { 0 } ) { \big ) } + f ^ { 2 } { \big ( } f ^ { 1 } ( \mathbf { x } ^ { 0 } ) { \big ) } + f ^ { 2 } ( \mathbf { x } ^ { 0 } ) + f ^ { 2 } ( \mathbf { x } ^ { 0 } ) + f ^ { 1 } ( \mathbf { x } ^ { 0 } ) } \end{array} }
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
A pattern is now clear: with this recursive definition $\mathbf { x } ^ { t }$ expands to a mixture of many paths, each of which applies a different subset of $f ^ { 1 }$ , . . . , $f ^ { t }$ to the initial input $\mathbf { X }$ . Since the weights of the mixture can to a large extent be controlled by varying the norm of the relation vectors $\mathbf { r } ^ { 1 } , \ldots . . . ^ { t }$ , this “kernel-like trick” increases the expressive power of the model without introducing new parameters. The final mixture of the $\mathbf { x } ^ { t }$ ’s seems to provide a bias towards accepting the output of shorter paths, which appears to be useful in practice.
|
md/train/BJlo91BYPr/BJlo91BYPr.md
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IRRATIONALITY CAN HELP REWARD INFERENCE
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Specifying reward functions is difficult, which motivates the area of reward inference: learning rewards from human behavior. The starting assumption in the area is that human behavior is optimal given the desired reward function, but in reality people have many different forms of irrationality, from noise to myopia to risk aversion and beyond. This fact seems like it will be strictly harmful to reward inference: it is already hard to infer the reward from rational behavior, and noise and systematic biases make actions have less direct of a relationship with the reward. Our insight in this work is that, contrary to expectations, irrationality can actually help rather than hinder reward inference. For some types and amounts of irrationality, the expert now produces more varied policies compared to rational behavior, which help disambiguate among different reward parameters – those that otherwise correspond to the same rational behavior. We put this to the test in a systematic analysis of the effect of irrationality on reward inference. We start by covering the space of irrationalities as deviations from the Bellman update, simulate expert behavior, and measure the accuracy of inference to contrast the different types and study the gains and losses. We provide a mutual informationbased analysis of our findings, and wrap up by discussing the need to accurately model irrationality, as well as to what extent we might expect (or be able to train) real people to exhibit helpful irrationalities when teaching rewards to learners.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The application of reinforcement learning (RL) in increasingly complex environments has been most successful for problems that are already represented by a specified reward function (Lillicrap et al., 2015; Mnih et al., 2015; 2016; Silver et al., 2016). Unfortunately, not only do real-world tasks usually lack an explicit exogenously-specified reward function, but attempting to specify one tends to lead to unexpected side-effects as the agent is faced with new situations (Lehman et al., 2018).
|
| 12 |
+
|
| 13 |
+
This has motivated the area of reward inference: the process of estimating a reward function from human inputs. The inputs are traditionally demonstrations, leading to inverse reinforcement learning (IRL) $\mathrm { N g }$ et al., 2000; Abbeel & $\mathrm { N g }$ , 2004) or inverse optimal control (IOC) (Kalman, 1964; Jameson & Kreindler, 1973; Mombaur et al., 2010; Finn et al., 2016). Recent work has expanded the range of inputs significantly,to comparisons (Wirth et al., 2017; Sadigh et al., 2017; Christiano et al., 2017), natural language instructions (MacGlashan et al., 2015; Fu et al., 2019), physical corrections (Jain et al., 2015; Bajcsy et al., 2017), proxy rewards (Hadfield-Menell et al., 2017; Ratner et al., 2018), or scalar reward values (Griffith et al., 2013; Loftin et al., 2014).
|
| 14 |
+
|
| 15 |
+
The central assumption behind these methods is that human behavior is rational, i.e. optimal with respect to the desired reward (cumulative, in expectation). Unfortunately, decades of research in behavioral economics and cognitive science Chipman (2014) has unearthed a deluge of irrationalities, i.e. of ways in which people deviate from optimal decision making: hyperbolic discounting, scope insensitivity, optimism bias, decision noise, certainty effects, loss aversion, status quo bias, etc.
|
| 16 |
+
|
| 17 |
+
Work on reward inference has predominantly used one model of irrationality: decision-making noise, where the probability of an action relates to the value that action has. The most widely used model by far is a Bolzmann distribution stemming from the Luce-Sherpard rule (Luce, 1959; Shepard, 1957; Lucas et al., 2009) and the principle of maximum (causal) entropy in (Ziebart et al., 2008; 2010), which we will refer to as Bolzmann-rationality (Fisac et al., 2017). Recent work has started to incorporate systematic biases though, like risk-aversion (Singh et al., 2017), having the wrong dynamics belief (Reddy et al., 2018), and myopia and hyperbolic discounting (Evans & Goodman, 2015; Evans et al., 2016).
|
| 18 |
+
|
| 19 |
+
Learning from irrational experts feels like daunting task: reward inference is already hard with rational behavior, but now a learner needs to make sense of behavior that is noisy or systematically biased. Our goal in this work is to characterize just how muddied the waters are – how (and how much) do different irrationalities affect reward inference?
|
| 20 |
+
|
| 21 |
+
Our insight is that, contrary to expectations, irrationality can actually help, rather than hinder, reward inference.
|
| 22 |
+
|
| 23 |
+
Our explanation is that how good reward inference is depends on the mutual information between the policies produced by the expert and the reward parameters to be inferred. While it is often possible for two reward parameters to produce the same rational behavior, irrationalities can sometimes produce different behaviors that disambiguate between those same two reward parameters. For instance, noise can help when it is related to the value function, as Boltzmann noise is, because it distinguishes the difference in values even when the optimal action stays the same. Optimism can be helpful because the expert takes fewer risk-avoiding actions and acts more directly on their goal.
|
| 24 |
+
|
| 25 |
+
Overall, we contribute 1) an analysis and comparison of the effects of different biases on reward inference testing our insight, 2) a way to systematically formalize and cover the space of irrationalities in order to conduct such an analysis, and 3) evidence for the importance of assuming the right type of irrationality during inference.
|
| 26 |
+
|
| 27 |
+
Our good news is that irrationalities can indeed be an ally for inference. Of course, this is not always true – the details of which irrationality type and how much of it also matter. We see these results as opening the door to a better understanding of reward inference, as well as to practical ways of making inference easier by asking for the right kind of expert demonstrations – after all, in some cases it might be easier for people to act optimistically or myopically than to act rationally. Our results reinforce that optimal teaching is different from optimal doing, but point out that some forms of teaching might actually be easier than doing.
|
| 28 |
+
|
| 29 |
+
# 2 METHOD
|
| 30 |
+
|
| 31 |
+
# 2.1 EXPLORING IRRATIONALITY THROUGH SIMULATION
|
| 32 |
+
|
| 33 |
+
Our goal is to explore the effect irrationalities have on reward inference if the learner knows about them – we explore the need for the learner to accurately model irrationalities in section 4.2. While ideally we would recruit human subjects with different irrationalities and measure how well we can learn rewards, this is prohibitive because we do not get to dictate someone’s irrationality type: people exhibit a mix of them, some yet to be discovered. Further, measuring accuracy of inference is complicated by the fact that we do not have ground truth access to the desired reward: the learner can measure agreement with some test set, but the test set itself is produced subject to the same irrationalities that produced the training data. As experimenters, we would remain deluded about the human’s true intentions and preferences.
|
| 34 |
+
|
| 35 |
+
To address this issue, we simulate expert behavior subject to different irrationalities based on ground truth reward functions, run reward inference, and measure the performance against the ground truth, i.e. the accuracy of a Bayesian posterior on the reward function given the (simulated) expert’s inputs.
|
| 36 |
+
|
| 37 |
+
# 2.2 TYPES AND DEGREES OF IRRATIONALITY
|
| 38 |
+
|
| 39 |
+
There are many possible irrationalities that people exhibit (Chipman, 2014), far more than what we could study in one paper. They come with varying degrees of mathematical formalization and replication across human studies. To provide good coverage of this space, we start from the Bellman update, and systematically manipulate its terms and operators to produce a variety of different irrationalities that deviate from the optimal MDP policy in complementary ways. For instance, operating on the discount factor can model more myopic behavior, while operating on the transition function can model optimism or the illusion of control. Figure 1 summarizes our approach, which we detail below.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 1: We modify the components of the Bellman update to cover different types of irrationalities: changing the max into a softmax to capture noise, changing the transition function to capture optimism/pessimism or the illusion of control, changing the reward values to capture the nonlinear perception of gains and losses (prospect theory), changing the average reward over time into a maximum (extremal), and changing the discounting to capture more myopic decision-making.
|
| 43 |
+
|
| 44 |
+
# 2.2.1 RATIONAL EXPERT
|
| 45 |
+
|
| 46 |
+
The rational expert does value iteration using the Bellman update from figure 1. Our models change this update to produce different types of non-rational behavior.
|
| 47 |
+
|
| 48 |
+
# 2.2.2 MODIFYING THE MAX OPERATOR: BOLZMANN
|
| 49 |
+
|
| 50 |
+
Boltzmann-rationality modifies the maximum over actions $\mathrm { m a x } _ { a }$ with a Boltzmann operator with parameter $\beta$ :
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
V _ { i + 1 } ( s ) = { \bf B o l t z } _ { a } ^ { \beta } \sum _ { s ^ { \prime } \in S } T ( s ^ { \prime } | s , a ) \left( r ( s , a , s ^ { \prime } ) + \gamma V _ { i } ( s ) \right)
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Where $\begin{array} { r } { \mathbf { B o l t z } ^ { \beta } ( \mathbf { x } ) = \sum _ { i } x _ { i } e ^ { \beta x _ { i } } / \sum _ { i } e ^ { \beta x _ { i } } } \end{array}$ (Ziebart et al., 2010; Asadi $\&$ Littman, 2017) This models that people will not be perfect, but rather noisily pick actions in a way that is related to the Qvalue of those actions. The constant $\beta$ is called the rationality constant, because as $\beta \infty$ , the human choices approach perfect rationality (optimality), whereas $\beta = 0$ produces uniformly random choices. This is the standard assumption for reward inference that does not assume perfect rationality, because it easily transforms the rationality assumption into a probability distribution over actions, enabling learners to make sense of imperfect demonstrations that otherwise do not match up with any reward parameters.
|
| 57 |
+
|
| 58 |
+
# 2.2.3 MODIFYING THE TRANSITION FUNCTION
|
| 59 |
+
|
| 60 |
+
Our next set of irrationalities manipulate the transition function away from reality.
|
| 61 |
+
|
| 62 |
+
Illusion of Control. Humans often overestimate their ability to control random events. To model this, we consider experts that use the Bellman update:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
V _ { i + 1 } ( s ) = \operatorname* { m a x } _ { a } \sum _ { s ^ { \prime } \in S } T ^ { n } ( s ^ { \prime } | s , a ) \left( r ( s , a , s ^ { \prime } ) + \gamma V _ { i } ( s ) \right)
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $T ^ { n } ( s ^ { \prime } | s , a ) \propto \left( T ( s ^ { \prime } | s , a ) \right) ^ { n }$ . As $n \to \infty$ , the demonstrator acts as if it exists in a deterministic environment. As $n 0$ , the expert acts as if it had an equal chance of transitioning to every possible successor state. At $n = 1$ , the expert is the rational expert.
|
| 69 |
+
|
| 70 |
+
Optimism/Pessimism. Humans tend to systematically overestimate their chance experiencing of positive over negative events. We model this using experts that modify the probability they get outcomes based on the value of those outcomes:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
V _ { i + 1 } ( s ) = \operatorname* { m a x } _ { a } \sum _ { s ^ { \prime } \in S } T ^ { 1 / \tau } ( s ^ { \prime } | s , a ) \left( r ( s , a , s ^ { \prime } ) + \gamma V _ { i } ( s ) \right)
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $T ^ { 1 / \tau } ( s ^ { \prime } | s , a ) \propto T ( s ^ { \prime } | s , a ) e ^ { \big ( r ( s , a , s ^ { \prime } ) + \gamma V _ { i } ( s ) \big ) / \tau }$ . $1 / \tau$ controls how pessimistic or optimistic the expert is. As $1 / \tau \to + \infty$ , the expert becomes increasingly certain that good transitions will happen. As $1 / \tau \to - \infty$ , the expert becomes increasingly certain that bad transitions will happen. As $1 / \tau \to 0$ , the expert approaches the rational expert.
|
| 77 |
+
|
| 78 |
+
# 2.2.4 MODIFYING THE REWARD: PROSPECT THEORY
|
| 79 |
+
|
| 80 |
+
Next, we consider experts that use the modified Bellman update:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
V _ { i + 1 } ( s ) = \operatorname* { m a x } _ { a } \sum _ { s ^ { \prime } \in S } T ( s ^ { \prime } | s , a ) \left( f ( r ( s , a , s ^ { \prime } ) ) + \gamma V _ { i } ( s ) \right)
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $f : \mathbb { R } \to \mathbb { R }$ is some scalar function. This is equivalent to solving the MDP with reward $f \circ r$ This allows us to model human behavior such as loss aversion and scope insensitivity.
|
| 87 |
+
|
| 88 |
+
Prospect Theory Kahneman & Tversky (2013) inspires us to consider a particular family of reward transforms:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
f _ { c } ( r ) = \left\{ \begin{array} { l l } { \log ( 1 + | r | ) } & { r > 0 } \\ { 0 } & { r = 0 } \\ { - c \log ( 1 + | r | ) } & { r < 0 } \end{array} \right.
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$c$ controls how loss averse the expert is. As $c \infty$ , the expert primarily focuses on avoiding negative rewards. As $c \to 0$ , the expert focuses on maximizing positive rewards and
|
| 95 |
+
|
| 96 |
+
2.2.5 MODIFYING THE SUM BETWEEN REWARD AND FUTURE VALUE: EXTREMAL
|
| 97 |
+
|
| 98 |
+
Extremal. Humans seem to exhibit duration neglect, sometimes only caring about the maximum intensity of an experiennce (Do et al., 2008). We model this using experts that use the Bellman step:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
V _ { i + 1 } ( s ) = \operatorname* { m a x } _ { a } \sum _ { s ^ { \prime } \in S } T ( s ^ { \prime } | s , a ) \left( \operatorname* { m a x } \left[ r ( s , a , s ^ { \prime } ) , ( 1 - \alpha ) r ( s , a , s ^ { \prime } ) + \alpha V _ { i } ( s ) \right] \right)
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
These experts maximize the expected maximum reward along a trajectory, instead of the expected sum of rewards. As $\alpha 1$ , the expert maximizes the expected maximum reward they achieve along their full trajectory. As $\alpha 0$ , the expert becomes greedy, and only cares about the reward they achieve in the next timestep.
|
| 105 |
+
|
| 106 |
+
# 2.2.6 MODIFYING THE DISCOUNTING
|
| 107 |
+
|
| 108 |
+
Myopic Discount. In practice, humans are often myopic, only considering immediate rewards. One way to model this is to decrease gamma in the Bellman update. At $\gamma = 1$ , this is the rational expert. As $\gamma 0$ , the expert becomes greedy and only acts to maximize immediate reward.
|
| 109 |
+
|
| 110 |
+
Myopic VI. As another way to model human myopia, we consider a expert that performs only $h$ steps of Bellman updates. That is, this expert cares equally about rewards for horizon $h$ , and discount to 0 reward after that. As $h \to \infty$ , this expert becomes rational. If $h = 1$ , this expert only cares about the immediate reward.
|
| 111 |
+
|
| 112 |
+
Hyperbolic Discounting. Human also exhibit hyperbolic discounting, with a high discount rate for the immediate future and a low discount rate for the far future. Alexander & Brown (2010) formulate this as the following Bellman update:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
V _ { i + 1 } ( s ) = \operatorname* { m a x } _ { a } \sum _ { s ^ { \prime } \in S } T ( s ^ { \prime } | s , a ) \left( r ( s , a , s ^ { \prime } ) + V _ { i } ( s ) \right) / ( 1 + k V _ { i } ( s ) )
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
$k$ modulates how much the expert prefers rewards now versus the future. As $k 0$ , this expert becomes the rational expert.
|
| 119 |
+
|
| 120 |
+
# 3 IMPACT OF IRRATIONALITIES ON REWARD INFERENCE
|
| 121 |
+
|
| 122 |
+
# 3.1 EXPERIMENTAL DESIGN
|
| 123 |
+
|
| 124 |
+
Simulation Environment. To reduce possible confounding from our choice of environment, we used a small 5x5 gridworld where the irrationalities nonetheless cause experts to exhibit different behavior. Our gridworld consists of three types of cells: ice, holes, and rewards. The expert can start in any ice cell. At each ice cell, the expert can move in one of the four cardinal directions. With probability 0.8, they will go in that direction. With probability 0.2, they will instead go in one of the two adjacent directions. Holes and rewards are terminal states, and return the expert back to their start state. They receive a penalty of $- 1 0$ for falling into a hole and $\theta _ { i } \in [ 0 , 4 ]$ for entering into the ith reward cell.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 2: The log loss (lower $=$ better) of the posterior as a function of the parameter we vary for each irrationality type. These six irrationalities all have parameter settings that outperform rational experts. For the models that interpolate to rational expert, we denote the value that is closest to rational using a dashed vertical line.
|
| 128 |
+
|
| 129 |
+
Dependent Measures. To separate the inference difficulty caused by suboptimal inference from the difficulty caused by expert irrationality, we perform the exact Bayesian update on the trajectory $\theta$ (Ramachandran & Amir, 2007), which gives us the posterior on $\theta$ given $\xi$ :
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
P ( \theta | \xi ) = \frac { P ( \xi | \theta ) P ( \theta ) } { \int _ { \theta ^ { \prime } } P ( \xi | \theta ^ { \prime } ) P ( \theta ^ { \prime } ) }
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
We use two metrics to measure the difficulty of inference The first is the expected log loss of this posterior, or negative log-likelihood:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\operatorname { L o g } \operatorname { L o s s } ( \theta | \xi ) = E _ { \theta , \xi \sim \pi _ { \theta } } \left[ - \log P ( \theta | \xi ) \right] .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
A low log loss implies that we are assigning a high likelihood to the true $\theta$ . As we are performing exact Bayesian inference with the true model $P ( \xi | \theta )$ and prior $P ( \theta )$ , the log loss is equal to the entropy of the posterior $H ( \theta | \xi )$ .
|
| 142 |
+
|
| 143 |
+
The second metric is the ${ \bf L } ^ { 2 }$ -distance between the mean posterior $\theta$ and the actual theta:
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
L ^ { 2 } ( \theta | \xi ) = E _ { \theta ^ { * } , \xi \sim \pi _ { \theta ^ { * } } } \left[ | | E [ \theta | \xi ] - \theta ^ { * } | | ^ { 2 } \right]
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
The closer the inferred posterior mean of $\theta$ is to the actual value $\theta ^ { * }$ , the lower the loss.
|
| 150 |
+
|
| 151 |
+
For each irrationality type, we calculate the performance of reward inference on trajectories of a fixed length $T$ , with respect to the two metrics above. To sample a trajectory of length $T$ from a expert, we fix $\theta ^ { * }$ and start state $s$ . Then, we perform the expert’s (possibly modified) Bellman updates until convergence to recover the policy $\pi _ { \theta ^ { \ast } }$ . Finally, we generate rollouts starting from state $s$ until $T$ state, action pairs have been sampled from $\pi _ { \theta ^ { \ast } }$ .
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: A best case analysis for each irrationality type: the log $\mathrm { { l o s s } } / L ^ { 2 }$ distance from mean (lowe $\fallingdotseq$ better) for experts, as a function of the length of trajectory observed. Each irrationality uses the parameter value that is most informative. As discussed in section 3.2, different irrationality types have different slopes and converge to different values. In addition, the best performing irrationality type according to log loss is not the best performing type according to $L ^ { 2 }$ loss.
|
| 155 |
+
|
| 156 |
+
# 3.2 ANALYSIS
|
| 157 |
+
|
| 158 |
+
Impact of Each Irrationality. We found that of the 8 irrationalities we studied, 6 had parameter settings that lead to lower log loss than the rational expert. We report how the parameter influences the log loss for each of these experts in figure 2.1 For $\bar { T ^ { \mathrm { ~ } } } = 3 0$ , Optimism with $1 \bar { / } \tau = 3 . 1 6$ performed the best, followed by Boltzmann with $\beta = 1 0 0$ and Hyperbolic with $k = 0 . 1$ . Both forms of Myopia also outperformed the rational expert, with best performance occurring at $\gamma = 0 . 9$ and $h = 5$ . Finally, the Extremal expert also slightly outperformed the rational expert, with best performance at $\alpha = 0 . 9$ . Notably, in every case, neither the most irrational expert nor the perfectly rational expert was the most informative.
|
| 159 |
+
|
| 160 |
+
Impact of Data for Different Irrationalities. Next, we investigate how the quality of inference varies as we increase the length of the observed trajectory $T$ . We report our results for the best performing parameter for each irrationality type in figure 3. Interestingly, while both metrics decrease monotonically regardless of irrationality type, the rate at which they decrease differs by the irrationality type, and the best performing irrationality type according to log loss (Optimism) is not the best performing type according to $L ^ { 2 }$ distance (Boltzmann).
|
| 161 |
+
|
| 162 |
+
What is behind these differences? To explain these results, we use the notion of mutual information $\mathbf { I } ( X ; Y )$ between two variables, defined as:
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\mathbf { I } ( X ; Y ) = E _ { X , Y } \left[ \log \left( { \frac { P ( X , Y ) } { P ( X ) P ( Y ) } } \right) \right] = H ( X ) - H ( X | Y )
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
The mutual information measures how much our uncertainty about $X$ decreases by observing $Y$
|
| 169 |
+
|
| 170 |
+
For reward inference, the term we care about is the mutual information between the expert’s trajectory and the reward parameters
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\mathbf { I } ( \theta ; \xi ) = E _ { \theta , \xi \sim \theta } \left[ \log \left( \frac { P ( \theta , \xi ) } { P ( \theta ) P ( \xi ) } \right) \right] = H ( \theta ) - H ( \theta | \xi )
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
The mutual information $\mathbf { I } ( \theta ; \xi )$ is equal to a constant minus the posterior log loss under the true model. A expert with mutual information will cause the learner to have a lower posterior log loss.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 4: (a) Optimism bias produces different actions for $\theta ^ { * } = ( 4 , 1 )$ vs. $\theta ^ { * } = ( 1 , 4 )$ in the states shown: the rational policy is to go away from the hole regardless of $\theta$ , but an optimistic expert takes the chance and goes for the larger reward – up in the first case, down in the second. (b) Pessimism bias produces different actions for $\theta ^ { * } = ( 1 , 1 )$ vs. $\theta ^ { * } = ( 4 , 4 )$ : when the reward is sufficiently large, the expert becomes convinced that no action it takes will lead to the reward, leading it to perform random actions.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 5: (a) Boltzmann-rationality produces different policies for $\theta ^ { * } = ( 1 , 1 )$ vs. $\theta ^ { * } = ( 4 , 4 )$ : when $| | \theta | |$ is larger, the policy becomes closer to that of the rational expert. (b) A Myopic expert produces different policies for $\theta ^ { * } = ( 4 , 1 )$ vs. $\theta ^ { * } = ( 4 , 0 )$ : while the rational expert always detours around the hole and attempts to reach the larger reward, myopia causes the myopic expert to go for the smaller source of reward when it is non-zero.
|
| 183 |
+
|
| 184 |
+
By the information processing inequality, we have the bound $\mathbf { I } ( \theta ; \xi ) \le \mathbf { I } ( \theta ; \pi )$ .
|
| 185 |
+
|
| 186 |
+
To have higher mutual information, different $\theta \mathrm { s }$ should be mapped to different policies $\pi \mathbf { S }$ . Indeed, we found that the experts that were able to outperform the rational expert were able to disambiguate between $\theta \mathrm { s }$ that the rational expert could not. To visualize this, we show examples of how the policy of several irrational experts differ when the rational expert’s policies are identical in figures 4 and 5.
|
| 187 |
+
|
| 188 |
+
We plot the correlation between $\mathbf { I } ( \theta ; \xi )$ and $\mathbf { I } ( \theta ; \pi )$ in figure 6. Experts that have more informative policies tend to have more informative trajectories, but the correlation is not perfect. Notably, the Optimism expert has the most informative trajectories of length 30, but has less informative policies than the Boltzmann expert.
|
| 189 |
+
|
| 190 |
+
In the limit of infinite data from every state, we would have $\mathbf { I } ( \theta ; \xi ) \to \mathbf { I } ( \theta ; \pi )$ . However, as each trajectory begins from the same start state, and not every state is reachable with every policy, the bound is not achievable in general, even if we observe an arbitrarily large number of trajectories. This highlights the need for off-policy data in reward inference tasks.
|
| 191 |
+
|
| 192 |
+
# 4 DISCUSSION
|
| 193 |
+
|
| 194 |
+
# 4.1 SUMMARY
|
| 195 |
+
|
| 196 |
+
We show that, contrary to what we might expect, suboptimal experts can actually help an agent learn the reward function. Optimism bias, myopia (via heavier discounting or hyperbolic discounting), and noise via Boltzmann rationality were the most informative irrationalities in our environments, far surpassing the performance of the rational expert for their ideal settings. Our contribution overall was to identify a systematic set of irrationalities by looking at deviations in the terms of the Bellman update, and show that being irrational is not automatically harmful to inference by quantifying and comparing the inference performance for these different types.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 6: The informativeness of policies correlates with the informativeness of trajectories of length 30, as discussed in section 3.2
|
| 200 |
+
|
| 201 |
+
# 4.2 LIMITATIONS AND FUTURE WORK.
|
| 202 |
+
|
| 203 |
+
Estimating expert irrationality. One major limitation of our work is that our findings hold for when the learner knows the type and parameter value of the irrationality. In practice, reward inference will require solving the difficult task of estimating the irrationality type and degree (Armstrong & Mindermann, 2018; Shah et al., 2019). We still need to quantify to what extent these results still hold given uncertainty about the irrationality model. It does, however, seem crucial to reward inference that learners do reason explicitly about irrationality – not only is the learner unable to take advantage of the irrationality to make better inference if it does not model it, but actually reward inference in general suffers tremendously if the learner assumes the wrong type.
|
| 204 |
+
|
| 205 |
+
In figure 10 in the Appendix, we compare inference with the true model vs. with assuming a Boltzmann model as default. The results are quite striking: not knowing the irrationality harms inference tremendously. Whether irrationalities help, this means that it is really important to model them.
|
| 206 |
+
|
| 207 |
+
Generalization to other environments. A second limitation of our work is that we only tested these models in a limited range of environments. Further work is needed to test generalization of our findings across different MDPs of interest. Our analysis of mutual information lends credence to the Boltzmann rationality result generalizing well: these policies are much more varied with the reward parameters. In contrast, how useful the optimism bias is depends on the task: if we know about what to avoid already, as was the case for our learner, the bias is useful; if, on the other hand, we would know the goal but do not know what to avoid, the bias can hinder inference. Overall, this paper merely points out that there is a lot of richness to the ways in which these biases affect inference, and provides a quantitative comparison for a starting domain – much more is needed to gain a deeper understanding of this phenomenon.
|
| 208 |
+
|
| 209 |
+
Applications to real humans. A third limitation is that we do not know where real humans lie. Do they have the helpful irrationality types? Do they fall in the range of parameters for these types that help inference? And what happens when types combine? While these questions are daunting, there is also a hidden opportunity here: what if we could influence humans to exhibit helpful types of irrationality? It might be much easier for them, for instance, to act myopically than to act rationally. In the end, reward inference is the confluence of two factors: how well the robot learns, and how well the teacher teaches. Our results point out that it might be easier than previously thought to be a good teacher – even easier than being a rational expert.
|
| 210 |
+
|
| 211 |
+
# REFERENCES
|
| 212 |
+
|
| 213 |
+
Pieter Abbeel and Andrew $\textbf { Y } \mathrm { N g }$ . Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 1. ACM, 2004. URL: http://people.eecs.berkeley.edu/˜russell/classes/cs294/ s11/readings/Abbeel+Ng:2004.pdf.
|
| 214 |
+
|
| 215 |
+
William H Alexander and Joshua W Brown. Hyperbolically discounted temporal difference learning. Neural computation, 22(6):1511–1527, 2010.
|
| 216 |
+
|
| 217 |
+
Stuart Armstrong and Soren Mindermann.¨ Occam’s razor is insufficient to infer the preferences of irrational agents. In Advances in Neural Information Processing Systems, pp. 5598–5609, 2018. URL: https://papers.nips.cc/paper/ 7803-occams-razor-is-insufficient-to-infer-the-preferences-of-irrational-agents. pdf.
|
| 218 |
+
|
| 219 |
+
Kavosh Asadi and Michael L Littman. An alternative softmax operator for reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 243– 252. JMLR. org, 2017.
|
| 220 |
+
|
| 221 |
+
Andrea Bajcsy, Dylan P Losey, Marcia K OMalley, and Anca D Dragan. Learning robot objectives from physical human interaction. Conference on Robot Learning (CoRL), 2017.
|
| 222 |
+
|
| 223 |
+
Susan E. F. Chipman. The Oxford Handbook of Cognitive Science. Oxford University Press, 11 2014. ISBN 9780199842193.
|
| 224 |
+
|
| 225 |
+
Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. In Advances in Neural Information Processing Systems, pp. 4299–4307, 2017. URL: https://papers.nips.cc/paper/ 7017-deep-reinforcement-learning-from-human-preferences.pdf.
|
| 226 |
+
|
| 227 |
+
Amy M Do, Alexander V Rupert, and George Wolford. Evaluations of pleasurable experiences: The peak-end rule. Psychonomic Bulletin & Review, 15(1):96–98, 2008.
|
| 228 |
+
|
| 229 |
+
Owain Evans and Noah D Goodman. Learning the preferences of bounded agents. In NIPS Workshop on Bounded Optimality, volume 6, 2015. URL: https://pdfs.semanticscholar. org/d55b/3f05ad612ecd0ae160850e9f07b1926e51bc.pdf.
|
| 230 |
+
|
| 231 |
+
Owain Evans, Andreas Stuhlmuller, and Noah Goodman.¨ Learning the preferences of ignorant, inconsistent agents. In Thirtieth AAAI Conference on Artificial Intelligence, 2016. URL: https://pdfs.semanticscholar.org/31bf/ e42e77a572bd83c0529e0f03bc3dc8af52c2.pdf.
|
| 232 |
+
|
| 233 |
+
Chelsea Finn, Sergey Levine, and Pieter Abbeel. Guided cost learning: Deep inverse optimal control via policy optimization. In International Conference on Machine Learning, pp. 49–58, 2016. URL: http://proceedings.mlr.press/v48/finn16.pdf.
|
| 234 |
+
|
| 235 |
+
Jaime F Fisac, Monica A Gates, Jessica B Hamrick, Chang Liu, Dylan Hadfield-Menell, Malayandi Palaniappan, Dhruv Malik, S Shankar Sastry, Thomas L Griffiths, and Anca D Dragan. Pragmaticpedagogic value alignment. arXiv preprint arXiv:1707.06354, 2017. URL: https://arxiv. org/pdf/1707.06354.pdf.
|
| 236 |
+
|
| 237 |
+
Justin Fu, Anoop Korattikara, Sergey Levine, and Sergio Guadarrama. From language to goals: Inverse reinforcement learning for vision-based instruction following. arXiv preprint arXiv:1902.07742, 2019.
|
| 238 |
+
|
| 239 |
+
Shane Griffith, Kaushik Subramanian, Jonathan Scholz, Charles L Isbell, and Andrea L Thomaz. Policy shaping: Integrating human feedback with reinforcement learning. In Advances in neural information processing systems, pp. 2625–2633, 2013.
|
| 240 |
+
|
| 241 |
+
Dylan Hadfield-Menell, Smitha Milli, Pieter Abbeel, Stuart J Russell, and Anca Dragan. Inverse reward design. In Advances in neural information processing systems, pp. 6765–6774, 2017.
|
| 242 |
+
|
| 243 |
+
Ashesh Jain, Shikhar Sharma, Thorsten Joachims, and Ashutosh Saxena. Learning preferences for manipulation tasks from online coactive feedback. The International Journal of Robotics Research, 34(10):1296–1313, 2015.
|
| 244 |
+
|
| 245 |
+
Antony Jameson and Eliezer Kreindler. Inverse problem of linear optimal control. SIAM Journal on Control, 11(1):1–19, 1973. URL: https://epubs.siam.org/doi/pdf/10.1137/ 0311001.
|
| 246 |
+
|
| 247 |
+
Daniel Kahneman and Amos Tversky. Prospect theory: An analysis of decision under risk. In Handbook of the fundamentals of financial decision making: Part I, pp. 99–127. World Scientific, 2013.
|
| 248 |
+
|
| 249 |
+
Rudolf Emil Kalman. When is a linear control system optimal? Journal of Basic Engineering, 86(1):51–60, 1964. URL: https://asmedigitalcollection.asme.org/ fluidsengineering/article-abstract/86/1/51/392203.
|
| 250 |
+
|
| 251 |
+
Joel Lehman, Jeff Clune, Dusan Misevic, Christoph Adami, Lee Altenberg, Julie Beaulieu, Peter J Bentley, Samuel Bernard, Guillaume Beslon, David M Bryson, et al. The surprising creativity of digital evolution: A collection of anecdotes from the evolutionary computation and artificial life research communities. arXiv preprint arXiv:1803.03453, 2018.
|
| 252 |
+
|
| 253 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. URL: https://arxiv.org/pdf/1509.02971.pdf.
|
| 254 |
+
|
| 255 |
+
Robert Tyler Loftin, James MacGlashan, Bei Peng, Matthew E Taylor, Michael L Littman, Jeff Huang, and David L Roberts. A strategy-aware technique for learning behaviors from discrete human feedback. In AAAI Conference on Artificial Intelligence, 2014.
|
| 256 |
+
|
| 257 |
+
Christopher G Lucas, Thomas L Griffiths, Fei Xu, and Christine Fawcett. A rational model of preference learning and choice prediction by children. In Advances in neural information processing systems, pp. 985–992, 2009. URL: http://papers.nips.cc/paper/ 3579-a-rational-model-of-preference-learning-and-choice-prediction-by-children. pdf.
|
| 258 |
+
|
| 259 |
+
R Duncan Luce. Individual choice behavior. 1959.
|
| 260 |
+
|
| 261 |
+
James MacGlashan, Monica Babes-Vroman, Marie desJardins, Michael L Littman, Smaranda Muresan, Shawn Squire, Stefanie Tellex, Dilip Arumugam, and Lei Yang. Grounding english commands to reward functions. In Robotics: Science and Systems, 2015.
|
| 262 |
+
|
| 263 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015. URL: https: //daiwk.github.io/assets/dqn.pdf.
|
| 264 |
+
|
| 265 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International conference on machine learning, pp. 1928–1937, 2016. URL: http: //proceedings.mlr.press/v48/mniha16.pdf.
|
| 266 |
+
|
| 267 |
+
Katja Mombaur, Anh Truong, and Jean-Paul Laumond. From human to humanoid locomotionan inverse optimal control approach. Autonomous robots, 28(3):369–383, 2010. URL: https: //link.springer.com/content/pdf/10.1007/s10514-009-9170-7.pdf.
|
| 268 |
+
|
| 269 |
+
Andrew Y Ng, Stuart J Russell, et al. Algorithms for inverse reinforcement learning. In Icml, volume 1, pp. 2, 2000. URL: http://ai.stanford.edu/˜ang/papers/icml00-irl. pdf.
|
| 270 |
+
|
| 271 |
+
Deepak Ramachandran and Eyal Amir. Bayesian inverse reinforcement learning. In IJCAI, volume 7, pp. 2586–2591, 2007.
|
| 272 |
+
|
| 273 |
+
Ellis Ratner, Dylan Hadfield-Menell, and Anca D Dragan. Simplifying reward design through divide-and-conquer. arXiv preprint arXiv:1806.02501, 2018.
|
| 274 |
+
|
| 275 |
+
Sid Reddy, Anca Dragan, and Sergey Levine. Where do you think you’re going?: Inferring beliefs about dynamics from behavior. In Advances in Neural Information Processing Systems, pp. 1454– 1465, 2018.
|
| 276 |
+
|
| 277 |
+
Dorsa Sadigh, Anca D. Dragan, Shankar Sastry, and Sanjit A Seshia. Active preference-based learning of reward functions. In Robotics: Science and Systems (RSS), 2017.
|
| 278 |
+
|
| 279 |
+
Rohin Shah, Noah Gundotra, Pieter Abbeel, and Anca D Dragan. On the feasibility of learning, rather than assuming, human biases for reward inference. arXiv preprint arXiv:1906.09624, 2019. URL: https://arxiv.org/pdf/1906.09624.pdf.
|
| 280 |
+
|
| 281 |
+
Roger N Shepard. Stimulus and response generalization: A stochastic model relating generalization to distance in psychological space. Psychometrika, 22(4):325–345, 1957. URL: https:// link.springer.com/content/pdf/10.1007/BF02288967.pdf.
|
| 282 |
+
|
| 283 |
+
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. nature, 529(7587):484, 2016. URL: http://web.iitd.ac.in/˜sumeet/Silver16.pdf.
|
| 284 |
+
|
| 285 |
+
Sumeet Singh, Jonathan Lacotte, Anirudha Majumdar, and Marco Pavone. Risk-sensitive inverse reinforcement learning via semi-and non-parametric methods. arXiv preprint arXiv:1711.10055, 2017.
|
| 286 |
+
|
| 287 |
+
Christian Wirth, Riad Akrour, Gerhard Neumann, and Johannes Furnkranz. A survey of preference- ¨ based reinforcement learning methods. The Journal of Machine Learning Research, 18(1):4945– 4990, 2017.
|
| 288 |
+
|
| 289 |
+
Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In Aaai, volume 8, pp. 1433–1438. Chicago, IL, USA, 2008.
|
| 290 |
+
|
| 291 |
+
Brian D Ziebart, J Andrew Bagnell, and Anind K Dey. Modeling interaction via the principle of maximum causal entropy. 2010.
|
| 292 |
+
|
| 293 |
+
<table><tr><td rowspan=1 colspan=1>Policy</td><td rowspan=1 colspan=1>Parameter</td><td rowspan=1 colspan=3>Values</td></tr><tr><td rowspan=1 colspan=1>Rational</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=3>[0.99]</td></tr><tr><td rowspan=1 colspan=1>Boltzmann</td><td rowspan=1 colspan=1>β</td><td rowspan=1 colspan=3>[1,1.78,3.16, 5.62,10,17.8,31.6,56.2,100,178,316, 562,1000,1780,3160,5620,10000]</td></tr><tr><td rowspan=1 colspan=1>Optimism</td><td rowspan=1 colspan=1>1/T</td><td rowspan=1 colspan=3>[-10,-3.16,-1,-0.316,-0.1,0.1, 0.316,1,3.16, 10]</td></tr><tr><td rowspan=1 colspan=1>Illusion of Control</td><td rowspan=1 colspan=1>n</td><td rowspan=1 colspan=3>[0.1,0.178,0.316, 0.562,1, 1.78,3.16,5.62,10]</td></tr><tr><td rowspan=1 colspan=1>Prospect Theory</td><td rowspan=1 colspan=1>C</td><td rowspan=1 colspan=3>[0.1,0.178,0.316,0.562,1., 1.78, 3.16, 5.62, 10]</td></tr><tr><td rowspan=1 colspan=1>Extremal</td><td rowspan=1 colspan=1>a</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>[0.5,0.7,0.8,0.9,0.99,0.999]</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Myopicγ</td><td rowspan=1 colspan=1>Y</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>[0.5, 0.7, 0.8, 0.9, 0.99,0.999]</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Myopic h</td><td rowspan=1 colspan=1>h</td><td rowspan=1 colspan=3>[1,2,3,4,5,6]</td></tr><tr><td rowspan=1 colspan=1>Hyperbolic</td><td rowspan=1 colspan=1>k</td><td rowspan=1 colspan=3>[0.01,0.1,0.178,0.316,0.562, 1, 1.78,3.16, 5.62, 10]</td></tr></table>
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Table 1: The parameter values we search over for each policy.
|
| 297 |
+
Figure 7: Log loss for the posterior on $\theta$ , given trajectories from the Prospect Theory expert and the Illusion of Control expert.
|
| 298 |
+
|
| 299 |
+
# A MORE EXPERIMENTAL DETAILS
|
| 300 |
+
|
| 301 |
+
To enable exact inference, we discretized $\theta$ , using 5 evenly spaced points for each $\theta _ { i }$ . Our specific grid is included in figures 4 and 5 As there are two reward cells, this gives us 25 possible distinct reward parameters. We assumed a uniform prior on the reward parameter.
|
| 302 |
+
|
| 303 |
+
We list the parameter values we search over for each policy in table 1. Except for myopic $\gamma$ and myopic $h$ , we use $\gamma = 0 . 9 9$ . For myopic $h$ , we use $\gamma = 1$ .
|
| 304 |
+
|
| 305 |
+
From each start state, we sample 10 trajectories of each length for each reward parameter, policy combination.
|
| 306 |
+
|
| 307 |
+
# B ADDITIONAL RESULTS
|
| 308 |
+
|
| 309 |
+
We include the plots for the log loss of trajectories from the Prospect Theory and Illusion of Control experts in 7
|
| 310 |
+
|
| 311 |
+
In addition, we include the plots for the $L ^ { 2 }$ loss for all 8 irrationalities in figures 8 and figure 9.
|
| 312 |
+
|
| 313 |
+
# C MODEL MISSPECIFICATION GREATLY IMPAIRS INFERENCE
|
| 314 |
+
|
| 315 |
+
Given that several types of irrationality can help inference when the form of irrationality is known, a natural question to ask is how important is it to known the irrationality exactly. To investigate this, we plot the log loss of the posterior of a learner who falsely assumes that the expert is Boltzmann
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 8: The $L ^ { 2 }$ distance (lower $=$ better) of posterior mean of $\theta$ to the true $\theta ^ { * }$ ,s as a function of the parameter we vary for each irrationality type. These six irrationalities all have parameter settings that outperform rational experts. For the models that interpolate to rational expert, we denote the value that is closest to rational using a dashed vertical line.
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 9: The $L ^ { 2 }$ distance (lower=better) of the posterior mean $\theta$ to th true $\theta ^ { * }$ , given trajectories from the Prospect Theory expert and the Illusion of Control expert.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Inference performance under model misspecification
|
| 325 |
+
Figure 10: A comparison of reward inference using a correct model of the irrationality type, versus always using a Boltzman model. (Lower log loss $=$ better.) The inference impairment from using the misspecified irrationality model (Boltzmann) greatly outweighs the variation in inference performance caused by the various irrationality types themselves. Hence, compared to using a misspecified model of irrationality, expert irrationality is not in itself a major impairment to reward inference, and sometimes expert irrationality can even helps when a model of the irrationality is known.
|
| 326 |
+
|
| 327 |
+
rational with $\beta = 1 0 0$ . Where applicable, the log loss is averaged over possible hyperparameter settings for the expert.
|
| 328 |
+
|
| 329 |
+
We report the results in figure 10. The log loss of the posterior if we wrongly imagine the expert is Boltzmann-rational far outweighs differences between particular irrationality types.
|
| 330 |
+
|
| 331 |
+
# C.1 WHY IS USING A MISSPECIFIED IRRATIONALITY TYPE FOR INFERENCE SO BAD?
|
| 332 |
+
|
| 333 |
+
Fundamentally, misspecification is bad for inference because different experts might exhibit the same action only under different reward parameters. For example, consider figure the case where the actual expert is myopic, with small $n$ . Then the myopic agent might go toward a closer reward even if it is much smaller, as shown in figure 11. This would cause the learner to falsely infer that the closer reward is quite large, leading to a posterior with extremely high log loss when the reward is actually smaller.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 11: An example of why assuming Boltzmann is bad for a myopic agent - the Boltzmann rational agent would take this trajectory only if the reward at the bottom was not much less than the reward at the top. The myopic agent with $n \leq 4$ , however, only ”sees” the reward at the bottom. Consequently, inferring the preferences of the myopic agent as if it were Boltzmann leads to poor performance in this case.
|
md/train/Byl1W1rtvH/Byl1W1rtvH.md
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RECURRENT HIERARCHICAL TOPIC-GUIDEDNEURAL LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
To simultaneously capture syntax and global semantics from a text corpus, we propose a new larger-context recurrent neural network (RNN) based language model, which extracts recurrent hierarchical semantic structure via a dynamic deep topic model to guide natural language generation. Moving beyond a conventional RNN based language model that ignores long-range word dependencies and sentence order, the proposed model captures not only intra-sentence word dependencies, but also temporal transitions between sentences and inter-sentence topic dependences. For inference, we develop a hybrid of stochastic-gradient MCMC and recurrent autoencoding variational Bayes. Experimental results on a variety of real-world text corpora demonstrate that the proposed model not only outperforms state-ofthe-art larger-context RNN-based language models, but also learns interpretable recurrent multilayer topics and generates diverse sentences and paragraphs that are syntactically correct and semantically coherent.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Both topic and language models are widely used for text analysis. Topic models, such as latent Dirichlet allocation (LDA) (Blei et al., 2003; Griffiths & Steyvers, 2004; Hoffman et al., 2013) and its nonparametric Bayesian generalizations (Teh et al., 2006; Zhou & Carin, 2015), are well suited to extract document-level word concurrence patterns into latent topics from a text corpus. Their modeling power has been further enhanced by introducing multilayer deep representation (Srivastava et al., 2013; Mnih & Gregor, 2014; Gan et al., 2015; Zhou et al., 2016; Zhao et al., 2018; Zhang et al., 2018). While having semantically meaningful latent representation, they typically treat each document as a bag of words (BoW), ignoring word order (Griffiths et al., 2004; Wallach, 2006). Language models have become key components of various natural language processing (NLP) tasks, such as text summarization (Rush et al., 2015; Gehrmann et al., 2018), speech recognition (Mikolov et al., 2010; Graves et al., 2013), machine translation (Sutskever et al., 2014; Cho et al., 2014), and image captioning (Vinyals et al., 2015; Mao et al., 2015; Xu et al., 2015; Gan et al., 2017; Rennie et al., 2017). The primary purpose of a language model is to capture the distribution of a word sequence, commonly with a recurrent neural network (RNN) (Mikolov et al., 2011; Graves, 2013) or a Transformer based neural network (Vaswani et al., 2017; Dai et al., 2019; Devlin et al., 2019; Radford et al., 2018; 2019). In this paper, we focus on improving RNN-based language models that often have much fewer parameters and are easier to perform end-to-end training.
|
| 12 |
+
|
| 13 |
+
While RNN-based language models do not ignore word order, they often assume that the sentences of a document are independent to each other. This simplifies the modeling task to independently assigning probabilities to individual sentences, ignoring their orders and document context (Tian & Cho, 2016). Such language models may consequently fail to capture the long-range dependencies and global semantic meaning of a document (Dieng et al., 2017; Wang et al., 2018). To relax the sentence independence assumption in language modeling, Tian & Cho (2016) propose larger-context language models that model the context of a sentence by representing its preceding sentences as either a single or a sequence of BoW vectors, which are then fed directly into the sentence modeling RNN. An alternative approach attracting significant recent interest is leveraging topic models to improve RNN-based language models. Mikolov & Zweig (2012) use pre-trained topic model features as an additional input to the RNN hidden states and/or output. Dieng et al. (2017); Ahn et al. (2017) combine the predicted word distributions, given by both a topic model and a language model, under variational autoencoder (Kingma & Welling, 2013). Lau et al. (2017) introduce an attention based convolutional neural network to extract semantic topics, which are used to extend the RNN cell. Wang et al. (2018) learn the global semantic coherence of a document via a neural topic model and use the learned latent topics to build a mixture-of-experts language model. Wang et al. (2019) further specify a Gaussian mixture model as the prior of the latent code in variational autoencoder, where each mixture component corresponds to a topic.
|
| 14 |
+
|
| 15 |
+
While clearly improving the performance of the end task, these existing topic-guided methods still have clear limitations. For example, they only utilize shallow topic models with only a single stochastic hidden layer in their data generation process. Note several neural topic models use deep neural networks to construct their variational encoders, but still use shallow generative models (decoders) (Miao et al., 2017; Srivastava & Sutton, 2017). Another key limitation lies in ignoring the sentence order, as they treat each document as a bag of sentences. Thus once the topic weight vector learned from the document context is given, the task is often reduced to independently assigning probabilities to individual sentences (Lau et al., 2017; Wang et al., 2018; 2019).
|
| 16 |
+
|
| 17 |
+
In this paper, as depicted in Fig. 1, we propose to use recurrent gamma belief network (rGBN) to guide a stacked RNN for language modeling. We refer to the model as rGBN-RNN, which integrates rGBN (Guo et al., 2018), a deep recurrent topic model, and stacked RNN (Graves, 2013; Chung et al., 2017), a neural language model, into a novel larger-context RNN-based language model. It simultaneously learns a deep recurrent topic model, extracting document-level multi-layer word concurrence patterns and sequential topic weight vectors for sentences, and an expressive language model, capturing both short- and long-range word sequential dependencies. For inference, we equip rGBN-RNN (decoder) with a novel variational recurrent inference network (encoder), and train it end-to-end by maximizing the evidence lower bound (ELBO). Different from the stacked RNN based language model in Chung et al. (2017), which relies on three types of customized training operations (UPDATE, COPY, FLUSH) to extract multi-scale structures, the language model in rGBN-RNN learns such structures purely under the guidance of the temporally and hierarchically connected stochastic layers of rGBN. The effectiveness of rGBN-RNN as a new larger-context language model is demonstrated both quantitatively, with perplexity and BLEU scores, and qualitatively, with interpretable latent structures and randomly generated sentences and paragraphs. Notably, rGBN-RNN can generate a paragraph consisting of a sequence of semantically coherent sentences.
|
| 18 |
+
|
| 19 |
+
# 2 RECURRENT HIERARCHICAL TOPIC-GUIDED LANGUAGE MODEL
|
| 20 |
+
|
| 21 |
+
Denote a document of $J$ sentences as $\mathcal { D } = ( S _ { 1 } , S _ { 2 } , \ldots , S _ { J } )$ , where $S _ { j } = ( y _ { j , 1 } , \ldots , y _ { j , T _ { j } } )$ consists of $T _ { j }$ words from a vocabulary of size $V$ . Conventional statistical language models often only focus on the word sequence within a sentence. Assuming that the sentences of a document are independent to each other, they often define $\begin{array} { r } { P ( \mathcal { D } ) \approx \prod _ { j = 1 } ^ { J } \bar { P } \left( S _ { j } \right) = \prod _ { j = 1 } ^ { J } \prod _ { t = 2 } ^ { T _ { j } } p \left( y _ { j , t } \vert y _ { j , < t } \right) p \left( y _ { j , 1 } \right) } \end{array}$ . RNN based neural language models define the conditional probability of each word $y _ { j , t }$ given all the previous words $y _ { j , < t }$ within the sentence $S _ { j }$ , through the softmax function of a hidden state $h _ { j , t }$ , as
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
p \left( y _ { j , t } \mid y _ { j , < t } \right) = p \left( y _ { j , t } \mid h _ { j , t } \right) , \quad h _ { j , t } = f \left( h _ { j , < t } , y _ { j , t - 1 } \right) ,
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
where $f ( \cdot )$ is a non-linear function typically defined as an RNN cell, such as long short-term memory (LSTM) (Hochreiter & Schmidhuber, 1997) and gated recurrent unit (GRU) (Cho et al., 2014).
|
| 28 |
+
|
| 29 |
+
These RNN-based statistical language models are typically applied only at the word level, without exploiting the document context, and hence often fail to capture long-range dependencies. While Dieng et al. (2017); Lau et al. (2017); Wang et al. (2018; 2019) remedy the issue by guiding the language model with a topic model, they still treat a document as a bag of sentences, ignoring the order of sentences, and lack the ability to extract hierarchical and recurrent topic structures.
|
| 30 |
+
|
| 31 |
+
We introduce rGBN-RNN, as depicted in Fig. 1(a), as a new larger-context language model. It consists of two key components: (i) a hierarchical recurrent topic model (rGBN), and (ii) a stacked RNN based language model. We use rGBN to capture both global semantics across documents and long-range inter-sentence dependencies within a document, and use the language model to learn the local syntactic relationships between the words within a sentence. Similar to Lau et al. (2017); Wang et al. (2018), we represent a document as a sequence of sentence-context pairs as $( \{ S _ { 1 } , d _ { 1 } \} , \dots , \{ S _ { J } , d _ { J } \} )$ , where $\bar { d } _ { j } \in \mathbb { Z } _ { + } ^ { V _ { c } }$ summarizes the document excluding $S _ { j }$ , specifically $( S _ { 1 } , . . . , S _ { j - 1 } , S _ { j + 1 } , . . . , S _ { J } )$ , into a BoW count vector, with $V _ { c }$ as the size of the vocabulary excluding stop words. Note a naive way is to treat each sentence as a document, use a dynamic topic model (Blei & Lafferty, 2006) to capture the temporal dependencies of the latent topic-weight vectors, which is fed to the RNN to model the word sequence of the corresponding sentence. However, the sentences are often too short to be well modeled by a topic model. In our setting, as $d _ { j }$ summarizes the document-level context of $S _ { j }$ , it is in general sufficiently long for topic modeling. Note during testing, we redefine $d _ { j }$ as the BoW vector summarizing only the preceding sentences, i.e., $S _ { 1 : j - 1 }$ , which will be further clarified when presenting experimental results.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: (a) The generative model of a three-hidden-layer rGBN-RNN, where the bottom part is the deep recurrent topic model (rGBN), document contexts of consecutive sentences are used as observed data, and upper is the language model. (b) Overview of the language model component, where input $x _ { j , t }$ denotes the tth word in $j$ th sentence of a document, $x _ { j , t } = y _ { j , t - 1 } , h _ { j , t } ^ { l }$ is the hidden state of the stacked RNN at time step $t$ , and $\theta _ { j } ^ { l }$ is the topic weight vector of sentence $j$ at layer $l$ . (c) The overall architecture of the proposed model, including the decoder (rGBN and language model) and encoder (variational recurrent inference), where the red arrows denote the inference of latent topic weight vectors, black ones the data generation.
|
| 35 |
+
|
| 36 |
+
# 2.1 HIERARCHICAL RECURRENT TOPIC MODEL
|
| 37 |
+
|
| 38 |
+
Shown in Fig. 1 (a), to model the time-varying sentence-context count vectors $d _ { j }$ in document $\mathcal { D }$ , the generative process of the rGBN component, from the top to bottom hidden layers, is expressed as
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\begin{array} { r l } & { \pmb { \theta } _ { j } ^ { L } \sim \mathrm { G a m } \left( \mathbf { \Pi } \mathbf { \ } \mathbf { \Pi } ^ { L } \pmb { \theta } _ { j - 1 } ^ { L } , \mathbf { \Delta } \tau _ { 0 } \right) , \cdots , \pmb { \theta } _ { j } ^ { l } \sim \mathrm { G a m } \left( \Phi ^ { l + 1 } \pmb { \theta } _ { j } ^ { l + 1 } + \mathbf { \Pi } \mathbf { \Pi } ^ { l } \pmb { \theta } _ { j - 1 } ^ { l } , \mathbf { \Delta } \tau _ { 0 } \right) , \cdots , } \\ & { \pmb { \theta } _ { j } ^ { 1 } \sim \mathrm { G a m } \left( \Phi ^ { 2 } \pmb { \theta } _ { j } ^ { 2 } + \mathbf { \Pi } \mathbf { \ } ^ { 1 } \pmb { \theta } _ { j - 1 } ^ { 1 } , \mathbf { \Delta } \tau _ { 0 } \right) , \pmb { d } _ { j } \sim \mathrm { P o i s } \left( \Phi ^ { 1 } \pmb { \theta } _ { j } ^ { 1 } \right) , } \end{array}
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\pmb { \theta } _ { j } ^ { l } \in \mathbb { R } _ { + } ^ { K _ { l } }$ denotes the gamma distributed topic weight vectors of sentence $j$ at layer $l$ $\mathbf { I I } ^ { l } \in \mathbb { R } _ { + } ^ { \bar { K } _ { l } \times K _ { l } }$ the transition matrix of layer $l$ that captures cross-topic temporal dependencies, $\Phi ^ { l } \in$ RKl−1×Kl+ the loading matrix at layer l, Kl the number of topics of layer l, and τ0 ∈ R+ a scaling hyperparameter. At $j = 1$ , $\pmb { \theta } _ { 1 } ^ { l } \sim \mathrm { G a m } \left( \pmb { \Phi } ^ { l + 1 } \pmb { \theta } _ { 1 } ^ { l + 1 } , \tau _ { 0 } \right)$ for $l = 1 , \ldots , L - 1$ and $\pmb { \theta } _ { 1 } ^ { L } \sim \mathbf { G a m } ( \nu , \tau _ { 0 } )$ , where $\nu = \mathbf { 1 } _ { K _ { L } }$ . Finally, Dirichlet priors are placed on the columns of $\Pi ^ { l }$ and $\Phi ^ { l }$ , i.e., $\pi _ { k } ^ { l }$ and $\phi _ { k } ^ { l }$ , which not only makes the latent representation more identifiable and interpretable, but also facilitates inference. The count vector $d _ { j }$ can be factorized into the product of $\Phi ^ { \hat { 1 } }$ and $\theta _ { j } ^ { 1 }$ under the Poisson likelihood. The shape parameters of $\pmb { \theta } _ { j } ^ { l } \in \mathbb { R } _ { + } ^ { K _ { l } }$ can be factorized into the sum of $\Phi ^ { l + 1 } \pmb { \theta } _ { j } ^ { l + 1 }$ , capturing inter-layer hierarchical dependence, and $\Pi ^ { l } \theta _ { j - 1 } ^ { l }$ , capturing intra-layer temporal dependence. rGBN not only captures the document-level word occurrence patterns inside the training text corpus, but also the sequential dependencies of the sentences inside a document. Note ignoring the recurrent structure, rGBN will reduce to the gamma belief network (GBN) of Zhou et al. (2016), which can be considered as a multi-stochastic-layer deep generalization of LDA (Cong et al., 2017a). If ignoring its hierarchical structure (i.e., $L = 1$ ), rGBN reduces to Poisson–gamma dynamical systems (Schein et al., 2016). We refer to the rGBN-RNN without its recurrent structure as GBN-RNN, which no longer models sequential sentence dependencies; see Appendix A for more details.
|
| 45 |
+
|
| 46 |
+
# 2.2 LANGUAGE MODEL
|
| 47 |
+
|
| 48 |
+
Different from a conventional RNN-based language model, which predicts the next word only using the preceding words within the sentence, we integrate the hierarchical recurrent topic weight vectors $\theta _ { j } ^ { l }$ into the language model to predict the word sequence in the $j$ th sentence. Our proposed language model is built upon the stacked RNN proposed in Graves (2013); Chung et al. (2017), but with the help of rGBN, it no longer requires specialized training heuristics to extract multi-scale structures. As shown in Fig. 1 (b), to generate $y _ { j , t }$ , the $t ^ { \mathrm { { t h } } }$ token of sentence $j$ in a document, we construct the hidden states $h _ { j , t } ^ { l }$ of the language model, from the bottom to top layers, as
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\begin{array} { r } { h _ { j , t } ^ { l } = \left\{ \begin{array} { l l } { \mathrm { L S T M } _ { \mathrm { w o r d } } ^ { l } \left( h _ { j , t - 1 } ^ { l } , W _ { e } \left[ x _ { j , t } \right] \right) , } & { \mathrm { i f } l = 1 , } \\ { \mathrm { L S T M } _ { \mathrm { w o r d } } ^ { l } \left( h _ { j , t - 1 } ^ { l } , a _ { j , t } ^ { l - 1 } \right) , } & { \mathrm { i f } L \geq l > 1 , } \end{array} \right. } \end{array}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\mathrm { L S T M } _ { \mathrm { w o r d } } ^ { l }$ denotes the word-level LSTM at layer $l$ , ${ \bf W } _ { e } \in \mathbb { R } ^ { V }$ are word embeddings to be learned, and $x _ { j , t } = y _ { j , t - 1 }$ . Note $\pmb { a } _ { j , t } ^ { l }$ denotes the coupling vector, which combines the temporal topic weight vectors $\theta _ { j } ^ { l }$ and hidden output of the word-level LSTM $h _ { j , t - 1 } ^ { l }$ at each time step $t$ .
|
| 55 |
+
|
| 56 |
+
Following Lau et al. (2017), a gating unit similar to GRU (Cho et al., 2014) combines $\theta _ { j } ^ { l }$ of sentence $j$ with its hidden state $h _ { j , t } ^ { l }$ of word-level LSTM at layer $l$ and time $t$ as $\mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf $ . We defer the details on $g ^ { l }$ to Appendix B. Denote $\mathbf { W } _ { o }$ as a weight matrix with $V$ rows and $\pmb { a } _ { j , t } ^ { 1 : L }$ as the concatenation of $\boldsymbol { a } _ { j , t } ^ { l }$ across all layers; different from (1), the conditional probability of $y _ { j , t }$ becomes
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
p \left( y _ { j , t } \mid y _ { j , < t } , \pmb { \theta } _ { j } ^ { l } \right) = \mathrm { s o f t m a x } \left( \mathbf { W } _ { o } \pmb { a } _ { j , t } ^ { 1 : L } \right) .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
There are two main reasons for combining all the latent representations $\cdot$ for language modeling. First, the latent representations exhibit different statistical properties at different stochastic layers of rGBN-RNN, and hence are combined together to enhance their representation power. Second, having “skip connections” from all hidden layers to the output one makes it easier to train the proposed network, reducing the number of processing steps between the bottom of the network and the top and hence mitigating the “vanishing gradient” problem (Graves, 2013).
|
| 63 |
+
|
| 64 |
+
To sum up, as depicted in Fig. 1 (a), the topic weight vector $\theta _ { j } ^ { l }$ of sentence $j$ quantifies the topic usage of its document context $d _ { j }$ at layer $l$ . It is further used as an additional feature of the language model to guide the word generation inside sentence $j$ , as shown in Fig. 1 (b). It is clear that rGBN-RNN has two temporal structures: a deep recurrent topic model to extract the temporal topic weight vectors from the sequential document contexts, and a language model to estimate the probability of each sentence given its corresponding hierarchical topic weight vector. Characterizing the word-sentencedocument hierarchy to incorporate both intra- and inter-sentence information, rGBN-RNN learns more coherent and interpretable topics and increases the generative power of the language model. Distinct from existing topic-guided language models, the temporally related hierarchical topics of rGBN exhibit different statistical properties across layers, which better guides language model to improve its language generation ability.
|
| 65 |
+
|
| 66 |
+
# 2.3 MODEL LIKELIHOOD AND INFERENCE
|
| 67 |
+
|
| 68 |
+
For rGBN-RNN, given $\{ \Phi ^ { l } , \pmb { \Pi } ^ { l } \} _ { l = 1 } ^ { L }$ , the marginal likelihood of the sequence of sentence-context pairs $( \{ s _ { 1 } , d _ { 1 } \} , \dots , \{ s _ { J } , d _ { J } \} )$ of document $\mathcal { D }$ is defined as
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r } { P \left( \mathcal { D } \mid \{ \Phi ^ { l } , \mathbf { T } ^ { l } \} _ { l = 1 } ^ { L } \right) = \int \prod _ { j = 1 } ^ { J } \left\{ p \left( d _ { j } \mid \Phi ^ { 1 } \theta _ { j } ^ { 1 } \right) \left[ \prod _ { t = 1 } ^ { T _ { j } } p \left( y _ { j t } \mid y _ { j , < t } , \theta _ { j } ^ { 1 ; L } \right) \right] \left[ \prod _ { l = 1 } ^ { L } p \left( \theta _ { j } ^ { l } \mid e _ { j } ^ { l } , \tau _ { 0 } \right) \right] \right\} d \theta _ { 1 : J } ^ { 1 : L } , } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\mathbf { \boldsymbol { e } } _ { j } ^ { l } : = \Phi ^ { l + 1 } \mathbf { \boldsymbol { \theta } } _ { j } ^ { l + 1 } + \Pi ^ { l } \mathbf { \boldsymbol { \theta } } _ { j - 1 } ^ { l }$ . The inference task is to learn the parameters of both the topic model and language model components. One naive solution is to alternate the training between these two components in each iteration: First, the topic model is trained using a sampling based iterative algorithm provided in Guo et al. (2018); Second, the language model is trained with maximum likelihood estimation under a standard cross-entropy loss. While this naive solution can utilize readily available inference algorithms for both rGBN and the language model, it may suffer from stability and convergence issues. Moreover, the need to perform a sampling based iterative algorithm for rGBN inside each iteration limits the scalability of the model for both training and testing.
|
| 75 |
+
|
| 76 |
+
Algorithm 1 Hybrid SG-MCMC and recurrent autoencoding variational inference for rGBN-RNN.
|
| 77 |
+
|
| 78 |
+
<table><tr><td>Set mini-batch size m and the number of layer L Initialize encoder and neural languagemodel parameter parameter Ω,and topic model parameter {Φl,l}=1·</td></tr><tr><td>foriter=1,2,. do</td></tr><tr><td>Randomly select a mini-batch of m documents consisting of J sentences to form a subset X =</td></tr><tr><td>{di,1:J,Si,1:J}m1; m,J,L</td></tr><tr><td>Draw random noise {e',j }i=1.j=1,l=1 from uniform distribution;</td></tr><tr><td>Calculate VΩL (S2, Φl,II'; X,e,j) according to (6),and update Ω; Sample 0’,j from (7) and (8) via Ω</td></tr><tr><td>to update {II′}=1 and {Φ′}𝑖=1, will be described in Appendix C; end for</td></tr></table>
|
| 79 |
+
|
| 80 |
+
To this end, we introduce a variational recurrent inference network (encoder) to learn the latent temporal topic weight vectors $\cdot$ . Denoting $\begin{array} { r } { Q = \prod _ { j = 1 } ^ { J } \prod _ { l = 1 } ^ { L } q ( \pmb { \theta } _ { j } ^ { l } | \pmb { d } _ { \leq j } ) } \end{array}$ , the ELBO of the log marginal likelihood shown in (5) can be constructed as
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r } { L = \sum _ { j = 1 } ^ { J } \mathbb { E } _ { Q } \left[ \ln p \left( d _ { j } | \Phi | ^ { \mathbf { i } } \pmb { \Phi } _ { j } ^ { 1 } \right) + \sum _ { t = 1 } ^ { T _ { j } } \ln p \left( y _ { j , t } | y _ { j , < t } , \pmb { \theta } _ { j } ^ { 1 ; L } \right) \right] - \sum _ { j = 1 } ^ { J } \sum _ { l = 1 } ^ { L } \mathbb { E } _ { Q } \left[ \ln \frac { q \left( \pmb { \theta } _ { j } ^ { l } | \pmb { d } _ { \pmb { \theta } _ { j } ^ { l } } \right) } { p \left( \pmb { \theta } _ { j } ^ { l } | \mathbf { e } _ { j } ^ { l } , \tau _ { 0 } \right) } \right] , } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
which unites both the terms that are primarily responsible for training the recurrent hierarchical topic model component, and terms for training the neural language model component. Similar to Zhang et al. (2018), we define $q ( \pmb { \theta } _ { j } ^ { l } \ \vert \ \pmb { d } _ { \leq j } ) = \bar { \mathrm { W e i b u l l } } ( \pmb { k } _ { j } ^ { l } , \pmb { \lambda } _ { j } ^ { l } )$ , a random sample from which can be obtained by transforming standard uniform variables $\epsilon _ { j } ^ { l }$ as
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\pmb { \theta } _ { j } ^ { l } = \lambda _ { j } ^ { l } \big ( - \ln ( 1 - \epsilon _ { j } ^ { l } ) \big ) ^ { 1 / { k _ { j } ^ { l } } } .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
To capture the temporal dependencies between the topic weight vectors, both $k _ { j } ^ { l }$ and $\lambda _ { j } ^ { l }$ , from the bottom to top layers, can be expressed as
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { \pmb { h } _ { j } ^ { s , l } = \mathrm { R N N } _ { \mathrm { s e n t } } ^ { l } \big ( \pmb { h } _ { j - 1 } ^ { s , l } , \pmb { h } _ { j } ^ { s , l - 1 } \big ) , \pmb { k } _ { j } ^ { l } = f _ { k } ^ { l } \big ( \pmb { h } _ { j } ^ { s , l } \big ) , \pmb { \lambda } _ { j } ^ { l } = f _ { \lambda } ^ { l } \big ( \pmb { h } _ { j } ^ { s , l } \big ) , } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $h _ { j } ^ { s , 0 } = d _ { j } , h _ { 0 } ^ { s , l } = 0 , $ denotes the sentence-level recurrent encoder at layer $\it l$ implemented with a basic RNN cell, capturing the sequential relationship between sentences within a document, $h _ { j } ^ { s , l }$ denotes the hidden state of $\mathrm { R N N } _ { \mathrm { s e n t } } ^ { l }$ , and superscript $s$ in $h _ { j } ^ { s , l }$ denotes “sentencelevel RNN” used to distinguish the hidden state of language model in (3) . Note both $f _ { k } ^ { l }$ and $f _ { \lambda } ^ { l }$ are nonlinear functions mapping state $h _ { j } ^ { s , l }$ to the parameters of $\theta _ { j } ^ { l }$ , implemented with $f ( { \pmb x } ) =$ $\ln ( 1 + \exp ( \mathbf { W } x + b ) )$ .
|
| 99 |
+
|
| 100 |
+
Rather than finding a point estimate of the global parameters $\{ \Phi ^ { l } , \Pi ^ { l } \} _ { l = 1 } ^ { L }$ of the rGBN, we adopt a hybrid inference algorithm by combining TLASGR-MCMC described in Cong et al. (2017a); Zhang et al. (2018) and our proposed recurrent variational inference network. In other words, the global parameters $\{ \bar { \boldsymbol { \Phi } } ^ { l } , \boldsymbol { \Pi } ^ { l } \} _ { l = 1 } ^ { \bar { L } }$ can be sampled with TLASGR-MCMC, while the parameters of the language model and variational recurrent inference network, denoted by $\pmb { \Omega }$ , can be updated via stochastic gradient descent (SGD) by maximizing the ELBO in (6). We describe a hybrid variational/sampling inference for rGBN-RNN in Algorithm 1 and provide more details about sampling $\{ \Phi ^ { l } , \pmb { \Pi } ^ { l } \} _ { l = 1 } ^ { L }$ with TLASGR-MCMC in Appendix C. We defer the details on model complexity to Appendix E.
|
| 101 |
+
|
| 102 |
+
To sum up, as shown in Fig. 1(c), the proposed rGBN-RNN works with a recurrent variational autoencoder inference framework, which takes the document context of the $j$ th sentence within a document as input and learns hierarchical topic weight vectors $\theta _ { j } ^ { 1 : L }$ that evolve sequentially with $j$ The learned topic vectors in different layer are then used to reconstruct the document context input and as an additional feature for the language model to generate the $j$ th sentence.
|
| 103 |
+
|
| 104 |
+
# 3 EXPERIMENTAL RESULTS
|
| 105 |
+
|
| 106 |
+
We consider three publicly available corpora, including APNEWS, IMDB, and BNC. The links, preprocessing steps, and summary statistics for them are deferred to Appendix D. We consider a recurrent variational inference network for rGBN-RNN to infer $\theta _ { j } ^ { l }$ , as shown in Fig. 1(c), whose number of hidden units in (8) are set the same as the number of topics in the corresponding layer.
|
| 107 |
+
|
| 108 |
+
Following Lau et al. (2017), word embeddings are pre-trained 300-dimension word2vec Google News vectors (https://code.google.com/archive/p/word2vec/). Dropout with a rate of 0.4 is used to the input of the stacked-RNN at each layer, i.e., $\dot { a } _ { j , t } ^ { l }$ or $W _ { e } \left[ \boldsymbol { x } _ { j , t } \right]$ in (3). The gradients are clipped if the norm of the parameter vector exceeds 5. We use the Adam optimizer (Kingma & Ba, 2015) with learning rate $1 0 ^ { - 3 }$ . The length of an input sentence is fixed to 30. We set the mini-batch size as 8, number of training epochs as 5, and scaling hyperparameter $\tau _ { 0 }$ as 1. Code in TensorFlow is provided.
|
| 109 |
+
|
| 110 |
+
# 3.1 QUANTITATIVE COMPARISON
|
| 111 |
+
|
| 112 |
+
Perplexity: For fair comparison, we use standard language model perplexity as the evaluation metric, by considering the following baselines: $( i )$ a standard LSTM language model (Hochreiter & Schmidhuber, 1997); (ii) LCLM (Tian & Cho, 2016), a larger-context language model that incorporates context from preceding sentences, which are treated as a bag of words; (iii) a standard LSTM language model incorporating the topic information of a separately trained LDA (LDA+LSTM); (iv) Topic-RNN (Dieng et al., 2017), a hybrid model rescoring the prediction of the next word by incorporating the topic information through a linear transformation; $( \nu )$ TDLM (Lau et al., 2017), a joint learning framework which learns a convolutional based topic model and a language model simultaneously. (vi) TCNLM (Wang et al., 2018), which extracts the global semantic coherence of a document via a neural topic model, with the probability of each learned latent topic further adopted to build a mixture-of-experts language model; (vii) TGVAE (Wang et al., 2019), combining a variational auto-encoder based neural sequence model with a neural topic model; (viii) GBN-RNN, a simplified rGBN-RNN that removes the recurrent structure of its rGBN component.
|
| 113 |
+
|
| 114 |
+
For rGBN-RNN, to ensure the information about the words in the $j$ th sentence to be predicted is not leaking through the sequential document context vectors at the testing stage, the input $d _ { j }$ in (8) only summarizes the preceding sentences $S _ { < j }$ . For GBN-RNN, following TDLM (Lau et al., 2017) and TCNLM (Wang et al., 2018), all the sentences in a document, excluding the one being predicted, are used to obtain the BoW document context. As shown in Table 1, rGBN-RNN outperforms all baselines, and the trend of improvement continues as its number of layers increases, indicating the effectiveness of assimilating recurrent hierarchical topic information. rGBN-RNN consistently outperforms GBN-RNN, suggesting the benefits of exploiting the sequential dependencies of the sentence-contexts for language modeling. Moreover, comparing Table 1 and Table 4 of Appendix E suggests rGBN-RNN, with its hierarchical and temporal topical guidance, achieves better performance with fewer parameters than comparable RNN-based baselines.
|
| 115 |
+
|
| 116 |
+
Note that for language modeling, there has been significant recent interest in replacing RNNs with Transformer (Vaswani et al., 2017), which consists of stacked multi-head self-attention modules, and its variants (Dai et al., 2019; Devlin et al., 2019; Radford et al., 2018; 2019). While Transformer based language models have been shown to be powerful in various natural language processing tasks, they often have significantly more parameters, require much more training data, and take much longer to train than RNN-based language models. For example, Transformer-XL with 12L and that with 24L (Dai et al., 2019), which improve Transformer to capture longer-range dependencies, have 41M and 277M parameters, respectively, while the proposed rGBN-RNN with three stochastic hidden layers has as few as $\cdot$ parameters, as shown in Table 4, when used for language modeling. From a structural point-of-view, we consider the proposed rGBN-RNN as complementary to rather than competing with Transformer based language models, and consider replacing RNN with Transformer to construct rGBN guided Transformer as a promising future extension.
|
| 117 |
+
|
| 118 |
+
BLEU: Following Wang et al. (2019), we use test-BLEU to evaluate the quality of generated sentences with a set of real test sentences as the reference, and self-BLEU to evaluate the diversity of the generated sentences (Zhu et al., 2018). Given the global parameters of the deep recurrent topic model (rGBN) and language model, we can generate the sentences by following the data generation process of rGBN-RNN: we first generate topic weight vectors $\theta _ { j } ^ { L }$ randomly and then downward propagate it through the rGBN as in (2) to generate $\theta _ { j } ^ { < L }$ . By assimilating the random draw topic weight vectors with the hidden states of the language model in each layer depicted in (3), we generate a corresponding sentence, where we start from a zero hidden state at each layer in the language model, and sample words sequentially until the end-of-the-sentence symbol is generated. Comparisons of the BLEU scores between different methods are shown in Fig. 2, using the benchmark tool in Texygen (Zhu et al., 2018); We show below BLEU-3 and BLEU-4 for BNC and defer the analogous plots for IMDB and APNEWS to Appendix G and H. Note we set the validation dataset as the ground-truth.
|
| 119 |
+
|
| 120 |
+
Table 1: Comparison of perplexity on three different datasets.
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">LSTM Size</td><td rowspan="2">Topic Size</td><td colspan="3">Perplexity</td></tr><tr><td>APNEWS</td><td>IMDB</td><td>BNC</td></tr><tr><td rowspan="2">LCLM(Tian & Cho,2016)</td><td>600</td><td></td><td>54.18</td><td>67.78</td><td>96.50</td></tr><tr><td>900-900</td><td>一</td><td>50.63</td><td>67.86</td><td>87.77</td></tr><tr><td rowspan="2">LDA+LSTM (Lau et al., 2017)</td><td>600</td><td>100</td><td>55.52</td><td>69.64</td><td>96.50</td></tr><tr><td>900-900</td><td>100</td><td>50.75</td><td>63.04</td><td>87.77</td></tr><tr><td rowspan="2">TopicRNN (Dieng et al.,2017)</td><td>600</td><td>100</td><td>54.54</td><td>67.83</td><td>93.57</td></tr><tr><td>900-900</td><td>100</td><td>50.24</td><td>61.59</td><td>84.62</td></tr><tr><td rowspan="2">TDLM (Lau et al., 2017)</td><td>600</td><td>100</td><td>52.75</td><td>63.45</td><td>85.99</td></tr><tr><td>900-900</td><td>100</td><td>48.97</td><td>59.04</td><td>81.83</td></tr><tr><td>TCNLM (Wang et al.,2018)</td><td>600</td><td>100</td><td>52.63</td><td>62.64</td><td>86.44</td></tr><tr><td rowspan="2">TGVAE (Wang et al.,2019)</td><td>900-900</td><td>100</td><td>47.81</td><td>56.38</td><td>80.14</td></tr><tr><td>600</td><td>50</td><td>48.73</td><td>57.11</td><td>87.86</td></tr><tr><td rowspan="2">basic-LSTM(Hochreiter & Schmidhuber,1997)</td><td>600</td><td>一</td><td>64.13</td><td>72.14</td><td>102.89</td></tr><tr><td>900-900</td><td></td><td>58.89</td><td>66.47</td><td>94.23</td></tr><tr><td rowspan="2">GBN-RNN</td><td>900-900-900</td><td>一</td><td>60.13</td><td>65.16</td><td>95.73</td></tr><tr><td>600 600-512</td><td>100</td><td>47.42</td><td>57.01</td><td>86.39</td></tr><tr><td rowspan="3"></td><td></td><td>100-80</td><td>44.64</td><td>55.42</td><td>82.95</td></tr><tr><td>600-512-256</td><td>100-80-50</td><td>44.35</td><td>54.53</td><td>80.25</td></tr><tr><td>600</td><td>100</td><td>46.35</td><td>55.76</td><td>81.94</td></tr><tr><td rowspan="2">rGBN-RNN</td><td>600-512</td><td>100-80</td><td>43.26</td><td>53.82</td><td>80.25</td></tr><tr><td>600-512-256</td><td>100-80-50</td><td>42.71</td><td>51.36</td><td>79.13</td></tr></table>
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 2: BLEU scores of different methods for BNC. $\mathbf { X }$ -axis denotes test-BLEU, y-axis self-BLEU, and a better BLEU score would fall within the lower right corner.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 3: Visualization of the $L _ { 2 }$ -norm of the hidden states of the language model of rGBN-RNN, shown in the top-row, and that of GBN-RNN, shown in the bottom row.
|
| 131 |
+
|
| 132 |
+
For all datasets, it is clear that rGBN-RNN yields both higher test-BLEU and lower self-BLEU scores than related methods do, indicating the stacked-RNN based language model in rGBN-RNN generalizes well and does not suffer from mode collapse (i.e., low diversity).
|
| 133 |
+
|
| 134 |
+
# 3.2 QUALITATIVE ANALYSIS
|
| 135 |
+
|
| 136 |
+
Hierarchical structure of language model: In Fig. 3, we visualize the hierarchical multi-scale structures learned with the language model of rGBN-RNN and that of GBN-RNN, by visualizing the $L _ { 2 }$ -norm of the hidden states in each layer, while reading a sentence from the APNEWS validation set as “the service employee international union asked why cme group needs tax relief when it is making huge amounts of money?” As shown in Fig. 3(a), in the bottom hidden layer (h1), the $\cdot$ norm sequence varies quickly from word to word, except within short phrases such “service employee”, “international union,” and “tax relief,” suggesting layer h1 is in charge of capturing short-term local dependencies. By contrast, in the top hidden layer (h3), the $L _ { 2 }$ norm sequence varies slowly and exhibits semantic/syntactic meaningful long segments, such as “service employee international union,” “asked why cme group needs tax relief,” “when it is,” and “making huge amounts of,” suggesting that layer h3 is in charge of capturing long-range dependencies. Therefore, the language model in rGBN-RNN can allow more specific information to transmit through lower layers, while allowing more general higher level information to transmit through higher layers. Our proposed model have the ability to learn hierarchical structure of the sequence, despite without designing the multiscale RNNs on purpose like Chung et al. (2017). We also visualize the language model of GBN-RNN in Fig. 3(b); with much less smoothly time-evolved deeper layers, GBN-RNN fails to utilize its stacked RNN structure as effectively as rGBN-RNN does. This suggests that the language model is much better trained in rGBN-RNN than in GBN-RNN for capturing long-range temporal dependencies, which helps explain why rGBN-RNN exhibits clearly boosted BLEU scores in comparison to GBN-RNN.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 4: Topics and their temporal trajectories inferred by a three-hidden-layer rGBN-RNN from the APNEWS dataset, and the generated sentences under topic guidance (best viewed in color). Top words of each topic at layer 3, 2, 1 are shown in orange, yellow and blue boxes respectively, and each sentence is shown in a dotted line box labeled with the corresponding topic index. Sentences generated with a combination of topics in different layers are at the bottom of the figure.
|
| 140 |
+
|
| 141 |
+
Hierarchical topics: We present an example topic hierarchy inferred by a three-layer rGBN-RNN from APNEWS. In Fig. 4, we select a large-weighted topic at the top hidden layer and move down the network to include any lower-layer topics connected to their ancestors with sufficiently large weights. Horizontal arrows link temporally related topics at the same layer, while top-down arrows link hierarchically related topics across layers. For example, topic 48 of layer 3 on “budget, lawmakers, gov., revenue,” is related not only in hierarchy to topic 57 on “lawmakers, pay, proposal, legislation” and topic 60 of the lower layer on “budget, gov., revenue, vote, costs, mayor,” but also in time to topic 35 of the same layer on “democratic, taxes, proposed, future, state.” Highly interpretable hierarchical relationships between the topics at different layers, and temporal relationships between the topics at the same layer are captured by rGBN-RNN, and the topics are often quite specific semantically at the bottom layer while becoming increasingly more general when moving upwards.
|
| 142 |
+
|
| 143 |
+
Sentence generation under topic guidance: Given the learned rGBN-RNN, we can sample the sentences both conditioning on a single topic of a certain layer and on a combination of the topics from different layers. Shown in the dotted-line boxes in Fig. 4, most of the generated sentences conditioned on a single topic or a combination of topics are highly related to the given topics in terms of their semantical meanings but not necessarily in key words, indicating the language model is successfully guided by the recurrent hierarchical topics. These observations suggest that rGBN-RNN has successfully captured syntax and global semantics simultaneously for natural language generation.
|
| 144 |
+
|
| 145 |
+
Sentence/paragraph generation conditioning on a paragraph: Given the GBN-RNN and rGBNRNN learned on APNEWS, we further present the generated sentences conditioning on a paragraph, as shown in Fig. 5. To randomly generate sentences, we encode the paragraph into a hierarchical latent representation and then feed it into the stacked-RNN. Besides, we can generate a paragraph with rGBN-RNN, using its recurrent inference network to encode the paragraph into a dynamic hierarchical latent representation, which is fed into the language model to predict the word sequence
|
| 146 |
+
|
| 147 |
+
# Document
|
| 148 |
+
|
| 149 |
+
。 the senate sponsor (…) , a house committee last week removed photo ids issued by public colleges and universities from the measure sponsored by republican rep. susan lynn , who said she agreed with the change . the house approved the bill on a 65-30 vote on monday evening . but republican sen. bill ketron in a statement noted that the upper chamber overwhelmingly rejected efforts to take student ids out of the bill when it passed 21-8 earlier this month . ketron said he would take the bill to conference committee if needed .
|
| 150 |
+
|
| 151 |
+
# Generated Sentences with GBN-RNN
|
| 152 |
+
|
| 153 |
+
$^ { \circ }$ if the house and senate agree , it will be the first time they 'll have to seek their first meeting .
|
| 154 |
+
。 the proposal would also give lawmakers with more money to protect public safety , he said .
|
| 155 |
+
|
| 156 |
+
# Generated Sentences with rGBN-RNN
|
| 157 |
+
|
| 158 |
+
the proposal , which was introduced in the house on a vote on wednesday , has already passed the senate floor to the house the city commission voted last week to approve the law , which would have allowed the council to approve the new bill .
|
| 159 |
+
|
| 160 |
+
# Generated temporal Sentences with rGBN-RNN (Paragraph)
|
| 161 |
+
|
| 162 |
+
senate president pro tem joe scarnati said the governor 's office has never resolved the deadline for a vote in the house . the proposal is a new measure version of the bill to enact a senate committee to approve the emergency manager ‘s emergency license . the house gave the bill to six weeks of testimony , but the vote now goes to the full house for consideration . jackson signed his paperwork wednesday with the legislature .the proposal would also give lawmakers with more money to protect public safety , he said . "a spokesman for the federal department of public safety says it has been selected for a special meeting for the state senate to investigate his proposed law . a new state house committee has voted to approve a measure to let idaho join a national plan to ban private school systems at public schools . the campaign also launched a website at the university of california , irvine , which are studying the current proposal .
|
| 163 |
+
|
| 164 |
+
Figure 5: Examples of generated sentences and paragraph conditioned on a document from APNEWS (green denotes novel words, blue the key words in document and generated sentences.)
|
| 165 |
+
|
| 166 |
+
in each sentence of the input paragraph. It is clear that both the proposed GBN-RNN and rGBN-RNN can successfully capture the key textual information of the input paragraph, and generate diverse realistic sentences. Interestingly, the rGBN-RNN can generate semantically coherent paragraphs, incorporating contextual information both within and beyond the sentences. Note that with the topics that extract the document-level word cooccurrence patterns, our proposed models can generate semantically-meaningful words, which may not exist in the original document.
|
| 167 |
+
|
| 168 |
+
# 4 CONCLUSION
|
| 169 |
+
|
| 170 |
+
We propose a recurrent gamma belief network (rGBN) guided neural language modeling framework, a novel method to learn a language model and a deep recurrent topic model simultaneously. For scalable inference, we develop hybrid SG-MCMC and recurrent autoencoding variational inference, allowing efficient end-to-end training. Experiments results conducted on real world corpora demonstrate that the proposed models outperform a variety of shallow-topic-model-guided neural language models, and effectively generate the sentences from the designated multi-level topics or noise, while inferring interpretable hierarchical latent topic structure of document and hierarchical multiscale structures of sequences. For future work, we plan to extend the proposed models to specific natural language processing tasks, such as machine translation, image paragraph captioning, and text summarization. Another promising extension is to replace the stacked-RNN in rGBN-RNN with Transformer, i.e., constructing an rGBN guided Transformer as a new larger-context neural language model.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Sungjin Ahn, Heeyoul Choi, Tanel Parnamaa, and Yoshua Bengio. A neural knowledge language model. arXiv: Computation and Language, 2017.
|
| 175 |
+
|
| 176 |
+
D. M. Blei and J. D. Lafferty. Dynamic topic models. In ICML, 2006.
|
| 177 |
+
|
| 178 |
+
David M Blei, Andrew Y Ng, and Michael I Jordan. Latent Dirichlet allocation. Journal of Machine Learning Research, 3:993–1022, 2003.
|
| 179 |
+
|
| 180 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Fethi Bougares, and Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In Computer Science, 2014.
|
| 181 |
+
|
| 182 |
+
Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. In ICLR, 2017.
|
| 183 |
+
|
| 184 |
+
Yulai Cong, Bo Chen, Hongwei Liu, and Mingyuan Zhou. Deep latent Dirichlet allocation with topic-layer-adaptive stochastic gradient Riemannian MCMC. In ICML, 2017a.
|
| 185 |
+
|
| 186 |
+
Yulai Cong, Bo Chen, and Mingyuan Zhou. Fast simulation of hyperplane-truncated multivariate normal distributions. Bayesian Anal., 12(4):1017–1037, 2017b.
|
| 187 |
+
|
| 188 |
+
BNC Consortium. The British National Corpus, version 3 (BNC XML Edition). http://www. natcorp.ox.ac.uk, 2007.
|
| 189 |
+
|
| 190 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, Jaime G Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. In ACL, 2019.
|
| 191 |
+
|
| 192 |
+
Jacob Devlin, Mingwei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In north american chapter of the association for computational linguistics, pp. 4171–4186, 2019.
|
| 193 |
+
|
| 194 |
+
Adji B Dieng, Chong Wang, Jianfeng Gao, and John Paisley. TopicRNN: A recurrent neural network with long-range semantic dependency. In ICLR, 2017.
|
| 195 |
+
|
| 196 |
+
Zhe Gan, Changyou Chen, Ricardo Henao, David Carlson, and Lawrence Carin. Scalable deep Poisson factor analysis for topic modeling. In ICML, pp. 1823–1832, 2015.
|
| 197 |
+
|
| 198 |
+
Zhe Gan, Chuang Gan, Xiaodong He, Yunchen Pu, Kenneth Tran, Jianfeng Gao, Lawrence Carin, and Li Deng. Semantic compositional networks for visual captioning. In CVPR, pp. 1141–1150, 2017.
|
| 199 |
+
|
| 200 |
+
Sebastian Gehrmann, Yuntian Deng, and Alexander Rush. Bottom-up abstractive summarization. In EMNLP, pp. 4098–4109, 2018.
|
| 201 |
+
|
| 202 |
+
Mark A Girolami and Ben Calderhead. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. Journal of The Royal Statistical Society Series B-statistical Methodology, 73(2):123–214, 2011.
|
| 203 |
+
|
| 204 |
+
A. Graves, A. Mohamed, and G. Hinton. Speech recognition with deep recurrent neural networks. In ICASSP, pp. 6645–6649, 2013.
|
| 205 |
+
|
| 206 |
+
Alex Graves. Generating sequences with recurrent neural networks. arXiv: Neural and Evolutionary Computing, 2013.
|
| 207 |
+
|
| 208 |
+
T. L. Griffiths and M. Steyvers. Finding scientific topics. Proceedings of the National Academy of Sciences, 101:5228–5235, 2004.
|
| 209 |
+
|
| 210 |
+
Thomas L Griffiths, Mark Steyvers, David M Blei, and Joshua B Tenenbaum. Integrating topics and syntax. In NeurIPS, pp. 537–544, 2004.
|
| 211 |
+
|
| 212 |
+
Dandan Guo, Bo Chen, Hao Zhang, and Mingyuan Zhou. Deep Poisson gamma dynamical systems. In NeurIPS, pp. 8451–8461, 2018.
|
| 213 |
+
|
| 214 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. Neural Computation, 9(8): 1735–1780, 1997.
|
| 215 |
+
|
| 216 |
+
Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013.
|
| 217 |
+
|
| 218 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 219 |
+
|
| 220 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2013.
|
| 221 |
+
|
| 222 |
+
D Klein and Christopher D Manning. Accurate unlexicalized parsing. In Meeting of the Association for Computational Linguistics, 2003.
|
| 223 |
+
|
| 224 |
+
Jey Han Lau, Timothy Baldwin, and Trevor Cohn. Topically driven neural language model. In meeting of the association for computational linguistics, pp. 355–365, 2017.
|
| 225 |
+
|
| 226 |
+
C. Li, C. Chen, D. Carlson, and L. Carin. Preconditioned stochastic gradient Langevin dynamics for deep neural networks. arXiv, 2015.
|
| 227 |
+
|
| 228 |
+
Y. Ma, T. Chen, and E. Fox. A complete recipe for stochastic gradient MCMC. In NIPS, pp. 2899–2907, 2015.
|
| 229 |
+
Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Huang Dan, Andrew Y. Ng, and Christopher Potts.
|
| 230 |
+
Learning Word Vectors for Sentiment Analysis. In Meeting of the Association for Computational Linguistics: Human Language Technologies, 2011.
|
| 231 |
+
Junhua Mao, Wei Xu, Yi Yang, Jiang Wang, Zhiheng Huang, and Alan L Yuille. Deep captioning with multimodal recurrent neural networks (m-RNN). In ICLR, 2015.
|
| 232 |
+
Yishu Miao, Edward Grefenstette, and Phil Blunsom. Discovering discrete latent topics with neural variational inference. In ICML, pp. 2410–2419, 2017.
|
| 233 |
+
Tomas Mikolov and Geoffrey Zweig. Context dependent recurrent neural network language model. In SLT, pp. 234–239, 2012.
|
| 234 |
+
Tomas Mikolov, Martin Karafiat, Lukas Burget, Jan Cernocky, and Sanjeev Khudanpur. Recurrent neural network based language model. In Interspeech, 2010.
|
| 235 |
+
Tomas Mikolov, Stefan Kombrink, Lukas Burget, Jan Cernocky, and Sanjeev Khudanpur. Extensions of recurrent neural network language model. In ICASSP, pp. 5528–5531, 2011.
|
| 236 |
+
Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In
|
| 237 |
+
ICML, pp. 1791–1799, 2014.
|
| 238 |
+
Sam Patterson and Yee Whye Teh. Stochastic gradient Riemannian Langevin dynamics on the
|
| 239 |
+
probability simplex. In NIPS, pp. 3102–3110, 2013.
|
| 240 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language under
|
| 241 |
+
standing by generative pre-training. 2018.
|
| 242 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language
|
| 243 |
+
models are unsupervised multitask learners. 2019.
|
| 244 |
+
Steven J Rennie, Etienne Marcheret, Youssef Mroueh, Jerret Ross, and Vaibhava Goel. Self-critical
|
| 245 |
+
sequence training for image captioning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7008–7024, 2017.
|
| 246 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, pp. 1278–1286, 2014.
|
| 247 |
+
Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In EMNLP, pp. 379–389, 2015.
|
| 248 |
+
Aaron Schein, Hanna Wallach, and Mingyuan Zhou. Poisson–gamma dynamical systems. In Neural Information Processing Systems, 2016.
|
| 249 |
+
Akash Srivastava and Charles Sutton. Autoencoding variational inference for topic models. In ICLR, 2017.
|
| 250 |
+
Nitish Srivastava, Ruslan Salakhutdinov, and Geoffrey E Hinton. Modeling documents with deep Boltzmann machines. In Uncertainty in Artificial Intelligence, 2013.
|
| 251 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks.
|
| 252 |
+
In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 253 |
+
Yee Whye Teh, Michael I Jordan, Matthew J Beal, and David M Blei. Hierarchical Dirichlet processes. Publications of the American Statistical Association, 101(476):1566–1581, 2006.
|
| 254 |
+
Wang Tian and Kyunghyun Cho. Larger-context language modelling with recurrent neural network. In Meeting of the Association for Computational Linguistics, 2016.
|
| 255 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Neural Information Processing Systems, pp. 6000–6010, 2017.
|
| 256 |
+
Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In CVPR, 2015.
|
| 257 |
+
Hanna M Wallach. Topic modeling: beyond bag-of-words. In ICML, pp. 977–984, 2006.
|
| 258 |
+
Wenlin Wang, Zhe Gan, Wenqi Wang, Dinghan Shen, Jiaji Huang, Wei Ping, Sanjeev Satheesh, and Lawrence Carin. Topic compositional neural language model. In AISTATS, pp. 356–365, 2018.
|
| 259 |
+
Wenlin Wang, Zhe Gan, Hongteng Xu, Ruiyi Zhang, Guoyin Wang, Dinghan Shen, Changyou Chen, and Lawrence Carin. Topic-guided variational autoencoders for text generation. In NAACL, 2019.
|
| 260 |
+
Max Welling and Yee Whye Teh. Bayesian learning via stochastic gradient Langevin dynamics. In ICML, pp. 681–688, 2011.
|
| 261 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, pp. 2048–2057, 2015.
|
| 262 |
+
Hao Zhang, Bo Chen, Dandan Guo, and Mingyuan Zhou. WHAI: Weibull hybrid autoencoding inference for deep topic modeling. In ICLR, 2018.
|
| 263 |
+
He Zhao, Lan Du, Wray Buntine, and Mingyuan Zhou. Dirichlet belief networks for topic structure learning. In Neural Information Processing Systems, pp. 7955–7966, 2018.
|
| 264 |
+
Mingyuan Zhou and Lawrence Carin. Negative binomial process count and mixture modeling. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(2):307–320, 2015.
|
| 265 |
+
Mingyuan Zhou, Yulai Cong, and Bo Chen. Augmentable gamma belief networks. J. Mach. Learn. Res., 17(163):1–44, 2016.
|
| 266 |
+
Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. Texygen: A benchmarking platform for text generation models. SIGIR, 2018.
|
| 267 |
+
|
| 268 |
+
# A THE GBN-RNN
|
| 269 |
+
|
| 270 |
+
GBN-RNN: $\{ y _ { 1 : T } , d \}$ denotes a sentence-context pair, where $d \in \mathbb { Z } _ { + } ^ { V _ { c } }$ represents the document-level context as a word frequency count vector, the vth element of which counts the number of times the vth word in the vocabulary appears in the document excluding sentence $y _ { 1 : T }$ . The hierarchical model of a $L$ -hidden-layer GBN, from top to bottom, is expressed as
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\begin{array} { r l } & { \pmb { \theta } ^ { L } \sim \mathrm { G a m } \left( r , c ^ { L + 1 } \right) , \ldots , \pmb { \theta } ^ { l } \sim \mathrm { G a m } \left( \Phi ^ { l + 1 } \pmb { \theta } ^ { l + 1 } , c ^ { l + 1 } \right) , \ldots , } \\ & { \pmb { \theta } ^ { 1 } \sim \mathrm { G a m } \left( \Phi ^ { 2 } \pmb { \theta } ^ { 2 } , c ^ { 2 } \right) , \ d \sim \mathrm { P o i s } \left( \Phi ^ { 1 } \pmb { \theta } ^ { 1 } \right) , } \end{array}
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
The stacked-RNN based language model described in (3) is also used in GBN-RNN.
|
| 277 |
+
|
| 278 |
+
Statistical inference: To infer GBN-RNN, we consider a hybrid of stochastic gradient MCMC (Welling & Teh, 2011; Patterson & Teh, 2013; Li et al., 2015; Ma et al., 2015; Cong et al., 2017a), used for the GBN topics $\phi _ { k } ^ { l }$ , and auto-encoding variational inference (Kingma & Welling, 2013; Rezende et al., 2014), used for the parameters of both the inference network (encoder) and RNN. More specifically, GBN-RNN generalizes Weibull hybrid auto-encoding inference (WHAI) of Zhang et al. (2018): it uses a deterministic-downward-stochastic-upward inference network to encode the bag-of-words representation of $^ d$ into the latent topic-weight variables $\pmb { \theta } ^ { l }$ across all hidden layers, which are fed into not only GBN to reconstruct $\textbf { \em d }$ , but also a stacked RNN in language model, as shown in (3), to predict the word sequence in $y _ { 1 : T }$ . The topics $\phi _ { k } ^ { l }$ can be sampled with topic-layeradaptive stochastic gradient Riemannian (TLASGR) MCMC, whose details can be found in Cong et al. (2017a); Zhang et al. (2018), omitted here for brevity. Given the sampled topics $\phi _ { k } ^ { l }$ , the joint marginal likelihood of $\{ y _ { 1 : T } , d \}$ is defined as
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
p \left( \boldsymbol { y } _ { 1 : T } , d \mid \{ \Phi ^ { l } \} _ { l } \right) = \int p \left( d \mid \Phi ^ { 1 } \theta ^ { 1 } \right) \left[ \prod _ { t = 1 } ^ { T } p \left( \boldsymbol { y } _ { t } \mid \boldsymbol { y } _ { 1 : t - 1 } , \boldsymbol { \theta } ^ { 1 : L } \right) \right] \left[ \prod _ { l = 1 } ^ { L } p \left( \boldsymbol { \theta } ^ { l } \mid \Phi ^ { l + 1 } \boldsymbol { \theta } ^ { l + 1 } \right) \right] d \boldsymbol { \theta } ^ { 1 : L } .
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
For efficient inference, an inference network as $\begin{array} { r } { Q = \prod _ { l = 1 } ^ { L } q ( \pmb { \theta } ^ { l } | \pmb { d } , \pmb { \Phi } ^ { l + 1 } \pmb { \theta } ^ { l + 1 } ) } \end{array}$ is used to provide a ELBO of the log joint marginal likelihood as
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
{ \overset { , } { \left( } { y _ { 1 : T } , d \right) } } = \mathbb { E } _ { Q } \left[ \ln p \left( d \mid \Phi ^ { 1 } \theta ^ { 1 } \right) + \sum _ { t = 1 } ^ { T } \ln p \left( y _ { t } \mid y _ { 1 : t - 1 } , \theta ^ { 1 : L } \right) \right] - \sum _ { l = 1 } ^ { L } \mathbb { E } _ { Q } \left[ \ln { \frac { q \left( \theta ^ { l } \mid d , \Phi ^ { l + 1 } \theta ^ { l + 1 } \right) } { p \left( \theta ^ { l } \mid \Phi ^ { l + 1 } \theta ^ { l + 1 } \right) } } \right]
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
and the training is performed by maximizing $\mathbb { E } _ { p _ { \mathrm { d a t a } } ( y _ { 1 : T } , d ) } [ L ( y _ { 1 : T } , d ) ]$ ; following Zhang et al. (2018), we define $q ( \pmb { \theta } ^ { l } \mid d , \pmb { \Phi } ^ { l + 1 } , \pmb { \theta } ^ { l + 1 } ) = \mathrm { W e i b u l l } ( \pmb { k } ^ { l } + \pmb { \Phi } ^ { l + 1 } \pmb { \theta } ^ { l + 1 } , \pmb { \lambda } ^ { l } )$ , where both $k ^ { l }$ and $\lambda ^ { l }$ are deterministically transformed from $^ d$ using neural networks. Distinct from a usual variational auto-encoder whose inference network has a pure bottom-up structure, the inference network here has a determisticupward–stoachstic-downward ladder structure (Zhang et al., 2018).
|
| 291 |
+
|
| 292 |
+
# B THE COUPLING VECTOR
|
| 293 |
+
|
| 294 |
+
Following Lau et al. (2017), the $\mathbf { \Delta } _ { \cdot \cdot } ^ { a _ { j , t } ^ { l } } = g ^ { l } \left( h _ { j , t } ^ { l } , \theta _ { j } ^ { l } \right)$ can be implemented with a gating unit similar to a GRU (Cho et al., 2014), describe as
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
\begin{array} { r l } & { z _ { j , t } ^ { l } = \sigma \left( \mathbf { W } _ { z } ^ { l } \pmb { \theta } _ { j } ^ { l } + \mathbf { U } _ { z } ^ { l } \pmb { h } _ { j , t } ^ { l } + \mathbf { b } _ { z } ^ { l } \right) } \\ & { r _ { j , t } ^ { l } = \sigma \left( \mathbf { W } _ { r } ^ { l } \pmb { \theta } _ { j } ^ { l } + \mathbf { U } _ { r } ^ { l } \pmb { h } _ { j , t } ^ { l } + \mathbf { b } _ { r } ^ { l } \right) } \\ & { \hat { h } _ { j , t } ^ { l } = \operatorname { t a n h } \left( \mathbf { W } _ { h } ^ { l } \pmb { \theta } _ { j } ^ { l } + \mathbf { U } _ { h } ^ { l } \left( r _ { j , t } ^ { l } \odot { h } _ { j , t } ^ { l } \right) + \mathbf { b } _ { h } ^ { l } \right) } \\ & { a _ { j , t } ^ { l } = \left( 1 - z _ { j , t } ^ { l } \right) \odot { h } _ { j , t } ^ { l } + z _ { j , t } ^ { l } \odot \hat { h } _ { j , t } ^ { l } } \end{array}
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
# C SGMCMC FOR RGBN-RNN
|
| 301 |
+
|
| 302 |
+
To allow for scalable inference, we apply the topic-layer-adaptive stochastic gradient Riemannian (TLASGR) MCMC algorithm described in Cong et al. (2017a); Zhang et al. (2018), which can be used to sample simplex-constrained global parameters Cong et al. (2017b) in a mini-batch based manner. It improves its sampling efficiency via the use of the Fisher information matrix (FIM)
|
| 303 |
+
|
| 304 |
+
Girolami & Calderhead (2011), with adaptive step-sizes for the latent factors and transition matrices of different layers. In this section, we discuss how to update the global parameters $\{ \Phi ^ { l } , \Pi ^ { l } \} _ { l = 1 } ^ { L }$ of rGBN in detail and give a complete one in Algorithm in 1.
|
| 305 |
+
|
| 306 |
+
Sample the auxiliary counts: This step is about the “backward” and “upward” pass. Let us denote $\_$ Kl , $\cdot$ , and $x _ { k j } ^ { ( 1 , 1 ) } = d _ { v j }$ , where $-$ is shown in (2). Working backward for $\cdot$ and upward for $\cdot$ , we draw
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { r l } & { ( A _ { k 1 j } ^ { l } , . . . , . , A _ { k K _ { l } j } ^ { l } ) \sim \mathrm { M u l t i } \left( x _ { k j } ^ { ( l , l ) } ; \frac { \phi _ { k 1 } ^ { l } \theta _ { 1 j } ^ { l } } { \sum _ { k _ { l } = 1 } ^ { K _ { l } } \phi _ { k k _ { l } } ^ { l } \theta _ { k l } ^ { l } } , . . . , \frac { \phi _ { k K _ { l } } ^ { l } \theta _ { K l } ^ { l } } { \sum _ { k _ { l } = 1 } ^ { K _ { l } } \phi _ { k l } ^ { l } \theta _ { k l } ^ { l } } \right) , } \\ & { x _ { k j } ^ { l + 1 } \sim \mathrm { C R T } \left[ A _ { \cdot k j } ^ { l } + Z _ { \cdot k , j + 1 } ^ { l } , \tau _ { 0 } \left( \sum _ { k _ { l + 1 } = 1 } ^ { K _ { l + 1 } } \phi _ { k k _ { l + 1 } } ^ { l + 1 } \theta _ { k _ { l + 1 } j } ^ { l + 1 } + \sum _ { k _ { l } = 1 } ^ { K _ { l } } \pi _ { k k _ { 1 } } ^ { l } \theta _ { k _ { 1 } , j - 1 } ^ { l } \right) \right] . } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
Note that via the deep structure, the latent counts xl+1kj will be influenced by the effects from both time $\cdot$ at layer $\cdot$ and time $j$ at layer ${ \it l } + 1$ . With $\_$ and $p _ { 2 } : =$ $\cdot$ , we can sample the latent counts at layer $\cdot$ and ${ \it l } + 1$ by
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
( x _ { k j } ^ { l + 1 , l } , x _ { k j } ^ { l + 1 , l + 1 } ) \sim \mathrm { M u l t i } \left( x _ { k j } ^ { l + 1 } , p _ { 1 } / ( p _ { 1 } + p _ { 2 } ) , p _ { 2 } / ( p _ { 1 } + p _ { 2 } ) \right) ,
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
and then draw
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
-
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
In rGBN, the prior and the likelihood of $\{ \Phi ^ { l } \} _ { l = 1 } ^ { L }$ is very similar with $\{ \boldsymbol { \Pi } ^ { l } \} _ { l = 1 } ^ { L }$ , so we also apply the TLASGR MCMC sampling algorithm on both of them conditioned on the auxiliary counts.
|
| 325 |
+
|
| 326 |
+
Sample the hierarchical components $\{ \Phi ^ { l } \} _ { l = 1 } ^ { L }$ : For $\phi _ { k } ^ { l }$ , the $k$ th column of the loading matrix $\Phi ^ { l }$ of layer $l$ , its sampling can be efficiently realized as
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { r l r } { { ( \phi _ { k } ^ { l } ) _ { n + 1 } = [ ( \phi _ { k } ^ { l } ) _ { n } + \frac { \varepsilon _ { n } } { P _ { k } ^ { l } } [ ( \rho \tilde { A } _ { : k \cdot } ^ { l } + \eta _ { 0 } ^ { l } ) - ( \rho \tilde { A } _ { : k \cdot } ^ { l } + K _ { l - 1 } \eta _ { 0 } ^ { l } ) ( \phi _ { k } ^ { l } ) _ { n } ] } } \\ & { } & { + \ N ( 0 , \frac { 2 \varepsilon _ { n } } { P _ { k } ^ { l } } [ \mathrm { d i a g } ( \phi _ { k } ^ { l } ) _ { n } - ( \phi _ { k } ^ { l } ) _ { n } ( \phi _ { k } ^ { l } ) _ { n } ^ { T } ] ) ] _ { \angle } , } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
where $P _ { k } ^ { l }$ is calculated using the estimated FIM, $\begin{array} { r } { \tilde { A } _ { k _ { l } j . } ^ { l } = \sum _ { j = 1 } ^ { J } A _ { k _ { l } k { j } } ^ { l } , \tilde { A } _ { : k \cdot } ^ { l } = \{ \tilde { A } _ { 1 j \cdot } ^ { l } , \cdot \cdot \cdot , \tilde { A } _ { K _ { l } j \cdot } ^ { l } \} ^ { T } } \end{array}$ and $\begin{array} { r } { \tilde { A } _ { \cdot k \cdot } ^ { l } = \sum _ { k _ { l } = 1 } ^ { k _ { l } } \tilde { A } _ { k _ { l } j } ^ { l } . } \end{array}$ , $A _ { k _ { l } k j } ^ { l }$ l l comes from the augmented latent counts $A ^ { l }$ in (13), $\eta _ { 0 } ^ { l }$ l denote the prior of $\phi _ { k } ^ { l }$ , and $[ \cdot ] _ { \angle }$ denotes a simplex constraint.
|
| 333 |
+
|
| 334 |
+
Sample the transmission matrix $\{ \boldsymbol { \Pi } ^ { l } \} _ { l = 1 } ^ { L }$ : For $\pi _ { k } ^ { l }$ , the $k$ th column of the transition matrix $\Pi ^ { l }$ of layer $l$ , its sampling can be efficiently realized as
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\begin{array} { r l } & { \left( \pi _ { k } ^ { l } \right) _ { n + 1 } = \biggr [ \left( \pi _ { k } ^ { l } \right) _ { n } + \frac { \varepsilon _ { n } } { M _ { k } ^ { l } } \left[ \left( \rho \tilde { Z } _ { : k \cdot } ^ { l } + \eta _ { : k } ^ { l } \right) - \left( \rho \tilde { Z } _ { : k \cdot } ^ { l } + \eta _ { . k } ^ { l } \right) \left( \pi _ { k } ^ { l } \right) _ { n } \right] } \\ & { \qquad + \mathcal { N } \left( 0 , \frac { 2 \varepsilon _ { n } } { M _ { k } ^ { l } } \left[ \mathrm { d i a g } ( \pi _ { k } ^ { l } ) _ { n } - ( \pi _ { k } ^ { l } ) _ { n } ( \pi _ { k } ^ { l } ) _ { n } ^ { T } \right] \right) \biggr ] _ { \angle } , } \end{array}
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
where $M _ { k } ^ { l }$ is calculated using the estimated FIM, $\begin{array} { r } { \tilde { Z } _ { k _ { l } j . } ^ { l } = \sum _ { j = 1 } ^ { J } Z _ { k _ { l } k _ { j } } ^ { l } , \tilde { Z } _ { : k \cdot } ^ { l } = \{ \tilde { Z } _ { 1 j \cdot } ^ { l } , \cdot \cdot \cdot , \tilde { Z } _ { K _ { l } j \cdot } ^ { l } \} ^ { T } } \end{array}$ and $\begin{array} { r } { \tilde { Z } _ { \cdot k \cdot } ^ { l } = \sum _ { k _ { l } = 1 } ^ { k _ { l } } \tilde { Z } _ { k _ { l } j } ^ { l } } \end{array}$ · , $Z _ { k _ { l } k j } ^ { l }$ comes from the augmented latent counts $Z ^ { l }$ in (16), and $[ . ] _ { \angle }$ denotes a simplex constraint, and $\eta _ { ; k } ^ { l }$ denotes the prior of $\pi _ { k } ^ { l }$ , more details about TLASGR-MCMC for our proposed model can be found in Cong et al. (2017a).
|
| 341 |
+
|
| 342 |
+
# D DATASETS
|
| 343 |
+
|
| 344 |
+
We consider three publicly available corpora1. APNEWS is a collection of Associated Press news articles from 2009 to 2016, IMDB is a set of movie reviews collected by Maas et al. (2011), and BNC is the written portion of the British National Corpus (Consortium, 2007). Following the preprocessing steps in Lau et al. (2017), we tokenize words and sentences using Stanford CoreNLP (Klein & Manning, 2003), lowercase all word tokens, and filter out word tokens that occur less than 10 times. For the topic model, we additionally exclude stopwords2 and the top $0 . 1 \%$ most frequent words. All these corpora are partitioned into training, validation, and testing sets, whose summary statistics are provided in Table 2 of the Appendix.
|
| 345 |
+
|
| 346 |
+
Table 2: Summary statistics for the datasets.
|
| 347 |
+
|
| 348 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="2">Vocubalry</td><td colspan="3">Training</td><td colspan="3">Validation</td><td colspan="3">Testing</td></tr><tr><td>LM</td><td>TM</td><td>Docs</td><td>Sents</td><td>Tokens</td><td>Docs</td><td>Sents</td><td>Tokens</td><td>Docs</td><td>Sents</td><td>Tokens</td></tr><tr><td>APNEWS</td><td>34231</td><td>32169</td><td>50K</td><td>0.8M</td><td>15M</td><td>2K</td><td>33K</td><td>0.6M</td><td>2K</td><td>32K</td><td>0.6M</td></tr><tr><td>IMDB</td><td>36009</td><td>34925</td><td>75K</td><td>1.1M</td><td>20M</td><td>12.5K</td><td>0.18M</td><td>0.3M</td><td>12.5K</td><td>0.18M</td><td>0.3M</td></tr><tr><td>BNC</td><td>43703</td><td>41552</td><td>15K</td><td>1M</td><td>18M</td><td>1K</td><td>57K</td><td>1M</td><td>1K</td><td>66K</td><td>1M</td></tr></table>
|
| 349 |
+
|
| 350 |
+
# E COMPLEXITY OF RGBN-RNN
|
| 351 |
+
|
| 352 |
+
The proposed rGBN-RNN consists of both language model and topic model compontopic model component, there are the global parameters of rGBN (decoder), including $\{ \Phi ^ { l } , \Pi ^ { l } \} _ { l = 1 } ^ { L }$ in (2) , and the parameters of the variational recurrent inference network (encoder), consisting of $\cdot$ , $f _ { k } ^ { l }$ , and $\cdot$ in (8). The language model component is parameterized by $\mathrm { L S T M } _ { \mathrm { w o r d } } ^ { l }$ in (3) and the coupling vectors $\cdot$ described in Appendix B. We summarize in Table 3 the complexity of rGBN-RNN (ignoring all bias terms), where $V$ denotes the vocabulary size of the language model, $\cdot$ the dimension of word embedding vectors, $V _ { c }$ the size of the vocabulary of the topic model that excludes stop words, $H _ { l } ^ { w }$ the number of hidden units of the word-level LSTM at layer $\cdot$ (stacked-RNN language model), $H _ { l } ^ { s }$ the number of hidden units of the sentence-level RNN at layer $\cdot$ (variational recurrent inference network), and $\cdot$ the number of topics at layer $\it l$ .
|
| 353 |
+
|
| 354 |
+
Table 4 further compares the number of parameters between various RNN-based language models, where we follow the convention to ignore the word embedding layers. Some models in Table 1 are not included here, because we could not find sufficient information from their corresponding papers or code to accurately calculate the number of model parameters. Note when used for language generation at the testing stage, rGBN-RNN no longer needs its topics $\{ \Phi ^ { l } \}$ , whose parameters are hence not counted. Note the number of parameters of the topic model component is often dominated by that of the language model component.
|
| 355 |
+
|
| 356 |
+
Table 3: Complexity of the three-layer rGBN-RNN.
|
| 357 |
+
|
| 358 |
+
<table><tr><td rowspan="2">Component Param</td><td colspan="2">Language Model</td><td colspan="2"></td><td colspan="4">Topic Model</td></tr><tr><td>LSTMword in (3)</td><td>glinB</td><td>Φin (2)</td><td>II in (2)</td><td></td><td>RNNsent in (8)</td><td>f in (8)</td><td>f in (8)</td></tr><tr><td>Layer1</td><td>O(4×(E+H) ×H")</td><td>O(3×(K1+H)×H1)</td><td>O(Vc × K1)</td><td>O(K1 × K1)</td><td></td><td>O(Vc+H𝑖) × Hi</td><td>O(Hi)</td><td>O(K1 x Hi)</td></tr><tr><td>Layer2</td><td>O(4×(H+H)×H²)</td><td>O(3 × (K2+H) × H)</td><td>O(K1 × K2)</td><td>O(K2 ×K2)</td><td>O((Hi +H²)×H)</td><td></td><td>O(H)</td><td>O(K2 ×H)</td></tr><tr><td>Layer3</td><td>O(4×(H+H)×H))</td><td>1O(3×(K3+H)×H)</td><td></td><td></td><td>[O(K2×K3)|O(K3 × K3)|O(H+H) × H)</td><td></td><td>O(H)</td><td>O(K ×H)</td></tr></table>
|
| 359 |
+
|
| 360 |
+
Table 4: Comparison of the number of parameters of different models when used for language generation.
|
| 361 |
+
|
| 362 |
+
<table><tr><td>Model</td><td>LSTM Size</td><td>Topic Size</td><td># LM Param</td><td>#TMParam</td><td># All Param</td></tr><tr><td>TDLM (Lau et al., 2017)</td><td>600 900-900</td><td>100 100</td><td>3.35M 13.38M</td><td>0.019M 0.019M</td><td>3.37M 13.40M</td></tr><tr><td>basic-LSTM (Hochreiter & Schmidhuber,1997)</td><td>600 900-900 900-900-900</td><td></td><td>2.16M 10.80M 17.68M</td><td></td><td>2.16M 10.80M 17.68M</td></tr><tr><td>GBN-RNN</td><td>600 600-512 600-512-256</td><td>100 100-80 100-80-50</td><td>3.40M 6.50M 7.20M</td><td>0.02M 0.04M 0.05M</td><td>3.42M 6.54M 7.25M</td></tr><tr><td>rGBN-RNN</td><td>600 600-512 600-512-256</td><td>100 100-80 100-80-50</td><td>3.40M 6.50M 7.20M</td><td>0.03M 0.06M 0.07M</td><td>3.43M 6.56M 7.27M</td></tr></table>
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure 6: Topics and their temporal trajectories inferred by a three-hidden-layer rGBN-RNN from the IMDB dataset, and the generated sentences under topic guidance (best viewed in color). Top words of each topic are shown in orange, yellow and blue box, and each sentence is shown in a dotted line box labeled with the corresponding topic index. Sentences generated with a combination of topics in different layers are at the bottom of the figure.
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
Figure 7: Topics and their temporal trajectories inferred by a three-hidden-layer rGBN-RNN from the BNC dataset, and the generated sentences under topic guidance (best viewed in color). Top words of each topic are shown in orange, yellow and blue box, and each sentence is shown in a dotted line box labeled with the corresponding topic index. Sentences generated with a combination of topics in different layers are at the bottom of the figure.
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
Figure 8: BLEU scores of different methods for IMDB. $\mathbf { X }$ -axis denotes test-BLEU, and y-axis self-BLEU. Left panel is BLEU-3 and right is BLEU-4, and a better BLEU score would fall within the lower right corner, where black point represents mean value and circles with different colors denote the elliptical surface of probability of BLEU in a two-dimensional space.
|
| 372 |
+
|
| 373 |
+
# H BLEU SCORES FOR APNEWS
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 9: BLEU scores of different methods for APNEWS. $\mathbf { X }$ -axis denotes test-BLEU, and y-axis self-BLEU. Left panel is BLEU-3 and right is BLEU-4, and a better BLEU score would fall within the lower right corner, where black point represents mean value and circles with different colors denote the elliptical surface of probability of BLEU in a two-dimensional space.
|
md/train/Byx93sC9tm/Byx93sC9tm.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP ENSEMBLE BAYESIAN ACTIVE LEARNING : ADRESSING THE MODE COLLAPSE ISSUE IN MONTE CARLO DROPOUT VIA ENSEMBLES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In image classification tasks, the ability of deep convolutional neural networks (CNNs) to deal with complex image data has proved to be unrivalled. Deep CNNs, however, require large amounts of labeled training data to reach their full potential. In specialized domains such as healthcare, labeled data can be difficult and expensive to obtain. One way to alleviate this problem is to rely on active learning, a learning technique that aims to reduce the amount of labelled data needed for a specific task while still delivering satisfactory performance. We propose a new active learning strategy designed for deep neural networks. This method improves upon the current state-of-the-art deep Bayesian active learning method, which suffers from the mode collapse problem. We correct for this deficiency by making use of the expressive power and statistical properties of model ensembles. Our proposed method manages to capture superior data uncertainty, which translates into improved classification performance. We demonstrate empirically that our ensemble method yields faster convergence of CNNs trained on the MNIST and CIFAR-10 datasets.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The success of deep learning in the last decade has been attributed to more computational power, better algorithms and larger datasets. In object classification tasks, CNNs widely outperform alternative methods in benchmark datasets (LeCun et al., 2015) and have been used in medical imaging for critical situations such as skin cancer detection (Haenssle et al., 2018), retinal disease detection (De Fauw et al., 2018) or even brain tumour survival prediction (Lao et al., 2017).
|
| 12 |
+
|
| 13 |
+
Although their performance is unrivalled, their success strongly depends on huge amounts of annotated data (Bengio et al., 2007; Krizhevsky et al., 2012). In specialized domains such as medicine or chemistry, expert labelled data is costly and time consuming to acquire (Hoi et al., 2006; Smith et al., 2018). Active Learning (AL) provides a theoretically sound framework (Cohn et al., 1996) that reduces the amount of labelled data needed for a specific task. Developed as an iterative process, AL progressively adds unlabelled data points to the training set using an acquisition function, ranking them in order of importance to maximize performance.
|
| 14 |
+
|
| 15 |
+
Using Active Learning within a Deep Learning framework (DAL) has recently seen successful applications in text classification (Zhang et al., 2017; Shen et al., 2017), visual question answering (Lin & Parikh, 2017) and image classification with CNNs (Gal et al., 2017; Sener & Savarese, 2017; Beluch et al., 2018). One key difference between DAL and classical AL is the sampling in batches, which is needed to keep computational costs low. As such, developing scalable DAL methods for CNNs presents challenging problems. Firstly, acquisitions functions do not scale well for high dimensional data or parameter spaces, due to the cost of estimating uncertainty measures, which is the main approach. Secondly, even with scalability not being an issue, one needs to obtain good uncertainty estimates in order to avoid having overconfident predictions. One of the most promising techniques is Deep Bayesian Active Learning (DBAL) (Gal, 2016; Gal & Ghahramani, 2016), which uses Monte-Carlo dropout (MC-dropout) as a Bayesian framework to obtain uncertainty estimates. However, as mentioned in Ducoffe & Precioso (2018), uncertainty-based methods can be fooled by adversarial examples, where small perturbations in inputs can result in overconfident and surprising outputs. Another approach presented by Beluch et al. (2018) uses ensemble models to obtain better uncertainty estimates than DBAL methods, although there are no result on how it deals with adversarial perturbations. Whereas uncertainty-based methods aim to pick data points the model is most uncertain about, density-based approaches try to identify the samples that are most representative of the entire unlabelled set, albeit at a computational cost (Sener & Savarese, 2017). Hybrid methods aim to trade uncertainty for representativeness. Our belief is that overconfident predictions for DBAL methods are an outcome of the mode collapse phenomenon in variational inference methods (Srivastava et al., 2017), and that by combining the expressive power of ensemble methods with MC-dropout we can obtain ”better” uncertainties without trading representativeness.
|
| 16 |
+
|
| 17 |
+
In this paper we provide evidence for the mode collapse phenomenon in the form of a highly imbalanced training set acquired during AL with MC-dropout, and show that ’preferential’ behaviour is not beneficial for the AL process. Furthermore, we link the mode collapse phenomenon to overconfident classifications. We compare the use of ensemble models to MC-Dropout for uncertainty estimation and give intuitive reasons why combining the two might perform better. We present Deep Ensemble Bayesian Active Learning (DEBAL) which confirms our intuition for experiments on MNIST and CIFAR-10.
|
| 18 |
+
|
| 19 |
+
In Section 2 we give an overview of current popular methods for DAL. In Section 3, various acquisition functions are introduced and the mode collapse issue is empirically identified. Further on, the use of model ensembles is motivated before presenting our method DEBAL. The last part of section 3 is devoted to understanding the cause of the observed improvements in performance.
|
| 20 |
+
|
| 21 |
+
# 2 BACKGROUND
|
| 22 |
+
|
| 23 |
+
The area of active learning has been studied extensively before (see Settles (2012) for a comprehensive review), but with the emergence of deep learning, it has seen widespread interest. As proved by Dasgupta (2005) there is no good universal AL strategy, researchers instead relying on heuristics tailored for their particular tasks.
|
| 24 |
+
|
| 25 |
+
Uncertainty-based Methods. We identify uncertainty-based methods as being the main ones used by the image classification community. Deep Bayesian Active Learning (Gal et al., 2017) models a Gaussian prior over the CNNs weights and uses variational inference techniques to obtain a posterior distribution over the network’s predictions, using these samples as a measure of uncertainty and as input to the acquisition function of the AL process. In practice, posterior samples are obtained using Monte-Carlo dropout (MC-dropout)(Srivastava et al., 2014), a computationally inexpensive and powerful stochastic regularization technique that performs well on real-world datasets (Leibig et al., 2017; Kendall et al., 2015) and has been shown to be equivalent to performing variational inference (Gal & Ghahramani, 2016). However, these approximating methods suffer from mode collapse, as evidenced in Blei et al. (2017). Another method, Cost-Effective Active Learning (CEAL) (Wang et al., 2016), uses the entropy of the network’s outputs to quantify uncertainty, with additional pseudo-labelling. This can be seen as the deterministic counterpart of DBAL, that adds highly confident samples directly from predictions, without the query process. Kading et al. (2016) ¨ propose a method on the expected model output change principle. This method approximates the expected reduction in the model’s error to avoid selecting redundant queries, albeit at a computational cost. Lastly, as this work was being developed, we found the work of Beluch et al. (2018), who propose to use deterministic ensemble models to obtain uncertainty approximations. Their method scores high both in terms of performance and robustness.
|
| 26 |
+
|
| 27 |
+
Density-based Methods & Hybrid Methods. Sener & Savarese (2017) looked at the data selection process from a set theory approach (core set) and showed their heuristic-free method outperforms existing uncertainty-based ones. Their acquisition function uses the geometry in the data-space to select the most informative samples. The main idea is to try to find a diverse subset of the entire input data space that best represents it. Although achieving promising results, the core set approach is computationally expensive as it requires solving a mixed integer programming optimisation problem. Ducoffe & Precioso (2018), on the other hand, rely on adversarial perturbation to select unlabeled samples. Their approach can be seen as margin based active learning, whereby distances to decision boundaries are approximated by distances to adversarial examples. To the best of our knowledge, the only hybrid method (combining measures of both uncertainty and representativeness) tested within a CNN-based DAL framework is the one proposed in Wang & Ye (2015).
|
| 28 |
+
|
| 29 |
+
Although originally not tested on CNNs, this method was shown to perform worse than the core set approach in Sener & Savarese (2017).
|
| 30 |
+
|
| 31 |
+
Deep Bayesian Active Learning. Given the set of inputs $\mathbb { X } = \{ \pmb { x } _ { 1 } , . . , \pmb { x } _ { n } \}$ and outputs $\mathbb { Y } =$ $\{ y _ { 1 } , . . , y _ { n } \}$ belonging to classes $c$ , one can define a probabilistic neural network by defining a model $f ( \pmb { x } ; \pmb { \theta } )$ with a prior $p ( \pmb \theta )$ over the parameter space $\pmb \theta$ , usually Gaussian, and a likelihood $p ( y =$ $c | \boldsymbol { x } , \boldsymbol { \theta } )$ which is usually given by softmax $\left( f ( \pmb { x } ; \pmb { \theta } ) \right)$ . The goal is to obtain the posterior distribution over $\pmb \theta$ :
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
p ( \pmb \theta | \mathbb { X } , \mathbb { Y } ) = \frac { p ( \mathbb { Y } | \mathbb { X } , \pmb \theta ) p ( \pmb \theta ) } { p ( \mathbb { Y } | \mathbb { X } ) }
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
One can make predictions $y ^ { * }$ about new data points $\pmb { x } ^ { * }$ by taking a weighted average of the forecasts obtained using all possible values of the parameters $\pmb \theta$ , weighted by the posterior probability of each parameter:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
p ( y ^ { * } | \mathbf { x } ^ { * } , \mathbb { X } , \mathbb { Y } ) = \int p ( y ^ { * } | x , \pmb { \theta } ) p ( \pmb { \theta } | \mathbb { X } , \mathbb { Y } ) d \pmb { \theta } = \mathbb { E } _ { \pmb { \theta } \sim p ( \pmb { \theta } | \mathbb { X } , \mathbb { Y } ) } [ f ( \mathbf { x } ; \pmb { \theta } ) ]
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
The real difficulty arises when trying to compute these expectations, as has been previously covered in the literature (Neal, 2012; Hinton & Van Camp, 1993; Barber & Bishop, 1998; Lawrence, 2001). One way to circumvent this issue is to use Monte Carlo (MC) techniques (Hoffman et al., 2013; Paisley et al., 2012; Kingma & Welling, 2013), which approximate the exact expectations using averages over finite independent samples from the posterior predictive distribution (Robert & Casella, 2013). The MC-Dropout technique (Srivastava et al., 2014) will replace $p ( \pmb { \theta } | \mathbb { X } , \mathbb { Y } )$ with the dropout distribution $\hat { q } ( \pmb \theta )$ . This method scales well to high dimensional data, it is highly flexible to accommodate complex models and it is extremely applicable to existing neural network architectures, as well as easy to use.
|
| 44 |
+
|
| 45 |
+
In DBAL (Gal, 2016), the authors incorporate Bayesian uncertainty via MC-dropout and use acquisition functions that originate from information theory to try and capture two types of uncertainty: epistemic and aleatoric (Smith & Gal, 2018; Depeweg et al., 2017). Epistemic uncertainty is a consequence of insufficient learning of model parameters due to lack of data, leading to broad posteriors. On the other hand, aleatoric uncertainty arises due to the genuine stochasticity in the data (noise) and always leads to predictions with high uncertainty. We briefly describe the three main types of acquisition functions:
|
| 46 |
+
|
| 47 |
+
• MaxEntropy (Shannon, 2001). The higher the entropy of the predictive distribution, the more uncertain the model is:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
H [ y | \mathbf { x } , \pmb { \theta } ] = - \sum _ { c } p ( y = c | \pmb { x } , \pmb { \theta } ) \mathrm { l o g } p ( y = c | \pmb { x } , \pmb { \theta } )
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
• Bayesian Active Learning by Disagreement $( B A L D )$ ) (Houlsby et al., 2011). Based on the mutual information between the input data and posterior, and quantifies the information gain about the model parameters if the correct label would be provided.
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
I ( y , \pmb \theta | \pmb x , \pmb \theta ) = H [ y | \pmb x ; \mathbb { X } , \mathbb { Y } ] - \mathbb { E } _ { \pmb \theta \sim p ( \pmb \theta | \mathbb { X } , \mathbb { Y } ) } \Big [ H [ \pmb y | \pmb x , \pmb \theta ] \Big ]
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
• Variation Ratio (Freeman, 1965). Measures the statistical dispersion of a categorical variable, with larger values indicating higher uncertainty:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathrm { V a r R a t i o } ( { \pmb x } ) = 1 - \operatorname* { m a x } _ { \pmb y } p ( { \pmb y } | { \pmb x } , { \pmb \theta } )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
As seen in Gal (2016), for the above deterministic acquisition functions we can write the stochastic versions using the Bayesian MC-Dropout framework, where the class conditional probability $p ( y | \mathbf { \boldsymbol { x } } , \mathbf { \boldsymbol { \theta } } )$ can be approximated by the average over the MC-Dropout forward passes. The stochastic predictive entropy becomes:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
H [ y | x , \theta ] = - \sum _ { c } { \Big ( } { \frac { 1 } { K } } \sum _ { k } p ( y = c | { \pmb x } , \theta _ { k } ) { \Big ) } \mathrm { l o g } { \Big ( } { \frac { 1 } { K } } \sum _ { k } p ( y = c | { \pmb x } , \theta _ { k } ) { \Big ) }
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
K corresponds to the total number of MC-Dropout forward passes at test time. Equivalent stochastic versions can be obtained for all other acquisition functions.
|
| 72 |
+
|
| 73 |
+
Table 1: Experiment settings for MNIST and CIFAR-10
|
| 74 |
+
|
| 75 |
+
<table><tr><td>Dataset</td><td>Model</td><td>Training epochs</td><td>Data size pool/val/test</td><td>Acquisition size</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>MNIST</td><td>2-Conv</td><td>500</td><td>59,780 /200 /10.000</td><td>20 +10—>1,000</td></tr><tr><td>CIFAR-10</td><td>4-Conv</td><td>500</td><td>47,800/2000/10.000</td><td>200 +100—>10,000</td></tr></table>
|
| 76 |
+
|
| 77 |
+
# 3 DEBAL: DEEP ENSEMBLE BAYESIAN ACTIVE LEARNING
|
| 78 |
+
|
| 79 |
+
# 3.1 EXPERIMENTAL DETAILS
|
| 80 |
+
|
| 81 |
+
We consider the multiclass image classification task on two well-studied datasets: MNIST (LeCun, 1998) and CIFAR-10 (Krizhevsky & Hinton, 2009). Table 1 contains a summary of the results, with the acquisition size containing the initial training set with the batch size for one iteration up to the maximum number of points acquired. At each acquisition step, a fixed sample set from the unlabelled pool is added to the initial balanced labelled data set and models are re-trained from the entire training set. We evaluate the model on the dataset’s standard test set. The CNN model architecture is the same as in the Keras CNN implementation for MNIST and CIFAR-10 (Chollet et al., 2015). We use Glorot initialization for weights, Adam optimizer and early stopping with patience of 15 epochs, for a maximum of 500 epochs. We select the best performing model during the patience duration. We use MC-Dropout with $K = 1 0 0$ forward passes for the stochastic acquisition functions. In all experiments results are averaged over three repetitions. For the ensemble models discussed later, each ensemble consists of $M = 3$ networks of identical architecture but different random initializations.
|
| 82 |
+
|
| 83 |
+
# 3.2 EVIDENCE OF MODE COLLAPSE IN DBAL
|
| 84 |
+
|
| 85 |
+
Our experimental results confirmed the performance of Gal (2016) using MC-dropout. However, we observe a lack of diversity in the data acquired during the AL process. This effect is more extreme in the initial phase, which is an important factor when dealing with a small dataset classification problem (see Figure 1).
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 1: MNIST histograms of true labels in the training set. Top: End of AL process. Total number of images in training set: 1,000. Bottom: After first 8 acquisition iterations. Total number of images in training set: 100.
|
| 89 |
+
|
| 90 |
+
One can argue that the preferential behaviour observed is a desirable one and is arising from the fact that images belonging to some specific classes are more uncertain and difficult to classify, due to resemblance of data from other classes. To debunk this hypothesis, we trained a model with the same architecture on the entire 60,000 sample training set available and used this model to rank the uncertainty for each sample from the 10,000 samples test set. As can be seen in Appendix Figure 7, over-represented class labels during the AL experiment do not have high uncertainty. To assess positive effects of over-sampling, we evaluated how easy models at the end of AL process classified them and observed no such effect (Appendix Figure 8).
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 2: MNIST uncertainty visualization in VAE space at the end of the AL process for all measures. Colours represent different classes. Low uncertainty: black, High uncertainty: white.
|
| 94 |
+
|
| 95 |
+
Smith & Gal (2018) argue that the MC-Dropout technique suffers from over-confident predictions. They are particularly concerned with the interpolation behaviour of the uncertainty methods across unknown regions (regions of the input space not seen during the model training phase). We performed a similar analysis in order to gain understanding into how these methods behave. Following their experimental setting, we use a VAE (Kingma & Welling, 2013) to project the MNIST dataset into a 2-dimensional latent space. Figure 2 allows us to visualize the encodings and decode points from latent space to image space, together with their associated measures of uncertainty. The large black regions behind the data suggest that the model is unrealistically over-confident about data that does not resemble anything seen during training, thus providing further evidence supporting MC-Dropouts main deficiency: mode-collapse.
|
| 96 |
+
|
| 97 |
+
# .3 DEEP ENSEMBLES: A RECIPE FOR USEFUL UNCERTAINTY ESTIMATIO
|
| 98 |
+
|
| 99 |
+
We hypothesize that one of DBALs main deficiencies is its inability to capture the full posterior distribution of the data (mode collapse). This can prevent the model from learning in an optimal way, leading to unsatisfactory performance when classifying previously unseen images. As suggested in Smith & Gal (2018) and Lakshminarayanan et al. (2017), one intuitive fix would be to replace the single MC-Dropout model in the AL process with an ensemble of MC-Dropout models, with each member of the ensemble using a different initialization. Since one MC-Dropout model collapses around a subspace (one, or a few local modes) of the posterior distribution, a collection of such models, starting from different initial configurations, will end up covering different (and somehow overlapping) sub-regions of the probability density space. However, one key assumption here, is that each model member of the ensemble will end up capturing the behaviour around a different local mode. Beluch et al. (2018) test this idea in a deterministic setting, where the uncertainty resulting from the use of a deterministic ensemble proved to be more useful for the active learner than the uncertainty provided from a single MC-Dropout network.
|
| 100 |
+
|
| 101 |
+
We propose DEBAL, a stochastic ensemble of $M$ MC-Dropout models, with $M \ < < \ K$ . Each member of the ensemble is characterized by a different set of weights $\pmb { \theta } _ { m }$ . We use the randomizationbased approach to ensembles (Breiman, 1996), where each member of the ensemble is trained in parallel without any interaction with the other members of the ensemble. We consider the ensemble as a mixture model where each member of the ensemble is uniformly weighted at prediction time. For our task, this corresponds to averaging the predictions as follows:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
p ( y | \mathbf { x } ; \mathbb { X } , \mathbb { Y } ) = \frac { 1 } { M } \sum _ { m } p ( y | \pmb { x } , \pmb { \theta } _ { m } )
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Input: $\mathcal { L }$ - initial labeled training set, $\mathcal { U }$ - initial unlabeled training set, $\mathcal { H }$ - initial set of hyperparameters to train the network, acq. $f n$ . - acquisition function, $n _ { q u e r y }$ - query batch size, $N$ - final training set size, $K$ - number of forward passes in MC-Dropout, $M$ - number of models in the ensemble Initialize: $\mathrm { i } { = } 0 , \mathscr { L } \gets \mathscr { L } _ { 0 } , \mathscr { U } \gets \mathscr { U } _ { 0 }$ while $i < N$ do Train the ensemble members $A _ { m , i } ( m \in M )$ given the current labeled training set $A _ { m , i } = t r a i n i n g ( \mathcal { H } , \mathcal { L } _ { i } )$ Form ensemble model $E _ { i } = { \mathrm { e n s e m b l e } } ( A _ { 1 } , \mathbf { A } _ { 2 } , . . . , \mathbf { A } _ { M } )$ for $x _ { j } \in \mathcal { U }$ do Compute uncertainty using the ensemble and MC-Dropout $r _ { j } \gets a c q . f n . ( x _ { j } , E _ { i } ; K )$ end for Query the labels of the $n _ { q u e r y } ^ { \mathrm { t h } }$ samples $\mathcal { Q } _ { j }$ with the largest uncertainty values $\begin{array} { r l } & { i n d e x _ { j } a r g s o r t ( r _ { j } ; n _ { q u e r y } ) } \\ & { \mathcal { Q } _ { j } \{ x _ { z } | z \in i n d e x _ { j } [ 0 : n _ { q u e r y } ] \} } \\ & { \mathcal { L } _ { i + 1 } \mathcal { L } _ { i } \cup \mathcal { Q } _ { j } } \\ & { \mathcal { U } _ { i + \frac { 1 } { 4 } } \mathcal { U } _ { i } \setminus \mathcal { Q } _ { j } } \end{array}$ end while
|
| 108 |
+
|
| 109 |
+
Equation 7 corresponds to the deterministic ensemble case. Our predictions are further averaged by a number of MC-Dropout forward passes, giving rise to what we call a stochastic ensemble:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
p ( y | \mathbf { x } ; \mathbb { X } , \mathbb { Y } ) = \frac { 1 } { M } \frac { 1 } { K } \sum _ { m } \sum _ { k } p ( y | \mathbf { x } , \pmb { \theta } _ { m , k } )
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
$\theta _ { m , k }$ denotes the model parameters for ensemble model member $m$ in the $k$ MC-Dropout forward pass. Each of the two equations can then be used with acquisitions functions previously described. In the deterministic ensemble case, we just replace the number of forward passes $k$ with the number of ensemble classifiers $m$ to obtain expressions for uncertainty. The predictive entropy for our stochastic ensemble becomes:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathrm { H } [ y | x ; \mathbb { X } , \mathbb { Y } ] = - \sum _ { c } { \Big ( } { \frac { 1 } { M } } { \frac { 1 } { K } } \sum _ { m } \sum _ { k } p ( y = c | \mathbf { x } , \theta _ { m , k } ) { \Big ) } \mathrm { l o g } { \Big ( } { \frac { 1 } { M } } { \frac { 1 } { K } } \sum _ { m } \sum _ { k } p ( y | \mathbf { x } , \theta _ { m , k } ) { \Big ) }
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
For both datasets, DEBAL shows significant improvements in classification accuracy (Figure 3 - similar results obtained for all other acquisition functions but for sake of clarity we illustrate results for BALD only). The better performance of the deterministic ensemble method over the single MCDropout one is in agreement with similar results presented in Beluch et al. (2018), and is attributed to better uncertainty estimates obtained from the ensemble. We hypothesize that the additional improvement is a result of better uncertainty estimates from the stochastic ensemble.
|
| 122 |
+
|
| 123 |
+
To validate our claims, we compare the uncertainty behaviour between single network MC-dropout and DEBAL, as can be seen qualitatively in Appendix Figure 10 by the elimination of ”black holes” in the latent space of DEBAL. Secondly, we observe how the methods behave on both seen and unseen distributions, using the NotMNIST dataset of letters A-J from different fonts (Bulatov, 2011). BALD uncertainty results for this approach are evidenced in Figure 4. We sample 2,000 balanced and random images from the MNIST test set and, similarly, 2,000 images from the NotMNIST test set. For MNIST, we make sure that the randomly selected images did not end up being acquired during AL. This corresponds to data unseen during training but originating from the same distribution source. For the known distribution, both methods produce low uncertainty for the majority of the test samples, as expected. However, for the single MC-Dropout network the distribution is characterized by fatter tails (both extremely confident and extremely uncertain about a significant number of images). The ensemble method, however, results in a more clustered distribution of the uncertainty. This further illustrates that ensemble learns a more representative part of the input space.
|
| 124 |
+
|
| 125 |
+
On the unseen distribution (Figure 4), the broad uniform distribution of uncertainty from the single network illustrates the presence of images about which the classifier is both extremely certain and uncertain. This implies that the network learned some specific transferable features that are recognizable in part of the new dataset. For the ensemble, on the other hand, the uncertainty is much smaller and more centered on a few values. This implies that the features learned during the initial training on MNIST are more general. This behaviour is a more realistic one to expect when evaluating a similar but new dataset. Apart from correcting for the mode-collapse phenomena, the MC-Dropout ensemble also does a better job in identifying and acquiring images from the pool set that are inherently more difficult to assign to a particular class (Appendix Figure 11).
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: Test accuracy as a function of size of the incremental training set during AL. Effect of using an ensemble of three similar models (stochastic or deterministic) instead of one single MCDropout network. Left: MNIST. Right: CIFAR-10
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 4: Histogram of BALD uncertainty of MNIST (left) and NotMNIST (right) images (2,000 random but balanced test set). Uncertainty obtained from single MC-Dropout and ensemble MCDropout methods at the end of the AL process.
|
| 132 |
+
|
| 133 |
+
# 3.4 DETERMINISTIC VS STOCHASTIC ENSEMBLE
|
| 134 |
+
|
| 135 |
+
In order to explain the additional improvement in DEBAL, we performed an analysis on both seen (MNIST) and unseen (NotMNIST) distributions similar to the one presented before. Figure 5 compares the histograms of BALD uncertainty obtained from the two methods using the ensemble models obtained at the end of the AL process. Additionally, we show the accuracy of the models corresponding to each binned subset of the test data. When the images are coming from a known distribution (MNIST), for both methods the accuracy decreases as the level of uncertainty increases. This observation suggests that the ambiguity captured by these methods is meaningful. However, the stochastic ensemble is more confident. Judging by the accuracy along the bins, this additional confidence seems to reflect meaningful uncertainty.
|
| 136 |
+
|
| 137 |
+
By observing the uncertainty behaviour on the unseen distribution (Figure 5, right), the stochastic ensemble is more confident overall than its deterministic counterpart, but at the same time, its uncertainty is more meaningful, as evidenced by the reduction in classification accuracy as we move towards the uncertain (right) tail of the distribution. On the other hand, the classification accuracy of the deterministic ensemble is more uniform, with both tails of the distributions (most and least certain) seeing similar levels of accuracy. This suggests that the uncertainty produced by the deterministic ensemble is less correlated with the level of its uncertainty and hence less meaningful.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 5: Histogram of BALD uncertainty of MNIST (left) and NotMNIST (right) images (2,000 random but balanced test set). Uncertainty obtained from deterministic and MC-Dropout ensemble methods at the end of the AL process. Numbers correspond to accuracy for corresponding binned subset of test data (in percentage).
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 6: Left MNIST uncertainty calibration. Expected fraction and observed fraction. Ideal output is the dashed black line. MSE reported in paranthesis. Calibration averaged over 3 different runs.
|
| 144 |
+
|
| 145 |
+
Uncertainty calibration. We used the ensemble models obtained at the end of the AL experiments to evaluate the entire MNIST test set. We looked whether the expected fraction of correct classifications matches the observed proportion. The expected proportion of correct classifications is derived from the models confidence. When plotting expected against observed fraction, a well-calibrated model should lie very close to the diagonal. Figure 6(left) shows that the stochastic ensemble method leads to a better calibrated uncertainty. An additional measure for uncertainty calibration (quality) is the Brier score (Brier, 1950), where a smaller value corresponds to better calibrated predictions. We find that the stochastic ensemble has a better quality of uncertainty (Brier score: 0.0244) compared to the deterministic one (Brier score: 0.0297). Finally, we investigated the effect of training the deterministic ensemble with data acquired by the stochastic one. Figure 6 (right) shows that incorporating stochasticity in the ensemble via MC-Dropout leads to an overall increase in performance, further reinforcing our hypothesis.
|
| 146 |
+
|
| 147 |
+
# 4 CONCLUSION AND FUTURE WORK
|
| 148 |
+
|
| 149 |
+
In this work, we focused on the use of active learning in a deep learning framework for the image classification task. We showed empirically how the mode collapse phenomenon is having a negative impact on the current state-of-the-art Bayesian active learning method. We improved upon this method by leveraging off the expressive power and statistical properties of model ensembles. We linked the performance improvement to a better representation of data uncertainty resulting from our method. For future work, this superior uncertainty representation could be used to address one of the major issues of deep networks in safety-critical applications: adversarial examples.
|
| 150 |
+
|
| 151 |
+
# REFERENCES
|
| 152 |
+
|
| 153 |
+
David Barber and Christopher M Bishop. Ensemble learning in bayesian neural networks. NATO ASI SERIES F COMPUTER AND SYSTEMS SCIENCES, 168:215–238, 1998.
|
| 154 |
+
|
| 155 |
+
William H Beluch, Tim Genewein, Andreas Nurnberger, and Jan M K ¨ ohler. The power of ensembles ¨ for active learning in image classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9368–9377, 2018.
|
| 156 |
+
|
| 157 |
+
Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In Advances in neural information processing systems, pp. 153–160, 2007.
|
| 158 |
+
|
| 159 |
+
David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877, 2017.
|
| 160 |
+
|
| 161 |
+
Leo Breiman. Bagging predictors. Machine learning, 24(2):123–140, 1996.
|
| 162 |
+
|
| 163 |
+
Glenn W Brier. Verification of forecasts expressed in terms of probability. Monthey Weather Review, 78(1):1–3, 1950.
|
| 164 |
+
|
| 165 |
+
Yaroslav Bulatov. Notmnist. 2011. http://yaroslavvb.blogspot.com/2011/09/ notmnist-dataset.html.
|
| 166 |
+
|
| 167 |
+
Franc¸ois Chollet et al. Keras. https://keras.io, 2015.
|
| 168 |
+
|
| 169 |
+
David A Cohn, Zoubin Ghahramani, and Michael I Jordan. Active learning with statistical models. Journal of artificial intelligence research, 4:129–145, 1996.
|
| 170 |
+
|
| 171 |
+
Sanjoy Dasgupta. Analysis of a greedy active learning strategy. In Advances in neural information processing systems, pp. 337–344, 2005.
|
| 172 |
+
|
| 173 |
+
Jeffrey De Fauw, Joseph R Ledsam, Bernardino Romera-Paredes, Stanislav Nikolov, Nenad Tomasev, Sam Blackwell, Harry Askham, Xavier Glorot, Brendan ODonoghue, Daniel Visentin, et al. Clinically applicable deep learning for diagnosis and referral in retinal disease. Nature medicine, 24(9):1342, 2018.
|
| 174 |
+
|
| 175 |
+
Stefan Depeweg, Jose Miguel Hern ´ andez-Lobato, Finale Doshi-Velez, and Steffen Udluft. Un- ´ certainty decomposition in bayesian neural networks with latent variables. arXiv preprint arXiv:1706.08495, 2017.
|
| 176 |
+
|
| 177 |
+
Melanie Ducoffe and Frederic Precioso. Adversarial active learning for deep networks: a margin based approach. arXiv preprint arXiv:1802.09841, 2018.
|
| 178 |
+
|
| 179 |
+
Linton C Freeman. Elementary applied statistics: for students in behavioral science. John Wiley & Sons, 1965.
|
| 180 |
+
|
| 181 |
+
Yarin Gal. Uncertainty in deep learning. University of Cambridge, 2016.
|
| 182 |
+
|
| 183 |
+
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pp. 1050–1059, 2016.
|
| 184 |
+
|
| 185 |
+
Yarin Gal, Riashat Islam, and Zoubin Ghahramani. Deep bayesian active learning with image data. arXiv preprint arXiv:1703.02910, 2017.
|
| 186 |
+
|
| 187 |
+
HA Haenssle, C Fink, R Schneiderbauer, F Toberer, T Buhl, A Blum, A Kalloo, A Hassen, L Thomas, A Enk, et al. Man against machine: diagnostic performance of a deep learning convolutional neural network for dermoscopic melanoma recognition in comparison to 58 dermatologists. Annals of Oncology, 2018.
|
| 188 |
+
|
| 189 |
+
Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the sixth annual conference on Computational learning theory, pp. 5–13. ACM, 1993.
|
| 190 |
+
|
| 191 |
+
Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013.
|
| 192 |
+
|
| 193 |
+
Steven CH Hoi, Rong Jin, Jianke Zhu, and Michael R Lyu. Batch mode active learning and its application to medical image classification. In Proceedings of the 23rd international conference on Machine learning, pp. 417–424. ACM, 2006.
|
| 194 |
+
|
| 195 |
+
Neil Houlsby, Ferenc Huszar, Zoubin Ghahramani, and M ´ at´ e Lengyel. Bayesian active learning for ´ classification and preference learning. arXiv preprint arXiv:1112.5745, 2011.
|
| 196 |
+
|
| 197 |
+
Christoph Kading, Erik Rodner, Alexander Freytag, and Joachim Denzler. Active and continu- ¨ ous exploration with deep neural networks and expected model output changes. arXiv preprint arXiv:1612.06129, 2016.
|
| 198 |
+
|
| 199 |
+
Alex Kendall, Vijay Badrinarayanan, and Roberto Cipolla. Bayesian segnet: Model uncertainty in deep convolutional encoder-decoder architectures for scene understanding. arXiv preprint arXiv:1511.02680, 2015.
|
| 200 |
+
|
| 201 |
+
Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 202 |
+
|
| 203 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 204 |
+
|
| 205 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 206 |
+
|
| 207 |
+
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, pp. 6402–6413, 2017.
|
| 208 |
+
|
| 209 |
+
Jiangwei Lao, Yinsheng Chen, Zhi-Cheng Li, Qihua Li, Ji Zhang, Jing Liu, and Guangtao Zhai. A deep learning-based radiomics model for prediction of survival in glioblastoma multiforme. Scientific reports, 7(1):10353, 2017.
|
| 210 |
+
|
| 211 |
+
Neil David Lawrence. Variational inference in probabilistic models. PhD thesis, University of Cambridge, 2001.
|
| 212 |
+
|
| 213 |
+
Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
|
| 214 |
+
|
| 215 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 216 |
+
|
| 217 |
+
Christian Leibig, Vaneeda Allken, Murat Sec¸kin Ayhan, Philipp Berens, and Siegfried Wahl. Leveraging uncertainty information from deep neural networks for disease detection. Scientific reports, 7(1):17816, 2017.
|
| 218 |
+
|
| 219 |
+
Xiao Lin and Devi Parikh. Active learning for visual question answering: An empirical study. arXiv preprint arXiv:1711.01732, 2017.
|
| 220 |
+
|
| 221 |
+
Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
|
| 222 |
+
|
| 223 |
+
John Paisley, David Blei, and Michael Jordan. Variational bayesian inference with stochastic search. arXiv preprint arXiv:1206.6430, 2012.
|
| 224 |
+
|
| 225 |
+
Christian Robert and George Casella. Monte Carlo statistical methods. Springer Science & Business Media, 2013.
|
| 226 |
+
|
| 227 |
+
Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: Acore-set approach. stat, 1050:27, 2017.
|
| 228 |
+
|
| 229 |
+
Burr Settles. Active learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 6 (1):1–114, 2012.
|
| 230 |
+
|
| 231 |
+
Claude Elwood Shannon. A mathematical theory of communication. ACM SIGMOBILE mobile computing and communications review, 5(1):3–55, 2001.
|
| 232 |
+
|
| 233 |
+
Yanyao Shen, Hyokun Yun, Zachary C Lipton, Yakov Kronrod, and Animashree Anandkumar. Deep active learning for named entity recognition. arXiv preprint arXiv:1707.05928, 2017.
|
| 234 |
+
|
| 235 |
+
Justin S Smith, Ben Nebgen, Nicholas Lubbers, Olexandr Isayev, and Adrian E Roitberg. Less is more: Sampling chemical space with active learning. The Journal of Chemical Physics, 148(24): 241733, 2018.
|
| 236 |
+
|
| 237 |
+
Lewis Smith and Yarin Gal. Understanding measures of uncertainty for adversarial example detection. arXiv preprint arXiv:1803.08533, 2018.
|
| 238 |
+
|
| 239 |
+
Akash Srivastava, Lazar Valkoz, Chris Russell, Michael U Gutmann, and Charles Sutton. Veegan: Reducing mode collapse in gans using implicit variational learning. In Advances in Neural Information Processing Systems, pp. 3308–3318, 2017.
|
| 240 |
+
|
| 241 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958, 2014.
|
| 242 |
+
|
| 243 |
+
Keze Wang, Dongyu Zhang, Ya Li, Ruimao Zhang, and Liang Lin. Cost-effective active learning for deep image classification. IEEE Transactions on Circuits and Systems for Video Technology, 2016.
|
| 244 |
+
|
| 245 |
+
Zheng Wang and Jieping Ye. Querying discriminative and representative samples for batch mode active learning. ACM Transactions on Knowledge Discovery from Data (TKDD), 9(3):17, 2015.
|
| 246 |
+
|
| 247 |
+
Ye Zhang, Matthew Lease, and Byron C Wallace. Active discriminative text representation learning. In AAAI, pp. 3386–3392, 2017.
|
| 248 |
+
|
| 249 |
+
# Appendices
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
Figure 7: MNIST histograms of the top 1,000 most uncertain samples from test set as ranked by the LeNet model trained on the entire training set.
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 8: MNIST confusion matrix for the models at the end of the AL process. Test set: 10,000. Additionally, the fully trained model (top left) is shown as baseline.
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 9: MNIST histogram of true labels in the training set after 8 acquisition iterations. Total number of images in training set: 100 Top: Single MC-Dropout network. Bottom: Ensemble of three networks of similar architecture but different random initialization.
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 10: Uncertainty visualization in latent space. MNIST dataset removed for a clearer visualization of the uncertainty. Uncertainty is in white (a lighter background corresponds to higher uncertainty while a darker one represents regions of lower uncertainty) Top: Uncertainty obtained at the end of the AL process using an ensemble of three similar networks. Bottom: Uncertainty obtained at the end of the AL process using a single network.
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 11: tSNE embeddings of the MNIST dataset. Effect of using an ensemble of three similar models (stochastic or deterministic) instead of one single MC-Dropout network. Orange points correspond to images acquired during the AL process.
|
md/train/EmeWbcWORRg/EmeWbcWORRg.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CHIP: CHannel Independence-based Pruning for Compact Neural Networks
|
| 2 |
+
|
| 3 |
+
Yang Sui Miao Yin Yi Xie Huy Phan Saman Zonouz Bo Yuan
|
| 4 |
+
|
| 5 |
+
Department of Electrical and Computer Engineering Rutgers University Piscataway, NJ 08854, USA {yang.sui, miao.yin, yi.xie, huy.phan, saman.zonouz}@rutgers.edu, bo.yuan@soe.rutgers.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Filter pruning has been widely used for neural network compression because of its enabled practical acceleration. To date, most of the existing filter pruning works explore the importance of filters via using intra-channel information. In this paper, starting from an inter-channel perspective, we propose to perform efficient filter pruning using channel independence, a metric that measures the correlations among different feature maps. The less independent feature map is interpreted as containing less useful information/knowledge, and hence its corresponding filter can be pruned without affecting model capacity. We systematically investigate the quantification metric, measuring scheme and sensitiveness/reliability of channel independence in the context of filter pruning. Our evaluation results for different models on various datasets show the superior performance of our approach. Notably, on CIFAR-10 dataset our solution can bring $0 . 9 0 \%$ and $0 . 9 4 \%$ accuracy increase over baseline ResNet-56 and ResNet-110 models, respectively, and meanwhile the model size and FLOPs are reduced by $4 2 . 8 \%$ and $4 7 . 4 \%$ (for ResNet-56) and $4 8 . 3 \%$ and $5 2 . 1 \%$ (for ResNet-110), respectively. On ImageNet dataset, our approach can achieve $4 0 . 8 \%$ and $4 4 . 8 \%$ storage and computation reductions, respectively, with $0 . 1 5 \%$ accuracy increase over the baseline ResNet-50 model. The code is available at https://github.com/Eclipsess/CHIP_NeurIPS2021.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Convolutional neural networks (CNNs) have obtained widespread adoptions in numerous important AI applications [17, 48, 47, 12, 11, 44, 35]. However, CNNs are inherently computation intensive and storage intensive, thereby posing severe challenges for their efficient deployment on resourceconstrained embedded platforms. To address these challenges, model compression is widely used to accelerate and compress CNN models on edge devices. To date, various types of compression strategies, such as network pruning [15, 16, 37, 60, 28, 14, 1, 49, 10, 63, 36, 18, 13, 3, 2, 25, 53, 50, 9, 39, 33], quantization [15, 55, 43, 8], low-rank approximation [56, 40, 58, 57], knowledge distillation [22, 41] and structured matrix-based construction [45, 29, 6], have been proposed and explored. Among them, network pruning is the most popular and extensively studied model compression technique in both academia and industry.
|
| 14 |
+
|
| 15 |
+
Based on their differences in pruning granularity, pruning approaches can be roughly categorized to weight pruning [16, 15] and filter pruning [54, 27, 21, 38, 34]. Weight pruning focuses on the proper selection of the to-be-pruned weights within the filters. Although enabling a high compression ratio, this strategy meanwhile causes unstructured sparsity patterns, which are not well supported by the general-purpose hardware in practice. On the other hand, filter pruning emphasizes the removal of (a) Feature information-based filter pruning from an intra-channel perspective.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
(b) Feature information-based filter pruning from an inter-channel perspective.
|
| 21 |
+
Figure 1: Intra-channel vs Inter-channel perspectives for filter pruning.
|
| 22 |
+
|
| 23 |
+
the entire selected filters. The resulting structured sparsity patterns can be then properly leveraged by the off-the-shelf CPUs/GPUs to achieve acceleration in the real-world scenario.
|
| 24 |
+
|
| 25 |
+
Existing Filter Pruning Methods. Motivated by the potential practical speedup offered by filter pruning, to date numerous research efforts have been conducted to study how to determine the important filters – the key component of efficient filter pruning. A well-known strategy is to utilize the norms of different filters to evaluate their importance. Such a "smaller-norm-less-important" hypothesis is adopted in several pioneering filter pruning works [27, 19]. Later, considering the limitations of norm-based criterion in real scenarios, [20] proposes to utilize geometric medianbased criterion. More recently, first determining those important feature maps and then preserving the corresponding filters, instead of directly selecting the filters, become a popular strategy for filter pruning. As indicated in [31], the features, by their natures, reflect and capture rich and important information and characteristics of both input data and filters, and hence measuring the importance of features can provide a better guideline to determine the important filters. Built on this pruning philosophy, several feature-guided filter pruning approaches [31, 51] have been proposed and developed, and the evaluation results show their superior performance over the state-of-the-art filter-guided counterparts with respect to both task performance (e.g., accuracy) and compression performance (e.g., model size and floating-point operations (FLOPs) reductions).
|
| 26 |
+
|
| 27 |
+
Determining Importance: Intra-channel & Inter-channel Perspectives. These recent advancements on filter pruning indeed show the huge benefits of leveraging feature information to determine the importance of filters. To date, some feature-guided approaches measure the importance from the intra-channel perspective. In other words, no matter which importance metric is used, the importance of one feature map (and its corresponding filter), is measured only upon the information of this feature map in its own channel. On the other aspect, the inter-channel perspective, which essentially determines the filter importance via using cross-channel information [20, 42, 46, 52, 26], is still being further explored. To be specific, [20] and [42] adopt cross-channel geometric median and Hessian, respectively, to measure the channel importance. However, such measurement is based on filter instead of feature map information, and hence the rich and important feature characteristics are not properly identified and extracted. [52, 26] also explore inter-channel-based filter pruning via introducing budget constraints across channels. However, such exploration and utilization of the inter-channel information are implicit and indirect, thereby limiting the practical pruning performance.
|
| 28 |
+
|
| 29 |
+
Benefits of Inter-channel Perspective. In principle, the feature information across multiple channels, if being leveraged properly, can potentially provide richer knowledge for filter pruning than the intra-channel information. Specifically, this is because: 1) the importance of one filter, if being solely determined by its corresponding feature map, may be sensitive to input data; while the cross-channel feature information can bring more stable and reliable measurement; and 2) consider the essential mission of pruning is to remove the unnecessary redundancy, the inter-channel strategy can inherently better identify and capture the potential unnecessary correlations among different feature maps (and the corresponding filters), and thereby unlocking the new opportunity of achieving better task and compression performance.
|
| 30 |
+
|
| 31 |
+
Technical Preview and Contributions. Motivated by these promising potential benefits, in this paper we propose to explore and leverage the cross-channel feature information for efficient filter pruning. To be specific, we propose Channel Independence, a cross-channel correlation-based metric to measure the importance of filters. Channel independence can be intuitively understood as the measurement of "replaceability": when the feature map of one filter is measured as exhibiting lower independence, it means this feature map tends to be more linearly dependent on other feature maps of other channels. In such a scenario, the contained information of this low-independence feature map is believed to have already been implicitly encoded in other feature maps – in other words, it does not contain useful information or knowledge. Therefore the corresponding filter, which outputs this low-independence feature map, is viewed as unimportant and can be safely removed without affecting the model capacity. Overall, the contributions of this paper are summarized as:
|
| 32 |
+
|
| 33 |
+
• We propose channel independence, a metric that measures the correlation of multiple feature maps, to determine the importance of filters. Built from an inter-channel perspective, channel independence can identify and capture the filter importance in a more global and precise way, thereby providing a better guideline for filter pruning.
|
| 34 |
+
• We systematically investigate and analyze the suitable quantification metric, the complexity of the measuring scheme and the sensitiveness & reliability of channel independence, and then we develop a low-cost fine-grained high-robustness channel independence calculation scheme for efficient filter pruning.
|
| 35 |
+
• We empirically apply the channel independence-based importance determination in different filter pruning tasks. The evaluation results show that our proposed approach brings very high pruning performance with preserving high accuracy. Notably, on CIFAR-10 dataset our solution can bring $0 . 9 0 \%$ and $0 . 9 4 \%$ accuracy increase over baseline ResNet-56 and ResNet-110 models, respectively, and meanwhile the model size and FLOPs are reduced by $4 2 . 8 \%$ and $4 7 . 4 \%$ (for ResNet-56) and $4 8 . 3 \%$ and $5 2 . 1 \%$ (for ResNet-110), respectively. On ImageNet dataset, our approach can achieve $4 0 . 8 \%$ and $4 4 . 8 \%$ storage and computation reductions, respectively, with $0 . 1 5 \%$ accuracy increase over the baseline ResNet-50 model.
|
| 36 |
+
|
| 37 |
+
# 2 Preliminaries
|
| 38 |
+
|
| 39 |
+
Filter Pruning. For a CNN model with $L$ layers, its $l$ -th convolutional layer $\begin{array} { r l } { \boldsymbol { w ^ { l } } } & { { } = } \end{array}$ $\{ \mathcal { F } _ { 1 } ^ { l } , \mathcal { F } _ { 2 } ^ { l } , \cdot \cdot \cdot , \mathcal { F } _ { c ^ { l } } ^ { l } \}$ contains $c ^ { l }$ filters $\mathcal { F } _ { i } ^ { l } \in \mathbb { R } ^ { c ^ { l - 1 } \times k ^ { l } \times k ^ { l } }$ , where $c ^ { l }$ , $c ^ { l - 1 }$ and $k ^ { l }$ denote the number of output channels, the number of input channels and the kernel size, respectively. In general, network pruning can be formulated as the following optimization problem:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\operatorname* { m i n } _ { \{ \mathscr { W } ^ { l } \} _ { l = 1 } ^ { L } } \mathscr { L } ( \pmb { \mathscr { V } } , f ( \pmb { \mathscr { X } } , \pmb { \mathscr { W } } ^ { l } ) ) , \mathrm { s . t . } \| \pmb { \mathscr { W } } ^ { l } \| _ { 0 } \leq \kappa ^ { l } ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\mathcal L ( \cdot , \cdot )$ is the loss function, $_ { \mathscr { p } }$ is the ground-truth labels, $_ { x }$ is the input data, and $f ( \cdot , \cdot )$ is the output function of CNN model $\{ \mathcal { W } ^ { l } \} _ { l = 1 } ^ { L }$ . Besides, $\Vert \cdot \Vert _ { 0 }$ is the $\ell _ { 0 }$ -norm that measures the number of non-zero filters in the set, and $\kappa ^ { l }$ is the number of filters to be preserved in the $l$ -th layer.
|
| 46 |
+
|
| 47 |
+
Feature-guided Filter Pruning. Consider the feature maps, in principle, contain rich and important information of both filters and input data, approaches using feature information have become popular and achieved the state-of-the-art performance for filter pruning. To be specific, unlike the filter-guided methods that directly minimize the loss function involved with filters (as Eq. 1), the objective of feature-guided filter pruning is to minimize the following loss function:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\operatorname* { m i n } _ { \{ \pmb { A } ^ { l } \} _ { l = 1 } ^ { L } } \mathcal { L } ( \pmb { \mathscr { V } } , \pmb { A } ^ { l } ) , \mathrm { s . t . } \| \pmb { A } ^ { l } \| _ { 0 } \leq \kappa ^ { l } ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\pmb { \mathcal { A } } ^ { l } = \{ \pmb { A } _ { 1 } ^ { l } , \pmb { A } _ { 2 } ^ { l } , \pmb { \cdot \cdot } \cdot , \pmb { A } _ { c ^ { l } } ^ { l } \} \in \mathbb { R } ^ { c ^ { l } \times h \times w }$ is a set of feature maps output from the $l$ -th layer, and $\mathbf { \Delta } A _ { i } ^ { l } \in \mathbb { R } ^ { h \times w }$ is the feature map corresponds to the $i$ -th channel. In general, after the $\kappa ^ { l }$ important feature maps are identified and selected, their corresponding $\kappa ^ { l }$ filters are preserved after pruning.
|
| 54 |
+
|
| 55 |
+
# 3 The Proposed Method
|
| 56 |
+
|
| 57 |
+
# 3.1 Motivation
|
| 58 |
+
|
| 59 |
+
As formulated in Eq. 2, feature-guided filter pruning leverages the generated feature maps in each layer to identify the important filters. To achieve that, various types of feature information, such as the high ranks [31] and the scaling factors [51], have been proposed and utilized to select the proper feature maps and the corresponding filters. A common point for these state-of-the-art approaches is that all of them focus on measuring the importance via using the information contained in each feature map. On the other hand, the correlation among different feature maps, as another type of rich information provided by the neural networks, is little exploited in the existing filter pruning works.
|
| 60 |
+
|
| 61 |
+
Why Inter-channel Perspective? We argue that the feature information across multiple channels is of significant importance and richness, and it can be leveraged towards efficient filter pruning. Such an inter-channel perspective is motivated by two promising benefits. First, filter pruning is essentially a data-driven strategy. When the importance of one filter solely depends on the information represented by its own generated feature map, the measurement of the importance may be unstable and sensitive to the slight change of input data. On the other hand, determining the importance built upon information contained in the multiple feature maps, if performed properly, can reduce the potential disturbance incurred by the change of input data, and thereby making the importance ranking more reliable and stable. Second, the inter-channel strategy, by its nature, can better model and capture the cross-channel correlation. In the context of model compression, these identified correlations can be interpreted as a type of architecture-level redundancy, which is exactly what filter pruning aims to remove. Therefore, inter-channel strategy can enable more aggressive pruning while still preserving high accuracy.
|
| 62 |
+
|
| 63 |
+
# 3.2 Channel Independence: A New Lens for Filter Importance
|
| 64 |
+
|
| 65 |
+
Key Idea. Motivated by these promising benefits, we propose to explore the filter importance from the inter-channel perspective. Our key idea is to use channel independence to represent the importance of each feature map (and its corresponding filter). To be specific, when one feature map of one channel is highly linearly dependent on other feature maps of other channels, it implies that its contained information has already been largely encoded in other feature maps. Consequently, even we remove the corresponding filter, the represented information and knowledge of its generated low-independence feature map can still be largely preserved and approximately reconstructed by other feature maps of other filters after the fine-tuning procedure. In other words, the filters that generate low-independence feature maps tend to exhibit more "replaceability", which can be interpreted as lower importance. Therefore, removing those filters with low channel-independence feature maps will be safe while still preserving high model capacity.
|
| 66 |
+
|
| 67 |
+
How to Measure Channel Independence? Next we discuss how to properly measure the independence of one feature map from others. To that end, four important questions need to be answered.
|
| 68 |
+
|
| 69 |
+
Question #1: Which mathematical metric should be adopted to quantify the independence of one feature map from other feature maps?
|
| 70 |
+
|
| 71 |
+
Analysis. Considering the entire set of feature maps generated from one layer is a 3-D tensor, we propose to extract the linear dependence information of each feature map within the framework of linear algebra. To be specific, given output feature map set of the $l$ -th layer $\mathbf { \mathcal { A } } ^ { l }$ , we first matricize $\mathbf { \mathcal { A } } ^ { l }$ $\begin{array} { r } { \bar { \mathbf { A } ^ { l } } = [ \bar { \mathbf { a } _ { 1 } ^ { l } } ^ { T } , \bar { \mathbf { a } _ { 2 } ^ { l } } ^ { \hat { T } } , \cdot \cdot \cdot , \bar { \mathbf { a } _ { c ^ { l } } ^ { l } } ^ { T } ] ^ { T } \in \mathbb { R } ^ { c ^ { l } \times h w } } \end{array}$ , where a row vector $\mathbf { \pmb { a } } _ { i } ^ { l } \in \mathbb { R } ^ { h w }$ is the vectorized $A _ { i } ^ { l }$ . In such a scenario, the linear independence of each vectorized feature map $\mathbf { \Delta } _ { \mathbf { \alpha } \mathbf { \beta } _ { i } } ^ { \mathbf { \alpha } _ { i } }$ , as a row of the matricized entire set of feature maps $A ^ { l }$ , can be measured via the existing matrix analysis tool.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 2: The change of (a) rank and (b) nuclear norm of the entire set of feature maps $( A ^ { l } )$ when one feature map $( \pmb { a } _ { i } ^ { l } )$ is removed. The $\mathbf { X }$ -axis represents the index of the feature map that is removed. The y-axis represents the corresponding rank/nuclear norm change of the entire set of feature maps. The feature maps are output from one layer of the ResNet-50 model with input as ImageNet image. It is seen that change of nuclear norm can better reveal the impact of the deleted feature map on the entire set of feature maps.
|
| 75 |
+
|
| 76 |
+
The most straightforward solution is to use rank to determine the independence of $\pmb { a } _ { i } ^ { l }$ , since rank mathematically represents the maximum number of linearly independent rows/columns of the matrix. For instance, we can remove one row from the matrix, and calculate the rank change of the matrix, and then identify the impact and the importance of the deleted row – the less rank change, the less independence (and the importance) of the removed row.
|
| 77 |
+
|
| 78 |
+
Our Proposal. However, in the context of filter pruning, we believe, the change of nuclear norm of the entire set of feature maps, is a better metric to quantify the independence of each feature map. This is because, as the $\overline { { \ell _ { 1 } } }$ -norm of singular values of the matrix, the nuclear norm can reveal richer "soft" information on the impact of the deleted row on the matrix; while the rank, as the $\ell _ { 0 }$ -norm of the singular values, is too "hard" to reflect such change. For instance, as shown in Fig. 2, when we select $\mathbf { \bar { \mathbf { a } } } _ { i } ^ { l }$ , as one row of $A ^ { l }$ , to be removed, the rank change of $A ^ { l }$ is almost the same regardless of our selection of $\mathbf { \Delta } \mathbf { a } _ { i } ^ { l }$ ; while the corresponding changes of nuclear norm vary significantly when different $\mathbf { \Delta } \mathbf { a } _ { i } ^ { l }$ are deleted. Therefore, the change of nuclear norm can be viewed as a more precise metric to measure the linear independence of one feature map in a more fine-grained way. In general, the channel independence of one feature map is defined and calculated as below:
|
| 79 |
+
|
| 80 |
+
Definition 1 (Channel independence of single feature map) For the i-th layer with output feature maps $\pmb { \mathcal { A } } ^ { l } = \{ \pmb { A } _ { 1 } ^ { l } , \pmb { A } _ { 2 } ^ { l } , \pmb { \cdot \cdot } \cdot , \pmb { A } _ { c ^ { l } } ^ { l } \} \in \mathbb { R } ^ { c ^ { l } \times h \times w }$ , the Channel Independence $( C I )$ of one feature map $\pmb { A } _ { i } ^ { l } \in \mathbb { R } ^ { h \times w }$ in the $i$ -th channel is defined and calculated as:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
C I ( \boldsymbol { A } _ { i } ^ { l } ) \triangleq \| \boldsymbol { A } ^ { l } \| _ { * } - \| \boldsymbol { M } _ { i } ^ { l } \odot \boldsymbol { A } ^ { l } \| _ { * } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\pmb { A } ^ { l } \in \mathbb { R } ^ { c ^ { l } \times h w }$ is the matricized $\mathbf { \mathcal { A } } ^ { l } , \parallel \cdot \parallel _ { * }$ is the nuclear norm, $\odot$ is the Hadamard product, and $M _ { i } ^ { l } \in \mathbb { R } ^ { c ^ { l } \times h w }$ is the row mask matrix whose $i$ -th row entries are zeros and other entries are ones.
|
| 87 |
+
|
| 88 |
+
Question #2: What is the proper scheme to quantify the independence of multiple feature maps?
|
| 89 |
+
|
| 90 |
+
Analysis. Eq. 3 describes the measurement of channel independence for a single feature map. However, in practice filter pruning typically aims to remove multiple filters, which means the independence of the combination of multiple feature maps needs to be calculated. In the case of pruning $m$ filters, such scenario corresponds to checking the changes of nuclear norm of the original $c ^ { l }$ -row $A ^ { l }$ after removing $m$ rows $( \pmb { a } _ { i } ^ { l } )$ . A straightforward solution is to just calculate $C _ { m } ^ { c ^ { l } }$ changes of nuclear norms for all the possible $m$ -row removal choices, and then select the one which corresponds to the smallest change. However, this strategy is very computationally expensive, and sometimes even intractable when $c ^ { l }$ is large. For instance, in order to identify the smallest nuclear norm change for pruning $5 0 \%$ filters of a 256-output channel ResNet-50 layer, such brutal-force measurement requires more than $5 \times 1 0 ^ { 7 5 }$ times of nuclear norm calculation.
|
| 91 |
+
|
| 92 |
+
Our Proposal. To address this computational challenge, we propose to leverage the independence of individual feature map to approximate the independence of their combination. To be specific, in order to determine $m$ least independent rows in the $A ^ { l }$ , we first iteratively remove one row $\mathbf { \bar { \rho } } ( \mathbf { \pmb { a } } _ { i } ^ { l } )$ from $A ^ { l }$ and calculate the corresponding nuclear norm change between the remaining $( c ^ { l } - 1 )$ -row matrix and the original $c ^ { l }$ -row $A ^ { l }$ . Then, among the $c ^ { l }$ calculated changes, we identify the $m$ smallest ones and the corresponding removed $\mathbf { \Delta } \mathbf { a } _ { i } ^ { l }$ . Those selected $m$ vectorized feature maps $\mathbf { \Delta } \mathbf { a } _ { i } ^ { l }$ are interpreted as the less independent from other feature maps, and hence their corresponding filters $\mathcal { F } _ { i } ^ { l }$ are less important ones that should be pruned. In general, this individual independence-based measurement can closely approximate the combined independence of multiple feature maps (see Definition 2). Such approximation requires much less computational complexity (reduction from $\mathcal { O } ( C ( N , \kappa ) )$ to $\mathcal { O } ( N ) )$ ; while still achieving superior filter pruning performance (see Section 4 for evaluation results).
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 3: Example of filter pruning process using the change of nuclear norm-based channel independence (CI) criterion.
|
| 96 |
+
|
| 97 |
+
Definition 2 (Approximated channel independence of combined multiple feature maps) For the $i$ -th layer with output feature maps $\pmb { \mathcal { A } } ^ { l } \in \mathbb { R } ^ { c ^ { l } \times h \times w }$ , the channel independence of combined $m$ feature maps $\{ A _ { b _ { i } } ^ { l } \} _ { i = 1 } ^ { m }$ , where $A _ { b _ { i } } ^ { l } \in \mathbb { R } ^ { h \times w }$ is in the $b _ { i }$ -th channel, is defined and approximated as:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
C I ( \{ A _ { b _ { i } } ^ { l } \} _ { i = 1 } ^ { m } ) \triangleq \| A ^ { l } \| _ { * } - \| M _ { b _ { 1 } , \cdots , b _ { m } } ^ { l } \odot A ^ { l } \| _ { * } \approx \sum _ { i = 1 } ^ { m } C I ( A _ { b _ { i } } ^ { l } ) ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $M _ { b _ { 1 } , \cdots , b _ { m } } ^ { l }$ is the multi-row mask matrix, in which the $b _ { 1 } , \cdots , b _ { m }$ -th row entries are zeros and all the other entries are ones.
|
| 104 |
+
|
| 105 |
+
Question #3: How is the sensitiveness of channel independence related to the distribution of input data?
|
| 106 |
+
|
| 107 |
+
Our Observation. Consider our proposed channel independence-based filter pruning is a data-driven approach, its reliability with different distributions of input data should be carefully ensured and examined. To that end, we perform empirical evaluations on channel independence with respect to multiple input images. We observe that the average channel independence of each feature map is very stable at the batch level. In other words, we can simply input small batches of image samples, and calculate the average channel independence, and then such averaged channel independence with a small number of input data can be used to estimate the channel independence with all the input data. As illustrated in Fig. 4, for the same feature map, the average channel independence in different batches remains very similar, thereby indicating that our channel independence-based approach is robust against different input data.
|
| 108 |
+
|
| 109 |
+
Question #4: Is this one-shot importance determination scheme good enough? Do we need to further learn and adjust the pruning mask from the data?
|
| 110 |
+
|
| 111 |
+
Our Observation. As described above, our proposed scheme calculates the channel independence to identify the filter importance. Considering our approach is built on one-shot calculation, a natural extension is to further adjust the importance ranking via additional learning. To be specific, if we interpret the filter pruning is a channel-wise masking operation over the entire weight tensor, the
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 4: The channel independence of feature maps for one layer in ResNet-50. Here the channel independence is averaged for one batch of input images. The $\mathbf { X }$ -axis is the index of the feature map. The y-axis is the index of batches of input images. Here the batch size is 128. Different colors denote the different values of channel independence. It is seen that the average channel independence is very stable regardless of different input data batches.
|
| 115 |
+
|
| 116 |
+
Algorithm 1 CHannel Independence-based Pruning (CHIP) procedure for the $l$ -th layer
|
| 117 |
+
|
| 118 |
+
Input: Pre-trained weight tensor $\boldsymbol { w ^ { l } }$ , $N$ sets of feature maps $\pmb { \mathcal { A } } ^ { l } = \{ \pmb { A } _ { 1 } ^ { l } , \pmb { A } _ { 2 } ^ { l } , \cdot \cdot \cdot , \pmb { A } _ { c ^ { l } } ^ { l } \} \in \mathbb { R } ^ { c ^ { l } \times h \times w }$ from $N$ input samples, and the desired number of filters to be preserved $\kappa ^ { l }$ .
|
| 119 |
+
|
| 120 |
+
Output: Pruned weight tensor $\boldsymbol { \mathcal { W } } _ { p r u n e } ^ { l }$ .
|
| 121 |
+
1: for each input sample do
|
| 122 |
+
2: Flatten feature maps: $\pmb { A } ^ { l } : = \mathrm { r e s h a p e } ( \pmb { A } ^ { l } , [ c ^ { l } , h w ] ) ;$ ;
|
| 123 |
+
3: for $i = 1$ to $c ^ { l }$ do
|
| 124 |
+
4: CI calculation: Calculate $C I ( A _ { i } ^ { l } )$ via Equation 3;
|
| 125 |
+
5: end for
|
| 126 |
+
6: end for
|
| 127 |
+
7: Averaging: Average $C I ( A _ { i } ^ { l } )$ under all $N$ input samples;
|
| 128 |
+
8: Sorting: Sort $\{ C I ( A _ { i } ^ { l } ) \} _ { i = 1 } ^ { c ^ { l } }$ in ascending order;
|
| 129 |
+
9: Pruning: Prune $c ^ { l } - \kappa ^ { l }$ filters in $\boldsymbol { w ^ { l } }$ corresponding to the $c ^ { l } - \kappa ^ { l }$ smallest $C I ( A _ { i } ^ { l } )$ ;
|
| 130 |
+
10: Fine-tuning: Obtain final $\boldsymbol { \mathcal { W } } _ { p r u n e } ^ { l }$ via fine-tuning $\boldsymbol { w ^ { l } }$ with removing the pruned filter channels.
|
| 131 |
+
|
| 132 |
+
selection of channel mask can be learned from data, and such learning process can use the pruning mask determined by our approach as the initialization. Though in principle this learning-based strategy is expected to enable additional performance improvement, our empirical evaluations show that the consecutive learning procedure does not easily bring further accuracy increase (with the target compression ratio) or compression ratio increase (with the target accuracy) – more experimental details are reported in Supplementary Material. We hypothesize the reason for such phenomenon is that, our proposed nuclear norm change-based channel independence, though only requires one-time calculation, already identifies and captures the importance of feature maps (and its corresponding filters) with high quality, and hence further learning-based adjustment of pruning mask does not easily provide additional improvement.
|
| 133 |
+
|
| 134 |
+
The Overall Algorithm. After addressing the above four problems, we can then integrate our proposals and observations to develop the entire filter pruning procedure from the inter-channel perspective. Algorithm 1 describes and summarizes the overall scheme for our proposed CHannel Independence-based filter Pruning (CHIP) algorithm.
|
| 135 |
+
|
| 136 |
+
# 4 Experiments
|
| 137 |
+
|
| 138 |
+
# 4.1 Experimental Settings
|
| 139 |
+
|
| 140 |
+
Baselines Models and Datasets. To demonstrate the effectiveness and generality of our proposed channel independence-based approach, we evaluate its pruning performance for various baseline models on different image classification datasets. To be specific, we conduct experiments for three CNN models (ResNet-56, ResNet-110 and VGG-16) on CIFAR-10 dataset [24]. Also, we further evaluate our approach and compare its performance with other state-of-the-art pruning methods for ResNet-50 model on large-scale ImageNet dataset [5].
|
| 141 |
+
|
| 142 |
+
Pruning and Fine-tuning Configurations. We conduct our empirical evaluations on Nvidia Tesla V100 GPUs with PyTorch 1.7 framework. To determine the importance of each filter, we randomly sample 5 batches (640 input images) to calculate the average channel independence of each feature map in all the experiments. After performing the channel independence-based filter pruning, we then perform fine-tuning on the pruned models with Stochastic Gradient Descent (SGD) as the optimizer. To be specific, we perform the fine-tuning for 300 epochs on CIFAR-10 datasets with the batch size, momentum, weight decay and initial learning rate as 128, 0.9, 0.05 and 0.01, respectively. On the ImageNet dataset, fine-tuning is performed for 180 epochs with the batch size, momentum, weight decay and initial learning rate as 256, 0.99, 0.0001 and 0.1, respectively.
|
| 143 |
+
|
| 144 |
+
Table 1: Experimental results on CIFAR-10 dataset.
|
| 145 |
+
|
| 146 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Top-1 Accuracy (%) △</td><td rowspan="2">#Params. (↓%)</td><td rowspan="2">FLOPs (↓%)</td></tr><tr><td>Baseline</td><td>Pruned</td></tr><tr><td colspan="6">ResNet-56</td></tr><tr><td>l1-norm (2016)[27]</td><td>93.04</td><td>93.06</td><td>+0.02</td><td>0.73M(13.7)</td><td>90.90M(27.6)</td></tr><tr><td>NISP (2018) [59]</td><td>93.04</td><td>93.01</td><td>-0.03</td><td>0.49M(42.4)</td><td>81.00M(35.5)</td></tr><tr><td>GAL (2019) [32]</td><td>93.26</td><td>93.38</td><td>+0.12</td><td>0.75M(11.8)</td><td>78.30M(37.6)</td></tr><tr><td>HRank (2020) [31]</td><td>93.26</td><td>93.52</td><td>+0.26</td><td>0.71M(16.8)</td><td>88.72M(29.3)</td></tr><tr><td>CHIP (Ours)</td><td>93.26</td><td>94.16</td><td>+0.90</td><td>0.48M(42.8)</td><td>65.94M(47.4)</td></tr><tr><td>GAL(2019)[32]</td><td>93.26</td><td>91.58</td><td>-1.68</td><td>0.29M(65.9)</td><td>49.99M(60.2)</td></tr><tr><td>LASSO (2017) [21]</td><td>92.80</td><td>91.80</td><td>-1.00</td><td>N/A</td><td>62.00M(50.6)</td></tr><tr><td>HRank (2020)[31]</td><td>93.26</td><td>90.72</td><td>-2.54</td><td>0.27M(68.1)</td><td>32.52M(74.1)</td></tr><tr><td>CHIP (Ours)</td><td>93.26</td><td>92.05</td><td>-1.21</td><td>0.24M(71.8)</td><td>34.79M(72.3)</td></tr><tr><td colspan="6">ResNet-110</td></tr><tr><td>l1-norm (2016) [27]</td><td>93.53</td><td>93.30</td><td>-0.23</td><td>1.16M(32.4)</td><td>155.00M(38.7)</td></tr><tr><td>HRank (2020)[31]</td><td>93.50</td><td>94.23</td><td>+0.73</td><td>1.04M(39.4)</td><td>148.70M(41.2)</td></tr><tr><td>CHIP (Ours)</td><td>93.50</td><td>94.44</td><td>+0.94</td><td>0.89M(48.3)</td><td>121.09M(52.1)</td></tr><tr><td>GAL (2019)[32]</td><td>93.50</td><td>92.74</td><td>-0.76</td><td>0.95M(44.8)</td><td>130.20M(48.5)</td></tr><tr><td>HRank (2020)[31]</td><td>93.50</td><td>92.65</td><td>-0.85</td><td>0.53M(68.7)</td><td>79.30M(68.6)</td></tr><tr><td>CHIP (Ours)</td><td>93.50</td><td>93.63</td><td>+0.13</td><td>0.54M(68.3)</td><td>71.69M(71.6)</td></tr><tr><td colspan="6">VGG-16</td></tr><tr><td>SSS (2018) [23]</td><td>93.96</td><td>93.02</td><td>-0.94</td><td>3.93M(73.8)</td><td>183.13M(41.6)</td></tr><tr><td>GAL (2019) [32]</td><td>93.96</td><td>93.77</td><td>-0.19</td><td>3.36M(77.6)</td><td>189.49M(39.6)</td></tr><tr><td>HRank (2020)[31]</td><td>93.96</td><td>93.43</td><td>-0.53</td><td>2.51M(82.9)</td><td>145.61M(53.5)</td></tr><tr><td>CHIP (Ours)</td><td>93.96</td><td>93.86</td><td>-0.10</td><td>2.76M(81.6)</td><td>131.17M(58.1)</td></tr><tr><td>GAL (2019)[32]</td><td>93.96</td><td>93.42</td><td>-0.54</td><td>2.67M(82.2)</td><td>171.89M(45.2)</td></tr><tr><td>HRank (2020) [31]</td><td>93.96</td><td>92.34</td><td>-1.62</td><td>2.64M(82.1)</td><td>108.61M(65.3)</td></tr><tr><td>CHIP (Ours)</td><td>93.96</td><td>93.72</td><td>-0.24</td><td>2.50M(83.3)</td><td>104.78M(66.6)</td></tr><tr><td>HRank (2020) [31]</td><td>93.96</td><td>91.23</td><td>-2.73</td><td>1.78M(92.0)</td><td>73.70M(76.5)</td></tr><tr><td>CHIP (Ours)</td><td>93.96</td><td>93.18</td><td>-0.78</td><td>1.90M(87.3)</td><td>66.95M(78.6)</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 147 |
+
|
| 148 |
+
# 4.2 Evaluation and Comparison on CIFAR-10 Dataset
|
| 149 |
+
|
| 150 |
+
Table 1 shows the evaluation results of the pruned ResNet-56, ResNet-110 and VGG-16 models on CIFAR-10 dataset. To be consistent with prior works, we evaluate the performance for two scenarios: targeting high accuracy and targeting high model size and FLOPs reductions.
|
| 151 |
+
|
| 152 |
+
ResNet-56. For ResNet-56 model, our channel independence-based approach can bring $0 . 9 0 \%$ accuracy increase over the baseline model with $4 2 . 8 \%$ and $4 7 . 4 \%$ model size and FLOPs reductions, respectively. When we adopt aggressive compression with $7 1 . 8 \%$ and $7 2 . 3 \%$ model size and FLOPs reductions, we can still achieve high performance – our solution enables $1 . 3 3 \%$ higher accuracy than HRank [31] with the similar model size and computational costs.
|
| 153 |
+
|
| 154 |
+
ResNet-110. For ResNet-110 model, our approach can bring $0 . 9 4 \%$ accuracy increase over the baseline model with $4 8 . 3 \%$ and $5 2 . 1 \%$ model size and FLOPs reductions, respectively. When we perform aggressive pruning with $6 8 . 3 \%$ and $7 1 . 6 \%$ model size and FLOPs reductions, our pruned model can still achieve $0 . 1 \hat { 3 } \%$ higher accuracy over the baseline model.
|
| 155 |
+
|
| 156 |
+
VGG-16. For VGG-16 model, our approach can bring $8 1 . 6 \%$ and $5 8 . 1 \%$ model size and FLOPs reductions, respectively, with only $0 . { \bar { 1 } } \%$ accuracy drop. Moreover, with $8 3 . 3 \%$ and $6 6 . 6 \%$ storage and computational cost reductions, our pruned model can achieve $1 . 3 8 \%$ higher accuracy than the model using other pruning approaches under a similar compression ratio. For even higher FLOPs reduction $( 7 8 . 6 \% )$ ), our method can bring nearly $2 \%$ accuracy increase over the prior works.
|
| 157 |
+
|
| 158 |
+
# 4.3 Evaluation and Comparison on ImageNet Dataset
|
| 159 |
+
|
| 160 |
+
Table 2 summarizes the pruning performance of our approach for ResNet-50 on ImageNet dataset. It is seen that when targeting a moderate compression ratio, our approach can achieve $4 0 . 8 \%$ and $4 4 . 8 \%$ storage and computation reductions, respectively, with $0 . 1 5 \%$ accuracy increase over the baseline model. When we further increase the compression ratio, our approach still achieves superior performance than state-of-the-art works. For instance, compared with SCOP [51], our approach shows higher accuracy $\left( 0 . 1 2 \% \right)$ in moderate compression region and the same accuracy in high compress region; while meanwhile enjoying a much smaller model size and fewer FLOPs.
|
| 161 |
+
|
| 162 |
+
Table 2: Experimental results on ImageNet dataset.
|
| 163 |
+
|
| 164 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Top-1 Accuracy (%)</td><td colspan="5">Top-5 Accuracy (%) Params.FLOPs</td></tr><tr><td></td><td>Baseline Pruned</td><td>△</td><td>Baseline</td><td>Pruned</td><td>△</td><td>↓(%)</td><td>↓(%)</td></tr><tr><td colspan="10">ResNet-50</td></tr><tr><td>ThiNet (2017) [37]</td><td>72.88</td><td></td><td>72.04-0.84</td><td>91.14</td><td>90.67</td><td>-0.47</td><td>33.7</td><td>36.8</td></tr><tr><td>SFP (2018)[19]</td><td>76.15</td><td>74.61</td><td>-1.54</td><td>92.87</td><td>92.06</td><td>-0.81</td><td>N/A</td><td>41.8</td></tr><tr><td>Autopruner (2020) [36]</td><td>76.15</td><td>74.76</td><td>-1.39</td><td>92.87</td><td>92.15</td><td>-0.72</td><td>N/A</td><td>48.7</td></tr><tr><td>FPGM (2019)[20]</td><td>76.15</td><td>75.59</td><td>-0.56</td><td>92.87</td><td>92.63</td><td>-0.24</td><td>37.5</td><td>42.2</td></tr><tr><td>Taylor (2019) [38]</td><td>76.18</td><td>74.50</td><td>-1.68</td><td>N/A</td><td>N/A</td><td>N/A</td><td>44.5</td><td>44.9</td></tr><tr><td>C-SGD (2019) [7]</td><td>75.33</td><td>74.93</td><td>-0.40</td><td>92.56</td><td>92.27</td><td>-0.29</td><td>N/A</td><td>46.2</td></tr><tr><td>GAL (2019) [32]</td><td>76.15</td><td>71.95</td><td>-4.20</td><td>92.87</td><td>90.94</td><td>-1.93</td><td>16.9</td><td>43</td></tr><tr><td>RRBP (2019)[61]</td><td>76.10</td><td>73.00</td><td>-3.10</td><td>92.90</td><td>91.00</td><td>-1.90</td><td>N/A</td><td>54.5</td></tr><tr><td>PFP (2020)[30]</td><td>76.13</td><td>75.91</td><td>-0.22</td><td>92.87</td><td>92.81</td><td>-0.06</td><td>18.1</td><td>10.8</td></tr><tr><td>HRank (2020) [31]</td><td>76.15</td><td>74.98</td><td>-1.17</td><td>92.87</td><td>92.33</td><td>-0.54</td><td>36.6</td><td>43.7</td></tr><tr><td>SCOP (2020) [51]</td><td>76.15</td><td>75.95</td><td>-0.20</td><td>92.87</td><td>92.79</td><td>-0.08</td><td>42.8</td><td>45.3</td></tr><tr><td>CHIP (Ours)</td><td>76.15</td><td>76.30</td><td>+0.15</td><td>92.87</td><td>93.02</td><td>+0.15</td><td>40.8</td><td>44.8</td></tr><tr><td>CHIP (Ours)</td><td>76.15</td><td>76.15</td><td>0.00</td><td>92.87</td><td>92.91</td><td>+0.04</td><td>44.2</td><td>48.7</td></tr><tr><td>PFP(2020)[30]</td><td>76.13</td><td>75.21</td><td>-0.92</td><td>92.87</td><td>92.43</td><td>-0.44</td><td>30.1</td><td>44</td></tr><tr><td>SCOP (2020) [51]</td><td>76.15</td><td>75.26</td><td>-0.89</td><td>92.87</td><td>92.53</td><td>-0.34</td><td>51.8</td><td>54.6</td></tr><tr><td>CHIP (Ours)</td><td>76.15</td><td>75.26</td><td>-0.89</td><td>92.87</td><td>92.53</td><td>-0.34</td><td>56.7</td><td>62.8</td></tr><tr><td>HRank(2020)[31]</td><td>76.15</td><td>71.98</td><td>-4.17</td><td>92.87</td><td>91.01</td><td>--1.86</td><td>46.0</td><td>62.1</td></tr><tr><td>HRank (2020) [31]</td><td>76.15</td><td>69.10</td><td>-7.05</td><td>92.87</td><td>89.58</td><td>-3.29</td><td>67.5</td><td>76.0</td></tr><tr><td>CHIP (Ours)</td><td>76.15</td><td>73.30</td><td>-2.85</td><td>92.87</td><td>91.48</td><td>-1.39</td><td>68.6</td><td>76.7</td></tr></table>
|
| 165 |
+
|
| 166 |
+
# 5 Conclusion
|
| 167 |
+
|
| 168 |
+
In this paper, we propose to use channel independence, an inter-channel perspective-motivated metric, to evaluate the importance of filters for network pruning. By systematically exploring the quantification metric, measuring scheme, and sensitiveness and reliability of channel independence, we develop CHIP, a CHannel Independence-based filter pruning for neural network compression. Extensive evaluation results on different datasets show our proposed approach brings significant storage and computational cost reductions while still preserving high model accuracy.
|
| 169 |
+
|
| 170 |
+
# Broader Impact
|
| 171 |
+
|
| 172 |
+
As technology advances, cell phones, laptops, wearable gadgets and intelligent connected vehicles with specific chips are required to handle more complicated tasks by deploying neural networks. However, more powerful networks will cost more memory size and running time. Network pruning is the main strategy to reduce the memory size and accelerate the run-time during the inference stage. Benefiting from pruning techniques and specific designs for hardware [62, 4], IoT (Internet of Things) devices are able to execute complex projects based on small and efficient models.
|
| 173 |
+
|
| 174 |
+
# Acknowledgements and Funding Disclosure
|
| 175 |
+
|
| 176 |
+
Bo Yuan would like to thank the support from National Science Foundation (NSF) award CCF1937403. Saman Zonouz would like to thank the support from NSF CPS and SATC programs.
|
| 177 |
+
|
| 178 |
+
# References
|
| 179 |
+
|
| 180 |
+
[1] Davis Blalock, Jose Javier Gonzalez Ortiz, Jonathan Frankle, and John Guttag. What is the state of neural network pruning? In I. Dhillon, D. Papailiopoulos, and V. Sze, editors, Proceedings of Machine Learning and Systems, volume 2, pages 129–146, 2020.
|
| 181 |
+
[2] Chunhua Deng, Siyu Liao, Yi Xie, Keshab K Parhi, Xuehai Qian, and Bo Yuan. Permdnn: Efficient compressed dnn architecture with permuted diagonal matrices. In 2018 51st Annual IEEE/ACM International Symposium on Microarchitecture (MICRO), pages 189–202. IEEE, 2018.
|
| 182 |
+
[3] Chunhua Deng, Siyu Liao, and Bo Yuan. Permcnn: Energy-efficient convolutional neural network hardware architecture with permuted diagonal structure. IEEE Transactions on Computers, 70(2):163–173, 2020.
|
| 183 |
+
[4] Chunhua Deng, Yang Sui, Siyu Liao, Xuehai Qian, and Bo Yuan. Gospa: An energy-efficient highperformance globally optimized sparse convolutional neural network accelerator. In 2021 ACM/IEEE 48th Annual International Symposium on Computer Architecture (ISCA), pages 1110–1123. IEEE, 2021.
|
| 184 |
+
[5] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255. Ieee, 2009.
|
| 185 |
+
[6] Caiwen Ding, Siyu Liao, Yanzhi Wang, Zhe Li, Ning Liu, Youwei Zhuo, Chao Wang, Xuehai Qian, Yu Bai, Geng Yuan, et al. Circnn: accelerating and compressing deep neural networks using block-circulant weight matrices. In Proceedings of the 50th Annual IEEE/ACM International Symposium on Microarchitecture, pages 395–408, 2017.
|
| 186 |
+
[7] Xiaohan Ding, Guiguang Ding, Yuchen Guo, and Jungong Han. Centripetal sgd for pruning very deep convolutional networks with complicated structure. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4943–4953, 2019.
|
| 187 |
+
[8] Steven K Esser, Jeffrey L McKinstry, Deepika Bablani, Rathinakumar Appuswamy, and Dharmendra S Modha. Learned step size quantization. In International Conference on Learning Representations, 2019.
|
| 188 |
+
[9] Utku Evci, Trevor Gale, Jacob Menick, Pablo Samuel Castro, and Erich Elsen. Rigging the lottery: Making all tickets winners. In International Conference on Machine Learning, pages 2943–2952. PMLR, 2020.
|
| 189 |
+
[10] Shangqian Gao, Feihu Huang, Jian Pei, and Heng Huang. Discrete model compression with resource constraint for deep neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1899–1908, 2020.
|
| 190 |
+
[11] Ross Girshick. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, pages 1440–1448, 2015.
|
| 191 |
+
[12] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 580–587, 2014.
|
| 192 |
+
[13] Shaopeng Guo, Yujie Wang, Quanquan Li, and Junjie Yan. Dmcp: Differentiable markov channel pruning for neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1539–1547, 2020.
|
| 193 |
+
[14] Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. arXiv preprint arXiv:1608.04493, 2016.
|
| 194 |
+
[15] Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 195 |
+
[16] Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in Neural Information Processing Systems, pages 1135–1143, 2015.
|
| 196 |
+
[17] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016.
|
| 197 |
+
[18] Yang He, Yuhang Ding, Ping Liu, Linchao Zhu, Hanwang Zhang, and Yi Yang. Learning filter pruning criteria for deep convolutional neural networks acceleration. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2009–2018, 2020.
|
| 198 |
+
[19] Yang He, Guoliang Kang, Xuanyi Dong, Yanwei Fu, and Yi Yang. Soft filter pruning for accelerating deep convolutional neural networks. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, pages 2234–2240, 2018.
|
| 199 |
+
[20] Yang He, Ping Liu, Ziwei Wang, Zhilan Hu, and Yi Yang. Filter pruning via geometric median for deep convolutional neural networks acceleration. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4340–4349, 2019.
|
| 200 |
+
[21] Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 1389–1397, 2017.
|
| 201 |
+
[22] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 202 |
+
[23] Zehao Huang and Naiyan Wang. Data-driven sparse structure selection for deep neural networks. In Proceedings of the European conference on computer vision (ECCV), pages 304–320, 2018.
|
| 203 |
+
[24] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 204 |
+
[25] Namhoon Lee, Thalaiyasingam Ajanthan, and Philip HS Torr. Snip: Single-shot network pruning based on connection sensitivity. arXiv preprint arXiv:1810.02340, 2018.
|
| 205 |
+
[26] Carl Lemaire, Andrew Achkar, and Pierre-Marc Jodoin. Structured pruning of neural networks with budget-aware regularization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9108–9116, 2019.
|
| 206 |
+
[27] Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016.
|
| 207 |
+
[28] Yawei Li, Shuhang Gu, Christoph Mayer, Luc Van Gool, and Radu Timofte. Group sparsity: The hinge between filter pruning and decomposition for network compression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8018–8027, 2020.
|
| 208 |
+
[29] Siyu Liao and Bo Yuan. Circconv: A structured convolution with low complexity. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4287–4294, 2019.
|
| 209 |
+
[30] Lucas Liebenwein, Cenk Baykal, Harry Lang, Dan Feldman, and Daniela Rus. Provable filter pruning for efficient neural networks. In International Conference on Learning Representations, 2019.
|
| 210 |
+
[31] Mingbao Lin, Rongrong Ji, Yan Wang, Yichen Zhang, Baochang Zhang, Yonghong Tian, and Ling Shao. Hrank: Filter pruning using high-rank feature map. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1529–1538, 2020.
|
| 211 |
+
[32] Shaohui Lin, Rongrong Ji, Chenqian Yan, Baochang Zhang, Liujuan Cao, Qixiang Ye, Feiyue Huang, and David Doermann. Towards optimal structured cnn pruning via generative adversarial learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2790–2799, 2019.
|
| 212 |
+
[33] Tao Lin, Sebastian U Stich, Luis Barba, Daniil Dmitriev, and Martin Jaggi. Dynamic model pruning with feedback. arXiv preprint arXiv:2006.07253, 2020.
|
| 213 |
+
[34] Jing Liu, Bohan Zhuang, Zhuangwei Zhuang, Yong Guo, Junzhou Huang, Jinhui Zhu, and Mingkui Tan. Discrimination-aware network pruning for deep model compression. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021.
|
| 214 |
+
[35] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3431–3440, 2015.
|
| 215 |
+
[36] Jian-Hao Luo and Jianxin Wu. Autopruner: An end-to-end trainable filter pruning method for efficient deep model inference. Pattern Recognition, 107:107461, 2020.
|
| 216 |
+
[37] Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In Proceedings of the IEEE International Conference on Computer Vision, pages 5058–5066, 2017.
|
| 217 |
+
[38] Pavlo Molchanov, Arun Mallya, Stephen Tyree, Iuri Frosio, and Jan Kautz. Importance estimation for neural network pruning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11264–11272, 2019.
|
| 218 |
+
[39] Hesham Mostafa and Xin Wang. Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization. In International Conference on Machine Learning, pages 4646–4655. PMLR, 2019.
|
| 219 |
+
[40] Yu Pan, Jing Xu, Maolin Wang, Jinmian Ye, Fei Wang, Kun Bai, and Zenglin Xu. Compressing recurrent neural networks with tensor ring for action recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4683–4690, 2019.
|
| 220 |
+
[41] Wonpyo Park, Dongju Kim, Yan Lu, and Minsu Cho. Relational knowledge distillation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3967–3976, 2019.
|
| 221 |
+
[42] Hanyu Peng, Jiaxiang Wu, Shifeng Chen, and Junzhou Huang. Collaborative channel pruning for deep networks. In International Conference on Machine Learning, pages 5113–5122, 2019.
|
| 222 |
+
[43] Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pages 525–542. Springer, 2016.
|
| 223 |
+
[44] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. arXiv preprint arXiv:1506.01497, 2015.
|
| 224 |
+
[45] Vikas Sindhwani, Tara N Sainath, and Sanjiv Kumar. Structured transforms for small-footprint deep learning. arXiv preprint arXiv:1510.01722, 2015.
|
| 225 |
+
[46] Taiji Suzuki, Hiroshi Abe, Tomoya Murata, Shingo Horiuchi, Kotaro Ito, Tokuma Wachi, So Hirai, Masatoshi Yukishima, and Tomoaki Nishimura. Spectral pruning: Compressing deep neural networks via spectral analysis and its generalization error. arXiv preprint arXiv:1808.08558, 2018.
|
| 226 |
+
[47] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1–9, 2015.
|
| 227 |
+
[48] Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105–6114. PMLR, 2019.
|
| 228 |
+
[49] Hidenori Tanaka, Daniel Kunin, Daniel L Yamins, and Surya Ganguli. Pruning neural networks without any data by iteratively conserving synaptic flow. Advances in Neural Information Processing Systems, 33, 2020.
|
| 229 |
+
[50] Yehui Tang, Yunhe Wang, Yixing Xu, Yiping Deng, Chao Xu, Dacheng Tao, and Chang Xu. Manifold regularized dynamic network pruning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5018–5028, 2021.
|
| 230 |
+
[51] Yehui Tang, Yunhe Wang, Yixing Xu, Dacheng Tao, Chunjing XU, Chao Xu, and Chang Xu. Scop: Scientific control for reliable neural network pruning. In Advances in Neural Information Processing Systems, pages 10936–10947, 2020.
|
| 231 |
+
[52] Rishabh Tiwari, Udbhav Bamba, Arnav Chavan, and Deepak Gupta. Chipnet: Budget-aware pruning with heaviside continuous approximations. In International Conference on Learning Representations, 2020.
|
| 232 |
+
[53] Chaoqi Wang, Guodong Zhang, and Roger Grosse. Picking winning tickets before training by preserving gradient flow. In International Conference on Learning Representations, 2019.
|
| 233 |
+
[54] Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in Neural Information Processing Systems, pages 2074–2082, 2016.
|
| 234 |
+
[55] Yuhui Xu, Yongzhuang Wang, Aojun Zhou, Weiyao Lin, and Hongkai Xiong. Deep neural network compression with single and multiple level quantization. arXiv preprint arXiv:1803.03289, 2018.
|
| 235 |
+
[56] Yinchong Yang, Denis Krompass, and Volker Tresp. Tensor-train recurrent neural networks for video classification. In International Conference on Machine Learning, pages 3891–3900, 2017.
|
| 236 |
+
[57] Miao Yin, Siyu Liao, Xiao-Yang Liu, Xiaodong Wang, and Bo Yuan. Compressing recurrent neural networks using hierarchical tucker tensor decomposition. arXiv preprint arXiv:2005.04366, 2020.
|
| 237 |
+
[58] Miao Yin, Yang Sui, Siyu Liao, and Bo Yuan. Towards efficient tensor decomposition-based dnn model compression with optimization framework. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10674–10683, 2021.
|
| 238 |
+
[59] Ruichi Yu, Ang Li, Chun-Fu Chen, Jui-Hsin Lai, Vlad I Morariu, Xintong Han, Mingfei Gao, ChingYung Lin, and Larry S Davis. Nisp: Pruning networks using neuron importance score propagation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9194–9203, 2018.
|
| 239 |
+
[60] Tianyun Zhang, Shaokai Ye, Kaiqi Zhang, Jian Tang, Wujie Wen, Makan Fardad, and Yanzhi Wang. A systematic dnn weight pruning framework using alternating direction method of multipliers. In Proceedings of the European Conference on Computer Vision (ECCV), pages 184–199, 2018.
|
| 240 |
+
[61] Yuefu Zhou, Ya Zhang, Yanfeng Wang, and Qi Tian. Accelerate cnn via recursive bayesian pruning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3306–3315, 2019.
|
| 241 |
+
[62] Chaoyang Zhu, Kejie Huang, Shuyuan Yang, Ziqi Zhu, Hejia Zhang, and Haibin Shen. An efficient hardware accelerator for structured sparse convolutional neural networks on fpgas. IEEE Transactions on Very Large Scale Integration (VLSI) Systems, 28(9):1953–1965, 2020.
|
| 242 |
+
[63] Zhuangwei Zhuang, Mingkui Tan, Bohan Zhuang, Jing Liu, Yong Guo, Qingyao Wu, Junzhou Huang, and Jinhui Zhu. Discrimination-aware channel pruning for deep neural networks. In Advances in Neural Information Processing Systems, pages 875–886, 2018.
|
md/train/HJx81ySKwr/HJx81ySKwr.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ITERATIVE ENERGY-BASED PROJECTION ON A NORMAL DATA MANIFOLD FOR ANOMALY LOCALIZATION
|
| 2 |
+
|
| 3 |
+
David Dehaene∗, Oriel Frigo∗, Sébastien Combrexelle, Pierre Eline AnotherBrain, Paris, France {david, oriel, sebastien, pierre}@anotherbrain.ai
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Autoencoder reconstructions are widely used for the task of unsupervised anomaly localization. Indeed, an autoencoder trained on normal data is expected to only be able to reconstruct normal features of the data, allowing the segmentation of anomalous pixels in an image via a simple comparison between the image and its autoencoder reconstruction. In practice however, local defects added to a normal image can deteriorate the whole reconstruction, making this segmentation challenging. To tackle the issue, we propose in this paper a new approach for projecting anomalous data on a autoencoder-learned normal data manifold, by using gradient descent on an energy derived from the autoencoder’s loss function. This energy can be augmented with regularization terms that model priors on what constitutes the user-defined optimal projection. By iteratively updating the input of the autoencoder, we bypass the loss of high-frequency information caused by the autoencoder bottleneck. This allows to produce images of higher quality than classic reconstructions. Our method achieves state-of-the-art results on various anomaly localization datasets. It also shows promising results at an inpainting task on the CelebA dataset.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Automating visual inspection on production lines with artificial intelligence has gained popularity and interest in recent years. Indeed, the analysis of images to segment potential manufacturing defects seems well suited to computer vision algorithms. However these solutions remain data hungry and require knowledge transfer from human to machine via image annotations. Furthermore, the classification in a limited number of user-predefined categories such as non-defective, greasy, scratched and so on, will not generalize well if a previously unseen defect appears. This is even more critical on production lines where a defective product is a rare occurrence. For visual inspection, a better-suited task is unsupervised anomaly detection, in which the segmentation of the defect must be done only via prior knowledge of non-defective samples, constraining the issue to a two-class segmentation problem.
|
| 12 |
+
|
| 13 |
+
From a statistical point of view, an anomaly may be seen as a distribution outlier, or an observation that deviates so much from other observations as to arouse suspicion that it was generated by a different mechanism (Hawkins, 1980). In this setting, generative models such as Variational AutoEncoders (VAE, Kingma & Welling (2014)), are especially interesting because they are capable to infer possible sampling mechanisms for a given dataset. The original autoencoder (AE) jointly learns an encoder model, that compresses input samples into a low dimensional space, and a decoder, that decompresses the low dimensional samples into the original input space, by minimizing the distance between the input of the encoder and the output of the decoder. The more recent variant, VAE, replaces the deterministic encoder and decoder by stochastic functions, enabling the modeling of the distribution of the dataset samples as well as the generation of new, unseen samples. In both models, the output decompressed sample given an input is often called the reconstruction, and is used as some sort of projection of the input on the support of the normal data distribution, which we will call the normal manifold. In most unsupervised anomaly detection methods based on VAE, models are trained on flawless data and defect detection and localization is then performed using a distance metric between the input sample and its reconstruction (Bergmann et al., 2018; 2019; An & Cho, 2015; Baur et al., 2018; Matsubara et al., 2018).
|
| 14 |
+
|
| 15 |
+
One fundamental issue in this approach is that the models learn on the normal manifold, hence there is no guarantee of the generalization of their behavior outside this manifold. This is problematic since it is precisely outside the dataset distribution that such methods intend to use the VAE for anomaly localization. Even in the case of a model that always generates credible samples from the dataset distribution, there is no way to ensure that the reconstruction will be connected to the input sample in any useful way. An example illustrating this limitation is given in figure 1, where a VAE trained on regular grid images provides a globally poor reconstruction despite a local perturbation, making the anomaly localization challenging.
|
| 16 |
+
|
| 17 |
+
In this paper, instead of using the VAE reconstruction, we propose to find a better projection of an input sample on the normal manifold, by optimizing an energy function defined by an autoencoder architecture. Starting at the input sample, we iterate gradient descent steps on the input to converge to an optimum, simultaneously located on the data manifold and closest to the starting input. This method allows us to add prior knowledge about the expected anomalies via regularization terms, which is not possible with the raw VAE reconstruction. We show that such an optimum is better than previously proposed autoencoder reconstructions to localize anomalies on a variety of unsupervised anomaly localization datasets (Bergmann et al., 2019) and present its inpainting capabilities on the CelebA dataset (Liu et al., 2015). We also propose a variant of the standard gradient descent that uses the pixel-wise reconstruction error to speed up the convergence of the energy.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Even though an anomaly is a local perturbation in the image (b), the whole VAEreconstructed image can be disturbed (c). Our gradient descent-based method gives better quality reconstructions (d).
|
| 21 |
+
|
| 22 |
+
# 2 BACKGROUND
|
| 23 |
+
|
| 24 |
+
# 2.1 GENERATIVE MODELS
|
| 25 |
+
|
| 26 |
+
In unsupervised anomaly detection, the only data available during training are samples $\mathbf { x }$ from a non-anomalous dataset $\check { \mathbb { X } } \subset \mathbb { R } ^ { d }$ . In a generative setting, we suppose the existence of a probability function of density $q$ , having its support on all $\mathbb { R } ^ { \bar { d } }$ , from which the dataset was sampled. The generative objective is then to model an estimate of density $q$ , from which we can obtain new samples close to the dataset. Popular generative architectures are Generative Adversarial Networks (GAN, Goodfellow et al. (2014)), that concurrently train a generator $G$ to generate samples from random, low-dimensional noise $\mathbf { z } \ \sim \ p , \ \mathbf { z } \ \in \ \mathbf { \bar { \mathbb { R } } } ^ { l } , \ l \ \ll \ \mathbf { \bar { d } } .$ , and a discriminator $D$ to classify generated samples and dataset samples. This model converges to the equilibrium of the expectation over both real and generated datasets of the binary cross entropy loss of the classifier $m i n _ { G } m a x _ { D }$ [ $\mathbb { E } _ { { \mathbf { x } } \sim q } \left[ \log ( D ( \mathbf { x } ) ) \right] + \mathbb { E } _ { { \mathbf { z } } \sim p } \left[ \log ( 1 - D ( G ( \mathbf { z } ) ) ) \right] ]$ .
|
| 27 |
+
|
| 28 |
+
Disadvantages of GANs are that they are notoriously difficult to train (Goodfellow, 2017), and they suffer from mode collapse, meaning that they have the tendency to only generate a subset of the original dataset. This can be problematic for anomaly detection, in which we do not want some subset of the normal data to be considered as anomalous (Bergmann et al., 2019). Recent works such as Thanh-Tung et al. (2019) offer simple and attractive explanations for GAN behavior and propose substantial upgrades, however Ravuri & Vinyals (2019) still support the point that GANs have more trouble than other generative models to cover the whole distribution support.
|
| 29 |
+
|
| 30 |
+
Another generative model is the VAE (Kingma & Welling (2014)), where, similar to a GAN generator, a decoder model tries to approximate the dataset distribution with a simple latent variables prior $p ( \mathbf { z } )$ , with $\mathbf { z } \in \mathbb { R } ^ { l }$ , and conditional distributions output by the decoder $p ( \mathbf { x } | \mathbf { z } )$ . This leads to the estimate $\begin{array} { r } { p ( \mathbf { x } ) = \int p ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) d z } \end{array}$ , that we would like to optimize using maximum likelihood estimation on the dataset. To render the learning tractable with a stochastic gradient descent (SGD) estimator with reasonable variance, we use importance sampling, introducing density functions $q ( \mathbf { z } | \mathbf { x } )$ output by an encoder network, and Jensen’s inequality to get the variational lower bound :
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
\begin{array} { r l } & { \log p ( \mathbf { x } ) = \log \ \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } \mid \mathbf { x } ) } \frac { p ( \mathbf { x } \mid \mathbf { z } ) p ( \mathbf { z } ) } { q ( \mathbf { z } \mid \mathbf { x } ) } } \\ & { \qquad \geq \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } \mid \mathbf { x } ) } \log \ p ( \mathbf { x } \mid \mathbf { z } ) - D _ { \mathrm { K L } } ( q ( \mathbf { z } \mid \mathbf { x } ) \| p ( \mathbf { z } ) ) = - \mathcal { L } ( \mathbf { x } ) } \end{array}
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
We will use $\mathcal { L } ( \mathbf { x } )$ as our loss function for training. We define the VAE reconstruction, per analogy with an autoencoder reconstruction, as the deterministic sample $f _ { V A E } ( \mathbf { x } )$ that we obtain by encoding $\mathbf { x }$ , decoding the mean of the encoded distribution $q ( \mathbf { z } | \mathbf { x } )$ , and taking again the mean of the decoded distribution $p ( \mathbf { x } | \mathbf { z } )$ .
|
| 37 |
+
|
| 38 |
+
VAEs are known to produce blurry reconstructions and generations, but Dai & Wipf (2019) show that a huge enhancement in image quality can be gained by learning the variance of the decoded distribution $p ( \mathbf { x } | \mathbf { z } )$ . This comes at the cost of the distribution of latent variables produced by the encoder $q ( \mathbf { z } )$ being farther away from the prior $p ( \mathbf { z } )$ , so that samples generated by sampling $\mathbf { z } \sim$ $p ( \mathbf { z } ) , \mathbf { x } \sim p ( \mathbf { x } | \mathbf { z } )$ have poorer quality. The authors show that using a second VAE learned on samples from $q ( \mathbf { z } )$ , and sampling from it with ancestral sampling $\mathbf { u } \sim p ( \mathbf { u } ) , \mathbf { z } \sim p ( \mathbf { z } | \mathbf { u } ) , \mathbf { x } \sim p ( \mathbf { x } | \mathbf { z } )$ , allows to recover samples of GAN-like quality. The original autoencoder can be roughly considered as a VAE whose encoded and decoded distributions have infinitely small variances.
|
| 39 |
+
|
| 40 |
+
# 2.2 ANOMALY DETECTION AND LOCALIZATION
|
| 41 |
+
|
| 42 |
+
We will consider that an anomaly is a sample with low probability under our estimation of the dataset distribution. The VAE loss, being a lower bound on the density, is a good proxy to classify samples between the anomalous and non-anomalous categories. To this effect, a threshold $T$ can be defined on the loss function, delimiting anomalous samples with ${ \mathcal { L } } ( \mathbf { x } ) \geq T$ and normal samples $\mathcal { L } ( \mathbf { x } ) < T$ . However, according to Matsubara et al. (2018), the regularization term $\mathcal { L } _ { K L } ( \mathbf { x } ) = D _ { \mathrm { K L } } ( q ( \mathbf { z } | \mathbf { x } ) | | p ( \mathbf { z } ) )$ has a negative influence in the computation of anomaly scores. They propose instead an unregularized score $\mathbf { \bar { \mathcal { L } } } _ { r } ( \mathbf { x } ) = - \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { x } ) }$ log $\bar { p } ( { \bf x } | { \bf z } )$ which is equivalent to the reconstruction term of a standard autoencoder and claim a better anomaly detection.
|
| 43 |
+
|
| 44 |
+
Going from anomaly detection to anomaly localization, this reconstruction term becomes crucial to most of existing solutions. Indeed, the inability of the model to reconstruct a given part of an image is used as a way to segment the anomaly, using a pixel-wise threshold on the reconstruction error. Actually, this segmentation is very often given by a pixel-wise (An & Cho, 2015; Baur et al., 2018; Matsubara et al., 2018) or patch-wise comparison of the input image, and some generated image, as in Bergmann et al. (2018; 2019), where the structural dissimilarity (DSSIM, Wang et al. (2004)) between the input and its VAE reconstruction is used.
|
| 45 |
+
|
| 46 |
+
Autoencoder-based methods thus provide a straightforward way of generating an image conditioned on the input image. In the GAN original framework, though, images are generated from random noise $\mathbf { z } \sim p ( \mathbf { z } )$ and are not conditioned by an input. Schlegl et al. (2017) propose with AnoGAN to get the closest generated image to the input using gradient descent on $\mathbf { z }$ for an energy defined by:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
E _ { A n o G A N } = | | \mathbf { x } - G ( \mathbf { z } ) | | _ { 1 } + \lambda \cdot | | f _ { D } ( \mathbf { x } ) - f _ { D } ( G ( \mathbf { z } ) ) | | _ { 1 }
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
The first term ensures that the generation $G ( \mathbf { z } )$ is close to the input $\mathbf { x }$ . The second term is based on a distance between features of the input and the generated images, where $f _ { D } ( { \bf x } )$ is the output of an intermediate layer of the discriminator. This term ensures that the generated image stays in the vicinity of the original dataset distribution.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: Illustration of our method. We perform gradient descent on $E ( \mathbf { x } _ { t } )$ to iteratively correct $\mathbf { x } _ { t }$ .
|
| 56 |
+
|
| 57 |
+
# 3 PROPOSED METHOD
|
| 58 |
+
|
| 59 |
+
# 3.1 ADVERSARIAL PROJECTIONS
|
| 60 |
+
|
| 61 |
+
According to Zimmerer et al. (2018), the loss gradient with respect to $\mathbf { x }$ gives the direction towards normal data samples, and its magnitude could indicate how abnormal a sample is. In their work on anomaly identification, they use the loss gradient as an anomaly score.
|
| 62 |
+
|
| 63 |
+
Here we propose to use the gradient of the loss to iteratively improve the observed $\mathbf { x }$ . We propose to link this method to the methodology of computing adversarial samples in Szegedy et al. (2014).
|
| 64 |
+
|
| 65 |
+
After training a VAE on non-anomalous data, we can define a threshold $T$ on the reconstruction loss $\mathcal { L } _ { r }$ as in (Matsubara et al., 2018), such that a small proportion of the most improbable samples are identified as anomalies. We obtain a binary classifier defined by
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
A ( \mathbf { x } ) = \left\{ { \begin{array} { l l } { 1 \mathrm { i f } \mathcal { L } _ { r } ( \mathbf { x } ) \geq T } \\ { 0 \mathrm { o t h e r w i s e } } \end{array} } \right.
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Our method consists in computing adversarial samples of this classifier (Szegedy et al., 2014), that is to say, starting from a sample $\mathbf { x } _ { \mathrm { 0 } }$ with $A ( \mathbf { x } _ { 0 } ) = \bar { 1 }$ , iterate gradient descent steps over the input $\mathbf { x }$ , constructing samples $\mathbf { x } _ { 1 } , \ldots . . . \mathbf { x } _ { N }$ , to minimize the energy $E ( \mathbf { x } )$ , defined as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { E ( \mathbf { x } _ { t } ) = \mathcal { L } _ { r } ( \mathbf { x } _ { t } ) + \lambda \cdot | | \mathbf { x } _ { t } - \mathbf { x } _ { 0 } | | _ { 1 } } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
An iteration is done by calculating $\mathbf { x } _ { t + 1 }$ as
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r } { \mathbf { x } _ { t + 1 } = \mathbf { x } _ { t } - \alpha \cdot \nabla _ { \mathbf { x } } E ( \mathbf { x } _ { t } ) , } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\alpha$ is a learning rate parameter, and $\lambda$ is a parameter trading off the inclusion of $\mathbf { x } _ { t }$ in the normal manifold, given by $\mathcal { L } _ { r } ( \mathbf { x } _ { t } )$ , and the proximity between $\mathbf { x } _ { t }$ and the input $\mathbf { x } _ { \mathrm { 0 } }$ , assured by the regularization term $| | \mathbf { x } _ { t } - \mathbf { x } _ { 0 } | | _ { 1 }$ .
|
| 84 |
+
|
| 85 |
+
# 3.2 REGULARIZATION TERM
|
| 86 |
+
|
| 87 |
+
We model the anomalous images that we encounter as normal images in which a region or several regions of pixels are altered but the rest of the pixels are left untouched. To recover the best segmentation of the anomalous pixels from an anomalous image $\mathbf { x } _ { a }$ , we want to recover the closest image from the normal manifold $\mathbf { x } _ { g }$ . The term closest has to be understood in the sense that the smallest number of pixels are modified between $\mathbf { x } _ { a }$ and $\mathbf { x } _ { g }$ . In our model, we therefore would like to use the $L ^ { 0 }$ distance as a regularization distance of the energy. Since the $L ^ { 0 }$ distance is not differentiable, we use the $L ^ { 1 }$ distance as an approximation.
|
| 88 |
+
|
| 89 |
+
# 3.3 OPTIMIZATION IN INPUT SPACE
|
| 90 |
+
|
| 91 |
+
While in our method the optimization is done in the input space, in the previously mentioned AnoGAN, the search for the optimal reconstruction is done by iterating over $\mathbf { z }$ samples with the
|
| 92 |
+
|
| 93 |
+
energy defined in equation 2. Following the aforementioned analogy between a GAN generator $G$ and a VAE decoder $D e c$ , a similar approach in the context of a VAE would be to use the energy
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
| | \mathbf { x } - D e c ( \mathbf { z } ) | | _ { 1 } - \lambda \cdot \log p ( \mathbf { z } )
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where the $- \log p ( \mathbf { z } )$ term has the same role as AnoGAN’s $| | f _ { D } ( \mathbf { x } ) - f _ { D } ( G ( \mathbf { z } ) ) | | _ { 1 }$ term, to ensure that $D e c ( \mathbf { z } )$ stays within the learned manifold. We chose not to iterate over $\mathbf { z }$ in the latent space for two reasons. First, because as noted in Dai & Wipf (2019) and Hoffman & Johnson (2016), the prior $p ( \mathbf { z } )$ is not always a good proxy for the real image of the distribution in the latent space $q ( \mathbf { z } )$ . Second, because the VAE tends to ignore some details of the original image in its reconstruction, considering that these details are part of the independent pixel noise allowed by the modeling of $p ( \mathbf { x } | \mathbf { z } )$ as a diagonal Gaussian, which causes its infamous blurriness. An optimization in latent space would have to recreate the high frequency structure of the image, whereas iterating over the input image space, and starting the descent on the input image $\mathbf { x } _ { \mathrm { 0 } }$ , allows us to keep that structure and thus to obtain projections of higher quality.
|
| 100 |
+
|
| 101 |
+
# 3.4 OPTIMIZING GRADIENT DESCENT
|
| 102 |
+
|
| 103 |
+
We observed that using the Adam optimizer (Kingma & Ba, 2015) is beneficial for the quality of the optimization. Moreover, to speed up the convergence and further preserve the aforementioned high frequency structure of the input, we propose to compute our iterative samples using the pixel-wise reconstruction error of the VAE. To explain the intuition behind this improvement, we will consider the inpainting task. In this setting, as in anomaly localization, a local perturbation is added on top of a normal image. However, in the classic inpainting task, the localization of the perturbation is known beforehand, and we can use the localization mask $\pmb { \Omega }$ to only change the value of the anomalous pixels in the gradient descent:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathbf { x } _ { t + 1 } = \mathbf { x } _ { t } - \alpha \cdot \left( \nabla _ { \mathbf { x } } E ( \mathbf { x } _ { t } ) \odot \Omega \right)
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $\odot$ is the Hadamard product.
|
| 110 |
+
|
| 111 |
+
For anomaly localization and blind inpainting, where this information is not available, we compute the pixel-wise reconstruction error which gives a rough estimate of the mask. The term $\nabla _ { \mathbf x } E ( \mathbf x _ { t } )$ is therefore replaced with $\nabla _ { \mathbf x } E ( \mathbf x _ { t } ) \odot ( { \mathbf x _ { t } } - f _ { V A E } ( \mathbf { x } _ { t } ) ) ^ { 2 } .$ ) in equation 5:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathbf { x } _ { t + 1 } = \mathbf { x } _ { t } - \alpha \cdot \left( \nabla _ { \mathbf { x } } E ( \mathbf { x } _ { t } ) \odot ( \mathbf { x } _ { t } - f _ { V A E } ( \mathbf { x } _ { t } ) ) ^ { 2 } \right)
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $f _ { V A E } ( \mathbf { x } )$ is the standard reconstruction of the VAE. Optimizing the energy this way, a pixel where the reconstruction error is high will update faster, whereas a pixel with good reconstruction will not change easily. This prevents the image to update its pixels where the reconstruction is already good, even with a high learning rate. As can be seen in appendix B, this method converges to the same performance as the method of equation 5, but with fewer iterations. An illustration of our method can be found in figure 2.
|
| 118 |
+
|
| 119 |
+
# 3.5 STOP CRITERION
|
| 120 |
+
|
| 121 |
+
A standard stop criterion based on the convergence of the energy can efficiently be used. Using the adversarial setting introduced in section 3.1, we also propose to stop the gradient descent when a certain predefined threshold on the VAE loss is reached. For example, such a threshold can be chosen to be a quantile of the empirical loss distribution computed on the training set.
|
| 122 |
+
|
| 123 |
+
# 4 EXPERIMENTS
|
| 124 |
+
|
| 125 |
+
In this section, we evaluate the proposed method for two different applications: anomaly segmentation and image inpainting. Both applications are interesting use cases of our method, where we search to reconstruct partially corrupted images, correcting the anomalies while preserving the uncorrupted image regions.
|
| 126 |
+
|
| 127 |
+
# 4.1 UNSUPERVISED ANOMALY SEGMENTATION
|
| 128 |
+
|
| 129 |
+
In order to evaluate the proposed method for the task of anomaly segmentation, we perform experiments with the recently proposed MVTec dataset (Bergmann et al., 2019). This collection of datasets
|
| 130 |
+
|
| 131 |
+
Table 1: Results for anomaly segmentation on MVTec datasets, expressed in AUROC (Area Under the Receiver Operating Characteristics). Four different baselines are trained on normal samples and are augmented by our proposed gradient based reconstruction (grad) for comparison: A deterministic autoencoder trained with $L ^ { \tilde { 2 } }$ loss $( L ^ { 2 } \mathbf { A E } )$ as in (Bergmann et al., 2019); A deterministic autoencoder trained with DSSIM loss (DSAE) as in (Bergmann et al., 2019); A variational autoencoder (VAE); And a variational autoencoder with a learned decoder variance $\langle \gamma \cdot$ -VAE) as in (Dai & Wipf, 2019). For each result a green or red background denotes respectively an improvement or a decrease in performance compared to the baseline. It can be seen that the proposed gradient-based reconstruction achieves the best segmentation for most datasets, with a mean improvement rate of $9 . 5 2 \%$ over all baselines.
|
| 132 |
+
|
| 133 |
+
<table><tr><td colspan="2">Category</td><td>L²AE</td><td>L²AE grad</td><td>DSAE</td><td>DSAE grad</td><td>VAE</td><td>VAE grad</td><td>γ-VAE</td><td>γ-VAE grad</td></tr><tr><td rowspan="5">TJ annes</td><td>carpet</td><td>0.539</td><td>0.734</td><td>0.545</td><td>0.774</td><td>0.580</td><td>0.735</td><td>0.648</td><td>0.727</td></tr><tr><td>grid</td><td>0.960</td><td>0.981</td><td>0.960</td><td>0.980</td><td>0.888</td><td>0.961</td><td>0.950</td><td>0.979</td></tr><tr><td>leather</td><td>0.751</td><td>0.921</td><td>0.710</td><td>0.602</td><td>0.834</td><td>0.925</td><td>0.818</td><td>0.897</td></tr><tr><td>tile</td><td>0.476</td><td>0.575</td><td>0.496</td><td>0.626</td><td>0.465</td><td>0.654</td><td>0.491</td><td>0.581</td></tr><tr><td>wood</td><td>0.630</td><td>0.805</td><td>0.641</td><td>0.738</td><td>0.695</td><td>0.838</td><td>0.665</td><td>0.809</td></tr><tr><td rowspan="9">seetqt</td><td>bottle</td><td>0.909</td><td>0.916</td><td>0.933</td><td>0.951</td><td>0.902</td><td>0.922</td><td>0.913</td><td>0.931</td></tr><tr><td>cable</td><td>0.732</td><td>0.864</td><td>0.790</td><td>0.859</td><td>0.828</td><td>0.910</td><td>0.777</td><td>0.880</td></tr><tr><td>capsule</td><td>0.786</td><td>0.952</td><td>0.769</td><td>0.884</td><td>0.862</td><td>0.917</td><td>0.814</td><td>0.917</td></tr><tr><td>hazelnut</td><td>0.976</td><td>0.984</td><td>0.966</td><td>0.966</td><td>0.977</td><td>0.976</td><td>0.977</td><td>0.988</td></tr><tr><td>metalnut</td><td>0.880</td><td>0.899</td><td>0.881</td><td>0.920</td><td>0.881</td><td>0.907</td><td>0.883</td><td>0.914</td></tr><tr><td>pill</td><td>0.885</td><td>0.912</td><td>0.895</td><td>0.927</td><td>0.888</td><td>0.930</td><td>0.897</td><td>0.935</td></tr><tr><td>screw</td><td>0.979</td><td>0.980</td><td>0.983</td><td>0.925</td><td>0.958</td><td>0.945</td><td>0.976</td><td>0.972</td></tr><tr><td>toothbrush</td><td>0.971</td><td>0.983</td><td>0.973</td><td>0.984</td><td>0.971</td><td>0.985</td><td>0.971</td><td>0.983</td></tr><tr><td>transistor</td><td>0.906</td><td>0.921</td><td>0.904</td><td>0.934</td><td>0.894</td><td>0.919</td><td>0.896</td><td>0.931</td></tr><tr><td>zipper</td><td></td><td>0.680</td><td>0.889</td><td>0.828</td><td>0.887</td><td>0.814</td><td>0.869</td><td>0.706</td><td>0.871</td></tr></table>
|
| 134 |
+
|
| 135 |
+
consists of 15 different categories of objects and textures in the context of industrial inspection, each category containing a number of normal and anomalous samples.
|
| 136 |
+
|
| 137 |
+
We train our model on normal training samples and test it on both normal and anomalous test samples to evaluate the anomaly segmentation performance.
|
| 138 |
+
|
| 139 |
+
We perform experiments with three different baseline autoencoders: A “vanilla” variational autoencoder with decoder covariance matrix fixed to identity (Kingma & Welling, 2014), a variational autoencoder with learned decoder variance (Dai & Wipf, 2019), a “vanilla” deterministic autoencoder trained with $L ^ { 2 }$ as reconstruction loss $( L ^ { 2 } \mathrm { A E } )$ and a deterministic autoencoder trained with DSSIM reconstruction loss (DSAE), as proposed by Bergmann et al. (2018). For the sake of a fair comparison, all the autoencoder models are parameterized by convolutional neural networks with the same architecture, latent space dimensionality (set to 100), learning rate (set to 0.0001) and number of epochs (set to 300). The architecture details (layers, paddings, strides) are the same as described in Bergmann et al. (2018) and Bergmann et al. (2019). Similarly to the authors in Bergmann et al. (2019), for the textures datasets, we first subsample the original dataset images to $5 1 2 \times 5 1 2$ and then crop random patches of size $1 2 8 \times 1 2 8$ which are used to train and test the different models. For the object datasets, we directly subsample the original dataset images to $1 2 8 \times 1 2 8$ unlike in Bergmann et al. (2019) who work on $2 5 6 \times 2 5 6$ images, then we perform rotation and translation data augmentations. For all datasets we train on 10000 images.
|
| 140 |
+
|
| 141 |
+
Anomaly segmentation is then computed by reconstructing the anomalous image and comparing it with the original. We perform the comparison between reconstructed and original with the DSSIM metric as it has been observed in Bergmann et al. (2018) that it provides better anomaly localization than $L ^ { 2 }$ or $L ^ { 1 }$ distances. For the gradient descent, we set the step size $\alpha : = 0 . 5$ , $L ^ { 1 }$ regularization weight $\lambda : = 0 . 0 5$ and the stop criterion is achieved when a sample reconstruction loss is inferior to the minimum reconstruction loss over the training set.
|
| 142 |
+
|
| 143 |
+
In table 1 we show the AUROC (Area Under the Receiver Operating Characteristics) for different autoencoder methods, with different thresholds applied to the DSSIM anomaly map computed between original and reconstructed images. Note that an AUROC of 1 expresses the best possible segmentation in terms of normal and anomalous pixels. For each autoencoder variant we compare the baseline reconstruction with the proposed gradient-based reconstruction (grad.). As in Bergmann et al. (2019) we observe that an overall best model is hard to identify, however we show that our method increases the AUC values for almost all autoencoder variants. Aggregating the results over all datasets and baselines, we report a mean improvement rate of $9 . 5 2 \%$ , with a median of $4 . 3 3 \%$ , a 25th percentile of $1 . 8 6 \%$ , and a 75th percentile of $1 5 . 8 6 \%$ . The histogram of the improvement rate for all datasets and baselines is provided in appendix F, as well as a short analysis.
|
| 144 |
+
|
| 145 |
+
In figure 3 we compare our anomaly segmentation with a baseline $L ^ { 2 }$ autoencoder Bergmann et al. (2019) $( L ^ { 2 } \mathbf { A E } )$ for a number of image categories. For all results in figure 3, we set the same threshold to 0.2 to the anomaly detection map given by the DSSIM metric. The visual results in figure 3 highlights an overall improvement of anomaly localization by our proposed iterative reconstruction $\bar { L ^ { 2 } } \mathrm { A } \bar { \mathrm { E } }$ -grad). See appendix C for additional visual results of anomaly segmentation on remaining categories of MVTec dataset, and on remaining baseline models.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 3: First row: Normal samples of hazelnut, grid, cable, wood, carpet and bottle categories in MVTec dataset; Second row: anomalous samples from the aforementioned dataset categories; Third row: Anomaly segmentation with baseline $\bar { L } ^ { 2 }$ autoencoder (Bergmann et al., 2019); Fourth row: our proposed anomaly segmentation with $L ^ { 2 }$ autoencoder augmented with gradient-based iterative reconstruction. Ground truth is represented by red contour, and each estimated segmentation by a green overlay. It can be seen that anomaly segmentation is refined by our proposed method, with a tendency of detecting less false positives.
|
| 149 |
+
|
| 150 |
+
# 4.2 INPAINTING
|
| 151 |
+
|
| 152 |
+
Image inpainting is a well known image reconstruction problem which consists of reconstructing a corrupted or missing part of an image, where the region to be reconstructed is usually given by a known mask. Many different approaches for inpainting have been proposed in the literature, such as anisotropic diffusion (Bertalmio et al., 2000), patch matching (Criminisi et al., 2004), context autoencoders (Pathak et al., 2016) and conditional variational autoencoders (Ivanov et al., 2019).
|
| 153 |
+
|
| 154 |
+
If we consider that the region to be reconstructed is not known beforehand, the problem is sometimes called blind inpainting (Altinel et al., 2018), and the corrupted part can be seen as an anomaly to be corrected.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 4: Inpainting experiment performed on CelebA dataset, where the test face images are masked with uniform noise. The baseline VAE reconstruction is disturbed by the noise mask, providing a poor inpainting. The proposed gradient-based VAE provides a more convincing inpainting by an iterative process.
|
| 158 |
+
|
| 159 |
+
We performed experiments with image inpainting on the CelebA dataset (Liu et al., 2015), which consists of celebrity faces. In figure 4 we compare the inpainting results obtained with a baseline VAE with learned variance $\left( \gamma { \mathrm { - V A E } } \right)$ and Resnet architecture, as described by Dai & Wipf (2019), with the same VAE model, augmented by our proposed gradient-based iterative reconstruction. Note that for the regular inpainting task, gradients are multiplied by the inpainting mask at each iteration (equation 7), while for the blind inpainting task, the mask is unknown. See appendix D for a comparison with a recent method based on variational autoencoders, proposed by Ivanov et al. (2019).
|
| 160 |
+
|
| 161 |
+
# 5 RELATED WORK
|
| 162 |
+
|
| 163 |
+
Baur et al. (2018) have used autoencoder reconstructions to localize anomalies in MRI scans, and have compared several variants using diverse per-pixel distances as well as perceptual metrics derived from a GAN-like architecture. Bergmann et al. (2018) use the structural similarity metric (Wang et al., 2004) to compare the original image and its reconstruction to achieve better anomaly localization, and also presents the SSIM autoencoder, which is trained directly with this metric.
|
| 164 |
+
|
| 165 |
+
Zimmerer et al. (2018) use the derivative of the VAE loss function with respect to the input, called the score. The amplitude of the score is supposed to indicate how abnormal a pixel is. While we agree that the gradient of the loss is an indication of an anomaly, we think that we have to integrate this gradient over the path from the input to the normal manifold to obtain meaningful information. We compare our results to score-based results for anomaly localization in appendix A.
|
| 166 |
+
|
| 167 |
+
The work that is the most related to ours is AnoGAN (Schlegl et al., 2017). We have mentioned above the differences between the two approaches, which, apart from the change in underlying architectures, boil down to the ability in our method to update directly the input image instead of searching for the optimal latent code. This enables the method to converge faster and above all to keep higher-frequency structures of the input, which would have been deteriorated if it were passed through the AE bottleneck. Bergmann et al. (2019) compare standard AE reconstructions techniques to AnoGAN, and observes that AnoGAN’s performances on anomaly localizations tasks are poorer than AE’s due to the mode collapse tendency of GAN architectures. Interestingly, updates on AnoGAN such as fast AnoGAN (Schlegl et al., 2019) or AnoVAEGAN (Baur et al., 2018) replaced the gradient descent search of the optimal z with a learned encoder model, yielding an approach very similar to the standard VAE reconstruction-based approaches, but with a reconstruction loss learned by a discriminator, which is still prone to mode collapse (Thanh-Tung et al., 2019).
|
| 168 |
+
|
| 169 |
+
# 6 CONCLUSION
|
| 170 |
+
|
| 171 |
+
In this paper, we proposed a novel method for unsupervised anomaly localization, using gradient descent of an energy defined by an autoencoder reconstruction loss. Starting from a sample under test, we iteratively update this sample to reduce its autoencoder reconstruction error. This method offers a way to incorporate human priors into what is the optimal projection of an out-of-distribution sample into the normal data manifold. In particular, we use the pixel-wise reconstruction error to modulate the gradient descent, which gives impressive anomaly localization results in only a few iterations. Using gradient descent in the input data space, starting from the input sample, enables us to overcome the autoencoder tendency to provide blurry reconstructions and keep normal high frequency structures. This significantly reduces the number of pixels that could be wrongly classified as defects when the autoencoder fails to reconstruct high frequencies. We showed that this method, which can easily be added to any previously trained autoencoder architecture, gives state-of-the-art results on a variety of unsupervised anomaly localization datasets, as well as qualitative reconstructions on an inpainting task. Future work can focus on replacing the $L ^ { 1 }$ -based regularization term with a Bayesian prior modeling common types of anomalies, and on further improving the speed of the gradient descent.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Fazil Altinel, Mete Ozay, and Takayuki Okatani. Deep structured energy-based image inpainting. In 2018 24th International Conference on Pattern Recognition (ICPR), pp. 423–428, Aug 2018. doi: 10.1109/ICPR.2018.8546025.
|
| 176 |
+
|
| 177 |
+
Jinwon An and Sungzoon Cho. Variational autoencoder based anomaly detection using reconstruction probability. Technical report, SNU Data Mining Center, 2015.
|
| 178 |
+
|
| 179 |
+
Christoph Baur, Benedikt Wiestler, Shadi Albarqouni, and Nassir Navab. Deep autoencoding models for unsupervised anomaly segmentation in brain MR images. CoRR, abs/1804.04488, 2018.
|
| 180 |
+
|
| 181 |
+
Paul Bergmann, Sindy Löwe, Michael Fauser, David Sattlegger, and Carsten Steger. Improving unsupervised defect segmentation by applying structural similarity to autoencoders. CoRR, abs/1807.02011, 2018.
|
| 182 |
+
|
| 183 |
+
Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Mvtec ad — a comprehensive real-world dataset for unsupervised anomaly detection. CVPR, 2019.
|
| 184 |
+
|
| 185 |
+
Marcelo Bertalmio, Guillermo Sapiro, Vincent Caselles, and Coloma Ballester. Image inpainting. In Proceedings of the 27th Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH $\mathbf { \dot { \theta } } _ { 0 0 }$ , pp. 417–424, New York, NY, USA, 2000. ACM Press/Addison-Wesley Publishing Co. ISBN 1-58113-208-5. doi: 10.1145/344779.344972.
|
| 186 |
+
|
| 187 |
+
Antonio Criminisi, Patrick Pérez, and Kentaro Toyama. Region filling and object removal by exemplar-based image inpainting. Trans. Img. Proc., 13(9):1200–1212, September 2004. ISSN 1057-7149. doi: 10.1109/TIP.2004.833105.
|
| 188 |
+
|
| 189 |
+
Bin Dai and David P. Wipf. Diagnosing and enhancing VAE models. CoRR, abs/1903.05789, 2019.
|
| 190 |
+
|
| 191 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 192 |
+
|
| 193 |
+
Ian J. Goodfellow. NIPS 2016 tutorial: Generative adversarial networks. CoRR, abs/1701.00160, 2017.
|
| 194 |
+
|
| 195 |
+
Douglas M Hawkins. Identification of outliers. Monographs on applied probability and statistics. Chapman and Hall, London [u.a.], 1980. ISBN 041221900X.
|
| 196 |
+
|
| 197 |
+
Matthew D. Hoffman and Matthew J. Johnson. Elbo surgery: yet another way to carve up the variational evidence lower bound. In NIPS 2016 Workshop on Advances in Approximate Bayesian Inference, 2016.
|
| 198 |
+
|
| 199 |
+
Oleg Ivanov, Michael Figurnov, and Dmitry Vetrov. Variational autoencoder with arbitrary conditioning. In International Conference on Learning Representations, 2019.
|
| 200 |
+
|
| 201 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
|
| 202 |
+
|
| 203 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Yoshua Bengio and Yann LeCun (eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
|
| 204 |
+
|
| 205 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
|
| 206 |
+
|
| 207 |
+
Takashi Matsubara, Ryosuke Tachibana, and Kuniaki Uehara. Anomaly machine component detection by deep generative model with unregularized score. CoRR, abs/1807.05800, 2018.
|
| 208 |
+
|
| 209 |
+
Deepak Pathak, Philipp Krähenbühl, Jeff Donahue, Trevor Darrell, and Alexei Efros. Context encoders: Feature learning by inpainting. In Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 210 |
+
|
| 211 |
+
Suman V. Ravuri and Oriol Vinyals. Classification accuracy score for conditional generative models. CoRR, abs/1905.10887, 2019.
|
| 212 |
+
|
| 213 |
+
Thomas Schlegl, Philipp Seeböck, Sebastian M Waldstein, Ursula Schmidt-Erfurth, and Georg Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International Conference on Information Processing in Medical Imaging, pp. 146– 157. Springer, 2017.
|
| 214 |
+
|
| 215 |
+
Thomas Schlegl, Philipp Seeböck, Sebastian M. Waldstein, Georg Langs, and Ursula SchmidtErfurth. f-anogan: Fast unsupervised anomaly detection with generative adversarial networks. Medical Image Analysis, 54:30 – 44, 2019. ISSN 1361-8415. doi: https://doi.org/10.1016/j. media.2019.01.010.
|
| 216 |
+
|
| 217 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In Yoshua Bengio and Yann LeCun (eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
|
| 218 |
+
|
| 219 |
+
Hoang Thanh-Tung, Truyen Tran, and Svetha Venkatesh. Improving generalization and stability of generative adversarial networks. CoRR, abs/1902.03984, 2019.
|
| 220 |
+
|
| 221 |
+
Zhou Wang, Alan Bovik, Hamid Sheikh, and Eero Simoncelli. Image quality assessment: From error visibility to structural similarity. Image Processing, IEEE Transactions on, 13:600 – 612, 05 2004. doi: 10.1109/TIP.2003.819861.
|
| 222 |
+
|
| 223 |
+
David Zimmerer, Fabian Isensee, Jens Petersen, Simon Kohl A. A., and Klaus H. Maier-Hein. Unsupervised anomaly localization using variational auto-encoders. CoRR, abs/1907.02796, 2019.
|
| 224 |
+
|
| 225 |
+
# A COMPARISON WITH ZIMMERER ET AL. (2019)
|
| 226 |
+
|
| 227 |
+
Table 2: Complementary results for anomaly segmentation on MVTec datasets, expressed in AUROC for different pixel-wise scores derived from a baseline VAE: from left to right, squared error reconstruction $| | { \bf x } - f _ { V A E } ( { \bf x } ) | | ^ { 2 }$ (denoted $\mathcal { L } _ { r } ( \mathbf { x } ) )$ , gradient of the loss $| \nabla _ { \mathbf x } \mathcal L ( \mathbf x ) |$ , combination of both, gradient of the KL divergence $| D _ { \mathrm { K L } } ( q ( \mathbf { z } | \mathbf { x } ) \| p ( \mathbf { z } ) )$ (denoted $| \nabla _ { \mathbf { x } } \mathcal { L } _ { K L } ( \mathbf { x } ) | )$ as well as combination of KL derivative and error reconstruction as suggested in Zimmerer et al. (2018; 2019).
|
| 228 |
+
|
| 229 |
+
<table><tr><td></td><td>Category</td><td>Lr(x)</td><td>VxL(x)</td><td>IVxL(x)) OLr(x)</td><td>IVxLKL(x)l</td><td>IVxLKL(x)) Lr(x)</td><td>VAE-grad</td></tr><tr><td rowspan="5">TJssnets</td><td>carpet</td><td>0.537</td><td>0.580</td><td>0.566</td><td>0.553</td><td>0.555</td><td>0.735</td></tr><tr><td>grid</td><td>0.823</td><td>0.635</td><td>0.812</td><td>0.507</td><td>0.790</td><td>0.961</td></tr><tr><td>leather</td><td>0.783</td><td>0.650</td><td>0.792</td><td>0.627</td><td>0.791</td><td>0.925</td></tr><tr><td>tile</td><td>0.547</td><td>0.606</td><td>0.581</td><td>0.623</td><td>0.588</td><td>0.654</td></tr><tr><td>wood</td><td>0.686</td><td>0.691</td><td>0.726</td><td>0.643</td><td>0.713</td><td>0.838</td></tr><tr><td rowspan="10">seetqt</td><td>bottle</td><td>0.831</td><td>0.762</td><td>0.832</td><td>0.629</td><td>0.830</td><td>0.922</td></tr><tr><td>cable</td><td>0.831</td><td>0.796</td><td>0.846</td><td>0.674</td><td>0.841</td><td>0.910</td></tr><tr><td>capsule</td><td>0.765</td><td>0.754</td><td>0.772</td><td>0.642</td><td>0.795</td><td>0.917.</td></tr><tr><td>hazelnut</td><td>0.907</td><td>0.831</td><td>0.908</td><td>0.468</td><td>0.885</td><td>0.976</td></tr><tr><td>metalnut</td><td>0.833</td><td>0.831</td><td>0.870</td><td>0.710</td><td>0.834</td><td>0.907</td></tr><tr><td>pill</td><td>0.869</td><td>0.833</td><td>0.872</td><td>0.480</td><td>0.826</td><td>0.930</td></tr><tr><td>screw</td><td>0.851</td><td>0.726</td><td>0.842</td><td>0.412</td><td>0.795</td><td>0.945</td></tr><tr><td>toothbrush</td><td>0.942</td><td>0.798</td><td>0.943</td><td>0.619</td><td>0.939</td><td>0.985</td></tr><tr><td>transistor</td><td>0.788</td><td>0.843</td><td>0.834</td><td>0.801</td><td>0.836</td><td>0.919</td></tr><tr><td>zipper</td><td>0.725</td><td>0.674</td><td>0.729</td><td>0.562</td><td>0.727</td><td>0.869</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Zimmerer et al. (2019) proposed to perform anomaly localization using different scores derived from the gradient of the VAE loss. In particular, it has been shown that the product of the VAE reconstruction error with the gradient of the KL divergence was very informative for medical images. In table 2 we compare the pixel-wise anomaly detection AUROC of these different scores with our method. For all experiments, we use the same “vanilla” VAE as described in section 4.1.
|
| 232 |
+
|
| 233 |
+
It can be seen that other VAE-based methods using a single evaluation of the gradient are constantly outperformed by our method.
|
| 234 |
+
|
| 235 |
+
# B CONVERGENCE SPEED
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Figure 5: Evolution of pixel-wise anomaly detection AUROC performance.
|
| 239 |
+
|
| 240 |
+
In figure 5 we compare the number of iterations needed to reach convergence with our two proposals for gradient descent: Standard update as in equation 5 and Tuned update using a gradient mask computed with the VAE reconstruction error, as in equation 8. The model is a VAE with learned decoder variance (Dai & Wipf, 2019), trained on the Grid dataset (Bergmann et al., 2019). We compute the mean pixel-wise anomaly detection AUROC after each iteration on the test set.
|
| 241 |
+
|
| 242 |
+
We can see that the tuned method converges to the same performance as the standard method, with far fewer iterations.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure 6: From left to right: Normal; Anomalous; Anomaly segmentation with baseline $L ^ { 2 }$ autoencoder (Bergmann et al., 2019); Our proposed anomaly segmentation with $L ^ { 2 }$ autoencoder augmented with gradient-based iterative reconstruction.
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure 7: Illustration of anomaly localization comparison over four baselines ( $L ^ { 2 } { \mathrm { A E } }$ , DSAE, VAE, $\gamma$ -VAE). Ground truth is represented by red contour, and each estimated segmentation by a green overlay. It can be seen that anomaly segmentation is overall improved when different baselines are augmented by our proposed gradient descent.
|
| 249 |
+
|
| 250 |
+
# D INPAINTING COMPARISON
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 8: Inpainting comparison. Each batch is made of four rows, from top to bottom: Masked input image; VAE with arbitrary conditioning (VAEAC, Ivanov et al. (2019)); Ours; Ground truth. The quality of the reconstructions is comparable, even though our VAE is trained without any assumptions over the mask’s properties.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 9: Principle of the energy optimization to project anomalous sample on the normal manifold
|
| 257 |
+
|
| 258 |
+
Figure 9 illustrates our method principle. We start with a defective input $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ whose reconstruction $\scriptstyle { \hat { \mathbf { x } } } _ { 0 }$ does not necessarily lie on the normal data manifold. As the optimization process carries on, the optimized sample $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ and its reconstruction look more similar and get closer to the manifold. The regularization term of the energy function makes sure that the optimized sample stays close to the original sample.
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 10: Distribution of the improvement rate over all presented baselines and all datasets in MVTec AD.
|
| 262 |
+
|
| 263 |
+
Figure 10 shows the distribution of the AUC improvement rate over all presented baselines and all datasets in MVTec AD using our gradient-based projection method.
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
{ \mathrm { i m p r o v e m e n t r a t e } } = { \frac { A U C _ { g r a d } - A U C _ { b a s e } } { A U C _ { b a s e } } }
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
• $8 . 3 \%$ of data points are under the 0 value delimiting an increase or decrease in AUC due to our method, and $9 1 . 7 \%$ data points are over this value. Our method increases the AUC in a vast majority of cases.
|
| 270 |
+
|
| 271 |
+
• The median is at $4 . 3 3 \%$ , the 25th percentile at $1 . 8 6 \%$ , and the 75th percentile at $1 5 . 8 6 \%$ .
|
md/train/HkMCybx0-/HkMCybx0-.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING DEEP LEARNING BY INVERSE SQUARE ROOT LINEAR UNITS (ISRLUS)
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We introduce the “inverse square root linear unit” (ISRLU) to speed up learning in deep neural networks. ISRLU has better performance than ELU but has many of the same benefits. ISRLU and ELU have similar curves and characteristics. Both have negative values, allowing them to push mean unit activation closer to zero, and bring the normal gradient closer to the unit natural gradient, ensuring a noiserobust deactivation state, lessening the over fitting risk. The significant performance advantage of ISRLU on traditional CPUs also carry over to more efficient HW implementations on HW/SW codesign for CNNs/RNNs. In experiments with TensorFlow, ISRLU leads to faster learning and better generalization than ReLU on CNNs. This work also suggests a computationally efficient variant called the “inverse square root unit” (ISRU) which can be used for RNNs. Many RNNs use either long short-term memory (LSTM) and gated recurrent units (GRU) which are implemented with tanh and sigmoid activation functions. ISRU has less computational complexity but still has a similar curve to tanh and sigmoid.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Two popular activation functions for neural networks are the rectified linear unit (ReLU) (Glorot et al., 2011) and the exponential linear unit (ELU) (Clevert et al., 2015). The ReLU activation function is the identity for positive arguments and zero otherwise. The ELU activation function is the identity for positive arguments and has an exponential asymptotic approach to -1 for negative values.
|
| 12 |
+
|
| 13 |
+
From previous analysis of the Fisher optimal learning, i.e., the natural gradient (Amari, 1998; Clevert et al., 2015), we can reduce the undesired bias shift effect without the natural gradient, either by centering the activation of incoming units at zero or by using activation functions with negative values. We introduce the inverse square root linear unit (ISRLU), an activation function like ELU, that has smoothly saturating negative values for negative arguments, and the identity for positive arguments. In addition this activation function can be more efficiently implemented than ELU in a variety of software or purpose-built hardware.
|
| 14 |
+
|
| 15 |
+
# 2 INVERSE SQUARE ROOT LINEAR UNIT (ISRLU)
|
| 16 |
+
|
| 17 |
+
The inverse square root linear unit (ISRLU) with $\alpha$ is
|
| 18 |
+
|
| 19 |
+
$$
|
| 20 |
+
f ( x ) = \left\{ \begin{array} { l l } { x } & { \mathrm { i f ~ } x \geq 0 } \\ { x \left( \frac { 1 } { \sqrt { 1 + \alpha x ^ { 2 } } } \right) } & { \mathrm { i f ~ } x < 0 } \end{array} , \right. \qquad f ^ { \prime } ( x ) = \left\{ \begin{array} { l l } { 1 } & { \mathrm { i f ~ } x \geq 0 } \\ { \left( \frac { 1 } { \sqrt { 1 + \alpha x ^ { 2 } } } \right) ^ { 3 } } & { \mathrm { i f ~ } x < 0 } \end{array} \right.
|
| 21 |
+
$$
|
| 22 |
+
|
| 23 |
+
The ISRLU hyperparameter $\alpha$ controls the value to which an ISRLU saturates for negative inputs (see Fig. 1). ISRLUs and ELUs have very similar curves so at a high level one would expect to see the same general characteristics in most cases. ISRLUs have smooth and continuous first and second derivatives. ELUs are only continuous in the first derivative (see Fig. 1). In contrast, ReLU is non-differentiable at zero. Since ISRLUs and ELUs share most of the same characteristics we use the same weight initialization guidelines as are used for ELUs (Clevert et al., 2015)).
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: The inverse square root linear unit (ISRLU), ISRLU $( \alpha = 1 ; \alpha = 3 )$ ), ELU $( \alpha = 1 )$ ), and ReLU; and their first derivatives.
|
| 27 |
+
|
| 28 |
+
The primary advantage of ISRLU is in its reduced computational complexity compared to ELU. Inverse square roots are faster to calculate than exponentials. When calculating ISRLU for negative inputs, first one calculates $1 / \sqrt { 1 + \alpha x ^ { 2 } }$ . Multiplying this function by $x$ provides the value for the forward calculation. Multiplying this function by itself twice (i.e. cubing) provides the value for back-propagation.
|
| 29 |
+
|
| 30 |
+
With $\alpha = 1$ , ISRLU saturation approaches -1. With $\alpha = 3$ , the negative saturation is reduced, so a smaller portion of the back-propagated error signal will pass to the next layer. This allows the network to output sparse activations while preserving its ability to reactivate dead neurons. Note that under variations of the $\alpha$ parameter, the ISRLU curve and its derivative remain smooth and continuous. Future work will establish what deeper saturation $( \alpha < 1 )$ ) is appropriate when applying ISRLU to self-normalizing neural networks (Klambauer et al., 2017).
|
| 31 |
+
|
| 32 |
+
In the same manner as parametric ReLUs (PReLUs) only one additional hyperparameter is required and methods can be used to directly learn its value during back-propagation (He et al., 2015). Similarly, ISRLU’s $\alpha$ can be learned during the training phase along with the weights and biases. Indeed for PReLUs, He et al. (2015) have empirically shown that learning the slope parameter “a” gives better performance than manually setting it to a pre-defined value.
|
| 33 |
+
|
| 34 |
+
# 3 ACTIVATION FUNCTION PERFORMANCE
|
| 35 |
+
|
| 36 |
+
Shah et al. (2016) showed that ELU was faster than the combination of ReLU and Batch Normalization for deep neural network (DNN) ResNet architectures. On CIFAR-10 and CIFAR-100 they showed that ELU not only speeds up learning but also improves the accuracy as the depth of the convolutional neural network (CNN) increases.
|
| 37 |
+
|
| 38 |
+
More than learning rate needs to be considered when evaluating the overall performance of CNNs. The amount of time and computational resources required to perform both the convolutions and activation functions combined should be considered.
|
| 39 |
+
|
| 40 |
+
The trend in CNNs is that less time is being spent calculating convolutions. There are three factors that we are seeing. First is that small convolution filters such as 5x5 or $3 { \tt X } 3$ filters are the basis of many architectures. Second, architectures as Inception-v3 and Inception-v4 now decompose 2d filters such as a 3x3 into a 3x1 filter and a 1x3 filter (Szegedy et al., 2016). Third, more efficient calculations of convolution that rely on techniques such as Winograd’s minimal filtering algorithm (Lavin & Gray, 2016; Winograd, 1980) are being used for 3x3 and smaller filters as are FFTs to reduce calculation time in 5x5 or larger filters. All of these techniques reduce the amount of calculations for each element in the convolution output.
|
| 41 |
+
|
| 42 |
+
Table 1 shows “cycles per output element” for an Intel Xeon Platinum 8160 (Skylake).
|
| 43 |
+
|
| 44 |
+
Table 1: Computational complexity of various filter sizes
|
| 45 |
+
|
| 46 |
+
<table><tr><td>Convolution</td><td>FP Multiplies</td><td>FP Adds</td><td>Cycles per output element (CPE)</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>5x5</td><td>25 9</td><td>24 8</td><td>~4.25 ~1.53</td></tr><tr><td>3x3</td><td></td><td>2</td><td></td></tr><tr><td>3x1,1x3 Inception-v3, -v4</td><td>3</td><td></td><td>~0.51</td></tr></table>
|
| 47 |
+
|
| 48 |
+
Due to all of these reductions in convolution computational complexity, activation function performance is now a greater part of overall learning performance.
|
| 49 |
+
|
| 50 |
+
Another characteristic that is changing with the use of smaller filters is the decrease in the compute intensity (Carlile, 1993a;b), which raises the importance of memory systems performance for CNNs. The compute intensity of an algorithm is the ratio of the number of operations divided by number of words accessed. For a given algorithm it is straightforward to calculate the upper bound of the computation rate that can be supported on a given memory bandwidth.
|
| 51 |
+
|
| 52 |
+
# 3.1 ACTIVATION FUNCTION IMPLEMENTATION
|
| 53 |
+
|
| 54 |
+
The main advantage of ISRLU over ELU is that it is based on the inverse square root, which has been faster to evaluate than the exponential for many generations of systems. In the past, whenever it has not been faster, optimization potentials for inverse square root implementation improvement have been found. It is instructive to understand the current CPU performance of the inverse square root intrinsic performance compared to exponentials and tanh.
|
| 55 |
+
|
| 56 |
+
Intel $\mathbf { \boldsymbol { x } } 8 6$ CPUs with SIMD instructions have vector intrinsic functions to accelerate performance. Intel publishes CPE (Clocks per Element) for various vector functions on their “Vector Mathematics (VM) Performance and Accuracy Data” website, see Table 2 (Intel, 2017).
|
| 57 |
+
|
| 58 |
+
Table 2: CPU performance on vector inverse square root, Exp, Tanh (x86).
|
| 59 |
+
|
| 60 |
+
<table><tr><td>Vector Function Single Precision (EP)</td><td>Intel Xeon E5-2699 v3 (Haswell AVX2)</td><td>Intel Xeon E5-2699 v4 (Broadwell AVX2)</td><td>Intel Xeon Platinum 8180 (Skylake AVX-512)</td></tr><tr><td>InvSqrt</td><td>0.66</td><td>0.64</td><td>0.24</td></tr><tr><td>Exp</td><td>0.81</td><td>0.89</td><td>0.52</td></tr><tr><td>Tanh</td><td>4.19</td><td>4.43</td><td>0.78</td></tr><tr><td>Exp/InvSqrt</td><td>1.2×</td><td>1.4×</td><td>2.2×</td></tr><tr><td>Tanh/InvSqrt</td><td>6.3×</td><td>6.9×</td><td>3.3×</td></tr><tr><td></td><td></td><td></td><td></td></tr></table>
|
| 61 |
+
|
| 62 |
+
For example, on a 3x1 filter using ELU in the negative region, approximately the same CPE is required to evaluate the convolution as is required for the exponential (cf. Table 1 and Table 2). Improvements in activation function performance will impact overall time spent in each learning step.
|
| 63 |
+
|
| 64 |
+
We measured the vector performance of AVX2 implementations for the various activation functions.
|
| 65 |
+
The dataset used was $50 \%$ negative and $50 \%$ positive. Results are shown in Table 3.
|
| 66 |
+
|
| 67 |
+
Table 3: Vector ISRLU, ISRU, ELU, and ReLU performance on AVX2 (Intel Core i7-7700 Processor [3.60 GHz “Kaby Lake”] ).
|
| 68 |
+
|
| 69 |
+
<table><tr><td>Activation Function Single Precision</td><td>nsec/ element</td><td>ISRLU Perf Advantage</td><td>ISRLU (approx.) Perf Advantage</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>ReLU</td><td>0.340</td><td>0.62×</td><td>0.99×</td></tr><tr><td>ISRU (approx.)</td><td>0.334 0.344</td><td>0.61× 0.62×</td><td>0.97× 1.00×</td></tr><tr><td>ISRLU (approx.) ISRLU</td><td>0.551</td><td>1.00×</td><td>1.60×</td></tr><tr><td>ELU</td><td>1.447</td><td>2.63×</td><td>4.21×</td></tr></table>
|
| 70 |
+
|
| 71 |
+
These results show that ISRLU ( $\alpha = 1 . 0 $ ) is $2 . 6 \times$ faster than ELU. The fast approximation of ISRLU is within $1 \%$ of the evaluation speed of ReLU while still retaining all of the desired learning curve properties mentioned in this paper. This fast approximation for ISRLU on this processor has only $\bar { 3 } \times 1 0 ^ { - 4 }$ maximum relative error ${ \sim } 1 1 . 6$ accurate bits). One Newton-Raphson iteration doubles that to ${ \sim } 2 3 . 4$ accurate bits out of the 24 bits of mantissa, and two iterations achieves full precision. We plan to evaluate if the fast approximation has similar learning rates of the full precision ISRLU.
|
| 72 |
+
|
| 73 |
+
# 3.2 A PRACTICAL TRICK FOR INVERSE SQUARE ROOT CALCULATION
|
| 74 |
+
|
| 75 |
+
It is instructive to look at a practical trick for the computation of the inverse square root as it may serve as inspiration for those implementing ISRLU in hardware. Software implementations on CPUs can take advantage of floating-point formats for faster evaluation of the inverse square root. John Carmack and Terje Mathisen are often associated with implementing fast inverse square root in 2002 (Lomont, 2003). In 1986, one of the authors of this paper originally invented this method, which was called “The K Method,” to implement vector square root for the production FPS T Series Hypercube Supercomputer (Gustafson, 1986). William Kahan and K.C. $\mathrm { N g }$ at Berkeley also independently discovered this around 1986.
|
| 76 |
+
|
| 77 |
+
Carmack & Mathisen only used one iteration of the Newton method after their fast approximation. One iteration had an error of approximately $0 . 1 7 5 \%$ , which was suitable for their graphics applications. Since various piecewise functions have been used to approximate activation functions for CNNs and RNNs, part of our future research will look into if fast approximations to ISRLUs are suitable for DNNs.
|
| 78 |
+
|
| 79 |
+
Another avenue to look at for hardware implementations of the inverse square root is table-lookup hardware. Our expectation is that an efficient hardware approximation for the inverse square root should take about the same execution time as a fused multiply and add (FMA).
|
| 80 |
+
|
| 81 |
+
# 4 EXPERIMENTS USING ISRLUS
|
| 82 |
+
|
| 83 |
+
We used TensorFlow (Abadi et al., 2016) to train a CNN on the (Lecun) MNIST dataset. We tested the MNIST gray images in 10 classes, 60k train and $1 0 \mathrm { k }$ test.
|
| 84 |
+
|
| 85 |
+
The first CNN architecture (see Table 4) in our experiments used $2 8 \mathbf { x } 2 8$ input, a convolutional layer with 6x6 with 6 feature maps, a convolutional layer with $5 \mathrm { x } 5$ with 12 feature maps, a convolutional layer with $4 \mathbf { x } 4$ with 24 feature maps, a fully connected layer of 1176 hidden units, and a softmax output layer with 10 units. Only a full-precision ISRLU was used in these initial tests due to time constraints.
|
| 86 |
+
|
| 87 |
+
Convolutional neural networks with ISRLUs ( $\alpha = 1 . 0$ , $\alpha = 3 . 0$ ), ELUs $( \alpha = 1 . 0 $ ), and ReLUs were trained on the MNIST digit classification dataset while each hidden units activation was tracked. Each network was trained for 17 epochs by using ADAM optimizer with learning rate 0.003 exponentially decreasing to 0.0001 and mini-batches of size 100. The weights have been initialized to truncated normal with standard deviation 0.1. The training error of ISRLU networks decreases much more rapidly than for the other networks. We also calculated the final cross-entropy loss function for each test.
|
| 88 |
+
|
| 89 |
+
Table 4: Architecture 1 on MNIST with test accuracy and cross-entropy loss with different activation functions.
|
| 90 |
+
|
| 91 |
+
<table><tr><td>Activation Function</td><td>DropOut pkeep</td><td>Max Test Accuracy</td><td>Cross-Entropy Loss</td></tr><tr><td></td><td></td><td></td><td>2.308</td></tr><tr><td>ISRLU α= 3.0 ELU</td><td>0.25 0.40</td><td>99.30 99.29</td><td>2.395</td></tr><tr><td>ISRLU α = 3.0</td><td>0.40</td><td>99.27</td><td>2.530</td></tr><tr><td>ReLU</td><td>0.40</td><td>99.22</td><td>2.644</td></tr><tr><td>ISRLU α = 1.0</td><td>0.40</td><td>99.20</td><td>2.785</td></tr><tr><td>ReLU</td><td>0.25</td><td>99.17</td><td>2.798</td></tr><tr><td>ELU</td><td>0.25</td><td>99.09</td><td>2.892</td></tr><tr><td>ISRLU α = 1.0</td><td>0.25</td><td>99.00</td><td>3.124</td></tr></table>
|
| 92 |
+
|
| 93 |
+
The second CNN architecture (see Table 5) in our experiments used $2 8 \mathbf { x } 2 8$ input, a convolutional layer with $3 { \tt X } 3$ with 64 feature maps, a convolutional layer with $3 { \tt X } 3$ with 64 feature maps, $2 \mathbf { x } 2$ Maxpooling, DropOut, a convolutional layer with 3x3 with 64 feature maps, a convolutional layer with 3x3 with 64 feature maps, 2x2 Maxpooling, DropOut, a fully connected (FC) layer of 512 hidden units, and a softmax output layer with 10 units. Full-precision ISRLU was used.
|
| 94 |
+
|
| 95 |
+
Convolutional neural networks with ISRLUs ( $\alpha = 1 . 0$ , $\alpha = 3 . 0$ ) and ELUs ( $\alpha = 1 . 0$ ) were trained on the MNIST digit classification dataset while each hidden units activation was tracked. The network was trained for 20 epochs by using ADAM optimizer with learning rate 0.003 exponentially decreasing to 0.0001 and mini-batches of size 100. The weights have been initialized to truncated normal with standard deviation 0.1.
|
| 96 |
+
|
| 97 |
+
Table 5: Architecture 2 on MNIST with test accuracy and cross-entropy loss with different activation functions.
|
| 98 |
+
|
| 99 |
+
<table><tr><td>Activation Function</td><td>DropOut pkeep</td><td>Max Test Accuracy</td><td>Cross-Entropy Loss</td></tr><tr><td>ISRLU α = 1.0</td><td>0.7 conv 0.4 FC</td><td>99.32</td><td>2.334</td></tr><tr><td>ISRLU α= 3.0</td><td>0.7 conv 0.4 FC</td><td>99.30</td><td>2.389</td></tr><tr><td>ELU</td><td>0.7 conv 0.4 FC</td><td>99.29</td><td>2.225</td></tr></table>
|
| 100 |
+
|
| 101 |
+
We did not expect significant differences in accuracy in ISRLU and ELU in this test of shallow networks due to the similar nature of the curves. The cross-entropy loss was reasonable, at between 2 and 3.2 for all activation functions. Future testing will be done on deeper networks where we expect larger advantages that are similar to ELU (Clevert et al., 2015; Shah et al., 2016).
|
| 102 |
+
|
| 103 |
+
# 5 INVERSE SQUARE ROOT UNIT (ISRU)
|
| 104 |
+
|
| 105 |
+
The work with ISRLU in this paper suggests that the inverse square root unit (ISRU) may be useful for a variety of neural networks. ISRUs are defined as:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
f ( x ) = x \left( { \frac { 1 } { \sqrt { 1 + \alpha x ^ { 2 } } } } \right) , \qquad f ^ { \prime } ( x ) = \left( { \frac { 1 } { \sqrt { 1 + \alpha x ^ { 2 } } } } \right) ^ { 3 }
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
In RNNs that use LSTM (Hochreiter & Schmidhuber, 1997) and GRU (Chung et al., 2014), the most common activation functions are sigmoid and tanh. We assert that ISRUs can be more efficient calculation than tanh and be more efficient than sigmoid when properly shifted and scaled. As shown above in Table 2, the inverse square root is $3 \mathbf { x }$ to 6x faster than tanh (depending on $\mathbf { \boldsymbol { x } } 8 6$ architecture). ISRUs will be an area of our future research.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 2: The inverse square root unit (ISRU) and tanh functions.
|
| 115 |
+
|
| 116 |
+
# 6 CONCLUSION
|
| 117 |
+
|
| 118 |
+
Activation function performance is becoming more important overall in convolutional neural networks (CNNs) because of the trending reductions in the computational complexity of the convolutions used in CNNs. We have introduced a new activation function, the inverse square root linear unit (ISRLU) for faster and precise learning in deep convolutional neural networks. ISRLUs have similar activation curves to ELUs, including the negative values. This decreases the forward propagated variation and brings the mean activations to zero. Mean activations close to zero decreases the bias shift for units in the next layer which speeds up learning by bringing the natural gradient closer to the unit natural gradient. Future work may prove the effectiveness of applying ISRLUs and the related ISRUs to other network architectures, such as recurrent neural networks, and to other tasks, such as object detection. ISRLUs have lower computational complexity than ELUs. Even greater savings on computation can be realized by implementing ISRLUs in custom hardware implementations. We expect ISRLU activations to increase the training efficiency of convolutional networks.
|
| 119 |
+
|
| 120 |
+
# REFERENCES
|
| 121 |
+
|
| 122 |
+
Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: A system for large-scale machine learning. In 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16), pp. 265–283, GA, 2016. USENIX Association. ISBN 978-1-931971-33-1. URL https://www.usenix.org/conference/osdi16/ technical-sessions/presentation/abadi.
|
| 123 |
+
|
| 124 |
+
Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural Computation, 10(2):251– 276, February 1998. ISSN 0899-7667. doi: 10.1162/089976698300017746. URL http://dx. doi.org/10.1162/089976698300017746.
|
| 125 |
+
|
| 126 |
+
Brad Carlile. Parallelism, compute intensity, and data vectorization. Submitted to Supercomputing ’93, Portland, OR., November 1993a.
|
| 127 |
+
|
| 128 |
+
Brad Carlile. Algorithms and design: the CRAY APP shared-memory system. In Digest of Papers. Compcon Spring, pp. 312–320, Feb 1993b. doi: 10.1109/CMPCON.1993.289687.
|
| 129 |
+
|
| 130 |
+
Junyoung Chung, C¸ aglar Gulc¸ehre, KyungHyun Cho, and Yoshua Bengio. Empirical eval ¨ uation of gated recurrent neural networks on sequence modeling. CoRR, abs/1412.3555, 2014. URL http://arxiv.org/abs/1412.3555. NIPS 2014 Workshop on Deep Learning, December 2014.
|
| 131 |
+
|
| 132 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast an ´ d accurate deep network learning by exponential linear units (ELUs). CoRR, abs/1511.07289, 2015. URL http:// arxiv.org/abs/1511.07289.
|
| 133 |
+
|
| 134 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Geoffrey Gordon, David Dunson, and Miroslav Dudk (eds.), Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pp. 315–323, Fort Lauderdale, FL, USA, 11–13 Apr 2011. PMLR. URL http://proceedings.mlr.press/v15/glorot11a.html.
|
| 135 |
+
|
| 136 |
+
John L. Gustafson. Programming the FPS T Series. Checkpoint, 4(6):2–8, 1986. URL http:// www.johngustafson.net/pubs/pubt1986.2/FPS.pdf.
|
| 137 |
+
|
| 138 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), ICCV ’15, pp. 1026–1034, Washington, DC, USA, 2015. IEEE Computer Society. ISBN 978-1-4673-8391-2. doi: 10.1109/ICCV.2015.123. URL http://dx.doi.org/10.1109/ICCV.2015.123.
|
| 139 |
+
|
| 140 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9 (8):1735–1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL http://dx.doi.org/10.1162/neco.1997.9.8.1735.
|
| 141 |
+
|
| 142 |
+
Vector Mathematics (VM) Performance and Accuracy Data. Intel, Sep 2017. URL https:// software.intel.com/sites/products/documentation/doclib/mkl/vm/ vmdata.htm. Visited 10-19-2017.
|
| 143 |
+
|
| 144 |
+
Gunter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sep ¨ p Hochreiter. Self-normalizing neural networks. CoRR, abs/1706.02515, 2017. URL http://arxiv.org/abs/1706. 02515.
|
| 145 |
+
|
| 146 |
+
Andrew Lavin and Scott Gray. Fast algorithms for convolutional neural networks. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4013–4021, 06 2016.
|
| 147 |
+
|
| 148 |
+
Chris Lomont. Fast inverse square root. https://www.lomont.org/Math/Papers/ 2003/InvSqrt.pdf, Feb 2003.
|
| 149 |
+
|
| 150 |
+
Anish Shah, Eashan Kadam, Hena Shah, Sameer Shinde, and Sandip Shingade. Deep residual networks with exponential linear unit. In Proceedings of the Third International Symposium on Computer Vision and the Internet, VisionNet’16, pp. 59–65, New York, NY, USA, 2016. ACM. ISBN 978-1-4503-4301-5. doi: 10.1145/2983402.2983406. URL http://doi.acm.org/ 10.1145/2983402.2983406.
|
| 151 |
+
|
| 152 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Conference: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2818–2826, 06 2016.
|
md/train/HklUCCVKDB/HklUCCVKDB.md
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNCERTAINTY-GUIDED CONTINUAL LEARNING WITH BAYESIAN NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Sayna Ebrahimi∗ Mohamed Elhoseiny† UC Berkeley KAUST, Stanford University
|
| 4 |
+
|
| 5 |
+
Trevor Darrell UC Berkeley
|
| 6 |
+
|
| 7 |
+
Marcus Rohrbach Facebook AI Research
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Continual learning aims to learn new tasks without forgetting previously learned ones. This is especially challenging when one cannot access data from previous tasks and when the model has a fixed capacity. Current regularization-based continual learning algorithms need an external representation and extra computation to measure the parameters’ importance. In contrast, we propose Uncertaintyguided Continual Bayesian Neural Networks (UCB), where the learning rate adapts according to the uncertainty defined in the probability distribution of the weights in networks. Uncertainty is a natural way to identify what to remember and what to change as we continually learn, and thus mitigate catastrophic forgetting. We also show a variant of our model, which uses uncertainty for weight pruning and retains task performance after pruning by saving binary masks per tasks. We evaluate our UCB approach extensively on diverse object classification datasets with short and long sequences of tasks and report superior or on-par performance compared to existing approaches. Additionally, we show that our model does not necessarily need task information at test time, i.e. it does not presume knowledge of which task a sample belongs to.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Humans can easily accumulate and maintain knowledge gained from previously observed tasks, and continuously learn to solve new problems or tasks. Artificial learning systems typically forget prior tasks when they cannot access all training data at once but are presented with task data in sequence.
|
| 16 |
+
|
| 17 |
+
Overcoming these challenges is the focus of continual learning, sometimes also referred to as lifelong learning or sequential learning. Catastrophic forgetting (McCloskey & Cohen, 1989; McClelland et al., 1995) refers to the significant drop in the performance of a learner when switching from a trained task to a new one. This phenomenon occurs because trained parameters on the initial task change in favor of learning new objectives.
|
| 18 |
+
|
| 19 |
+
Given a network of limited capacity, one way to address this problem is to identify the importance of each parameter and penalize further changes to those parameters that were deemed to be important for the previous tasks (Kirkpatrick et al., 2017; Aljundi et al., 2018; Zenke et al., 2017). An alternative is to freeze the most important parameters and allow future tasks to only adapt the remaining parameters to new tasks (Mallya & Lazebnik, 2018). Such models rely on the explicit parametrization of importance. We propose here implicit uncertainty-guided importance representation.
|
| 20 |
+
|
| 21 |
+
Bayesian approaches to neural networks (MacKay, 1992b) can potentially avoid some of the pitfalls of explicit parameterization of importance in regular neural networks. Bayesian techniques, naturally account for uncertainty in parameters estimates. These networks represent each parameter with a distribution defined by a mean and variance over possible values drawn from a shared latent probability distribution (Blundell et al., 2015). Variational inference can approximate posterior distributions using Monte Carlo sampling for gradient estimation. These networks act like ensemble methods in that they reduce the prediction variance but only use twice the number of parameters present in a regular neural network. We propose to use the predicted mean and variance of the latent distributions to characterize the importance of each parameter. We perform continual learning with
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Illustration of evolution of weight distributions through learning two tasks. (a) circles represent Figure 1: Illustration of the evolution of weight distributions – uncertain weights adapt more quickly – from Ɲ(0,0.1). As an example we show five color-coded and plot their distributions. (b) Shows when learning two tasks using UCB. (a) weight parameter initialized by distributions initialized with posterior distribution after learning Task 1. Whicontributions in learning Task 1), W3, W4, and mean and variance values randomly sampled from $\mathcal { N } ( 0 , 0 . 1 )$ xhibit lower uncertainties (more ve larger uncertainties, with the . (b) posterior distribution after learning task one; while $\theta _ { 1 }$ higand $\theta _ { 2 }$ STD in W5, making them available to learn more tasks. (c) Task 2 is learned using highexhibit lower uncertainties after learning the first task, $\theta _ { 3 } , \theta _ { 4 }$ , and $\theta _ { 5 }$ have learning rates for previously uncertain parameters (W3 and W4, W5) while learning rates for W1 and W2 are moderated according to their predicted low uncertainty after finishing task 1. larger uncertainties, making them available to learn more tasks. (c) a second task is learned using 1 2 higher learning rates for previously uncertain parameters $( \theta _ { 1 } , \theta _ { 2 } , \theta _ { 3 }$ , and $\theta _ { 4 }$ ) while learning rates for $\theta _ { 1 }$ and $\theta _ { 2 }$ 3 4 5 are reduced. Size of the arrows indicate the magnitude of the change of the distribution mean upon gradient update.
|
| 25 |
+
|
| 26 |
+
Bayesian neural networks by controlling the learning rate of each parameter as a function of its uncertainty. Figure 1 illustrates how posterior distributions evolve for certain and uncertain weight distributions while learning two consecutive tasks. Intuitively, the more uncertain a parameter is, the more learnable it can be and therefore, larger gradient steps can be taken for it to learn the current task. As a hard version of this regularization technique, we also show that pruning, i.e., preventing the most important model parameters from any change and learning new tasks with the remaining parameters, can be also integrated into UCB. We refer to this method as UCB-P.
|
| 27 |
+
|
| 28 |
+
Contributions: We propose to perform continual learning with Bayesian neural networks and develop a new method which exploits the inherent measure of uncertainty therein to adapt the learning rate of individual parameters (Sec. 4). Second, we introduce a hard-threshold variant of our method that decides which parameters to freeze (Sec. 4.2). Third, in Sec. 5, we extensively validate our approach experimentally, comparing it to prior art both on single datasets split into different tasks, as well as for the more difficult scenario of learning a sequence of different datasets. Forth, in contrast to most prior work, our approach does not rely on knowledge about task boundaries at inference time, which humans do not need and might not be always available. We show in Sec. 6 that our approach naturally supports this scenario and does not require task information at test time, sometimes also referred to as a “single head” scenario for all tasks. We refer to evaluation metric of a “single head” model without task information at test time as “generalized accuracy”. Our code is available at https://github.com/SaynaEbrahimi/UCB.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Conceptually, approaches to continual learning can be divided into the following categories: dynamic architectural methods, memory-based methods, and regularization methods.
|
| 33 |
+
|
| 34 |
+
Dynamic architectural methods: In this setting, the architecture grows while keeping past knowledge fixed and storing new knowledge in different forms such as additional layers, nodes, or modules. In this approach, the objective function remains fixed whereas the model capacity grows –often exponentially– with the number of tasks. Progressive networks (Rusu et al., 2016; Schwarz et al., 2018) was one of the earliest works in this direction and was successfully applied to reinforcement learning problems; the base architecture was duplicated and lateral connections added in response to new tasks. Dynamically Expandable Network (DEN) (Yoon et al., 2018) also expands its network by selecting drifting units and retraining them on new tasks. In contrast to our method, these approaches require the architecture grow with each new task.
|
| 35 |
+
|
| 36 |
+
Memory-based methods: In this regime, previous information is partially stored to be used later as a form of rehearsal (Robins, 1995). Gradient episodic memory (GEM) (Lopez-Paz et al., 2017) uses this idea to store the data at the end of each episode to be used later to prevent gradient updates from deviating from their previous values. GEM also allows for positive backward knowledge transfer, i.e, an improvement on previously learned tasks, and it was the first method capable of learning using a single training example. Recent approaches in this category have mitigated forgetting by using external data combined with distillation loss and/or confidence-based sampling strategies to select the most representative samples. (Castro et al., 2018; Wu et al., 2019; Lee et al., 2019)
|
| 37 |
+
|
| 38 |
+
Regularization methods: In these approaches, significant changes to the representation learned for previous tasks are prevented. This can be performed through regularizing the objective function or directly enforced on weight parameters. Typically, this importance measure is engineered to represent the importance of each parameter. Inspired by Bayesian learning, in elastic weight consolidation (EWC) method (Kirkpatrick et al., 2017) important parameters are those to have the highest in terms of the Fisher information matrix. In Synaptic Intelligence (SI) (Zenke et al., 2017) this parameter importance notion is engineered to correlate with the loss function: parameters that contribute more to the loss are more important. Similar to SI, Memory-aware Synapses (MAS) (Aljundi et al., 2018) proposed an online way of computing importance adaptive to the test set using the change in the model outputs w.r.t the inputs. While all the above algorithms are task-dependent, in parallel development to this work, (Aljundi et al., 2019) has recently investigated task-free continual learning by building upon MAS and using a protocol to update the weights instead of waiting until the tasks are finished. PackNet (Mallya & Lazebnik, 2018) used iterative pruning to fully restrict gradient updates on important weights via binary masks. This method requires knowing which task is being tested to use the appropriate mask. PackNet also ranks the weight importance by their magnitude which is not guaranteed to be a proper importance indicative. HAT (Serra et al., 2018) identifies important neurons by learning an attention vector to the task embedding to control the gradient propagation. It maintains the information learned on previous tasks using an almost-binary mask per previous tasks.
|
| 39 |
+
|
| 40 |
+
Bayesian approaches: Using Bayesian approach in learning neural networks has been studied for few decades (MacKay, 1992b;a). Several approaches have been proposed for Bayesian neural networks, based on, e.g., the Laplace approximation (MacKay, 1992a), Hamiltonian Monte Carlo (Neal, 2012), variational inference (Hinton & Van Camp, 1993; Graves, 2011), and probabilistic backpropagation (Hernandez-Lobato & Adams, 2015). Variational continual learning (Nguyen et al., ´ 2018) uses Bayesian inference to perform continual learning where new posterior distribution is simply obtained by multiplying the previous posterior by the likelihood of the dataset belonging to the new task. They also showed that by using a core-set, a small representative set of data from previous tasks, VCL can experience less forgetting. In contrast, we rely on Bayesian neural networks to use their predictive uncertainty to perform continual learning. Moreover, we do not use episodic memory or any other way to access or store previous data in our approach.
|
| 41 |
+
|
| 42 |
+
Natural gradient descent methods: A fast natural gradient descent method for variational inference was introduced in (Khan & Nielsen, 2018) in which, the Fisher Information matrix is approximated using the generalized Gauss-Newton method. In contrast, in our work, we use classic gradient descent. Although second order optimization algorithms are proven to be more accurate than the first order methods, they add considerable computational cost. Tseran et al. (2018); Chen et al. (2019) both investigate the effect of natural gradient descent methods as an alternative to classic gradient descent used in VCL and EWC methods. GNG (Chen et al., 2019) uses Gaussian natural gradients in the Adam optimizer (Kingma & Ba, 2014) in the framework of VCL because as opposed to conventional gradient methods which perform in Euclidian space, natural gradients cause a small difference in terms of distributions following the changes in parameters in the Riemannian space. Similar to VCL, they obtained their best performance by adding a coreset of previous examples. Tseran et al. (2018) introduce two modifications to VCL called Natural-VCL (N-VCL) and VCL-Vadam. N-VCL (Tseran et al., 2018) uses a Gauss-Newton approximation introduced by (Schraudolph, 2002; Graves, 2011) to estimate the VCL objective function and used natural gradient method proposed in (Khan et al., 2018) to exploit the Riemannian geometry of the variational posterior by scaling the gradient with an adaptive learning rate equal to $\bar { \sigma } ^ { - 2 }$ obtained by approximating the Fisher Information matrix in an online fashion. VCL-Vadam (Tseran et al., 2018) is a simpler version of N-VCL to trade-off accuracy for simplicity which uses Vadam (Khan et al., 2018) to update the gradients by perturbing the weights with a Gaussian noise using a reparameterization trick and scaling by $\sigma ^ { - 1 }$ instead of its squared. N-VCL/VCL-Vadam both use variational inference to adapt the learning rate within Adam optimizer at every time step, whereas in our method below, gradient decent is used with constant learning rate during each task where learning rate scales with uncertainty only after finishing a task. We show extensive comparison with state-of-the-art results on short and relatively long sequence of vision datasets with Bayesian convolutional neural networks, whereas VCL-Vadam only rely on multi-layer perceptron networks. We also like to highlight that this is the first work which evaluates and shows the working of convolutional Bayesian Neural Networks rather than only fully connected MLP models for continual learning.
|
| 43 |
+
|
| 44 |
+
# 3 BACKGROUND: VARIATIONAL BAYES-BY-BACKPROP
|
| 45 |
+
|
| 46 |
+
In this section, we review the Bayes-by-Backprop (BBB) framework which was introduced by (Blundell et al., 2015); to learn a probability distribution over network parameters. (Blundell et al., 2015) showed a back-propagation-compatible algorithm which acts as a regularizer and yields comparable performance to dropout on the MNIST dataset. In Bayesian models, latent variables are drawn from a prior density $p ( \mathbf { w } )$ which are related to the observations through the likelihood $p ( \mathbf { x } | \mathbf { w } )$ During inference, the posterior distribution $p ( \mathbf { w } | \mathbf { x } )$ is computed conditioned on the given input data. However, in practice, this probability distribution is intractable and is often estimated through approximate inference. Markov Chain Monte Carlo (MCMC) sampling (Hastings, 1970) has been widely used and explored for this purpose, see (Robert & Casella, 2013) for different methods under this category. However, MCMC algorithms, despite providing guarantees for finding asymptotically exact samples from the target distribution, are not suitable for large datasets and/or large models as they are bounded by speed and scalability issues. Alternatively, variational inference provides a faster solution to the same problem in which the posterior is approximated using optimization rather than being sampled from a chain (Hinton & Van Camp, 1993).Variational inference methods always take advantage of fast optimization techniques such as stochastic methods or distributed methods, which allow them to explore data models quickly. See (Blei et al., 2017) for a complete review of the theory and (Shridhar et al., 2018) for more discussion on how to use Bayes by Backprop (BBB) in convolutioal neural networks.
|
| 47 |
+
|
| 48 |
+
# 3.1 BAYES BY BACKPROP (BBB)
|
| 49 |
+
|
| 50 |
+
Let $\mathbf { x } \in \mathbb { R } ^ { n }$ be a set of observed variables and w be a set of latent variables. A neural network, as a probabilistic model $P ( \mathbf { y } | \mathbf { x } , \mathbf { w } )$ , given a set of training examples $\mathcal { D } = ( \mathbf { x } , \mathbf { y } )$ can output y which belongs to a set of classes by using the set of weight parameters w. Variational inference aims to calculate this conditional probability distribution over the latent variables by finding the closest proxy to the exact posterior by solving an optimization problem.
|
| 51 |
+
|
| 52 |
+
We first assume a family of probability densities over the latent variables w parametrized by $\theta$ , i.e., $q ( \mathbf { w } | \theta )$ . We then find the closest member of this family to the true conditional probability of interest $P ( \mathbf { w } | \mathcal { D } )$ by minimizing the Kullback-Leibler (KL) divergence between $q$ and $P$ which is equivalent to minimizing variational free energy or maximizing the expected lower bound:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\begin{array} { r } { \theta ^ { * } = \arg \operatorname* { m i n } _ { \theta } { \mathrm { K L } } \big ( q ( \mathbf { w } | \theta ) \| P ( \mathbf { w } | \mathcal { D } ) \big ) } \end{array}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
The objective function can be written as:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathcal { L } _ { B B B } ( \theta , \mathcal { D } ) = \mathrm { K L } \big [ q ( \mathbf { w } | \theta ) \| P ( \mathbf { w } ) \big ] - \mathbb { E } _ { q ( \mathbf { w } | \theta ) } \big [ \log ( P ( \mathcal { D } | \mathbf { w } ) ) \big ]
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Eq. 2 can be approximated using $N$ Monte Carlo samples $\mathbf { w } _ { i }$ from the variational posterior (Blundell et al., 2015):
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\mathcal { L } _ { B B B } ( \boldsymbol { \theta } , \mathcal { D } ) \approx \sum _ { i = 1 } ^ { N } \log q ( \mathbf { w } _ { i } | \boldsymbol { \theta } ) - \log P ( \mathbf { w } _ { i } ) - \log ( P ( \mathcal { D } | \mathbf { w } _ { i } ) )
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
We assume $q ( \mathbf { w } | \theta )$ to have a Gaussian pdf with diagonal covariance and parametrized by $\theta = \left( \mu , \rho \right)$ . A sample weight of the variational posterior can be obtained by sampling from a unit Gaussian and reparametrized by $\mathbf { w } = \mu + \sigma \circ \epsilon$ where $\epsilon$ is the noise drawn from unit Gaussian, and $\circ$ is a pointwise multipliation. Standard deviation is parametrized as $\sigma = \log ( 1 + \exp ( \rho ) )$ and thus is always positive. For the prior, as suggested by Blundell et al. (2015), a scale mixture of two Gaussian pdfs are chosen which are zero-centered while having different variances of $\sigma _ { 1 } ^ { 2 }$ and $\sigma _ { 2 } ^ { 2 }$ . The uncertainty obtained for every parameter has been successfully used in model compression (Han et al., 2015) and uncertainty-based exploration in reinforcement learning (Blundell et al., 2015). In this work we propose to use this framework to learn sequential tasks without forgetting using per-weight uncertainties.
|
| 71 |
+
|
| 72 |
+
# 4 UNCERTAINTY-GUIDED CONTINUAL LEARNING IN BAYESIAN NEURAL NETWORKS
|
| 73 |
+
|
| 74 |
+
In this section, we introduce Uncertainty-guided Continual learning approach with Bayesian neural networks (UCB), which exploits the estimated uncertainty of the parameters’ posterior distribution to regulate the change in “important” parameters both in a soft way (Section 4.1) or setting a hard threshold (Section 4.2).
|
| 75 |
+
|
| 76 |
+
# 4.1 UCB WITH LEARNING RATE REGULARIZATION
|
| 77 |
+
|
| 78 |
+
A common strategy to perform continual learning is to reduce forgetting by regularizing further changes in the model representation based on parameters’ importance. In UCB the regularization is performed with the learning rate such that the learning rate of each parameter and hence its gradient update becomes a function of its importance. As shown in the following equations, in particular, we scale the learning rate of $\mu$ and $\rho$ for each parameter distribution inversely proportional to its importance $\Omega$ to reduce changes in important parameters while allowing less important parameters to alter more in favor of learning new tasks.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\begin{array} { r } { \alpha _ { \mu } \alpha _ { \mu } / \Omega _ { \mu } } \\ { \alpha _ { \rho } \alpha _ { \rho } / \Omega _ { \rho } } \end{array}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
The core idea of this work is to base the definition of importance on the well-defined uncertainty in parameters distribution of Bayesian neural networks, i.e., setting the importance to be inversely proportional to the standard deviation $\sigma$ which represents the parameter uncertainty in the Baysian neural network:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\Omega \propto { } ^ { 1 } / \sigma
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
We explore different options to set $\Omega$ in our ablation study presented in Section A.2 of the appendix, Table 1. We empirically found that $\Omega _ { \mu } = 1 / \sigma$ and not adapting the learning rate for $\rho$ (i.e. $\Omega _ { \rho } = 1 $ ) yields the highest accuracy and the least forgetting.
|
| 91 |
+
|
| 92 |
+
The key benefit of UCB with learning rate as the regularizer is that it neither requires additional memory, as opposed to pruning technique nor tracking the change in parameters with respect to the previously learned task, as needed in common weight regularization methods.
|
| 93 |
+
|
| 94 |
+
More importantly, this method does not need to be aware of task switching as it only needs to adjust the learning rates of the means in the posterior distribution based on their current uncertainty. The complete algorithm for UCB is shown in Algorithm 1 with parameter update function given in Algorithm 2.
|
| 95 |
+
|
| 96 |
+
# 4.2 UCB USING WEIGHT PRUNING (UCB-P)
|
| 97 |
+
|
| 98 |
+
In this section, we introduce a variant of our method, UCB-P, which is related to recent efforts in weight pruning in the context of reducing inference computation and network compression (Liu et al., 2017; Molchanov et al., 2016). More specifically, weight pruning has been recently used in continual learning (Mallya & Lazebnik, 2018), where the goal is to continue learning multiple tasks using a single network’s capacity. (Mallya & Lazebnik, 2018) accomplished this by freeing up parameters deemed to be unimportant to the current task according to their magnitude. Forgetting is prevented in pruning by saving a task-specific binary mask of important vs. unimportant parameters. Here, we adapt pruning to Bayesian neural networks. Specifically, we propose a different criterion for measuring importance: the statistically-grounded uncertainty defined in Bayesian neural networks.
|
| 99 |
+
|
| 100 |
+
Unlike regular deep neural networks, in a BBB model weight parameters are represented by probability distributions parametrized by their mean and standard deviation. Similar to (Blundell et al., 2015), in order to take into account both mean and standard deviation, we use the signal-to-noise ratio (SNR) for each parameter defined as
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\Omega = \mathrm { S N R } = | \mu | / \sigma
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
1: Require Training data for all tasks $\mathcal { D } = ( \mathbf { x } , \mathbf { y } )$ , $\mu$ (mean of posterior), $\rho , \sigma _ { 1 }$ and $\sigma _ { 2 }$ (std for the scaled
|
| 107 |
+
mixture Gaussian pdf of prior), $\pi$ (weighting factor for prior), $N$ (number of samples in a mini-batch), $M$
|
| 108 |
+
(Number of minibatches per epoch), initial learning rate $( \alpha _ { 0 } )$
|
| 109 |
+
2: $\alpha _ { \mu } = \alpha _ { \rho } = \alpha _ { 0 }$
|
| 110 |
+
3: for every task do
|
| 111 |
+
4: repeat
|
| 112 |
+
5: $\begin{array} { r l r } & { \mathbf { \Lambda } _ { \epsilon \sim \mathcal { N } ( 0 , I ) } ^ { \mathbf { \epsilon } } } & { \sim \mathcal { N } ( 0 , I ) } \\ & { \boldsymbol { \epsilon } \sim \mathrm { l o g } ( 1 + \exp ( \rho ) ) } & { \triangleright \mathrm { E n s u r e s ~ } \sigma \mathrm { ~ i s ~ a l w a y s ~ p o s i t i v e } } \\ & { \mathbf { w } = \mu + \sigma \circ \boldsymbol { \epsilon } } & { \triangleright \mathbf { w } = \{ \mathbf { w } _ { 1 } , \dots , \mathbf { w } _ { i } , \dots , \mathbf { w } _ { N } \} \mathrm { ~ p o s t e r i o r ~ s a m p l e s ~ o f ~ w e i g h t } } \\ & { l _ { 1 } = \sum _ { i = 1 } ^ { N } \log N ( \mathbf { w } _ { i } | \mu , \sigma ^ { 2 } ) } & { \triangleright \mathbf { \epsilon } [ \mathbf { u } _ { 1 } , \dots , \mathbf { u } _ { 0 } , \dots , \mathbf { u } _ { 0 } , \dots , \mathbf { u } _ { 0 } ] } \\ & { l _ { 2 } = \sum _ { i = 1 } ^ { N } \log \big ( \pi N ( \mathbf { \epsilon } _ { i } | 0 , \sigma _ { 1 } ^ { 2 } ) + ( 1 - \pi ) \mathcal { N } ( \mathbf { w } _ { i } | 0 , \sigma _ { 2 } ^ { 2 } ) \big ) } & { \qquad v _ { l } : = \mathrm { L o g - p o s t e r i o r } } \\ & { l _ { 3 } = \sum _ { i = 1 } ^ { N } \log ( p ( \mathcal { D } | \mathbf { w } _ { i } ) ) } & { \qquad v _ { l } : = \mathrm { L o g - h i k e l i h o o d ~ o f ~ d a t a } } \\ & { \mathcal { L } _ { B B B } = \frac { 1 } { M } ( l _ { 1 } - l _ { 2 } - l _ { 3 } ) } & \\ & { \mu \mu - \alpha _ { \mu } \nabla \mathcal { L } _ { B B B \mu } } \\ & { \boldsymbol { \rho } \boldsymbol { \rho } - \alpha _ { \rho } \nabla \mathcal { L } _ { B B B \rho } } & \end{array}$
|
| 113 |
+
6:
|
| 114 |
+
10:
|
| 115 |
+
11:
|
| 116 |
+
12:
|
| 117 |
+
13:
|
| 118 |
+
14: until loss plateaus
|
| 119 |
+
15: αµ, $\alpha _ { \rho } \gets$ LearningRateUpdate $( \alpha _ { \mu } , \alpha _ { \rho } , \sigma , \mu )$ $\vartriangleright$ See Algorithm 2 for UCB and 3 for UCB-P
|
| 120 |
+
16: end for
|
| 121 |
+
|
| 122 |
+
Algorithm 1 Uncertainty-guided Continual Learning with Bayesian Neural Networks UCB
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Algorithm2LearningRateUpdate in UCB</td><td>Algorithm 3LearningRateUpdate in UCB-P</td></tr><tr><td>1:function LearningRateUpdate(αμ, α,)</td><td>1:function LearningRateUpdate(αμ, @p,0, μ)</td></tr><tr><td>2: for each parameter do</td><td>2: for each parameter j in each layer l do</td></tr><tr><td>3: Ωμ←1/σ</td><td>3: Ω←lμ//g Signal to noise ratio</td></tr><tr><td>4: ←1</td><td>4: if 2[j] ∈ top p% of SΩs in l then</td></tr><tr><td>5: aμ←aμ/Ωμ</td><td>5: αμ=αp=0</td></tr><tr><td>6: ap←αp/p</td><td>6: end if</td></tr><tr><td>7: end for</td><td>7: end for</td></tr><tr><td>8:end function</td><td>8:end function</td></tr></table>
|
| 125 |
+
|
| 126 |
+
SNR is a commonly used measure in signal processing to distinguish between “useful” information from unwanted noise contained in a signal. In the context of neural models, the SNR can be thought as an indicative of parameter importance; the higher the SNR, the more effective or important the parameter is to the model predictions for a given task.
|
| 127 |
+
|
| 128 |
+
UCB-P, as shown in Algorithms 1 and 3, is performed as follows: for every layer, convolutional or fully-connected, the parameters are ordered by their SNR value and those with the lowest importance are pruned (set to zero). The pruned parameters are marked using a binary mask so that they can be used later in learning new tasks whereas the important parameters remain fixed throughout training on future tasks. Once a task is learned, an associated binary mask is saved which will be used during inference to recover key parameters and hence the exact performance to the desired task.
|
| 129 |
+
|
| 130 |
+
The overhead memory per parameter in encoding the mask as well as saving it on the disk is as follows. Assuming we have $n$ tasks to learn using a single network, the total number of required bits to encode an accumulated mask for a parameter is at max $\log _ { 2 } n$ bits assuming a parameter deemed to be important from task 1 and kept being encoded in the mask.
|
| 131 |
+
|
| 132 |
+
# 5 RESULTS
|
| 133 |
+
|
| 134 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 135 |
+
|
| 136 |
+
Datasets: We evaluate our approach in two common scenarios for continual learning: 1) classincremental learning of a single or two randomly alternating datasets, where each task covers only a subset of the classes in a dataset, and 2) continual learning of multiple datasets, where each task is a dataset. We use Split MNIST with 5 tasks (5-Split MNIST) similar to (Nguyen et al., 2018; Chen et al., 2019; Tseran et al., 2018) and permuted MNIST (Srivastava et al., 2013) for class incremental learning with similar experimental settings as used in (Serra et al., 2018; Tseran et al., 2018). Furthermore, to have a better understanding of our method, we evaluate our approach on continually learning a sequence of 8 datasets with different distributions using the identical sequence as in (Serra et al., 2018), which includes FaceScrub ( $\mathrm { N g }$ & Winkler, 2014), MNIST, CIFAR100, NotMNIST (Bulatov, 2011), SVHN (Netzer et al., 2011), CIFAR10, TrafficSigns (Stallkamp et al., 2011), and FashionMNIST (Xiao et al., 2017). Details of each are summarized in Table 4 in appendix. No data augmentation of any kind has been used in our analysis.
|
| 137 |
+
|
| 138 |
+
Baselines: Within the Bayesian framework, we compare to three models which do not incorporate the importance of parameters, namely fine-tuning, feature extraction, and joint training. In fine-tuning (BBB-FT), training continues upon arrival of new tasks without any forgetting avoidance strategy. Feature extraction, denoted as (BBB-FE), refers to freezing all layers in the network after training the first task and training only the last layer for the remaining tasks. In joint training (BBB-JT) we learn all the tasks jointly in a multitask learning fashion which serves as the upper bound for average accuracy on all tasks, as it does not adhere to the continual learning scenario. We also perform the counterparts for FT, FE, and JT using ordinary neural networks and denote them as ORD-FT, ORDFE, and ORD-JT. From the prior work, we compare with state-of-the-art approaches including Elastic Weight Consolidation (EWC) (Kirkpatrick et al., 2017), Incremental Moment Matching (IMM) (Lee et al., 2017), Learning Without Forgetting (LWF) (Li & Hoiem, 2016), Less-Forgetting Learning (LFL) (Jung et al., 2016), PathNet (Fernando et al., 2017), Progressive neural networks (PNNs) (Rusu et al., 2016), and Hard Attention Mask (HAT) (Serra et al., 2018) using implementations provided by (Serra et al., 2018). On Permuted MNIST results for SI (Zenke et al., 2017) are reported from (Serra et al., 2018). On Split and Permuted MNIST, results for VCL (Nguyen et al., 2018) are obtained using their original provided code whereas for VCL-GNG (Chen et al., 2019) and VCL-Vadam (Tseran et al., 2018) results are reported from the original work without re-implementation. Because our method lies into the regularization-based regime, we only compare against baselines which do not benefit from episodic or coreset memory.
|
| 139 |
+
|
| 140 |
+
Hyperparameter tuning: Unlike commonly used tuning techniques which use a validation set composed of all classes in the dataset, we only rely on the first two task and their validations set, similar to the setup in (Chaudhry et al., 2019). In all our experiments we consider a 0.15 split for the validation set on the first two tasks. After tuning, training starts from the beginning of the sequence. Our scheme is different from (Chaudhry et al., 2019), where the models are trained on the first (e.g. three) tasks for validation and then training is restarted for the remaining ones and the reported performance is only on the remaining tasks.
|
| 141 |
+
|
| 142 |
+
Training details: It is important to note that in all our experiments, no pre-trained model is used. We used stochastic gradient descent with a batch size of 64 and a learning rate of 0.01, decaying it by a factor of 0.3 once the loss plateaued. Dataset splits and batch shuffle are identically in all UCB experiments and all baselines.
|
| 143 |
+
|
| 144 |
+
Pruning procedure and mask size: Once a task is learned, we compute the performance drop for a set of arbitrary pruning percentages from the maximum training accuracy achieved when no pruning is applied. The pruning portion is then chosen using a threshold beyond which the performance drop is not accepted. Mask size is chosen without having the knowledge of how many tasks to learn in the future. Upon learning each task we used a uniform distribution of pruning ratios $( 5 0 - 1 0 0 \% )$ ) and picked the ratio resulted in at most $1 \%$ , $2 \%$ , and $3 \%$ forgetting for MNIST, CIFAR, and 8tasks experiments, respectively. We did not tune this parameter because in our hyperparameter tuning, we only assume we have validation sets of the first two tasks.
|
| 145 |
+
|
| 146 |
+
Parameter regularization and importance measurement: Table 1 ablates different ways to compute the importance $\Omega$ of an parameter in Eq. 4 and 5. As shown in Table 1 the configuration that yields the highest accuracy and the least forgetting (maximum BWT) occurs when the learning rate regularization is performed only on $\mu$ of the posteriors using $\Omega _ { \mu } = 1 / \sigma$ as the importance and $\Omega _ { \rho } = 1$ .
|
| 147 |
+
|
| 148 |
+
Performance measurement: Let $n$ be the total number of tasks. Once all are learned, we evaluate our model on all $n$ tasks. ACC is the average test classification accuracy across all tasks. To measure forgetting we report backward transfer, BWT, which indicates how much learning new tasks has influenced the performance on previous tasks. While BWT $< 0$ directly reports catastrophic forgetting, $\mathrm { B W T } > 0$ indicates that learning new tasks has helped with the preceding tasks. Formally, BWT and ACC are as follows:
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\mathrm { B W T } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } R _ { i , n } - R _ { i , i } , \quad \mathrm { A C C } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } R _ { i , n }
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
Table 1: Variants of learning rate regularization and importance measurement on 2-Split MNIST
|
| 155 |
+
Table 2: Continually learning on different datasets. BWT and ACC in $\%$ . $( ^ { * } )$ denotes that methods do not adhere to the continual learning setup: BBB-JT and ORD-JT serve as the upper bound for ACC for BBB/ORD networks, respectively. $^ \ddag$ denotes results reported by (Serra et al., 2018). $^ \dagger$ denotes the result reported from original work. BWT was not reported in $^ \ddag$ and $\dagger$ . All others results are (re)produced by us and are averaged over 3 runs with standard deviations given in Section A.3 of the appendix.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Method</td><td>μ</td><td>p</td><td>Importance Ω</td><td>BWT (%)</td><td>ACC (%)</td></tr><tr><td>UCB</td><td>X</td><td>1</td><td>1/g</td><td>0.00</td><td>99.2</td></tr><tr><td>UCB</td><td>1</td><td>X</td><td>1/g</td><td>-0.04</td><td>98.7</td></tr><tr><td>UCB</td><td>X</td><td>X</td><td>1/g</td><td>-0.02</td><td>98.0</td></tr><tr><td>UCB</td><td>X</td><td>-</td><td>|μ//σ</td><td>-0.03</td><td>98.4</td></tr><tr><td>UCB</td><td>-</td><td>X</td><td>/g</td><td>-0.52</td><td>98.7</td></tr><tr><td>UCB</td><td>X</td><td>X</td><td>lμ//σ</td><td>-0.32</td><td>98.8</td></tr><tr><td>UCB-P</td><td>X</td><td>X</td><td>μ/σ</td><td>-0.01</td><td>99.0</td></tr><tr><td>UCB-P</td><td>X</td><td>X</td><td>1/g</td><td>-0.01</td><td>98.9</td></tr></table>
|
| 158 |
+
|
| 159 |
+
(a) 5-Split MNIST, 5 tasks.
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Method</td><td>BWT</td><td>ACC</td></tr><tr><td>VCL-Vadam†</td><td></td><td>99.17</td></tr><tr><td>VCL-GNG†</td><td></td><td>96.50</td></tr><tr><td>VCL</td><td>-0.56</td><td>98.20</td></tr><tr><td>IMM</td><td>-11.20</td><td>88.54</td></tr><tr><td>EWC</td><td>-4.20</td><td>95.78</td></tr><tr><td>HAT</td><td>0.00</td><td>99.59</td></tr><tr><td>ORD-FT</td><td>-9.18</td><td>90.60</td></tr><tr><td>ORD-FE</td><td>0.00</td><td>98.54</td></tr><tr><td>BBB-FT</td><td>-6.45</td><td>93.42</td></tr><tr><td>BBB-FE</td><td>0.00</td><td>98.76</td></tr><tr><td>UCB-P (Ours)</td><td>-0.72</td><td>99.32</td></tr><tr><td>UCB (Ours)</td><td></td><td>0.00 99.63</td></tr><tr><td>ORD-JT*</td><td>0.00</td><td>99.78</td></tr><tr><td>BBB-JT*</td><td>0.00</td><td>99.87</td></tr></table>
|
| 162 |
+
|
| 163 |
+
(b) Permuted MNIST, 10 permutations. (c) Alternating CIFAR10/100
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Method</td><td>#Params</td><td>BWTACC</td></tr><tr><td>SI</td><td>0.1M</td><td>- 86.0</td></tr><tr><td>EWC #</td><td>0.1M</td><td>- 88.2</td></tr><tr><td>HAT t</td><td>0.1M</td><td>- 91.6</td></tr><tr><td>VCL-Vadam†</td><td>0.1M</td><td>-86.34</td></tr><tr><td>VCL-GNG†</td><td>0.1M</td><td>-90.50</td></tr><tr><td>VCL</td><td>0.1M</td><td>-7.90 88.80</td></tr><tr><td>UCB (Ours)</td><td>0.1M</td><td>-0.38 91.44</td></tr><tr><td>LWF</td><td>1.9M</td><td>-31.17 65.65</td></tr><tr><td>IMM</td><td>1.9M</td><td>-7.14 90.51</td></tr><tr><td>HAT</td><td>1.9M</td><td>0.03 97.34</td></tr><tr><td>BBB-FT</td><td>1.9M</td><td>-0.58 90.01</td></tr><tr><td>BBB-FE</td><td>1.9M</td><td>0.02 93.54</td></tr><tr><td>UCB-P(Ours)1.9M</td><td></td><td>-0.95 97.24</td></tr><tr><td>UCB (Ours)</td><td>1.9M</td><td>0.03 97.42</td></tr><tr><td></td><td></td><td></td></tr><tr><td>BBB-JT*</td><td>1.9M</td><td>0.00 98.12</td></tr></table>
|
| 166 |
+
|
| 167 |
+
(d) Sequence of 8 tasks
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Method</td><td>BWT</td><td>ACC</td></tr><tr><td>LFL</td><td>-10.0</td><td>8.61</td></tr><tr><td>PathNet</td><td>0.00</td><td>20.22</td></tr><tr><td>LWF</td><td>-54.3</td><td>28.22</td></tr><tr><td>IMM</td><td>-38.5</td><td>43.93</td></tr><tr><td>EWC</td><td>-18.04</td><td>50.68</td></tr><tr><td>PNN</td><td>0.00</td><td>76.78</td></tr><tr><td>HAT</td><td>-0.14</td><td>81.59</td></tr><tr><td>BBB-FT</td><td>-23.1</td><td>43.09</td></tr><tr><td>BBB-FE</td><td>-0.01</td><td>58.07</td></tr><tr><td>UCB-P (Ours)</td><td>-2.54</td><td>80.38</td></tr><tr><td>UCB (Ours) BBB-JT*</td><td>-0.84 84.04 -1.2</td><td>84.1</td></tr></table>
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Method</td><td>BWT</td><td>ACC</td></tr><tr><td>PathNet</td><td>0.00</td><td>28.94</td></tr><tr><td>LWF</td><td>-37.9</td><td>42.93</td></tr><tr><td>LFL</td><td>-24.22</td><td>47.67</td></tr><tr><td>IMM</td><td>-12.23</td><td>69.37</td></tr><tr><td>PNN</td><td>0.00</td><td>70.73</td></tr><tr><td>EWC</td><td>-1.53</td><td>72.46</td></tr><tr><td>HAT</td><td>-0.04</td><td>78.32</td></tr><tr><td>BBB-FE</td><td>-0.04</td><td>51.04</td></tr><tr><td>BBB-FT</td><td>-7.43</td><td>68.89</td></tr><tr><td>UCB-P (Ours)</td><td>-1.89</td><td>77.32</td></tr><tr><td>UCB (Ours)</td><td></td><td>-0.72 79.44</td></tr><tr><td>BBB-JT*</td><td>1.52</td><td>83.93</td></tr></table>
|
| 172 |
+
|
| 173 |
+
where $R _ { i , n }$ is the test classification accuracy on task $i$ after sequentially finishing learning the $n ^ { \mathrm { t h } }$ task. Note that in UCB-P, $R _ { i , i }$ refers the test accuracy on task $i$ before pruning and $R _ { i , n }$ after pruning which is equivalent to the end of sequence performance. In Section 6, we show that our UCB model can be used when tasks labels are not available at inference time by training it with a “single head” architecture with a sum of number of classes for all tasks. We refer to the ACC measured for this scenario as “Generalized Accuracy”.
|
| 174 |
+
|
| 175 |
+
# 5.2 5-SPLIT MNIST
|
| 176 |
+
|
| 177 |
+
We first present our results for class incremental learning of MNIST (5-Split MNIST) in which we learn the digits $0 - 9$ in five tasks with 2 classes at a time in 5 pairs of $0 / 1 , 2 / 3 , 4 / 5 , 6 / 7$ , and $8 / 9$ . Table 2a shows the results for reference baselines in Bayesian and non-Bayesian neural networks including fine-tuning (BBB-FT, ORD-FT), feature extraction (BBB-FE, ORD-FE) and, joint training (BBB-JT, ORD-JT) averaged over 3 runs and standard deviations are given in Table 9 in the appendix. Although the MNIST dataset is an “easy” dataset, we observe throughout all experiments that Bayesian fine-tuning and joint training perform significantly better than their counterparts, ORD-FT and ORD-JT. For Bayesian methods, we compare against VCL and its variations named as VCL with Variational Adam (VCL-Vadam), VCL with Adam and Gaussian natural gradients (VCL-GNG). For non-Bayesian methods, we compare against HAT, IMM, and EWC (EWC can be regarded as Bayesian-inspired). VCL-Vadam $\mathrm { \Delta A C C = } 9 9 . 1 7 \%$ ) appears to be outperforming VCL $\mathrm { \Delta A C C { = } 9 8 . 2 0 \% }$ ) and VCL-GNG ( $\mathrm { A C C } { = } 9 6 . 5 0 \%$ ) in average accuracy. However, full comparison is not possible because forgetting was not reported for Vadam and GNG. Nevertheless, UCB $\mathrm { \ A C C { = } 9 9 . 6 3 \% }$ ) is able to surpass all the baselines including VCL-Vadam in average accuracy while in zero forgetting it is on par with HAT $( \mathrm { A C C { = } 9 9 . 5 9 \% }$ ). We also report results on incrementally learning MNIST in two tasks (2-Split MNIST) in Table 8 in the appendix, where we compare it against PackNet, HAT, and LWF where PackNet, HAT, UCB-P, and UCB have zero forgetting while UCB has marginally higher accuracy than all others.
|
| 178 |
+
|
| 179 |
+
# 5.3 PERMUTED MNIST
|
| 180 |
+
|
| 181 |
+
Permuted MNIST is a popular variant of the MNIST dataset to evaluate continual learning approaches in which each task is considered as a random permutation of the original MNIST pixels. Following the literature, we learn a sequence of 10 random permutations and report average accuracy at the end. Table 2b shows ACC and BWT of UCB and UCB-P in comparison to state-of-the-art models using a small and a large network with 0.1M and $1 . 9 \mathrm { M }$ parameters, respectively (architecture details are given in Section A.2 of the appendix). The accuracy achieved by UCB $( \mathrm { A C C = 9 1 . 4 4 \pm 0 . 0 4 \% } )$ using the small network outperforms the ACC reported by Serra et al. (2018) for SI $\mathrm { \Delta A C C { = } 8 6 . 0 \% }$ ), EWC $( \mathrm { A C C { = } 8 8 . 2 \% }$ ), while HAT attains a slightly better performance $( \mathrm { { A C C = 9 1 . 6 \% } }$ ). Comparing the average accuracy reported in VCL-Vadam $\mathrm { A C C } { = } 8 6 . 3 4 \%$ ) and VCL-GNG $( \mathrm { A C C } { = } 9 0 . 5 0 \%$ ) as well as obtained results for VCL $\mathrm { \Delta A C C { = } 8 8 . 8 0 \% }$ ) shows UCB with $\mathbf { B W T } { = } ( 0 . 0 3 \% \pm 0 . 0 0 \% )$ is able to outperform other Bayesian approaches in accuracy while forgetting significantly less compared to VCL with $\mathrm { B W T = - 7 . 9 \% }$ . While we do not experiment with memory in this work, not surprisingly adding memory to most approaches will improve their performance significantly as it allows looking into past tasks. E.g. Chen et al. (2019) report $\mathrm { A C C { = } 9 4 . 3 7 \% }$ for VCL-GNC when adding a memory of size 200.
|
| 182 |
+
|
| 183 |
+
Next, we compare the results for the larger network (1.9M). While HAT and UCB have zero forgetting, UCB, reaching $\mathrm { A C C = 9 7 . 4 2 \pm 0 . 0 1 \% }$ , performs better than all baselines including HAT which obtains $\mathrm { A C C = 9 7 . 3 4 \pm 0 . 0 5 \% }$ using 1.9M parameters. We also observe again that BBB-FT, despite being not specifically penalized to prevent forgetting, exhibits reasonable negative BWT values, performing better than IMM and LWF baselines. It is close to joint training, BBB-JT, with $\mathrm { A C C { = } 9 8 . \bar { 1 } \% }$ , which can be seen as an upper bound.
|
| 184 |
+
|
| 185 |
+
# 5.4 ALTERNATING CIFAR10 AND CIFAR100
|
| 186 |
+
|
| 187 |
+
In this experiment, we randomly alternate between class incremental learning of CIFAR10 and CIFAR100. Both datasets are divided into 5 tasks each with 2 and 20 classes per task, respectively. Table 2c presents ACC and BWT obtained with UCB-P, UCB, and three BBB reference methods compared against various continual learning baselines. Among the baselines presented in Table 2c, PNN and PathNet are the only zero-forgetting-guaranteed approaches. It is interesting to note that in this setup, some baselines (PathNet, LWF, and LFL) do not perform better than the naive accuracy achieved by feature extraction. PathNet suffers from bad pre-assignment of the network’s capacity per task which causes poor performance on the initial task from which it never recovers. IMM performs almost similar to fine-tuning in ACC, yet forgets more. PNN, EWC, and HAT are the only baselines that perform better than BBB-FE and BBB-FT. EWC and HAT are both allowed to forget by construction, however, HAT shows zero forgetting behavior. While EWC is outperformed by both of our UCB variants, HAT exhibits $1 \%$ better ACC over UCB-P. Despite having a slightly higher forgetting, the overall accuracy of UCB is higher, reaching $7 9 . 4 \%$ . BBB-JT in this experiment achieves a positive BWT which shows that learning the entire sequence improves the performance on earlier tasks.
|
| 188 |
+
|
| 189 |
+
# 5.5 MULTIPLE DATASETS LEARNING
|
| 190 |
+
|
| 191 |
+
Finally, we present our results for continual learning of 8 tasks using UCB-P and UCB in Table 2d. Similar to the previous experiments we look at both ACC and BWT obtained for UCB-P, UCB, BBB references (FT, FE, JT) as well as various baselines. Considering the ACC achieved by BBB-FE or BBB-FT $( 5 8 . 1 \% )$ as a lower bound we observe again that some baselines are not able to do better than BBB-FT including LFL, PathNet, LWF, IMM, and EWC while PNN and HAT remain the only strong baselines for our UCB-P and UCB approaches. UCB-P again outperforms PNN by $3 . 6 \%$ in ACC. HAT exhibits only $- 0 . 1 \%$ BWT, but our UCB achieves $2 . 4 \%$ higher ACC.
|
| 192 |
+
|
| 193 |
+
# 6 SINGLE HEAD AND GENERALIZED ACCURACY OF UCB
|
| 194 |
+
|
| 195 |
+
UCB can be used even if the task information is not given at test time. For this purpose, at training time, instead of using a separate fully connected classification head for each task, we use a single head with the total number of outputs for all tasks. For example in the 8-dataset experiment we only use one head with 293 number of output classes, rather than using 8 separate heads, during training and inference time.
|
| 196 |
+
|
| 197 |
+
Table 3: Single Head vs. Multi-Head architecture and Generalized vs. Standard Accuracy. Generalized accuracy means that task information is not available at test time. SM, PM, CF, and 8T denote the 5-Split MNIST, Permuted MNIST, Alternating CIFAR10/100, and sequence of 8 tasks, respectively.
|
| 198 |
+
|
| 199 |
+
<table><tr><td rowspan="3"></td><td rowspan="3" colspan="2">Generalized ACC Single Head</td><td colspan="4">ACC</td></tr><tr><td colspan="2">Single Head</td><td colspan="2">Multi Head</td></tr><tr><td>BBB-FT</td><td>UCB BBB-FT</td><td>UCB</td><td>BBB-FT</td></tr><tr><td>Exp SM</td><td>UCB 98.7</td><td>98.1</td><td>98.9</td><td>98.7</td><td>99.2</td><td>98.4</td></tr><tr><td>PM</td><td>92.5</td><td>86.1</td><td>95.1</td><td>88.3</td><td>97.7</td><td>90.0</td></tr><tr><td>CF</td><td>71.2</td><td>65.2</td><td>74.3</td><td>67.8</td><td>79.4</td><td>68.9</td></tr><tr><td>8T</td><td>76.8</td><td>47.6</td><td>79.9</td><td>53.2</td><td>84.0</td><td>43.1</td></tr></table>
|
| 200 |
+
|
| 201 |
+
Table 3 presents our results for UCB and BBB-FT trained with a single head against having a multi-head architecture, in columns 4-7. Interestingly, we see only a small performance degrade for UCB from training with multi-head to a single head. The ACC reduction is $0 . 3 \%$ , $2 . 6 \%$ , ${ \bar { 5 } } . 1 \%$ , and $4 . 1 \%$ for 2-Split MNIST, Permuted MNIST, Alternating CIFAR10/100, and sequence of 8 tasks experiments, respectively.
|
| 202 |
+
|
| 203 |
+
We evaluated UCB and BBB-FT with a more challenging metric where the prediction space covers the classes across all the tasks. Hence, confusion of similar class labels across tasks can be measured. Performance for this condition is reported as Generalized ACC in Table 3 in columns 2-3. We observe a small performance reduction in going from ACC to Generalized ACC, suggesting non-significant confusion caused by the presence of more number of classes at test time. The performance degradation from ACC to Generalized ACC is $0 . 2 \%$ , $2 . 6 \%$ , $3 . 1 \%$ , and $3 . 1 \%$ for 2-Split MNIST, Permuted MNIST, Alternating CIFAR10/100, and sequence of 8 tasks, respectively. This shows that UCB can perform competitively in more realistic conditions such as unavailability of task information at test time. We believe the main insight of our approach is that instead of computing additional measurements of importance, which are often task, input or output dependent, we directly use predicted weight uncertainty to find important parameters. We can freeze them using a binary mask, as in UCB-P, or regularize changes conditioned on current uncertainty, as in UCB.
|
| 204 |
+
|
| 205 |
+
# 7 CONCLUSION
|
| 206 |
+
|
| 207 |
+
In this work, we propose a continual learning formulation with Bayesian neural networks, called UCB, that uses uncertainty predictions to perform continual learning: important parameters can be either fully preserved through a saved binary mask (UCB-P) or allowed to change conditioned on their uncertainty for learning new tasks (UCB). We demonstrated how the probabilistic uncertainty distributions per weight are helpful to continually learning short and long sequences of benchmark datasets compared against baselines and prior work. We show that UCB performs superior or on par with state-of-the-art models such as HAT (Serra et al., 2018) across all the experiments. Choosing between the two UCB variants depends on the application scenario: While UCB-P enforces no forgetting after the initial pruning stage by saving a small binary mask per task, UCB does not require additional memory and allows for more learning flexibility in the network by allowing small forgetting to occur. UCB can also be used in a single head setting where the right subset of classes belonging to the task is not known during inference leading to a competitive model that can be deployed where it is not possible to distinguish tasks in a continuous stream of the data at test time. UCB can also be deployed in a single head scenario and where tasks information is not available at test time.
|
| 208 |
+
|
| 209 |
+
# REFERENCES
|
| 210 |
+
|
| 211 |
+
Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 139–154, 2018.
|
| 212 |
+
|
| 213 |
+
Rahaf Aljundi, Klaas Kelchtermans, and Tinne Tuytelaars. Task-free continual learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 11254–11263, 2019.
|
| 214 |
+
|
| 215 |
+
David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877, 2017.
|
| 216 |
+
|
| 217 |
+
Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1613–1622. PMLR, 2015.
|
| 218 |
+
|
| 219 |
+
Yaroslav Bulatov. Notmnist dataset. Google (Books/OCR), Tech. Rep.[Online]. Available: http://yaroslavvb. blogspot. it/2011/09/notmnist-dataset. html, 2011.
|
| 220 |
+
|
| 221 |
+
Francisco M Castro, Manuel J Mar´ın-Jimenez, Nicol ´ as Guil, Cordelia Schmid, and Karteek Alahari. ´ End-to-end incremental learning. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 233–248, 2018.
|
| 222 |
+
|
| 223 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with A-GEM. In International Conference on Learning Representations, 2019.
|
| 224 |
+
|
| 225 |
+
Yu Chen, Tom Diethe, and Neil Lawrence. Facilitating bayesian continual learning by natural gradients and stein gradients. arXiv preprint arXiv:1904.10644, 2019.
|
| 226 |
+
|
| 227 |
+
Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. arXiv preprint arXiv:1701.08734, 2017.
|
| 228 |
+
|
| 229 |
+
Alex Graves. Practical variational inference for neural networks. In Advances in neural information processing systems, pp. 2348–2356, 2011.
|
| 230 |
+
|
| 231 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 232 |
+
|
| 233 |
+
W Keith Hastings. Monte carlo sampling methods using markov chains and their applications. Biometrika, 1970.
|
| 234 |
+
|
| 235 |
+
Jose Miguel Hern ´ andez-Lobato and Ryan Adams. Probabilistic backpropagation for scalable learning ´ of bayesian neural networks. In International Conference on Machine Learning, pp. 1861–1869, 2015.
|
| 236 |
+
|
| 237 |
+
Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the sixth annual conference on Computational learning theory, pp. 5–13. ACM, 1993.
|
| 238 |
+
|
| 239 |
+
Heechul Jung, Jeongwoo Ju, Minju Jung, and Junmo Kim. Less-forgetting learning in deep neural networks. arXiv preprint arXiv:1607.00122, 2016.
|
| 240 |
+
|
| 241 |
+
Mohammad Emtiyaz Khan and Didrik Nielsen. Fast yet simple natural-gradient descent for variational inference in complex models. In 2018 International Symposium on Information Theory and Its Applications (ISITA), pp. 31–35. IEEE, 2018.
|
| 242 |
+
|
| 243 |
+
Mohammad Emtiyaz Khan, Didrik Nielsen, Voot Tangkaratt, Wu Lin, Yarin Gal, and Akash Srivastava. Fast and scalable bayesian deep learning by weight-perturbation in adam. arXiv preprint arXiv:1806.04854, 2018.
|
| 244 |
+
|
| 245 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 246 |
+
|
| 247 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, pp. 201611835, 2017.
|
| 248 |
+
|
| 249 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 250 |
+
|
| 251 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 252 |
+
|
| 253 |
+
Kibok Lee, Kimin Lee, Jinwoo Shin, and Honglak Lee. Overcoming catastrophic forgetting with unlabeled data in the wild. In Proceedings of the IEEE International Conference on Computer Vision, pp. 312–321, 2019.
|
| 254 |
+
|
| 255 |
+
Sang-Woo Lee, Jin-Hwa Kim, Jaehyun Jun, Jung-Woo Ha, and Byoung-Tak Zhang. Overcoming catastrophic forgetting by incremental moment matching. In Advances in Neural Information Processing Systems, pp. 4652–4662, 2017.
|
| 256 |
+
|
| 257 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. In European Conference on Computer Vision, pp. 614–629. Springer, 2016.
|
| 258 |
+
|
| 259 |
+
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2736–2744, 2017.
|
| 260 |
+
|
| 261 |
+
David Lopez-Paz et al. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, pp. 6467–6476, 2017.
|
| 262 |
+
|
| 263 |
+
David JC MacKay. A practical bayesian framework for backpropagation networks. Neural computation, 4(3):448–472, 1992a.
|
| 264 |
+
|
| 265 |
+
David JC MacKay. Bayesian methods for adaptive models. PhD thesis, California Institute of Technology, 1992b.
|
| 266 |
+
|
| 267 |
+
Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single network by iterative pruning. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 268 |
+
|
| 269 |
+
James L McClelland, Bruce L McNaughton, and Randall C O’reilly. Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and memory. Psychological review, 102(3):419, 1995.
|
| 270 |
+
|
| 271 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pp. 109–165. Elsevier, 1989.
|
| 272 |
+
|
| 273 |
+
Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient inference. In International Conference on Learning Representations (ICLR), 2016.
|
| 274 |
+
|
| 275 |
+
Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
|
| 276 |
+
|
| 277 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, 2011.
|
| 278 |
+
|
| 279 |
+
Hong-Wei Ng and Stefan Winkler. A data-driven approach to cleaning large face datasets. In Image Processing (ICIP), 2014 IEEE International Conference on, pp. 343–347. IEEE, 2014.
|
| 280 |
+
|
| 281 |
+
Cuong V. Nguyen, Yingzhen Li, Thang D. Bui, and Richard E. Turner. Variational continual learning. In International Conference on Learning Representations, 2018.
|
| 282 |
+
|
| 283 |
+
Christian Robert and George Casella. Monte Carlo statistical methods. Springer Science & Business Media, 2013.
|
| 284 |
+
|
| 285 |
+
Anthony Robins. Catastrophic forgetting, rehearsal and pseudorehearsal. Connection Science, 7(2): 123–146, 1995.
|
| 286 |
+
|
| 287 |
+
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
|
| 288 |
+
|
| 289 |
+
Nicol N Schraudolph. Fast curvature matrix-vector products for second-order gradient descent. Neural computation, 14(7), 2002.
|
| 290 |
+
|
| 291 |
+
Jonathan Schwarz, Jelena Luketina, Wojciech M Czarnecki, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. arXiv preprint arXiv:1805.06370, 2018.
|
| 292 |
+
|
| 293 |
+
Joan Serra, Didac Suris, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 4548–4557. PMLR, 2018.
|
| 294 |
+
|
| 295 |
+
Kumar Shridhar, Felix Laumann, and Marcus Liwicki. Uncertainty estimations by softplus normalization in bayesian convolutional neural networks with variational inference. arXiv preprint arXiv:1806.05978, 2018.
|
| 296 |
+
|
| 297 |
+
Rupesh K Srivastava, Jonathan Masci, Sohrob Kazerounian, Faustino Gomez, and Jurgen Schmidhu-¨ ber. Compete to compute. In Advances in neural information processing systems, pp. 2310–2318, 2013.
|
| 298 |
+
|
| 299 |
+
Johannes Stallkamp, Marc Schlipsing, Jan Salmen, and Christian Igel. The german traffic sign recognition benchmark: a multi-class classification competition. In Neural Networks (IJCNN), The 2011 International Joint Conference on, pp. 1453–1460. IEEE, 2011.
|
| 300 |
+
|
| 301 |
+
Hanna Tseran, Mohammad Emtiyaz Khan, Tatsuya Harada, and Thang D Bui. Natural variational continual learning. In Continual Learning Workshop@ NeurIPS, volume 2, 2018.
|
| 302 |
+
|
| 303 |
+
Yue Wu, Yinpeng Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, and Yun Fu. Large scale incremental learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 374–382, 2019.
|
| 304 |
+
|
| 305 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, The MIT License (MIT) Copyright $\circledcirc$ 2017 Zalando SE. https://tech.zalando.com, arXiv preprint arXiv:1708.07747, 2017.
|
| 306 |
+
|
| 307 |
+
Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. In International Conference on Learning Representations, 2018.
|
| 308 |
+
|
| 309 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 3987–3995. PMLR, 2017.
|
| 310 |
+
|
| 311 |
+
# A APPENDIX
|
| 312 |
+
|
| 313 |
+
# A.1 DATASETS
|
| 314 |
+
|
| 315 |
+
Table 4 shows a summary of the datasets utilized in our work along with their size and number of classes. In all the experiments we resized images to $3 2 \times 3 2 \times 3$ if necessary. For datasets with monochromatic images, we replicate the image across all RGB channels.
|
| 316 |
+
|
| 317 |
+
Table 4: Utilized datasets summary
|
| 318 |
+
|
| 319 |
+
<table><tr><td>Names</td><td>#Classes</td><td>Train</td><td>Test</td></tr><tr><td>FaceScrub (Ng & Winkler,2014)</td><td>100</td><td>20.600</td><td>2,289</td></tr><tr><td>MNIST (LeCun et al.,1998)</td><td>10</td><td>60,000</td><td>10,000</td></tr><tr><td>CIFAR100 (Krizhevsky & Hinton,2009)</td><td>100</td><td>50.000</td><td>10,000</td></tr><tr><td>NotMNIST (Bulatov,2011)</td><td>10</td><td>16,853</td><td>1,873</td></tr><tr><td>SVHN (Netzer et al., 2011)</td><td>10</td><td>73,257</td><td>26.032</td></tr><tr><td>CIFAR10 (Krizhevsky & Hinton,2009)</td><td>10</td><td>39,209</td><td>12.630</td></tr><tr><td>TrafficSigns (Stallkamp et al., 2011)</td><td>43</td><td>39,209</td><td>12,630</td></tr><tr><td>FashionMNIST (Xiao et al.,2017)</td><td>10</td><td>60,000</td><td>10,000</td></tr></table>
|
| 320 |
+
|
| 321 |
+
# A.2 IMPLEMENTATION DETAILS
|
| 322 |
+
|
| 323 |
+
In this section we take a closer look at elements of our UCB model on MNIST and evaluate variants of parameter regularization, importance measurement, as well as the effect of the number of samples drawn from the posited posterior.
|
| 324 |
+
|
| 325 |
+
Bayes-by-backprop (BBB) Hyperparamters: Table 5 shows the search space for hyperparamters in the BBB algorithm Blundell et al. (2015) which we used for tuning on the validation set of the first two tasks.
|
| 326 |
+
|
| 327 |
+
Table 5: Search space for hyperparamters in BBB given by Blundell et al. (2015)
|
| 328 |
+
|
| 329 |
+
<table><tr><td rowspan=1 colspan=1>BBB hyperparamters</td><td rowspan=1 colspan=1>-logσ1</td><td rowspan=1 colspan=1>-logσ2</td><td rowspan=1 colspan=1>T</td></tr><tr><td rowspan=1 colspan=1>Search space</td><td rowspan=1 colspan=1>{0,1,2}</td><td rowspan=1 colspan=1>{6,7,8}</td><td rowspan=1 colspan=1>{0.25,0.5,0.75}</td></tr></table>
|
| 330 |
+
|
| 331 |
+
Network architecture: For Split MNIST and Permuted MNIST experiments, we have used a twolayer perceptron which has 1200 units. Because there is more number of parameters in our Bayesian neural network compared to its equivalent regular neural net, we ensured fair comparison by matching the total number of parameters between the two to be $1 . 9 \mathrm { M }$ unless otherwise is stated. For the multiple datasets learning scenario, as well as alternating incremental CIFAR10/100 datasets, we have used a ResNet18 Bayesian neural network with 7.1-11.3M parameters depending on the experiment. However, the majority of the baselines provided in this work are originally developed using some variants of AlexNet structure and altering that, e.g. to ResNet18, resulted in degrading in their reported and experimented performance as shown in Table 6. Therefore, we kept the architecture for baselines as AlexNet and ours as ResNet18 and only matched their number of parameters to ensure having equal capacity across different approaches.
|
| 332 |
+
|
| 333 |
+
Table 6: Continually learning on CIFAR10/100 using AlexNet and ResNet18 for UCB (our method) and HAT (Serra et al., 2018). BWT and ACC in $\%$ . All results are (re)produced by us.
|
| 334 |
+
|
| 335 |
+
<table><tr><td>Method</td><td>BWT</td><td>ACC</td></tr><tr><td>HAT (AlexNet) HAT (ResNet18)</td><td>0.0</td><td>78.3</td></tr><tr><td>UCB (AlexNet)</td><td>-9.0 -0.7</td><td>56.8 79.44</td></tr><tr><td>UCB (ResNet18)</td><td>-0.7</td><td>79.70</td></tr></table>
|
| 336 |
+
|
| 337 |
+
Number of Monte Carlo samples: UCB is ensured to be robust to random noise using multiple samples drawn from posteriors. Here we explore different number of samples and the effect on final performance for ACC and BWT. We have used $\Omega _ { \mu } = 1 / \sigma$ as importance and regularization has been performed on mean values only. Following the result in Table 7 we chose the number of samples to be 10 for all experiments.
|
| 338 |
+
|
| 339 |
+
Table 7: Number of Monte Carlo samples $( \mathrm { N } )$ in 2-Split MNIST
|
| 340 |
+
|
| 341 |
+
<table><tr><td>Method</td><td>N</td><td>BWT (%)</td><td>ACC (%)</td></tr><tr><td>UCB</td><td>1</td><td>0.00</td><td>98.0</td></tr><tr><td>UCB</td><td>2</td><td>0.00</td><td>98.3</td></tr><tr><td>UCB</td><td>5</td><td>-0.15</td><td>99.0</td></tr><tr><td>UCB</td><td>10</td><td>0.00</td><td>99.2</td></tr><tr><td>UCB</td><td>15</td><td>-0.01</td><td>98.3</td></tr></table>
|
| 342 |
+
|
| 343 |
+
# A.3 ADDITIONAL RESULTS
|
| 344 |
+
|
| 345 |
+
Here we include some additional results such as Table 8 for 2-split MNIST and some complementary results for tables in the main text as follows: 9, 10, and 11 include standard deviation for results shown in Table 2a, 2b, 2c, respectively.
|
| 346 |
+
|
| 347 |
+
Table 8: Continually learning on 2-Split MNIST. BWT and ACC in $\%$ . $( ^ { * } )$ denotes that methods do not adhere to the continual learning setup: BBB-JT and ORD-JT serve as the upper bound for ACC for BBB/ORD networks, respectively. All results are (re)produced by us.
|
| 348 |
+
|
| 349 |
+
<table><tr><td>Method</td><td>BWT</td><td>ACC</td></tr><tr><td>PackNet (Mallya&Lazebnik,2018)</td><td>0.04±0.01</td><td>98.91±0.03</td></tr><tr><td>LWF (Li& Hoiem,2016)</td><td>-0.22 ± 0.04</td><td>99.12 ±0.03</td></tr><tr><td>HAT (Serra et al., 2018)</td><td>0.01 ±0.00</td><td>99.02 ±0.00</td></tr><tr><td>ORD-FT</td><td>-6.81± 0.03</td><td>92.42 ±0.02</td></tr><tr><td>ORD-FE</td><td>0.04±0.04</td><td>97.90 ±0.04</td></tr><tr><td>BBB-FT</td><td>-0.61±0.03</td><td>98.44±0.03</td></tr><tr><td>BBB-FE</td><td>0.02 ±0.05</td><td>98.03±0.05</td></tr><tr><td>UCB-P (Ours)</td><td>0.03 ±0.04</td><td>99.02 ±0.01</td></tr><tr><td>UCB (Ours)</td><td>0.01±0.00</td><td>99.18 ±0.01</td></tr><tr><td>ORD-JT*</td><td>0.02±0.03</td><td>99.13±0.03</td></tr><tr><td>BBB-JT*</td><td>0.03 ±0.02</td><td>99.51 ±0.02</td></tr></table>
|
| 350 |
+
|
| 351 |
+
Table 9: Continually learning on 5-Split MNIST. BWT and ACC in $\%$ . $( ^ { \ast } )$ denotes that methods do not adhere to the continual learning setup: BBB-JT and ORD-JT serve as the upper bound for ACC for BBB/ORD networks, respectively. All results are (re)produced by us.
|
| 352 |
+
|
| 353 |
+
<table><tr><td>Method</td><td>BWT</td><td>ACC</td></tr><tr><td>VCL-Vadam (Tseran et al., 2018)</td><td></td><td>99.17 ± 0.05</td></tr><tr><td>VCL-GNG (Chen et al., 2019)</td><td>=</td><td>96.50± 0.07</td></tr><tr><td>VCL (Nguyen et al., 2018)</td><td>-0.56 ±0.03</td><td>98.20±0.03</td></tr><tr><td>IMM (Lee et al., 2017)</td><td>-11.20 ± 1.57</td><td>88.54 ± 1.56</td></tr><tr><td>EWC (Kirkpatrick et al., 2017)</td><td>-4.20 ±1.08</td><td>95.78 ±1.08</td></tr><tr><td>HAT (Serra et al., 2018)</td><td>0.00±0.02</td><td>99.59 ±0.02</td></tr><tr><td>ORD-FT*</td><td>-9.18 ± 1.12</td><td>90.60 ±1.12</td></tr><tr><td>ORD-FE*</td><td>0.00 ±1.56</td><td>98.54 ± 1.57</td></tr><tr><td>BBB-FT*</td><td>-6.45 ± 1.99</td><td>93.42 ±1.98</td></tr><tr><td>BBB-FE*</td><td>0.00 ± 2.23</td><td>98.76 ± 2.23</td></tr><tr><td>UCB-P (Ours)</td><td>-0.72 ± 0.04</td><td>99.32 ±0.04</td></tr><tr><td>UCB (Ours)</td><td>0.00 ±0.04</td><td>99.63 ± 0.03</td></tr><tr><td>ORD-JT*</td><td>0.00±0.02</td><td>99.78±0.02</td></tr><tr><td>BBB-JT*</td><td>0.00 ± 0.01</td><td>99.87 ± 0.01</td></tr></table>
|
| 354 |
+
|
| 355 |
+
Table 10: Continually learning on Permuted MNIST. BWT and ACC in $\%$ . $( ^ { * } )$ denotes that method does not adhere to the continual learning setup: BBB-JT serves as the upper bound for ACC for BBB network. $^ \ddag$ denotes results reported by (Serra et al., 2018). $\dagger$ denotes the result reported from original work. BWT was not reported in $^ \ddag$ and $\dagger$ . All others results are (re)produced by us.
|
| 356 |
+
|
| 357 |
+
<table><tr><td>Method</td><td>#Params</td><td>BWT</td><td>ACC</td></tr><tr><td>SI (Zenke et al., 2017)‡</td><td>0.1M</td><td>=</td><td>86.0</td></tr><tr><td>EWC (Kirkpatrick et al., 2017)‡</td><td>0.1M</td><td>=</td><td>88.2</td></tr><tr><td>HAT (Serra et al., 2018)‡</td><td>0.1M</td><td></td><td>91.6</td></tr><tr><td>VCL-Vadamt</td><td>0.1M</td><td></td><td>93.34</td></tr><tr><td>VCL-GNGt</td><td>0.1M</td><td></td><td>94.62</td></tr><tr><td>VCL</td><td>0.1M</td><td>-7.90 ±0.23</td><td>88.80±0.23</td></tr><tr><td>UCB (Ours)</td><td>0.1M</td><td>-0.38 ± 0.02</td><td>91.44±0.04</td></tr><tr><td>LWF (Li& Hoiem,2016)</td><td>1.9M</td><td>-31.17 ± 0.05</td><td>65.65 ± 0.05</td></tr><tr><td>IMM (Lee et al., 2017)</td><td>1.9M</td><td>-7.14±0.07</td><td>90.51 ± 0.08</td></tr><tr><td>HAT (Serra et al., 2018)</td><td>1.9M</td><td>0.03 ±0.05</td><td>97.34 ± 0.05</td></tr><tr><td>BBB-FT</td><td>1.9M</td><td>-0.58 ± 0.05</td><td>90.01 ±0.05</td></tr><tr><td>BBB-FE</td><td>1.9M</td><td>0.02 ±0.03</td><td>93.54± 0.04</td></tr><tr><td>UCB-P (Ours)</td><td>1.9M</td><td>-0.95 ± 0.06</td><td>97.24± 0.06</td></tr><tr><td>UCB (Ours)</td><td>1.9M</td><td>0.03 ±0.00</td><td>97.42 ± 0.01</td></tr><tr><td>BBB-JT*</td><td>1.9M</td><td>0.00±0.00</td><td>98.12±0.01</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 11: Continually learning on CIFAR10/100. BWT and ACC in $\%$ . $( ^ { * } )$ denotes that method does not adhere to the continual learning setup: BBB-JT serves as the upper bound for ACC for BBB network. All results are (re)produced by us.
|
| 360 |
+
|
| 361 |
+
<table><tr><td>Method</td><td>BWT</td><td>ACC</td></tr><tr><td>PathNet (Fernando et al., 2017)</td><td>0.00 ±0.00</td><td>28.94±0.03</td></tr><tr><td>LWF (Li& Hoiem,2016)</td><td>-37.9 ± 0.32</td><td>42.93 ± 0.30</td></tr><tr><td>LFL (Jung et al., 2016)</td><td>-24.22 ± 0.21</td><td>47.67 ± 0.22</td></tr><tr><td>IMM (Lee et al., 2017)</td><td>-12.23 ±0.06</td><td>69.37 ±0.06</td></tr><tr><td>PNN (Rusu et al., 2016)</td><td>0.00±0.00</td><td>70.73 ±0.08</td></tr><tr><td>EWC (Kirkpatrick et al., 2017)</td><td>-1.53 ± 0.07</td><td>72.46 ± 0.06</td></tr><tr><td>HAT (Serra et al., 2018)</td><td>0.04±0.06</td><td>78.32 ±0.06</td></tr><tr><td>BBB-FE</td><td>0.04±0.02</td><td>51.04 ± 0.03</td></tr><tr><td>BBB-FT</td><td>-7.43 ± 0.07</td><td>68.89 ± 0.07</td></tr><tr><td>UCB-P (Ours)</td><td>-1.89±0.03</td><td>77.32 ± 0.03</td></tr><tr><td>UCB (Ours)</td><td>-0.72 ±0.02</td><td>79.44± 0.02</td></tr><tr><td>BBB-JT*</td><td>1.52 ± 0.04</td><td>83.93±0.04</td></tr></table>
|
md/train/HyBbjW-RW/HyBbjW-RW.md
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OPEN LOOP HYPERPARAMETER OPTIMIZATIONAND DETERMINANTAL POINT PROCESSES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Driven by the need for parallelizable hyperparameter optimization methods, this paper studies open loop search methods in the sense that the sequence is predetermined and can be generated before a single configuration is evaluated. Examples include grid search, uniform random search, low discrepancy sequences, and other sampling distributions. In particular, we propose the use of $k$ -determinantal point processes in hyperparameter optimization via random search. Compared to conventional uniform random search where hyperparameter settings are sampled independently, a $k$ -DPP promotes diversity. We describe an approach that transforms hyperparameter search spaces for efficient use with a $k$ -DPP. In addition, we introduce a novel Metropolis-Hastings algorithm which can sample from $k$ - DPPs defined over spaces with a mixture of discrete and continuous dimensions. Our experiments show significant benefits over uniform random search in realistic scenarios with a limited budget for training supervised learners, whether in serial or parallel.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Hyperparameter values—regularization strength, model family choices like depth of a neural network or which nonlinear functions to use, procedural elements like dropout rates, stochastic gradient descent step sizes, and data preprocessing choices—can make the difference between a successful application of machine learning and a wasted effort. To search among many hyperparameter values requires repeated execution of often-expensive learning algorithms, creating a major obstacle for practitioners and researchers alike.
|
| 12 |
+
|
| 13 |
+
In general, on request/iteration $k$ , a hyperparameter searcher suggests a hyperparameter configuration $x _ { k }$ , a worker trains a model using $x _ { k }$ , and returns a validation loss of $y _ { k }$ computed on a hold out set. In this work we say a hyperparameter searcher is open loop if $x _ { k }$ depends only on $\{ x _ { i } \} _ { i = 1 } ^ { k - 1 }$ ; examples include choosing $x _ { k }$ uniformly at random (Bergstra et al., 2011a), or $x _ { k }$ coming from a low-discrepancy sequence (c.f., Iaco (2015)). We say a searcher is \` closed loop if $x _ { k }$ depends on both the past configurations and validation losses $\{ ( \stackrel { \cdot } { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { k - 1 }$ ; examples include Bayesian optimization (Snoek et al., 2012) and recent reinforcement learning methods (Zoph & Le, 2016). Note that open loop methods can draw an infinite sequence of configurations before training a single model, whereas closed loop methods rely on validation loss feedback in order to make suggestions.
|
| 14 |
+
|
| 15 |
+
While sophisticated closed loop selection methods have been shown to empirically identify good hyperparameter configurations faster (i.e., with fewer iterations) than open loop methods like random search, two trends have rekindled interest in embarrassingly parallel open loop methods: 1) modern deep learning models can take days or weeks to train with no signs of efficiency breakthroughs, and 2) the rise of cloud resources available to anyone that charge not by the number of machines, but by the number of CPU-hours used so that 10 machines for 100 hours costs the same as 1000 machines for 1 hour.
|
| 16 |
+
|
| 17 |
+
This paper explores the landscape of open loop methods, identifying tradeoffs that are rarely considered, if at all acknowledged. While random search is arguably the most popular open loop method and chooses each uniform random s $x _ { k }$ independently of ch is the least inter $\{ x _ { i } \} _ { i = 1 } ^ { k - 1 }$ , it is by no means the only choice. In many ways the methods we will discuss because we will advocate for methods where $x _ { k }$ depends on $\{ x _ { i } \} _ { i = 1 } ^ { k - 1 }$ to promote diversity. In particular, we will focus on drawing $\{ x _ { i } \} _ { i = 1 } ^ { k }$ from a $k$ -determinantal point process (DPP) (Kulesza et al., 2012). DPPs support real, integer, and categorical dimensions—any of which may have a tree structure—and have computationally efficient methods of drawing samples.
|
| 18 |
+
|
| 19 |
+
Experimentally, we explore the use of our diversity-promoting open-loop hyperparameter optimization method based on $k$ -DPP random search. We find that it significantly outperforms uniform random search in cases where the hyperparameter values have a large effect on performance.
|
| 20 |
+
|
| 21 |
+
Open source implementations of both our hyperparameter optimization algorithm (as an extension to the hyperopt package (Bergstra et al., 2013)) and the MCMC algorithm introduced in Algorithm 2 will be released upon publication.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
While this work focuses on open loop methods, the vast majority of recent work on hyperparameter tuning has been on closed loop methods, which we briefly review.
|
| 26 |
+
|
| 27 |
+
# 2.1 CLOSED LOOP METHODS
|
| 28 |
+
|
| 29 |
+
Much attention has been paid to sequential model-based optimization techniques such as Bayesian optimization (Snoek et al., 2012; Bergstra et al., 2011b), which sample hyperparameter spaces adaptively. These techniques first choose a point in the space of hyperparameters, then train and evaluate a model with the hyperparameter values represented by that point, then sample another point based on how well previous point(s) performed. These methods can become complicated, and while they can lead to improved performance, the differences are frequently small. In addition, it has recently been observed that many Bayesian optimization methods, when run for $k$ iterations, are outperformed by sampling $2 k$ points uniformly at random (Li et al., 2017). Parallelizing Bayesian optimization methods has proven to be nontrivial, and while a number of algorithms exist which sample more than one point at each iteration (Contal et al., 2013; Desautels et al., 2014; Gonzalez ´ et al., 2016), none can achieve the parallelization that grid search, sampling uniformly, or sampling according to a DPP allow.
|
| 30 |
+
|
| 31 |
+
One recent line of research has examined the use of DPPs for optimizing hyperparameters, in the context of parallelizing Bayesian optimization (Kathuria et al., 2016; Wang et al., 2017). At each iteration within one trial of Bayesian optimization, instead of drawing a single new point to evaluate from the posterior, they define a DPP over a small region of the space and sample a set of diverse points. While this can lead to easy parallelization within one iteration of Bayesian optimization, the overall algorithms are still sequential. Additionally, their approach requires discretizing the hyperparameter space, a drawback which we circumvent.
|
| 32 |
+
|
| 33 |
+
So-called configuration evaluation methods have been shown to perform well by adaptively allocating resources to different hyperparameter settings (Swersky et al., 2014; Li et al., 2017). They initially choose a set of hyperparameters to evaluate (often uniformly), then partially train a set of models for these hyperparameters. After some fixed training budget (e.g. time, or number of training examples observed), they compare the partially trained models against one another and allocate more resources to those which perform best. Eventually, these algorithms produce one (or a small number) of fully trained, high-quality models. In some sense, these approaches are orthogonal to open vs. closed loop methods since both can be applied with these methods.
|
| 34 |
+
|
| 35 |
+
# 2.2 OPEN LOOP METHODS
|
| 36 |
+
|
| 37 |
+
As discussed above, recent trends have renewed interest in open loop methods. And recently, random search was shown to be competitive with sophisticated closed loop methods for modern hyperparameter optimization tasks like deep networks (Li et al., 2017), inspiring other works to explain the phenomenon (Ahmed et al., 2016). Bergstra & Bengio (2012) offer one of the most comprehensive studies of open loop methods to date, and focus attention on comparing random search and grid search. A main takeaway of the paper is that uniform random sampling is generally preferred to grid search1 due to the frequent observation that some hyperparameters have little impact on performance, and random search promotes more diversity in the dimensions that matter. Essentially, if points are drawn uniformly at random in $d$ dimensions but only $d ^ { \prime } < d$ dimensions are relevant, those same points are uniformly distributed (and just as diverse) in $d ^ { \prime }$ dimensions. Grid search, on the other hand, distributes configurations aligned with the axes so if only $d ^ { \prime } < d$ dimensions are relevant, many configurations are essentially duplicates.
|
| 38 |
+
|
| 39 |
+
However, grid search does have one favorable property that is clear in just one dimension. If $k$ points are distributed on [0, 1] on a grid, the maximum spacing between points is equal to $\frac { 1 } { k - 1 }$ . But if points are uniformly at random drawn on [0, 1], the expected largest gap between points scales as √ k . If you are unlucky enough to have your minimum located in this largest gap, this difference could be considerable. The phenomenon generalizes to higher dimensions but grid search’s advantage does not for the reasons above. This is an important concept in numerical integration and one way to quantify this property of a sequence $\mathbf { x } = ( x _ { 1 } , x _ { 2 } , \ldots , x _ { k } )$ is known as star discrepancy:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
D _ { k } ( \mathbf x ) = \operatorname* { s u p } _ { u _ { 1 } , \dots , u _ { d } \in [ 0 , 1 ] } \left| { \frac { 1 } { k } } \sum _ { i = 1 } ^ { k } \mathbf 1 \left\{ x _ { i } \in \prod _ { j = 1 } ^ { d } [ 0 , u _ { j } ) \right\} - \prod _ { j = 1 } ^ { d } u _ { j } \right|
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
One can interpret the star discrepancy as a multidimensional version of the Kolmogorov-Smirnov statistic between the sequence $\mathbf { x }$ and the uniform measure. It is well-known that a sequence chosen uniformly at random from $[ 0 , 1 ] ^ { d }$ has an expected star discrepancy of at least $\scriptstyle { \sqrt { \frac { 1 } { k } } }$ (and is no greater than $\sqrt { \frac { d \log ( d ) } { k } } )$ (Devroye et al., 2013, Corollary 12.5) whereas sequences are known to exist with star discrepancy less than log(k)dk Sobol’ (1967), where both bounds depend on absolute constants. These low-discrepancy sequences, as they are known, include the Sobol sequence, which was also given brief mention in (Bergstra & Bengio, 2012) and shown to outperform random search and grid search. We also note that the Sobol sequence is also used as an initialization procedure for some Bayesian Optimization schemes Snoek et al. (2012). However, the Sobol sequence is only defined for continuous spaces, so for hyperparameter search which involves discrete dimensions it is not appropriate.
|
| 46 |
+
|
| 47 |
+
The final open loop method we study is the DPP, which has been given considerably less attention in the hyperparameter optimization literature. Comparing the star discrepancy of uniform at random and Sobol, one observes that as $d$ grows large relative to $k$ , Sobol starts to suffer. Indeed, Bardenet & Hardy (2016) notes that the Sobol rate is not even valid until $k = \Omega ( 2 ^ { d } )$ which motivates them to study a formulation of a DPP that has a star discrepancy between Sobol and random and holds for all $k$ , small and large. They primarily approached this problem from a theoretical perspective, and didn’t include experimental results. Their work, in part, motivates us to look at DPPs as a solution for hyperparameter optimization.
|
| 48 |
+
|
| 49 |
+
# 3 COMPARISON OF OPEN LOOP METHODS
|
| 50 |
+
|
| 51 |
+
Optimization performance–how close a point in our sequence is to the true, fixed minimum–is our goal, not a sequence with low discrepancy. However, as Bergstra & Bengio (2012) observed, the rare “large gap” that can occur in random sequences without the low discrepancy property can affect optimization performance, on average. One natural surrogate of average optimization performance is to define a hyperparameter space on $[ 0 , 1 ] ^ { d }$ and measure the distance from a fixed point, say ${ \frac { 1 } { 2 } } \mathbf { 1 } = { \bigl ( } { \frac { 1 } { 2 } } , \ldots , { \frac { 1 } { 2 } } { \bigr ) }$ , to the nearest point in the length $k$ sequence in the Euclidean norm squared: $\operatorname* { m i n } _ { i = 1 , \ldots , k } | | x _ { i } - { \textstyle \frac { 1 } { 2 } } \mathbf { 1 } | | _ { 2 } ^ { 2 }$ . The Euclidean norm (squared) is motivated by a quadratic Taylor series approximation around the minimum of the hypothetical function we wish to minimize. The first question we wish to answer is: is low discrepancy a surrogate for optimization performance? In the first and second columns of Figure 1 we plot the star discrepancy and smallest distance from the center ${ \textstyle \frac { 1 } { 2 } } \mathbf { 1 }$ , respectively, as a function of the length of the sequence, with each row representing dimensions $ \bar { \mathrm { d } } = 2 , 3 , 4$ , for the Sobol sequence, uniform at random, and a DPP (see the next section for details). We observe that the Sobol sequence is clearly superior in terms of star discrepancy, with the DPP having a slight edge over Uniform. However, all methods appear comparable when it comes to distance to the center.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 1: Comparison of the Sobol sequence (with uniform noise), samples a from $k$ -DPP, and uniform random for three metrics of interest.
|
| 55 |
+
|
| 56 |
+
Acknowledging the fact that practitioners define the search space themselves more often than not, we realize that if the search space bounds are too small, the optimal solution often is found on the edge, or in a corner of the hypercube. Thus, in some situations it makes sense to bias the sequence towards the edges and the corners, the very opposite of what low discrepancy sequences attempt to do. While Sobol and uniformly random sequences will not bias themselves towards the corners, a DPP does. This happens because points from a DPP are sampled according to how distant they are from the existing points; this tends to favor points in the corners. This same behavior of sampling in the corners is also very common for Bayesian optimization schemes, which is not surprise due to the known connections between sampling from a DPP and gaussian process (see Section 4.5). In the third column of Figure 1 we plot the distance to the origin which is just an arbitrarily chosen corner of hypercube. As expected, we observe that the DPP tends to outperform uniform at random and Sobol in this metric. In what follows, we study the DPP in more depth and how it performs on real-world hyperparameter tuning problems.
|
| 57 |
+
|
| 58 |
+
# 4 METHOD
|
| 59 |
+
|
| 60 |
+
We begin by reviewing determinantal point processes (DPPs) and $k$ -DPPs.
|
| 61 |
+
|
| 62 |
+
Let $\boldsymbol { B }$ be a domain of values from which we would like to sample a finite subset. (In our use of DPPs, this is the set of hyperparameter settings.) In general, $\boldsymbol { B }$ could be discrete or continuous; here we assume it is discrete with $N$ values, and we define $\mathcal { Y } = \{ 1 , \ldots , N \}$ to be a a set which indexes $\boldsymbol { B }$ (this will be particularly useful in Algorithm 1). In Section 4.2 we address when $\boldsymbol { B }$ has continuous dimensions. A DPP defines a probability distribution over $2 ^ { y }$ (all subsets of $\mathcal { V }$ ) with the property that two elements of $\mathcal { V }$ are more (less) likely to both be chosen the more dissimilar (similar) they are. Let random variable $\mathbf { Y }$ range over finite subsets of $\mathcal { V }$ .
|
| 63 |
+
|
| 64 |
+
There are several ways to define the parameters of a DPP. We focus on $\mathbf { L }$ -ensembles, which define the probability that a specific subset is drawn (i.e., $P ( \mathbf { \boldsymbol { Y } } = \mathcal { A } )$ for some $\mathcal { A } \subset \mathcal { V }$ ) as:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
P ( \mathbf { } Y = \mathcal { A } ) = \frac { \operatorname* { d e t } ( \mathbf { L } _ { \mathcal { A } } ) } { \operatorname* { d e t } ( \mathbf { L } + I ) } .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
As shown in Kulesza et al. (2012), this definition of $\mathbf { L }$ admits a decomposition to terms representing the quality and diversity of the elements of $\mathcal { V }$ . For any $y _ { i } , y _ { j } \in \mathcal { D }$ , let:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
{ \bf L } _ { i , j } = q _ { i } q _ { j } \mathcal { K } ( \phi _ { i } , \phi _ { j } ) ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $q _ { i } > 0$ is the quality of $y _ { i }$ $, \phi _ { i } \in R ^ { d }$ is a featurized representation of $y _ { i }$ , and ${ \boldsymbol { \mathcal { K } } } : R ^ { d } \times R ^ { d } \to$ $[ 0 , 1 ]$ is a similarity kernel (e.g. cosine distance). (We will discuss how to featurize hyperparameter settings in Section 4.3.)
|
| 77 |
+
|
| 78 |
+
Here, we fix all $q _ { i } = 1$ ; in future work, closed loop methods might make use of $q _ { i }$ to encode evidence about the quality of particular hyperparameter settings to adapt the DPP’s distribution over time.
|
| 79 |
+
|
| 80 |
+
# 4.1 SAMPLING FROM A $k$ -DPP
|
| 81 |
+
|
| 82 |
+
DPPs have support over all subsets of $\mathcal { V }$ , including $\varnothing$ and $\mathcal { V }$ itself. In many practical settings, one may have a fixed budget that allows running the training algorithm $k$ times, so we require precisely $k$ elements of $\mathcal { V }$ for evaluation. $k$ -DPPs are distributions over subsets of $\mathcal { V }$ of size $k$ . Thus,
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
P ( \mathbf { Y } = A \mid \mid \mathbf { \boldsymbol { Y } } | = k ) = \frac { \operatorname* { d e t } ( \mathbf { L } _ { A } ) } { \sum _ { \mathbf { \boldsymbol { A } } ^ { \prime } \subset \mathcal { V } , \mid \mathbf { \boldsymbol { A } } ^ { \prime } \mid = k } \operatorname* { d e t } ( \mathbf { L } _ { A ^ { \prime } } ) } .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
# 4.2 NEW MCMC ALGORITHM
|
| 89 |
+
|
| 90 |
+
Kulesza et al. (2012) give an algorithm for sampling exactly from $k$ -DPPs, though it runs in $O ( N ^ { 3 } )$ ; a Metropolis-Hastings algorithm presented by Anari et al. (2016) is a simple and fast alternative (included here as Algorithm 1). Both of these sampling algorithms assume the DPP is defined over a finite number of items; they are restricted to discrete domains. We propose a generalization of the MCMC algorithm which preserves relevant computations while allowing sampling from base sets with discrete dimensions, continuous dimensions, or some continuous and some discrete dimensions (Algorithm 2). To the best of our knowledge, this is the first algorithm which allows for sampling from a $k$ -DPP defined over mixed discrete and continuous spaces.
|
| 91 |
+
|
| 92 |
+
Algorithm 1 proceeds as follows: First, initialize a set $\mathbf { Y }$ with $k$ indices of $\mathbf { L }$ , drawn uniformly. Then, at each iteration, sample two indices of $\mathbf { L }$ (one within and one outside of the set $\mathbf { Y }$ ), and with some probability replace the item in $\mathbf { Y }$ with the other.
|
| 93 |
+
|
| 94 |
+
When we have continuous dimensions in the base set, however, we can’t define the matrix $\mathbf { L }$ , so sampling indices from it is not possible. We propose Algorithm 2, which samples points directly from the base set $\boldsymbol { B }$ instead (assuming continuous dimensions are bounded), and computes only the principal minors of $\mathbf { L }$ needed for the relevant computations on the fly.
|
| 95 |
+
|
| 96 |
+
Even in the case where the dimensions of $\boldsymbol { B }$ are discrete, Algorithm 2 requires less computation and space than Algorithm 1 (assuming the quality and similarity scores are stored once computed, and retrieved when needed). Previous analyses claimed that Algorithm 1 should be run for ${ \cal O } ( \bar { N } \log ( N ) )$
|
| 97 |
+
|
| 98 |
+
Algorithm 1 Drawing a sample from a discrete $k$ -DPP
|
| 99 |
+
|
| 100 |
+
Input: L, a symmetric, $N \times N$ matrix where ${ \bf L } _ { i , j } = q _ { i } q _ { j } K ( \phi _ { i } , \phi _ { j } )$ which defines a DPP over a finite base set of items $\boldsymbol { B }$ , and $\mathcal { Y } = \{ 1 , \ldots , N \}$ , where $\mathcal { \mathrm { V } } _ { i }$ indexes a row or column of $\mathbf { L }$
|
| 101 |
+
|
| 102 |
+
Output: $B _ { \mathbf { Y } }$ (the points in $\boldsymbol { B }$ indexed by $\mathbf { Y }$ )
|
| 103 |
+
|
| 104 |
+
1: Initialize $\mathbf { Y }$ to $k$ elements sampled from $\mathcal { V }$ uniformly
|
| 105 |
+
2: while not mixed do
|
| 106 |
+
3: uniformly sample $u \in \mathbf { Y } , v \in \mathcal { Y } \setminus \mathbf { Y }$
|
| 107 |
+
4: set $\mathbf { Y } ^ { \prime } = \mathbf { Y } \cup \{ v \} \setminus \{ u \}$
|
| 108 |
+
5: $\begin{array} { r } { p \gets \frac { 1 } { 2 } m i n \big ( 1 , \frac { \operatorname* { d e t } ( \mathbf { L } _ { \mathbf { Y } ^ { \prime } } ) } { \operatorname* { d e t } ( \mathbf { L } _ { \mathbf { Y } } ) } \big ) } \end{array}$
|
| 109 |
+
6: with probability $p$ : $\mathbf { Y } = \mathbf { Y } ^ { \prime }$
|
| 110 |
+
|
| 111 |
+
7: Return $B _ { \mathbf { Y } }$
|
| 112 |
+
|
| 113 |
+
Algorithm 2 Drawing a sample from a $k$ -DPP defined over a space with continuous and discrete dimensions
|
| 114 |
+
|
| 115 |
+
Input: A base set $\boldsymbol { B }$ with some continuous and some discrete dimensions, a quality function $\Psi$ : $\mathbf { Y } _ { i } \to q _ { i }$ , a feature function $\Phi : \mathbf { Y } _ { i } \phi _ { i }$
|
| 116 |
+
|
| 117 |
+
Output: $\beta$ , a set of $k$ points in $\boldsymbol { B }$
|
| 118 |
+
|
| 119 |
+
1: Initialize $\beta$ to $k$ points sampled from $\boldsymbol { B }$ uniformly
|
| 120 |
+
2: while not mixed do
|
| 121 |
+
3: uniformly sample $u \in \beta , v \in B \setminus \beta$
|
| 122 |
+
4: set $\beta ^ { \prime } = \mathsf { \bar { \beta } } \cup \bar { \{ v \} } \setminus \{ u \}$
|
| 123 |
+
5: compute the quality score for each item, $q _ { i } = \Psi ( \beta _ { i } ) , \forall i$ , and $\boldsymbol { q } _ { i } ^ { \prime } = \boldsymbol { \Psi } ( \beta _ { i } ^ { \prime } ) , \forall i$
|
| 124 |
+
6: construct $\mathbf { L } _ { \beta } = [ q _ { i } q _ { j } K ( \Phi ( \beta _ { i } ) , \Phi ( \beta _ { j } ) ) ] , \forall i , j$
|
| 125 |
+
7: construct ${ \bf L } _ { \beta ^ { \prime } } = [ q _ { i } ^ { \prime } q _ { j } ^ { \prime } \mathcal { K } ( \Phi ( \beta _ { i } ^ { \prime } ) , \Phi ( \beta _ { j } ^ { \prime } ) ) ] , \forall i , j$
|
| 126 |
+
8: $\begin{array} { r } { p \gets \frac { 1 } { 2 } m i n ( 1 , \frac { \operatorname* { d e t } ( \mathbf { L } _ { \beta ^ { \prime } } ) } { \operatorname* { d e t } ( \mathbf { L } _ { \beta } ) } ) } \end{array}$
|
| 127 |
+
9: with probability $p$ : $\beta = \beta ^ { \prime }$
|
| 128 |
+
10: Return $\beta$
|
| 129 |
+
|
| 130 |
+
steps. There are $O ( N ^ { 2 } )$ computations required to compute the full matrix $L$ , and at each iteration we will compute at most $O ( k )$ new elements of $L$ , so even in the worst case we will save space and computation whenever $k \log ( N ) < N$ . In expectation, we will save significantly more.
|
| 131 |
+
|
| 132 |
+
# 4.3 CONSTRUCTING L FOR HYPERPARAMETER OPTIMIZATION
|
| 133 |
+
|
| 134 |
+
The vector $\phi _ { i }$ will encode $y _ { i }$ (an element of $\mathcal { V }$ ), which in its most general form is an attribute-value mapping assigning values to different hyperparameters.
|
| 135 |
+
|
| 136 |
+
Let $\phi _ { i }$ be a feature vector for $y _ { i } \in \mathcal { V }$ , a modular encoding of the attribute-value mapping, in which fixed segments of the vector are assigned to each hyperparameter attribute (e.g., the dropout rate, the choice of nonlinearity, etc.). For a hyperparameter that takes a numerical value in range $[ h _ { \operatorname* { m i n } } , h _ { \operatorname* { m a x } } ]$ , we encode value $h$ using one dimension $( j )$ of $\phi$ and project into the range $[ 0 , 1 ]$ :
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\phi [ j ] = \frac { h - h _ { \operatorname* { m i n } } } { h _ { \operatorname* { m a x } } - h _ { \operatorname* { m i n } } }
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
This rescaling prevents hyperparameters with greater dynamic range from dominating the similarity calculations. A categorical-valued hyperparameter attribute that takes $m$ values is given $m$ elements of $\mathbf { r }$ and a one-hot encoding. We then compute similarity using an RBF kernel, $\begin{array} { r } { { \cal K } = \exp \left( - \frac { | | \phi _ { i } - \phi _ { j } | | ^ { 2 } } { 2 \sigma ^ { 2 } } \right) } \end{array}$ and hence label our approach $k$ -DPP-RBF. Values for $\sigma ^ { 2 }$ lead to models with different properties; when $\sigma ^ { 2 }$ is small, points that are spread out have little impact, and when $\sigma ^ { 2 }$ is large, the increased repulsion between the points encourages them to be as far apart as possible. This tradeoff is represented in Figure 1.
|
| 143 |
+
|
| 144 |
+
# 4.4 TREE-STRUCTURED HYPERPARAMETERS
|
| 145 |
+
|
| 146 |
+
Many real-world hyperparameter search spaces are tree-structured. For example, the number of layers in a neural network is a hyperparameter, and each additional layer adds at least one new hyperparameter which ought to be tuned (the number of nodes in that layer). For a binary hyperparameter like whether or not to use regularization, we use a one-hot encoding. When this hyperparameter is “on,” we set the associated regularization strength as above, and when it is “off” we set it to zero. Intuitively, with all other hyperparameter settings equal, this causes the off-setting to be closest to the least strong regularization. One can also treat higher-level design decisions as hyperparameters (Komer et al., 2014), such as whether to train a logistic regression classifier, a convolutional neural network, or a recurrent neural network. In this construction, the type of model would be a categorical variable (and thus get a one-hot encoding), and all child hyperparameters for an “off” model setting (such as the convergence tolerance for logistic regression, when training a recurrent neural network) would be set to zero.
|
| 147 |
+
|
| 148 |
+
# 4.5 CONNECTION TO GAUSSIAN PROCESSES
|
| 149 |
+
|
| 150 |
+
Gaussian processes are used widely in hyperparameter optimization algorithms. Hennig & Garnett (2016) claim that sampling from a DPP with kernel $\kappa$ is equivalent to sequentially sampling proportional to the posterior variance of a GP defined with covariance kernel $\kappa$ . Since the entropy of a Gaussian is proportional to the log determinant of the covariance matrix, points drawn from a DPP have probability proportional to exp(information gain), and the most probable set from the DPP is the set which maximizes the information gain.
|
| 151 |
+
|
| 152 |
+
# 5 HYPERPARAMETER OPTIMIZATION EXPERIMENTS
|
| 153 |
+
|
| 154 |
+
In this section we present our hyperparameter optimization experiments. We compare $k$ -DPP-RBF, uniform sampling, and a Bayesian optimization algorithm in Section 5.1. We compare samples drawn using Algorithm 1 (which necessitates discretizing the hyperparameter space) and Algorithm 2 against samples drawn uniformly at random in Section 5.2. It is worth noting that as $k$ increases, all sampling methods approach the true optimum.
|
| 155 |
+
|
| 156 |
+
# 5.1 CONVOLUTIONAL NEURAL NETWORKS FOR TEXT CLASSIFICATION
|
| 157 |
+
|
| 158 |
+
Our experiments consider a setting where hyperparameters have a large effect on performance: a convolutional neural network for text classification (Kim, 2014). The task is binary sentiment analysis on the Stanford sentiment treebank (Socher et al., 2013). On this balanced dataset, random guessing leads to $50 \%$ accuracy. We use the CNN-non-static model from Kim (2014), with word2vec (Mikolov et al., 2013) vectors. The model architecture consists of a convolutional layer, a max-over-time pooling layer, then a fully connected layer leading to a softmax.
|
| 159 |
+
|
| 160 |
+
We begin with a search over three hyperparameters, assuming a budget of $k = 2 0$ repetitions of training the convolutional neural net. $L _ { 2 }$ regularization strengths in the range $[ e ^ { - 5 } , \dot { e } ^ { - 1 } ]$ (or no regularization) and dropout rates in $[ 0 . 0 , 0 . 7 ]$ are considered. We consider three increasingly “easy” ranges for the learning rate:
|
| 161 |
+
|
| 162 |
+
• Hard: $[ e ^ { - 5 } , e ^ { 5 } ]$ , where the majority of the range leads to accuracy no better than chance.
|
| 163 |
+
• Medium: $[ e ^ { - 5 } , e ^ { - 1 } ]$ , where half of the range leads to accuracy no better than chance.
|
| 164 |
+
• Easy: $[ e ^ { - 1 0 } , e ^ { - 3 } ]$ , where the entire range leads to models that beat chance.
|
| 165 |
+
|
| 166 |
+
Figure 2 shows the accuracy (averaged over 50 runs) of the best model found after exploring $1 , 2 , \ldots$ , $k$ hyperparameter settings. We see that $k$ -DPP-RBF finds better models with fewer iterations necessary than the other approaches, especially in the most difficult case. Figure 2 compares the sampling methods against a Bayesian optimization technique using a tree-structured Parzen estimator (BOTPE; Bergstra et al., 2011b). This technique evaluates points sequentially, allowing the model to choose the next point based on how well previous points performed (a closed loop approach). It is state-of-the-art on tree-structured search spaces (though its sequential nature limits parallelization). Surprisingly, we find it performs the worst, even though it takes advantage of additional information.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 2: Average best-found model accuracy by iteration when training a convolutional neural network on three hyperparameter search spaces (defined in Section 5.1), averaged across 50 trials of hyperparameter optimization, with $k = 2 0$ .
|
| 170 |
+
|
| 171 |
+
We hypothesize that the exploration/exploitation tradeoff in BO-TPE causes it to commit to more local search before exploring the space fully, thus not finding hard-to-reach global optima.
|
| 172 |
+
|
| 173 |
+
Note that when considering points sampled uniformly or from a DPP, the order of the $k$ hyperparameter settings in one trial is arbitrary (though this is not the case with BO-TPE as it is an iterative algorithm). The variance of the $k$ -DPP methods (not shown for clarity) tends to be high in early iterations, simply because the $k$ samples from a $k$ -DPP are likely to be more diverse than those sampled uniformly, but in all cases the variance of the best of the $k$ points is lower than when sampled uniformly.
|
| 174 |
+
|
| 175 |
+
# 5.2 OPTIMIZING WITHIN RANGES KNOWN TO BE GOOD
|
| 176 |
+
|
| 177 |
+
Zhang & Wallace (2015) analyzed the stability of convolutional neural networks for sentence classification with respect to a large set of hyperparameters, and found a set of six which they claimed had the largest impact: the number of kernels, the difference in size between the kernels, the size of each kernel, dropout, regularization strength, and the number of filters. We optimized over their prescribed “Stable” ranges; average accuracies across 50 trials of hyperparameter optimization are shown in Figure 3, across $k = 2 0$ iterations, with each dimension discretized to five values (for the discretized experiments). For both uniform sampling and sampling using $k$ -DPP-RBF, discretizing the search space hurts performance, thus motivating the use of Algorithm 2. Additionally, we find that even in this case where every value gives reasonable performance, $k$ -DPP-RBF sampling outperforms uniform sampling.
|
| 178 |
+
|
| 179 |
+
Our experiments reveal that, while the hyperparameters proposed by Zhang & Wallace (2015), can have an effect, the learning rate, which they don’t analyze, is at least as impactful.
|
| 180 |
+
|
| 181 |
+
# 6 CONCLUSIONS
|
| 182 |
+
|
| 183 |
+
We have explored open loop hyperparameter optimization built on sampling from $k$ -DPPs. We described how to construct $k$ -DPPs over hyperparameter search spaces, and showed that sampling from these retains the attractive parallelization capabilities of random search. Our experiments demonstrate that, under a limited computation budget, on a number of realistic hyperparameter optimization problems, these approaches perform better than sampling uniformly at random. As we increase the difficulty of our hyperparameter optimization problem (i.e., as values which lead to good model evaluations become more scarce) the improvement over sampling uniformly at random increases. An open-source implementation of our method is available.2
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 3: Average best-found model accuracy by iteration when training a convolutional neural network on the “Stable” search space (defined in Section 5.2), averaged across 50 trials of hyperparameter optimization, with $k =$ 20. Discretizing the space reduces the accuracy found for both uniform sampling and $k$ -DPP-RBF, but in both cases $k$ -DPP-RBF finds better optima than uniform sampling.
|
| 187 |
+
|
| 188 |
+
# REFERENCES
|
| 189 |
+
|
| 190 |
+
Mohamed Osama Ahmed, Bobak Shahriari, and Mark Schmidt. Do we need harmless bayesian optimization and first-order bayesian optimization? NIPS BayesOpt, 2016.
|
| 191 |
+
|
| 192 |
+
Nima Anari, Shayan Oveis Gharan, and Alireza Rezaei. Monte carlo markov chain algorithms for sampling strongly rayleigh distributions and determinantal point processes. In Proceedings of the 29th Conference on Learning Theory, COLT 2016, New York, USA, June 23-26, 2016, pp. 103–115, 2016. URL http: //jmlr.org/proceedings/papers/v49/anari16.html.
|
| 193 |
+
|
| 194 |
+
Rmi Bardenet and Adrien Hardy. Monte carlo with determinantal point processes. In arXiv preprint arXiv:arXiv:1605.00361, 2016.
|
| 195 |
+
|
| 196 |
+
James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13:281–305, 2012.
|
| 197 |
+
|
| 198 |
+
James Bergstra, Remi Bardenet, Yoshua Bengio, and Balazs Kegl. Algorithms for hyper-parameter optimization. In Proc. of NIPS, 2011a.
|
| 199 |
+
|
| 200 |
+
James Bergstra, Daniel Yamins, and David D Cox. Making a science of model search: Hyperparameter optimization in hundreds of dimensions for vision architectures. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pp. 115–123, 2013.
|
| 201 |
+
|
| 202 |
+
James S Bergstra, Remi Bardenet, Yoshua Bengio, and Bal ´ azs K ´ egl. Algorithms for hyper-parameter optimiza-´ tion. In Advances in Neural Information Processing Systems, pp. 2546–2554, 2011b.
|
| 203 |
+
|
| 204 |
+
Emile Contal, David Buffoni, Alexandre Robicquet, and Nicolas Vayatis. Parallel gaussian process optimization with upper confidence bound and pure exploration. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 225–240. Springer, 2013.
|
| 205 |
+
|
| 206 |
+
Thomas Desautels, Andreas Krause, and Joel W Burdick. Parallelizing exploration-exploitation tradeoffs in gaussian process bandit optimization. Journal of Machine Learning Research, 15(1):3873–3923, 2014.
|
| 207 |
+
|
| 208 |
+
Luc Devroye, Laszl ´ o Gy ´ orfi, and G ¨ abor Lugosi. ´ A probabilistic theory of pattern recognition, volume 31. Springer Science & Business Media, 2013.
|
| 209 |
+
|
| 210 |
+
Javier Gonzalez, Zhenwen Dai, Philipp Hennig, and Neil Lawrence. Batch bayesian optimization via local ´ penalization. In Artificial Intelligence and Statistics, pp. 648–657, 2016.
|
| 211 |
+
|
| 212 |
+
Maria Rita Iaco. Low discrepancy sequences: Theory and applications. \` arXiv preprint arXiv:1502.04897, 2015.
|
| 213 |
+
|
| 214 |
+
Tarun Kathuria, Amit Deshpande, and Pushmeet Kohli. Batched gaussian process bandit optimization via determinantal point processes. In Advances in Neural Information Processing Systems, pp. 4206–4214, 2016.
|
| 215 |
+
|
| 216 |
+
Yoon Kim. Convolutional neural networks for sentence classification. EMNLP 2014, 2014.
|
| 217 |
+
|
| 218 |
+
Brent Komer, James Bergstra, and Chris Eliasmith. Hyperopt-sklearn: automatic hyperparameter configuration for scikit-learn. In ICML workshop on AutoML. Citeseer, 2014.
|
| 219 |
+
|
| 220 |
+
Alex Kulesza, Ben Taskar, et al. Determinantal point processes for machine learning. Foundations and Trend $\textsuperscript { \textregistered }$ in Machine Learning, 5(2–3):123–286, 2012.
|
| 221 |
+
|
| 222 |
+
Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: Banditbased configuration evaluation for hyperparameter optimization. Proc. of ICLR, 17, 2017.
|
| 223 |
+
|
| 224 |
+
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.
|
| 225 |
+
|
| 226 |
+
Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. In Advances in neural information processing systems, pp. 2951–2959, 2012.
|
| 227 |
+
|
| 228 |
+
Il’ya Meerovich Sobol’. On the distribution of points in a cube and the approximate evaluation of integrals. Zhurnal Vychislitel’noi Matematiki i Matematicheskoi Fiziki, 7(4):784–802, 1967.
|
| 229 |
+
|
| 230 |
+
Richard Socher, Alex Perelygin, Jean Y Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, Christopher Potts, et al. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the conference on empirical methods in natural language processing (EMNLP), volume 1631, pp. 1642. Citeseer, 2013.
|
| 231 |
+
|
| 232 |
+
Kevin Swersky, Jasper Snoek, and Ryan Prescott Adams. Freeze-thaw bayesian optimization. arXiv preprint arXiv:1406.3896, 2014.
|
| 233 |
+
|
| 234 |
+
Zi Wang, Chengtao Li, Stefanie Jegelka, and Pushmeet Kohli. Batched high-dimensional bayesian optimization via structural kernel learning. In International Conference on Machine Learning (ICML), 2017.
|
| 235 |
+
|
| 236 |
+
Ye Zhang and Byron Wallace. A sensitivity analysis of (and practitioners’ guide to) convolutional neural networks for sentence classification. arXiv preprint arXiv:1510.03820, 2015.
|
| 237 |
+
|
| 238 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
md/train/HyEl3o05Fm/HyEl3o05Fm.md
ADDED
|
@@ -0,0 +1,364 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STOCHASTIC ADVERSARIAL VIDEO PREDICTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Being able to predict what may happen in the future requires an in-depth understanding of the physical and causal rules that govern the world. A model that is able to do so has a number of appealing applications, from robotic planning to representation learning. However, learning to predict raw future observations, such as frames in a video, is exceedingly challenging—the ambiguous nature of the problem can cause a naively designed model to average together possible futures into a single, blurry prediction. Recently, this has been addressed by two distinct approaches: (a) latent variational variable models that explicitly model underlying stochasticity and (b) adversarially-trained models that aim to produce naturalistic images. However, a standard latent variable model can struggle to produce realistic results, and a standard adversarially-trained model underutilizes latent variables and fails to produce diverse predictions. We show that these distinct methods are in fact complementary. Combining the two produces predictions that look more realistic to human raters and better cover the range of possible futures. Our method outperforms prior works in these aspects.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
When we interact with objects in our environment, we can easily imagine the consequences of our actions: push a ball and it will roll; drop a vase and it will break. The ability to imagine future outcomes provides an appealing avenue for learning about the world. Unlabeled video sequences can be gathered autonomously with minimal human intervention, and a machine that learns to predict future events will gain an in-depth and functional understanding of its environment. This leads naturally to the problem of video prediction—given a sequence of context frames, and optionally a proposed action sequence, generate the pixels of the future frames. Once trained, such a model could be used to determine which actions can bring about desired outcomes (Finn et al., 2016; Ebert et al., 2017). Unfortunately, accurate and naturalistic video prediction remains an open problem.
|
| 12 |
+
|
| 13 |
+
One major challenge in video prediction is the ambiguous nature of the problem. While frames in the immediate future can be extrapolated with high precision, the space of possibilities diverges beyond a few frames, and the problem becomes multimodal by nature. Methods that use deterministic models and loss functions unequipped to handle this inherent uncertainty, such as mean-squared error (MSE), will average together possible futures, producing blurry predictions. Prior works have explored stochastic models for video prediction (Babaeizadeh et al., 2018; Denton & Fergus, 2018), using the framework of variational autoencoders (VAEs) (Kingma & Welling, 2014). These models predict possible futures by sampling latent variables. During training, they optimize a variational lower bound on the likelihood of the data in a latent variable model. However, the posterior is still a pixel-wise MSE loss, corresponding to the log-likelihood under a fully factorized Gaussian distribution. This makes training tractable, but causes them to still make blurry and unrealistic predictions when the latent variables alone do not adequately capture the uncertainty.
|
| 14 |
+
|
| 15 |
+
Another relevant branch of recent work has been generative adversarial networks (GANs) (Goodfellow et al., 2014) for image generation. Here, a generator network is trained to produce images that are indistinguishable from real images, under the guidance of a learned discriminator network trained to classify images as real or generated. The discriminator operates on patches or entire images, and is thus capable of modeling the joint distribution of pixels. Although this overcomes the limitations of pixel-wise losses, GANs are notoriously susceptible to mode collapse, where latent random variables are often ignored by the model, especially in the conditional setting. This makes them difficult to apply to generation of diverse and plausible futures, conditioned on context frames.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Example results. While the SV2P method (Babaeizadeh et al., 2018) produces blurry images, our method maintains sharpness and realism through time. The prior SVG-LP method (Denton & Fergus, 2018) produces sharper predictions, but still blurs out objects in the background (left) or objects that interact with the robot such as the baseball (right).
|
| 19 |
+
|
| 20 |
+
To address these challenges, we propose a model that combines both adversarial losses and latent variables to enable realistic stochastic video prediction. Our model consists of a video prediction network that can sample multiple plausible futures by sampling time-varying stochastic latent variables and decoding them into multiple frames. At training time, an inference network estimates the distribution of these latent variables, and video discriminator networks classify generated videos from real. The full training objective is the variational lower bound used in VAEs combined with the adversarial loss used in GANs. This enables us to capture stochastic posterior distributions of videos while also modeling the spatiotemporal joint distribution of pixels. VAEs with no adversarial losses are also capable of modeling joint distributions, provided that the generator model doesn’t assume any factorization of the pixels. This is the case of pixel-autoregressive models, such as Pixel Video Networks (Kalchbrenner et al., 2017), though training and inference with these models are impractically slow. In this work, we take a different approach and we instead focus on the losses.
|
| 21 |
+
|
| 22 |
+
The primary contribution of our work is an stochastic video prediction model based on VAE-GANs. To our knowledge, this is the first stochastic video prediction model that combines an adversarial loss with a latent variable model trained via the variational lower bound. Our experiments show that the VAE component greatly improves the diversity of the generated images, while the adversarial loss attains prediction results that are substantially more realistic than state-of-the-art methods, as shown in Fig. 1. We further present a comparison of various types of prediction models and losses, including VAE, GAN, and VAE-GAN models, and analyze the impact of these choices on prediction realism, diversity, and accuracy.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
Recent developments in expressive generative models based on deep networks has led to impressive developments in video generation and prediction. Earlier approaches to prediction focused on models that generate pixels directly from the latent state of the model using both feed-forward (Ranzato et al., 2014; Mathieu et al., 2016) and recurrent (Oh et al., 2015; Xingjian et al., 2015) architectures. An alternative to generating pixels is transforming them by applying a constrained geometric distortion to a previous frame (Finn et al., 2016; De Brabandere et al., 2016; Xue et al., 2016; Byravan & Fox, 2016; Vondrick & Torralba, 2017; van Amersfoort et al., 2017; Liu et al., 2017; Chen et al., 2017; Lu et al., 2017; Walker et al., 2015; 2016; Liang et al., 2017). Aside from the design of the generator architecture, performance is strongly affected by the training objective. Simply minimizing MSE loss can lead to strong results for deterministic synthetic videos (Oh et al., 2015; Chiappa et al., 2017). However, on real-world videos that contain uncertainty, this loss can result in blurry predictions, as the model averages futures to avoid incurring a large MSE loss (Mathieu et al., 2016).
|
| 27 |
+
|
| 28 |
+
Incorporating uncertainty is critical for addressing this issue. One approach is to model the full joint distribution using pixel-autoregressive models (van den Oord et al., 2016; Kalchbrenner et al., 2017; Reed et al., 2017), though training and inference are impractically slow. Another approach is to train a latent variable model, such as in variational autoencoders (VAEs) (Kingma & Welling, 2014). Conditional VAEs have been used for prediction of optical flow trajectories (Walker et al.,
|
| 29 |
+
|
| 30 |
+
2016), single-frame prediction (Xue et al., 2016), and recently for stochastic multi-frame video prediction (Babaeizadeh et al., 2018; Denton & Fergus, 2018). While these models can model distributions over possible futures, the prediction distribution is still fully factorized over pixels, which still tends to produce blurry predictions.
|
| 31 |
+
|
| 32 |
+
Adversarial losses (Goodfellow et al., 2014) for image generation can produce substantially improved realism. However, these networks tend to be difficult to train and are susceptible to mode collapse. A number of prior works have used adversarial losses for deterministic video prediction (Mathieu et al., 2016; Vondrick & Torralba, 2017; Villegas et al., 2017; Lu et al., 2017; Zhou & Berg, 2016; Bhattacharjee & Das, 2017). Several prior works have also sought to produce unconditioned video generations (Vondrick et al., 2016; Saito et al., 2017; Tulyakov et al., 2018) and conditional generation with input noise (Chen et al., 2017; Tulyakov et al., 2018; Wang et al., 2018). We show that a GAN model with input noise can indeed generate realistic videos, but fails to adequately cover the space of possible futures. In contrast, our method, which combines latent variable models with an adversarial loss, produces videos that are both visually plausible and diverse.
|
| 33 |
+
|
| 34 |
+
Prior works have combined VAEs and GANs to produce stochastic and realistic predictions. Walker et al. (2017) predicts videos of humans by decomposing the problem into a VAE that predicts stochastic future poses and a GAN that generates videos conditioned on those poses and an image. VAE-GANs, which jointly optimize the VAE and GAN losses, have shown promising results for unconditional and conditional image generation (Larsen et al., 2016; Bao et al., 2017; Zhu et al., 2017), but have not been applied to video prediction. The video prediction setting presents two important challenges. First, conditional image generation can handle large appearance changes between the input and output, but suffer when attempting to produce large spatial changes. The video prediction setting is precisely the opposite—the appearance remains largely the same from frame to frame, but the most important changes are spatial. Secondly, video prediction involves sequential prediction, where it’s increasingly difficult to predict farther into the future. Our approach is the first to use VAE-GANs in a recurrent setting for stochastic video prediction.
|
| 35 |
+
|
| 36 |
+
# 3 VIDEO PREDICTION WITH STOCHASTIC ADVERSARIAL MODELS
|
| 37 |
+
|
| 38 |
+
Our goal is to learn a stochastic video prediction model that can predict videos that are diverse and perceptually realistic, and where all predictions are plausible futures for the given initial image. In practice, we use a short initial sequence of images (typically two frames), though we will omit this in our derivation for ease of notation. Our model consists of a recurrent generator network $G$ , which is a deterministic video prediction model that maps an initial image $\mathbf { x } _ { \mathrm { 0 } }$ and a sequence of latent random codes ${ \bf z } _ { 0 : T - 1 }$ , to the predicted sequence of future images $\hat { \mathbf { x } } _ { 1 : T }$ . Intuitively, the latent codes encapsulate any ambiguous or stochastic events that might affect the future. At test time, we sample videos by first sampling the latent codes from a prior distribution $p ( \mathbf { z } _ { t } )$ , and then passing them to the generator. We use a fixed unit Gaussian prior, $\mathcal { N } ( 0 , 1 )$ . The training procedure for this includes elements of variational inference and generative adversarial networks. Before describing the training procedure, we formulate the problem in the context of VAEs and GANs.
|
| 39 |
+
|
| 40 |
+
# 3.1 VARIATIONAL AUTOENCODERS
|
| 41 |
+
|
| 42 |
+
Our recurrent generator predicts each frame given the previous frame and a random latent code. The previous frame passed to the generator is denoted as $\tilde { \mathbf { x } } _ { t - 1 }$ to indicate that it could be a ground truth frame $\mathbf { x } _ { t - 1 }$ (for the initial frames) or the last prediction $\hat { \mathbf { x } } _ { t - 1 }$ . The generator specifies a distribution $p ( \mathbf { x } _ { t } | \mathbf { x } _ { t - 1 } , \mathbf { z } _ { t - 1 } )$ , parametrized as a fixed-variance Laplacian distribution with mean $\hat { \mathbf { x } } _ { t } = G ( \mathbf { x } _ { t - 1 } , \mathbf { z } _ { t - 1 } )$ . The likelihood of the data $p ( \mathbf { x } _ { 1 : T } | \mathbf { x } _ { 0 } )$ cannot be directly maximized, since it involves marginalizing over the latent variables, which is intractable in general. Thus, we instead maximize the variational lower bound of the log-likelihood. We approximate the posterior with a recognition model $q \big ( \mathbf { z } _ { t } \big | \mathbf { x } _ { t : t + 1 } \big )$ , which is parametrized as a conditionally Gaussian distribution $\sqrt { ( \mu _ { \mathbf { z } _ { t } } ) } , \sigma _ { \mathbf { z } _ { t } } ^ { 2 } )$ , represented by a network $E ( \mathbf { x } _ { t : t + 1 } )$ . The encoder $E$ is conditioned on adjacent frames $\mathbf { x } _ { t }$ and $\mathbf { x } _ { t + 1 }$ in order to have temporally local latent variables $\mathbf { z } _ { t }$ that capture the ambiguity for only that transition, a sensible choice when using independent and identically distributed Gaussian priors. Another choice is to use temporally correlated latent variables, which would require a stronger prior (e.g. as in Denton & Fergus (2018)). For simplicity, we opted for the former.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: Our proposed video prediction model. (a) During testing, we synthesize new frames by sampling random latent codes $\mathbf { z }$ from a prior distribution $p ( \mathbf { z } )$ independently at each time step. The generator $G$ takes a previous frame and a latent code to synthesize a new frame. (b) During training, the generator is optimized to predict videos that match the distribution of real videos, using learned discriminators. The discriminators operate on entire sequences. We sample latent codes from two distributions: (1) the prior distribution, and (2) a posterior distribution approximated by a learned encoder $E$ . For the latter, the regression $\mathcal { L } _ { 1 }$ loss is used. Separate discriminators $D$ and $D ^ { \mathrm { V A E } }$ are used depending on the distribution used to sample the latent code.
|
| 46 |
+
|
| 47 |
+
During training, the latent code is sampled from $q \big ( \mathbf { z } _ { t } | \mathbf { x } _ { t : t + 1 } \big )$ . The generation of each frame can be thought of as the reconstruction of frame $\hat { \mathbf { x } } _ { t + 1 }$ , where the ground truth frame $\mathbf { x } _ { t + 1 }$ (along with $\mathbf { x } _ { t }$ ) is encoded into a latent code $\mathbf { z } _ { t }$ , and then it (along with the last frame) is mapped back to $\hat { \mathbf { x } } _ { t + 1 }$ . Since the latent code has ground truth information about the frame being reconstructed, the model is encouraged to use it during training. This is a conditional version of VAEs, where the encoder and decoder are conditioned on the previous frame $\mathbf { \check { x } } _ { t }$ or $\hat { \mathbf { x } } _ { t } .$ ). To allow back-propagation through the encoder, the reconstruction term is rewritten using the re-parametrization trick,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathcal { L } _ { 1 } ( G , E ) = \mathbb { E } _ { \mathbf { x } _ { 0 : T } , \mathbf { z } _ { t } \sim E \left( \mathbf { x } _ { t : t + 1 } \right) | _ { t = 0 } ^ { T - 1 } } \left[ \sum _ { t = 1 } ^ { T } | | \mathbf { x } _ { t } - G ( \mathbf { x } _ { t - 1 } , \mathbf { z } _ { t - 1 } ) | | _ { 1 } \right] .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
To enable sampling from the prior at test time, a regularization term encourages the approximate posterior to be close to the prior distribution,
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { { K L } } } ( E ) = \mathbb { E } _ { { \mathbf { x } _ { 0 : T } } } \left[ \sum _ { t = 1 } ^ { T } \mathcal { D } _ { \mathrm { { K L } } } ( E ( { \mathbf { x } _ { t - 1 : t } } ) | | p ( \mathbf { z } _ { t - 1 } ) ) \right] . } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
The VAE optimization involves minimizing the following objective, where the relative weighting of $\lambda _ { 1 }$ and $\lambda _ { \mathrm { K L } }$ is determined by the (fixed) variance of conditional likelihood $p ( \mathbf { x } _ { t } | \mathbf { x } _ { t - 1 } , \mathbf { z } _ { t - 1 } )$ ,
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
G ^ { * } , E ^ { * } = \arg \operatorname* { m i n } _ { G , E } \lambda _ { 1 } \mathcal { L } _ { 1 } ( G , E ) + \lambda _ { \mathrm { K L } } \mathcal { L } _ { \mathrm { K L } } ( E ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
# 3.2 GENERATIVE ADVERSARIAL NETWORKS
|
| 66 |
+
|
| 67 |
+
Without overcoming the problem of modeling pixel covariances, it is likely not possible to produce sharp and clean predictions. Indeed, as shown in our experiments, the pure VAE model tends to produce blurry futures. We can force the predictions to stay on the video manifold by matching the distributions of predicted and real videos. Given a classifier $D$ that is capable of distinguishing generated videos $\hat { \mathbf { x } } _ { 1 : T }$ from real videos $\mathbf { x } _ { \mathrm { 1 : } T }$ , the generator can be trained to match the statistics of the real data distribution using the binary cross-entropy loss,
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { G a N } } ( G , D ) = \mathbb { E } _ { \mathbf { x } _ { 1 : T } } [ \log D ( \mathbf { x } _ { 1 : T } ) ] + \mathbb { E } _ { \mathbf { x } _ { 1 : T } , \mathbf { z } _ { t } \sim p ( \mathbf { z } _ { t } ) | _ { t = 0 } ^ { T - 1 } } [ \log ( 1 - D ( G ( \mathbf { x } _ { 0 } , \mathbf { z } _ { 0 : T - 1 } ) ) ) ] . } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The overloaded notation $G ( { \bf x } _ { 0 } , { \bf z } _ { 0 : T - 1 } )$ indicates the generated sequence $\hat { \mathbf { x } } _ { 1 : T }$ . The classifier, which is not known a priori and is problem-specific, can be realized as a deep discriminator network that can be adversarially learned,
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
G ^ { * } = \arg \operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } \mathcal { L } _ { \mathrm { G A N } } ( G , D ) .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
This is the setting of GANs. In the conditional case, a per-pixel reconstruction term $\mathcal { L } _ { 1 } ^ { \mathrm { G A N } }$ is added to the objective, which is analogous to $\mathcal { L } _ { 1 }$ , except that the latent codes are sampled from the prior.
|
| 80 |
+
|
| 81 |
+
# 3.3 STOCHASTIC ADVERSARIAL VIDEO PREDICTION
|
| 82 |
+
|
| 83 |
+
The VAE and GAN models provide complementary strengths. GANs use a learned loss function through the discriminator, which learns the statistics of natural videos. However, GANs can suffer from the problem of mode collapse, especially in the conditional setting (Pathak et al., 2016; Isola et al., 2017; Zhu et al., 2017). VAEs explicitly encourage the latent code to be more expressive and meaningful, since the learned encoder produces codes that are useful for making accurate predictions at training time. However, during training, VAEs only observe latent codes that are encodings of ground truth images, and never train on completely randomly drawn latent codes, leading to a potential train and test mismatch. GANs, however, are trained with randomly drawn codes.
|
| 84 |
+
|
| 85 |
+
Our stochastic adversarial video prediction (SAVP) model combines both approaches, shown in Fig. 2. Another term $\mathcal { L } _ { \mathrm { G A N } } ^ { \mathrm { V A E } }$ is introduced, which is analogous to $\mathcal { L } _ { \mathrm { G A N } }$ except that it uses latent codes sampled from $q \big ( \mathbf { z } _ { t } | \mathbf { x } _ { t : t + 1 } \big )$ and a video discriminator . The objective of our SAVP model is
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
G ^ { * } , E ^ { * } = \operatorname * { a r g m i n } _ { G , E } \operatorname* { m a x } _ { D , D ^ { \mathrm { v a g } } } \lambda _ { 1 } \mathcal { L } _ { 1 } ( G , E ) + \lambda _ { \mathrm { { K L } } } \mathcal { L } _ { \mathrm { { K L } } } ( E ) + \mathcal { L } _ { \mathrm { G a N } } ( G , D ) + \mathcal { L } _ { \mathrm { G A N } } ^ { \mathrm { v a g } } ( G , E , D ^ { \mathrm { v a E } } ) .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
# 3.4 NETWORK ARCHITECTURES
|
| 92 |
+
|
| 93 |
+
The generator is a convolutional LSTM (Xingjian et al., 2015) that predicts pixel-space transformations between the current and next frame, with additional skip connections with the first frame as done in SNA (Ebert et al., 2017). At every time step, the network is conditioned on the current frame and latent code. After the initial frames, the network is conditioned on its own predictions. The conditioning on the latent codes is realized by concatenating them along the channel dimension to the inputs of all the convolutional layers of the convolutional LSTM. We note that the warping component of this generator assumes that the frames in the videos can be described as transformations of pixels, which is the case for the datasets that we consider. And although the generator used in this work is based on SNA, any video generator (including the one from Denton & Fergus (2018)) could be used with our losses. The encoder is a feed-forward convolutional network that, at every time step, encodes a pair of images $\mathbf { x } _ { t }$ and $\mathbf { x } _ { t + 1 }$ into $\mu _ { \mathbf { z } _ { t } }$ and $\log \sigma _ { \mathbf { z } _ { t } }$ .
|
| 94 |
+
|
| 95 |
+
The video discriminator is a feed-forward convolutional network with 3D filters, based on SNGAN (Miyato et al., 2018) but with the filters “inflated” from 2D to 3D. The network takes in a spatiotemporal cube of all the predicted pixels and outputs a single logit. The ground-truth context frames are not provided to the network. We found that spectral normalization in the discriminator and conditioning only on the predicted frames were important for a stable training. We also found that image discriminators that operate on single frames were not necessary. See Fig. 8 and Appendix A for additional details.
|
| 96 |
+
|
| 97 |
+
# 3.5 DISCUSSION OF RELATED VAE MODELS
|
| 98 |
+
|
| 99 |
+
Aside from the adversarial losses, the VAE component of our model is related to prior work on stochastic video prediction. Although the variational losses are the same, there are differences on encoding the posterior distribution and sampling the latent variables at training and test time.
|
| 100 |
+
|
| 101 |
+
The inference network of Babaeizadeh et al. (2018) estimates a single distribution $q ( \mathbf { z } | \mathbf { x } _ { 1 : T } )$ by using a feed-forward network that encodes the entire video sequence at once. At test time, the latent variable is sampled from a unit Gaussian prior. They propose two variants for sampling. The latent is sampled once for the entire sequence in the time-invariant case or at every time step in the time-variant case.
|
| 102 |
+
|
| 103 |
+
On the other hand, the inference network of Denton & Fergus (2018) estimates a time-varying distribution $q \big ( \mathbf { z } _ { t } | \mathbf { x } _ { 1 : t + 1 } \big )$ by using a recurrent network that encodes all the frames up to the next frame. They propose two versions for the prior. The prior is either a fixed unit Gaussian distribution or a time-varying distribution $p ( \mathbf { z } _ { t } | \mathbf { x } _ { 1 : t } )$ , which is learned and estimated by a recurrent network. In both cases, the latent variable is sampled at every time step.
|
| 104 |
+
|
| 105 |
+
In contrast, our inference network estimates a single distribution $q \big ( \mathbf { z } _ { t } | \mathbf { x } _ { t : t + 1 } \big )$ by using a feedforward network that encodes the current and next frames. Unlike both prior works, the posterior distribution is temporally local and is conditioned on only two adjacent frames. The latent variables are sampled at every time step and, like the time-variant SV2P and fixed-prior SVG, the prior is a fixed unit Gaussian distribution for every time step.
|
| 106 |
+
|
| 107 |
+
# 4 EXPERIMENTS
|
| 108 |
+
|
| 109 |
+
Our experimental evaluation studies the realism, diversity, and accuracy of the videos generated by our approach and prior methods, and evaluates the importance of various design decisions, including the form of the reconstruction loss and the presence of the variational and adversarial objectives. Evaluating the performance of stochastic video prediction models is exceedingly challenging: not only should the samples from the model be physically realistic and visually plausible given the context frames, but the model should also be able to produce diverse samples that match the conditional distribution in the data. This is difficult to evaluate precisely: realism is not accurately reflected with simple metrics of reconstruction accuracy, and the true conditional distribution in the data is unknown, since real-world datasets only have a single future for each initial sequence. Below, we discuss the metrics that we use to evaluate realism, diversity, and accuracy. No single metric alone provides a clear answer as to which model is better, but considering multiple metrics can provide us with a more complete understanding of the performance and trade-offs of each approach.
|
| 110 |
+
|
| 111 |
+
# 4.1 EVALUATION METRICS
|
| 112 |
+
|
| 113 |
+
Realism: comparisons to real videos using human judges. The realism of the predicted videos is evaluated based on a real vs. fake two-alternative forced choice (2AFC) test. Human judges on Amazon Mechanical Turk (AMT) are presented with a pair of videos—one generated and one real—and asked to identify the generated, or “fake” video. We use the implementation from (Zhang et al., 2016), modified for videos. Each video is 10 frames long and shown over 2.5 seconds. For each method, we gather 1000 judgments from 25 human judges. Each human evaluator is provided with 10 training trials followed by 40 test trials. A method that produces perfectly realistic videos would achieve a fooling rate of $5 \dot { 0 } \%$ .
|
| 114 |
+
|
| 115 |
+
Diversity: distance between samples. Realism is not the only factor in determining the performance of a video prediction model: aside from generating predictions that look physically plausible and realistic, a successful model must also adequately cover the range of possible futures in an uncertain environment. We compute diversity as the average distance between randomly sampled video predictions, similar to Zhu et al. (2017). Distance is measured in the VGG feature space (pretrained on ImageNet classification), averaged across five layers, which has been shown to correlate well with human perception (Dosovitskiy & Brox, 2016; Johnson et al., 2016; Zhang et al., 2018).
|
| 116 |
+
|
| 117 |
+
Accuracy: similarity of the best sample. One weakness of the above metric is that the samples may be diverse but still not cover the feasible output space. Though we do not have the true output distribution, we can still leverage the single ground truth instance. This can be done by sampling the model a finite number of times, and evaluating the similarity between the best sample and the ground truth. This has been explored in prior work on stochastic video prediction (Babaeizadeh et al., 2018; Denton & Fergus, 2018), using PSNR or SSIM as the evaluation metric. In addition to these, we use cosine similarity in the pretrained VGG feature space.
|
| 118 |
+
|
| 119 |
+
# 4.2 DATASETS
|
| 120 |
+
|
| 121 |
+
We evaluate on two real-world datasets: the BAIR action-free robot pushing dataset (Ebert et al., 2017) and the KTH human actions dataset (Schuldt et al., 2004). See Appendix B.2 for additional results on the action-conditioned version of the robot pushing dataset.
|
| 122 |
+
|
| 123 |
+
BAIR action-free. This dataset consists of a randomly moving robotic arm that pushes objects on a table. This dataset is particularly challenging since (a) it contains large amounts of stochasticity due to random arm motion, and (b) it is a real-world application, with a diverse set of objects and large cluttered scene (rather than a single frame-centered object with a neutral background). The frame resolution is $6 4 \times 6 4$ . We condition on 2 frames and train to predict the next 10 frames. We predict 10 future frames for the 2AFC experiments and 28 future frames for the other experiments.
|
| 124 |
+
|
| 125 |
+
KTH. This dataset consists of a human subject doing one of six activities: walking, jogging, running, boxing, hand waving, and hand clapping. For the first three activities, the human enters and leaves the frame multiple times, leaving the frame empty with a mostly static background for multiple frames at a time. The sequences are particularly stochastic when the initial frames are all empty since the human can enter the frame at any point in the future. As a preprocessing step, we center-crop each frame to a $1 2 0 \times 1 2 0$ square and then resize to a spatial resolution of $6 4 \times 6 4$ . We condition on the first 10 frames and train to predict the next 10 frames. We predict 10 future frames for the 2AFC experiments and 30 future frames for the other experiments. For each sequence, subclips of the desired length are randomly sampled at training and test time.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: Qualitative Results (BAIR action-free dataset). Unless labeled otherwise, we show the closest generated sample to ground truth using VGG cosine similarity. SV2P immediately produces blurry results. Our GAN and VAE-based variants, as well as SVG-LP produce sharper results. However, SVG-LP still blurs out the jar on the right side of the image when it is touched by the robot, while our GAN-based models keep the jar sharp. We show three results for our SAVP model: using the closest, furthest, and random samples. There is large variation between the three samples in the arm motion, and even the furthest sample from the ground truth looks realistic. (bottom) We show a failure case where the arm disappears.
|
| 129 |
+
|
| 130 |
+
# 4.3 METHODS: ABLATIONS AND COMPARISONS
|
| 131 |
+
|
| 132 |
+
We compare the following variants of our method, in our effort to evaluate the effect of each loss term. Videos, code, and models are available at our website1.
|
| 133 |
+
|
| 134 |
+
Ours, SAVP. Our stochastic adversarial video prediction model, with the VAE and GAN objectives.
|
| 135 |
+
|
| 136 |
+
Ours, GAN-only. An ablation of our model with only a conditional GAN, without the variational autoencoder. This model still takes a noise sample as input, but the noise is sampled from the prior during training. This model is broadly representative of prior stochastic GAN-based methods.
|
| 137 |
+
|
| 138 |
+
Ours, VAE-only. An ablation of our model with only a conditional VAE, with the reconstruction $\mathcal { L } _ { 1 }$ loss but without the adversarial loss. This model is broadly representative of prior stochastic VAE-based methods.
|
| 139 |
+
|
| 140 |
+
Ours, deterministic. A deterministic ablation of our model with the reconstruction $\mathcal { L } _ { 1 }$ loss but without the VAE nor the GAN objectives. The model uses the same generator architecture but without the latent variables.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 4: Qualitative Results (KTH dataset). We show qualitative comparisons to ablations of our model. Models are conditioned on 10 frames and trained to predict 10 future frames (vertical dashed line). For stochastic models, we show the closest generated sample to ground truth using VGG cosine similarity. We hypothesize that this dataset has much less stochasticity; even our deterministic model produces reasonable predictions. (top) Both the deterministic and VAE models generate images that are slightly blurry, but that do not degrade over time. The GAN-based methods produce sharper predictions. (middle) Our VAE model generates images where small limbs disappear further into the future, whereas our SAVP method preserves them. (bottom) All conditioning frames are empty except for a shadow on the left. All our variants are able to use this cue to predict that a person is coming from the left, although our SAVP model generates the most realistic sequence.
|
| 144 |
+
|
| 145 |
+
We also compare to prior stochastic VAE-based methods Stochastic Variational Video Prediction (SV2P) (Babaeizadeh et al., 2018) and Stochastic Video Generation (SVG) (Denton & Fergus, 2018), both of which use the reconstruction $\mathcal { L } _ { 2 }$ loss and no adversarial loss.
|
| 146 |
+
|
| 147 |
+
# 4.4 EXPERIMENTAL RESULTS
|
| 148 |
+
|
| 149 |
+
We show qualitative results on the BAIR and KTH datasets in Fig. 3 and Fig. 4, respectively. For the quantitative results, we evaluate the realism, diversity, and accuracy of the predicted videos.
|
| 150 |
+
|
| 151 |
+
Does our method produce realistic results? In Fig. 5, variants of our method are compared to prior work. On the BAIR action-free dataset, our GAN variant achieves the highest fooling rate, whereas our proposed SAVP model, a VAE-GAN-based method, achieves a fooling rate that is roughly halfway between the GAN and VAE models alone. The SV2P method (Babaeizadeh et al., 2018) does not achieve realistic results. The VAE-based SVG-LP method (Denton & Fergus, 2018) achieves high realism, similar to our VAE variant, but substantially below our GAN-based variants. On the KTH dataset, our SAVP model achieves the highest realism score, substantially above our GAN variant. Among the VAE-based methods without adversarial losses, our VAE-only model outperforms SV2P and SVG-FP (Denton & Fergus, 2018) in terms of realism.
|
| 152 |
+
|
| 153 |
+
Does our method generate diverse results? We measure diversity by taking the distance between random samples. Diversity results are also shown in Fig. 5. For a qualitative visualization of diversity, see Appendix B.4. While the GAN-only approach achieves realistic results, it shows lower diversity than the VAE-based methods. This is an example of the commonly known phenomenon of mode-collapse, where multiple latent codes produce the same or similar images on the output (Goodfellow, 2016). Intuitively, the VAE-based methods explicitly encourage the latent code to be more expressive by using an encoder from the output space into the latent space during training. This is verified in our experiments, as the VAE-based variants, including our SAVP model, achieve higher diversity than our GAN-only models on both datasets. On the KTH dataset, our VAE variant and VAE-based SVG-FP method (Denton & Fergus, 2018) both achieve significantly higher diversity than all the other methods. Although the VAE-based SV2P methods (Babaeizadeh et al., 2018) mode-collapse on the KTH dataset, we note that they did not evaluate on this dataset, and as such, their method could benefit from different hyperparameters that are better suited for this dataset.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 5: Realism vs Diversity. We measure realism using a real vs fake Amazon Mechanical Turk (AMT) test, and diversity using average VGG cosine distance. Higher is better on both metrics. Our VAE variant achieves higher realism and diversity than the SV2P (Babaeizadeh et al., 2018) and SVG (Denton & Fergus, 2018) methods based on VAEs. Our GAN variant achieves higher realism than the pure VAE methods, at the expense of significantly lower diversity. Our SAVP model, based on VAE-GANs, improves along the realism axis compared to a pure VAE method, and improves along the diversity axis compared to a pure GAN method. Although the SV2P methods mode-collapse on the KTH dataset, we note that they did not evaluate on this dataset, and their method could benefit from hyperparameters that are better suited for this dataset.
|
| 157 |
+
|
| 158 |
+
Does our method generate accurate results? Following recent work on VAE-based video prediction (Babaeizadeh et al., 2018; Denton & Fergus, 2018), we evaluate on full-reference metrics by sampling multiple predictions from the model. We draw 100 samples for each video, find the “best” sample by computing similarity to the ground truth video, and show the average similarity across the test set as a function of time. The results on the BAIR and KTH datasets are shown in Fig. 14 and Fig. 15, respectively. We test generalization ability by running the model for more time steps than it was trained for. Even though the model is only trained to predict 10 future frames, we observe graceful degradation over time.
|
| 159 |
+
|
| 160 |
+
While PSNR and SSIM (Wang et al., 2004) are commonly used for video prediction, these metrics are not necessarily indicative of prediction quality. In video prediction, structural ambiguities and geometric deformations are a dominant factor, and SSIM is not an appropriate metric in such situations (Sampat et al., 2009; Zhang et al., 2018). This is particularly noticeable with the SV2P method, which achieves high PSNR and SSIM scores, but produces blurry and unrealistic images. Furthermore, we additionally trained our VAE and deterministic variants using the standard MSE loss $\mathcal { L } _ { 2 }$ to understand the relationship between the form of the reconstruction loss and the metrics. The general trend is that models trained with $\mathcal { L } _ { 2 }$ , which favors blurry predictions, are better on PSNR and SSIM, but models trained with $\mathcal { L } _ { 1 }$ are better on VGG cosine similarity. See Appendix B.1 for quantitative results comparing models trained with $\mathcal { L } _ { 1 }$ and $\mathcal { L } _ { 2 }$ . In addition, we expect for our GAN-based variants to underperform on PSNR and SSIM since GANs prioritize matching joint distributions of pixels over per-pixel reconstruction accuracy.
|
| 161 |
+
|
| 162 |
+
To partially overcome the limitations of these metrics, we also evaluate using distances in a deep feature space (Dosovitskiy & Brox, 2016; Johnson et al., 2016), which have been shown to correspond better with human perceptual judgments (Zhang et al., 2018). We use cosine similarity between VGG features averaged across five layers. Otherwise, a model trained for it would unfairly and artificially achieve better similarities by exploiting potential flaws on that metric. Our VAE variant, along with SVG (Denton & Fergus, 2018), performs best on this metric. Although our SAVP model improves on diversity and realism, it also performs worse in accuracy compared to pure VAE models (both our own ablation and SVG). This is to be expected, since accuracy and realism are at odds with each other. This tradeoff has recently been proved and it holds even for similarity distances based on VGG features (Blau & Michaeli; Blau et al., 2018). Among the VAE-based methods, SV2P (Babaeizadeh et al., 2018) achieves the lowest VGG similarity.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 6: Similarity of the best sample (BAIR action-free dataset). We show the similarity (higher is better) between the best sample (of 100) as a function of prediction time step across different methods and evaluation metrics. (top) Although SV2P produces blurry and unrealistic images, it achieves the highest PSNR. Both SAVP and SVG-LP outperform SV2P on VGG similarity. We expect our GAN-based variants to underperform on PSNR and SSIM since GANs prioritize matching joint distributions of pixels over per-pixel reconstruction accuracy. (bottom) We compare to ablated versions of our model. Our VAE variant achieves higher scores than our SAVP model, which in turn achieves significantly higher VGG similarities compared to our GAN-only model. Note that the models were only trained to predict 10 future frames (indicated by the vertical line), but is being tested on generalization to longer sequences.
|
| 166 |
+
|
| 167 |
+
On stochastic environments, such as in the BAIR action-free dataset, there is correlation between diversity and accuracy of the best sample: a model with diverse predictions is more likely to sample a video that is close to the ground truth. This relation can be seen in Fig. 5 and Fig. 14 for the robot dataset, e.g. our SAVP model is both more diverse and achieves higher similarity than our GAN-only variant. This is not true on less stochastic environments. We hypothesize that the KTH dataset is not as stochastic when conditioning on 10 frames, as evidenced the similarities between the predictions from the deterministic and stochastic models. This would explain why our GAN variant and SV2P achieve modest similarities despite achieving low diversity on the KTH dataset.
|
| 168 |
+
|
| 169 |
+
Does combining the VAE and GAN produce better predictions? The GAN alone achieves high realism but low diversity. The VAE alone achieves lower realism but increased diversity. Adding the GAN to the VAE model increases the realism without sacrificing diversity, at only a small or no cost in realism on stochastic datasets. This is consistent with Zhu et al. (2017), which showed that combining GAN and VAE-based models provides benefits in the case of image generation. To our knowledge, our method is the first to extend this class of models to the video prediction setting, and the first to illustrate that this leads to improved realism with a degree of diversity comparable to the best VAE models in stochastic environments. The results show that this combination of losses is the best choice for realistic coverage of diverse stochastic futures.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 7: Similarity of the best sample (KTH dataset). We evaluate the similarity between the best predicted sample (out of a 100 samples) and the ground truth video. (top) As in the case of the robot dataset, SV2P achieves high PSNR values, even though it produces blurry and unrealistic images. Although all three methods achieve comparable VGG similarities for the first 10 future frames (which is what the models were trained for, and indicated by the vertical line), our SAVP model predicts videos that are substantially more realistic, as shown in our subjective human evaluation, thus achieving a desirable balance between realism and accuracy. (bottom) We compare to ablated versions of our model. Our VAE-only method outperforms all our other variants on the three metrics. In addition, our deterministic model is not that far behind in terms of similarity, leading us to believe that the KTH dataset is not as stochastic when conditioning on the past 10 frames.
|
| 173 |
+
|
| 174 |
+
# 5 CONCLUSION
|
| 175 |
+
|
| 176 |
+
We develop a video prediction model that combines latent variables trained via a variational lower bound with an adversarial loss to produce a high degree of visual and physical realism. VAE-style training enables our method to make diverse stochastic predictions, and our experiments show that the adversarial loss is effective at producing predictions that are more visually realistic according to human raters. Evaluation of video prediction models is a major challenge, and we evaluate our method, as well as ablated variants that consist of only the VAE or only the GAN loss, in terms of a variety of quantitative and qualitative measures, including human ratings, diversity, and accuracy of the predicted samples. Our results demonstrate that our approach produces more realistic predictions than prior methods, while preserving the sample diversity of VAE-based methods.
|
| 177 |
+
|
| 178 |
+
# REFERENCES
|
| 179 |
+
|
| 180 |
+
Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H. Campbell, and Sergey Levine. Stochastic variational video prediction. In International Conference on Learning Representations (ICLR), 2018.
|
| 181 |
+
|
| 182 |
+
Jianmin Bao, Dong Chen, Fang Wen, Houqiang Li, and Gang Hua. CVAE-GAN: fine-grained image generation through asymmetric training. In International Conference on Computer Vision (ICCV), 2017.
|
| 183 |
+
|
| 184 |
+
Prateep Bhattacharjee and Sukhendu Das. Temporal coherency based criteria for predicting video frames using deep multi-stage generative adversarial networks. In Neural Information Processing Systems (NIPS), 2017.
|
| 185 |
+
|
| 186 |
+
Yochai Blau and Tomer Michaeli. The perception-distortion tradeoff.
|
| 187 |
+
|
| 188 |
+
Yochai Blau, Roey Mechrez, Radu Timofte, Tomer Michaeli, and Lihi Zelnik-Manor. 2018 pirm challenge on perceptual image super-resolution. arXiv preprint arXiv:1809.07517, 2018.
|
| 189 |
+
|
| 190 |
+
Samuel Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. In Conference on Computational Natural Language Learning (CoNLL), 2016.
|
| 191 |
+
|
| 192 |
+
Arunkumar Byravan and Dieter Fox. SE3-nets: Learning rigid body motion using deep neural networks. arXiv preprint arXiv:1606.02378, 2016.
|
| 193 |
+
|
| 194 |
+
Baoyang Chen, Wenmin Wang, Jinzhuo Wang, Xiongtao Chen, and Weimian Li. Video imagination from a single image with transformation generation. arXiv preprint arXiv:1706.04124, 2017.
|
| 195 |
+
|
| 196 |
+
Silvia Chiappa, Sebastien Racani ´ ere, Daan Wierstra, and Shakir Mohamed. Recurrent environment \` simulators. In International Conference on Learning Representations (ICLR), 2017.
|
| 197 |
+
|
| 198 |
+
Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. In Neural Information Processing Systems (NIPS), 2016.
|
| 199 |
+
|
| 200 |
+
E. Denton and R. Fergus. Stochastic video generation with a learned prior. In International Conference on Machine Learning (ICML), 2018.
|
| 201 |
+
|
| 202 |
+
Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In Neural Information Processing Systems (NIPS), 2016.
|
| 203 |
+
|
| 204 |
+
Frederik Ebert, Chelsea Finn, Alex Lee, and Sergey Levine. Self-supervised visual planning with temporal skip connections. In Conference on Robot Learning (CoRL), 2017.
|
| 205 |
+
|
| 206 |
+
Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Neural Information Processing Systems (NIPS), 2016.
|
| 207 |
+
|
| 208 |
+
Ian Goodfellow. NIPS 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016.
|
| 209 |
+
|
| 210 |
+
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 (NIPS), 2014.
|
| 211 |
+
|
| 212 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 1997.
|
| 213 |
+
|
| 214 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Conference on Vision and Pattern Recognition (CVPR), 2017.
|
| 215 |
+
|
| 216 |
+
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.
|
| 217 |
+
|
| 218 |
+
Nal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex ¨ Graves, and Koray Kavukcuoglu. Video pixel networks. In International Conference on Machine Learning (ICML), 2017.
|
| 219 |
+
|
| 220 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 221 |
+
|
| 222 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representations (ICLR), 2014.
|
| 223 |
+
|
| 224 |
+
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.
|
| 225 |
+
|
| 226 |
+
Xiaodan Liang, Lisa Lee, Wei Dai, and Eric P. Xing. Dual motion GAN for future-flow embedded video prediction. In International Conference on Computer Vision (ICCV), 2017.
|
| 227 |
+
|
| 228 |
+
Ziwei Liu, Raymond Yeh, Xiaoou Tang, Yiming Liu, and Aseem Agarwala. Video frame synthesis using deep voxel flow. In International Conference on Computer Vision (ICCV), 2017.
|
| 229 |
+
|
| 230 |
+
C. Lu, M. Hirsch, and B. Scholkopf. Flexible spatio-temporal networks for video prediction. In ¨ Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 231 |
+
|
| 232 |
+
Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. In International Conference on Learning Representations (ICLR), 2016.
|
| 233 |
+
|
| 234 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations (ICLR), 2018.
|
| 235 |
+
|
| 236 |
+
Simon Niklaus, Long Mai, and Feng Liu. Video frame interpolation via adaptive separable convolution. In International Conference on Computer Vision (ICCV), 2017.
|
| 237 |
+
|
| 238 |
+
Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and checkerboard artifacts. Distill, 2016. doi: 10.23915/distill.00003. URL http://distill.pub/2016/ deconv-checkerboard.
|
| 239 |
+
|
| 240 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Neural Information Processing Systems (NIPS), 2015.
|
| 241 |
+
|
| 242 |
+
Deepak Pathak, Philipp Krahenb ¨ uhl, Jeff Donahue, Trevor Darrell, and Alexei Efros. Context en- ¨ coders: Feature learning by inpainting. In Conference on Vision and Pattern Recognition (CVPR), 2016.
|
| 243 |
+
|
| 244 |
+
MarcAurelio Ranzato, Arthur Szlam, Joan Bruna, Michael Mathieu, Ronan Collobert, and Sumit Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv preprint arXiv:1412.6604, 2014.
|
| 245 |
+
|
| 246 |
+
Scott E. Reed, Aaron van den Oord, Nal Kalchbrenner, Sergio Gomez Colmenarejo, Ziyu Wang, ¨ Yutian Chen, Dan Belov, and Nando de Freitas. Parallel multiscale autoregressive density estimation. In International Conference on Machine Learning (ICML), 2017.
|
| 247 |
+
|
| 248 |
+
Masaki Saito, Eiichi Matsumoto, and Shunta Saito. Temporal generative adversarial nets with singular value clipping. In International Conference on Computer Vision (ICCV), 2017.
|
| 249 |
+
|
| 250 |
+
Mehul P Sampat, Zhou Wang, Shalini Gupta, Alan Conrad Bovik, and Mia K Markey. Complex wavelet structural similarity: A new image similarity index. Transactions on Image Processing (TIP), 2009.
|
| 251 |
+
|
| 252 |
+
Christian Schuldt, Ivan Laptev, and Barbara Caputo. Recognizing human actions: a local SVM approach. In International Conference on Pattern Recognition (ICPR), 2004.
|
| 253 |
+
|
| 254 |
+
Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. MoCoGAN: Decomposing motion and content for video generation. In Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 255 |
+
|
| 256 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor S. Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
|
| 257 |
+
|
| 258 |
+
Joost van Amersfoort, Anitha Kannan, Marc’Aurelio Ranzato, Arthur Szlam, Du Tran, and Soumith Chintala. Transformation-based models of video sequences. arXiv preprint arXiv:1701.08435, 2017.
|
| 259 |
+
|
| 260 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In International Conference on Machine Learning (ICML), 2016.
|
| 261 |
+
|
| 262 |
+
Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. In International Conference on Learning Representations (ICLR), 2017.
|
| 263 |
+
|
| 264 |
+
Carl Vondrick and Antonio Torralba. Generating the future with adversarial transformers. In Conference on Vision and Pattern Recognition (CVPR), 2017.
|
| 265 |
+
|
| 266 |
+
Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In Neural Information Processing Systems (NIPS), 2016.
|
| 267 |
+
|
| 268 |
+
Jacob Walker, Abhinav Gupta, and Martial Hebert. Dense optical flow prediction from a static image. In International Conference on Computer Vision (ICCV), 2015.
|
| 269 |
+
|
| 270 |
+
Jacob Walker, Carl Doersch, Abhinav Gupta, and Martial Hebert. An uncertain future: Forecasting from static images using variational autoencoders. In European Conference on Computer Vision (ECCV), 2016.
|
| 271 |
+
|
| 272 |
+
Jacob Walker, Kenneth Marino, Abhinav Gupta, and Martial Hebert. The pose knows: Video forecasting by generating pose futures. In International Conference on Computer Vision (ICCV), 2017.
|
| 273 |
+
|
| 274 |
+
Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Guilin Liu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Video-to-video synthesis. arXiv preprint arXiv:1808.06601, 2018.
|
| 275 |
+
|
| 276 |
+
Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. Transactions on Image Processing (TIP), 2004.
|
| 277 |
+
|
| 278 |
+
SHI Xingjian, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. In Neural Information Processing Systems (NIPS), 2015.
|
| 279 |
+
|
| 280 |
+
Tianfan Xue, Jiajun Wu, Katherine Bouman, and Bill Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. In Neural Information Processing Systems (NIPS), 2016.
|
| 281 |
+
|
| 282 |
+
Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In European Conference on Computer Vision (ECCV), 2016.
|
| 283 |
+
|
| 284 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep networks as a perceptual metric. In Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 285 |
+
|
| 286 |
+
Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia. Pyramid scene parsing network. In Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 287 |
+
|
| 288 |
+
Yipin Zhou and Tamara L Berg. Learning temporal transformations from time-lapse videos. In European Conference on Computer Vision (ECCV), 2016.
|
| 289 |
+
|
| 290 |
+
Jun-Yan Zhu, Richard Zhang, Deepak Pathak, Trevor Darrell, Alexei A Efros, Oliver Wang, and Eli Shechtman. Toward multimodal image-to-image translation. In Neural Information Processing Systems (NIPS), 2017.
|
| 291 |
+
|
| 292 |
+
# A NETWORKS AND TRAINING DETAILS
|
| 293 |
+
|
| 294 |
+
# A.1 NETWORK DETAILS
|
| 295 |
+
|
| 296 |
+
# A.1.1 GENERATOR.
|
| 297 |
+
|
| 298 |
+
Our generator network, shown in Fig. 8, is inspired by the convolutional dynamic neural advection (CDNA) model proposed by Finn et al. (2016). The video prediction setting is a sequential prediction problem, so we use a convolutional LSTM (Hochreiter & Schmidhuber, 1997; Xingjian et al., 2015) to predict future frames. We initialize the prediction on the initial sequence of ground truth frames (2 or 10 frames for the BAIR and KTH datasets, respectively), and predict 10 future frames. The model predicts a sequence of future frames by repeatedly making next-frame predictions and feeding those predictions back to itself. For each one-step prediction, the predicted frame is given by a compositing layer, which composes intermediate frames with predicted compositing masks. The intermediate frames include the previous frame, transformed versions of the previous frame, and a frame with pixels directly synthesized by the network. The transformed versions of the frame are produced by convolving in the input image with predicted convolutional kernels, allowing for different shifted versions of the input. In more recent work, the first frame of the sequence is also given as one of the intermediate frames (Ebert et al., 2017).
|
| 299 |
+
|
| 300 |
+
To enable stochastic sampling, the generator is also conditioned on time-varying latent codes, which are sampled at training and test time. Each latent code $\mathbf { z } _ { t }$ is an 8-dimensional vector. At each prediction step, the latent code is passed through a fully-connected LSTM to facilitate correlations in time of the latent variables. The encoded latent code is then passed to all the convolutional layers of the main network, by concatenating it along the channel dimension to the inputs of these layers. Since they are vectors with no spatial dimensions, they are replicated spatially to match the spatial dimensions of the inputs.
|
| 301 |
+
|
| 302 |
+
We made a variety of architectural improvements to the original CDNA (Finn et al., 2016) and SNA (Ebert et al., 2017) models, which overall produced better results on the per-pixel loss and similarity metrics. See Fig. 11 for a quantitative comparison of our deterministic variant (without
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 8: Architecture of our generator network. Our network uses a convolutional LSTM (Hochreiter & Schmidhuber, 1997; Xingjian et al., 2015) with skip-connection between internal layers. As proposed by Finn et al. (2016), the network predicts (1) a set of convolution kernels to produce a set of transformed input images (2) synthesized pixels at the input resolution and (3) a compositing mask. Using the mask, the network can choose how to composite together the set of warped pixels, the first frame, previous frame, and synthesized pixels. One of the internal feature maps is given to a fully-connected layer to compute the kernels that specify pixel flow. The output of the main network is passed to two separate heads, each with two convolutional layers, to predict the synthesized frame and the composite mask. These two outputs use sigmoid and softmax non-linearities, respectively, to ensure proper normalization. We enable stochastic sampling of the model by conditioning the generator network on latent codes. These are first passed through a fully-connected LSTM, and then given to all the convolutional layers of the the convolutional LSTM.
|
| 306 |
+
|
| 307 |
+
VAE or GAN losses) to the SNA model on the BAIR action-conditioned dataset. Each convolutional layer is followed by instance normalization (Ulyanov et al., 2016) and ReLU activations. We also use instance normalization on the LSTM pre-activations (i.e., the input, forget, and output gates, as well as the transformed and next cell of the LSTM). In addition, we modify the spatial downsampling and upsampling mechanisms. Standard subsampling and upsampling between convolutions is known to produce artifacts for dense image generation tasks (Odena et al., 2016; Zhao et al., 2017; Niklaus et al., 2017). In the encoding layers, we reduce the spatial resolution of the feature maps by average pooling, and in the decoding layers, we increase the resolution by using bilinear interpolation. All convolutions in the generator use a stride of 1. In the case of the action-conditioned dataset, actions are concatenated to the inputs of all the convolutional layers of the main network, as opposed to only the bottleneck.
|
| 308 |
+
|
| 309 |
+
# A.1.2 ENCODER.
|
| 310 |
+
|
| 311 |
+
The encoder is a standard convolutional network that, at every time step, encodes a pair of images $\mathbf { x } _ { t }$ and $\mathbf { x } _ { t + 1 }$ into $\mu _ { \mathbf { z } _ { t } }$ and $\log \sigma _ { \mathbf { z } _ { t } }$ . The latent variable $\mathbf { z } _ { t }$ is sampled at every time step and the same encoder network with shared weights is used at every step. The encoder architecture consists of three convolutional layers, followed by average pooling of all the spatial dimensions. Two separate fullyconnected layers are then used to estimate $\mu _ { \mathbf { z } _ { t } }$ and $\log \sigma _ { \mathbf { z } _ { t } }$ , respectively. The convolutional layers use instance normalization, leaky ReLU non-linearities, and stride 2. This encoder architecture is the same one used in BicyleGAN (Zhu et al., 2017) except that the inputs are pair of images, concatenated along the channel dimension.
|
| 312 |
+
|
| 313 |
+
# A.1.3 DISCRIMINATOR.
|
| 314 |
+
|
| 315 |
+
The discriminator is a 3D convolutional neural network that takes in all the images of the video at once. We use spectral normalization and the SNGAN discriminator architecture (Miyato et al., 2018), except that we “inflate” the convolution filters from 2D to 3D. The two video discriminators, $D$ and $D _ { \mathrm { v A E } }$ , share the same architecture, but not the weights, as done in BicycleGAN (Zhu et al., 2017).
|
| 316 |
+
|
| 317 |
+
# A.2 TRAINING DETAILS
|
| 318 |
+
|
| 319 |
+
Our generator network uses scheduled sampling during training as in Finn et al. (2016), such that at the beginning the model is trained for one-step predictions, while by the end of training the model is fully autoregressive. We trained all models with Adam (Kingma & Ba, 2015) for 300000 iterations, linearly decaying the learning rate to 0 for the last 100000 iterations. The same training schedule was used for all the models, except for SVG, which was trained by its author. Our GAN-based variants used an optimizer with $\beta _ { 1 } = 0 . 5$ , $\beta _ { 2 } = 0 . 9 9 9$ , learning rate of 0.0002, and a batch size of 16. Our deterministic and VAE models (including SNA and SV2P from prior work) used an optimizer with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , learning rate of 0.001, and a batch size of 32.
|
| 320 |
+
|
| 321 |
+
We used $\lambda _ { 1 } = 1 0 0$ for our GAN-based variants, and $\lambda _ { 1 } = 1$ for all the other models. For our VAEbased variants, we linearly anneal the weight on the KL divergence term from 0 to the final value $\lambda _ { \mathrm { K L } }$ during training, as proposed by Bowman et al. (2016), from iterations 50000 to 100000. We used a relative weighting of $\lambda _ { \mathrm { K L } } / \lambda _ { 1 } = 0 . 0 0 1$ for the BAIR robot pushing datasets, and $\lambda _ { \mathrm { K L } } / \lambda _ { 1 } = 0 . 0 0 0 0 1$ for the KTH dataset. This hyperparameter was empirically chosen by computing similarity metrics on the validation set.
|
| 322 |
+
|
| 323 |
+
# B ADDITIONAL EXPERIMENTS
|
| 324 |
+
|
| 325 |
+
# B.1 COMPARISON OF PIXEL-WISE $\mathcal { L } _ { 1 }$ AND $\mathcal { L } _ { 2 }$ LOSSES
|
| 326 |
+
|
| 327 |
+
We train our deterministic and VAE variants with the $\mathcal { L } _ { 1 }$ and $\mathcal { L } _ { 2 }$ losses to compare the effects of these reconstruction losses on the full-reference metrics used in this work. The pixel-wise $\mathcal { L } _ { 1 }$ loss assumes that pixels are generated according to a fully factorized Laplacian distribution, whereas the $\mathcal { L } _ { 2 }$ loss corresponds to a fully factorized Gaussian distribution. See Fig. 9 and Fig. 11 for quantitative results on the action-free and action-conditioned BAIR datasets, respectively.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 9: Similarity of the best sample (BAIR action-conditioned dataset). We show the similarity between the predicted video and the ground truth, using the same evaluation as in Fig. 14. We compare our deterministic and VAE variants when trained with $\mathcal { L } _ { 1 }$ and $\mathcal { L } _ { 2 }$ losses, and observe that they have a significant impact on the quality of our predictions. The models trained with $\mathcal { L } _ { 1 }$ produce videos that are qualitatively better and achieve higher VGG similarity than the equivalent models trained with $\mathcal { L } _ { 2 }$ .
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 10: Realism vs Diversity (BAIR action-conditioned dataset). The SV2P method (Babaeizadeh et al., 2018) from prior work produces images with low realism, whereas our GAN, VAE, and SAVP models fool the human judges at a rate of around $3 5 \mathrm { - } 4 0 \%$ . Our VAE-based models also produce videos with higher diversity, though lower diversity than other datasets, as this task involves much less stochasticity. The trend is the same as in the other datasets. Our SAVP model improves the realism of the predictions compared to our VAE-only model, and improves the diversity compared to our GAN-only model.
|
| 334 |
+
|
| 335 |
+
The general trend is that models trained with the $\mathcal { L } _ { 2 }$ loss tend to generate blurry predictions but achieve higher PSNR scores than equivalent models trained with the $\mathcal { L } _ { 1 }$ loss. This is because PSNR and $\mathcal { L } _ { 2 }$ are closely related, the former being a logarithmic function of the latter. The opposite is true for the VGG cosine similarity metric, which has been shown to correspond better with human perceptual judgments (Zhang et al., 2018). Models trained with $\mathcal { L } _ { 1 }$ significantly outperforms equivalent models trained with $\mathcal { L } _ { 2 }$ . On the SSIM metric, models trained with $\mathcal { L } _ { 1 }$ achieve roughly the same or better similarities than models trained with $\mathcal { L } _ { 2 }$ . Although both losses are pixel-wise losses, the choice between $\mathcal { L } _ { 1 }$ and $\mathcal { L } _ { 2 }$ have a significant impact on the quality of our predicted videos.
|
| 336 |
+
|
| 337 |
+
# B.2 RESULTS ON ACTION-CONDITIONED BAIR ROBOT PUSHING DATASET
|
| 338 |
+
|
| 339 |
+
We use the same dataset as the one in the main paper, except that we use the robot actions. Each action is a 4-dimensional vector corresponding to Cartesian translations and a value indicating if the gripper has been closed or opened. As in the action-free dataset, we condition on the first 2 frames of the sequence and train to predict the next 10 frames. In this dataset, the video prediction model is now also conditioned on a sequence of actions ${ \bf a } _ { 0 : T - 1 }$ , in addition to the initial frames. The generator network is modified to take an action $\mathbf { a } _ { t }$ at each time step, by concatenating the action to the inputs of all the convolutional layers of the main network, similar to how the latent code $\mathbf { z } _ { t }$ is passed in (but without the additional fully-connected LSTM).
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 11: Similarity of the best sample (BAIR action-conditioned dataset). We show the similarity between the predicted video and the ground truth, using the same evaluation as in Fig. 14, except that we condition on robot actions. (top) We compare to prior SV2P (Babaeizadeh et al., 2018) and ours ablations. Our VAE and deterministic models both outperform SV2P, even though it is VAE-based. However, notice that the gap in performance between our VAE and deterministic models is small, as the dataset is less stochastic when conditioning on actions. Our SAVP model achieves much lower scores on all three metrics. We hypothesize that our SAVP model, as well as SV2P, is underutilizing the provided actions and thus achieving more stochasticity at the expense of accuracy. (bottom) We compare deterministic models—SNA (Ebert et al., 2017) and ours— and our VAE model when trained with $\mathcal { L } _ { 1 }$ and $\mathcal { L } _ { 2 }$ losses. As in the action-free case, we observe that the choice of the pixel-wise reconstruction loss significantly affects prediction accuracy. Models trained with $\mathcal { L } _ { 1 }$ are substantially better in SSIM and VGG cosine similarity compared to equivalent models trained with $\mathcal { L } _ { 2 }$ . Surprisingly, the VAE model trained with $\mathcal { L } _ { 1 }$ outperforms the other models even on the PSNR metric. We hypothesize that VAE models trained with $\mathcal { L } _ { 1 }$ are better equipped to separate multiple modes of futures, whereas the ones trained with $\mathcal { L } _ { 2 }$ might still average some of the modes. In fact, we evidenced this in preliminary experiments on the toy shapes dataset used by Babaeizadeh et al. (2018). Among the deterministic models, ours improves upon SNA (Ebert et al., 2017), which is currently the best deterministic action-conditioned model on this dataset.
|
| 343 |
+
|
| 344 |
+
We show the realism and diversity results in Fig. 10 and the accuracy results in Fig. 11. In addition to the methods compared in the action-free dataset, we also compare to SNA (Ebert et al., 2017), an action-conditioned deterministic video prediction model. The results indicate that our VAE model significantly outperforms prior methods on the full-reference metrics, and that our models significantly outperforms the model by Babaeizadeh et al. (2018) both in terms of diversity of predictions and realism.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 12: Example generations of MoCoGAN. We use the unconditional version of MoCoGAN (Tulyakov et al., 2018) to generate videos from the BAIR robot pushing dataset. We chose this model as a representative recent example of purely GAN-based unconditioned video generation. MoCoGAN produces impressive results on various applications related to human action, which are focused on a actor in the middle of the frame. However, this model struggles in the robot dataset where multiple entities are moving at a time. Note that since the patch-based discriminator has a limited receptive field of the image, the model can produce videos with two robot arms (last row) even though this is not in the dataset. We did not observe this behavior with their image-based discriminator.
|
| 348 |
+
|
| 349 |
+
# B.3 EXAMPLE GENERATIONS OF AN UNCONDITIONAL GAN
|
| 350 |
+
|
| 351 |
+
We consider the motion and content decomposed GAN (MoCoGAN) model (Tulyakov et al., 2018) as a representative unconditional GAN method from prior work, and use it to generate videos from the BAIR robot pushing dataset. We use their publicly available code and show qualitative results in Fig. 12. The results show the variant that uses patch-based discriminators, since this one achieved higher realism than the variant that uses image-based discriminators. Since this prior work demonstrates competitive results in comparison to other prior unconditional GAN methods, we chose it as the most representative recent example of purely GAN-based video generation for this comparison. MoCoGAN produces impressive results on various applications related to human action, which are focused on a single actor in the middle of the frame. However, it struggles on videos in the robot pushing domain where multiple entities are moving at a time, i.e. the robot arm and the objects it interacts with.
|
| 352 |
+
|
| 353 |
+
# B.4 QUALITATIVE VISUALIZATION OF DIVERSITY
|
| 354 |
+
|
| 355 |
+
We show a qualitative visualization of diversity in Fig. 13 by averaging multiple samples.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 13: Qualitative visualization of diversity. We show predictions of our models, averaged over 100 samples. A model that produces diverse outputs should predict that the robot arm moves in random directions at each time step, and thus the arm should “disappear” over time in these averaged predictions. Consistent with our quantitative evaluation of diversity, we see that both our SAVP model and our VAE variant produces diverse samples, whereas the GAN-only method is prone to mode-collapse.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 14: Similarity of the best sample (BAIR action-free dataset), updated plot. We show the similarity (higher is better) between the best sample (of 100) as a function of prediction time step across different methods and evaluation metrics. The three leftmost plots show the similarity (higher is better) between the best sample (of 100) as a function of prediction time step across different methods and evaluation metrics. Besides the standard metrics, we also use the Learned Perceptual Image Patch Similarity (LPIPS) metric (Zhang et al., 2018), which has been shown to correlate well with human perception. This distance is measured in the AlexNet feature space (pretrained on ImageNet classification) with linear weights calibrated to match human judgements. The plot on the right shows the diversity (higher is better) as a function of prediction time step, computed as the LPIPS distance between pairs of samples. Aside for the first two predicted frames, our SAVP model achieves similar LPIPS distances as the VAE models, both our VAE ablation and the SVG model from Denton & Fergus (2018). In addition, not only our SAVP method substantially improve sample diversity compared to the GAN-only model, but it also produces more diverse samples than both of the VAE models.
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 15: Similarity of the best sample and diversity (KTH dataset), updated plot. The three leftmost plots show the similarity (higher is better) between the best sample (of 100) as a function of prediction time step. The plot on the right shows the diversity (higher is better) as a function of prediction time step, computed as the LPIPS distance between pairs of samples. The top and bottom plots show results when conditioning on 10 and 2 frames, respectively. Among the VAE methods, our VAE-only model achieves substantially higher similarities and diversities than the SVG model from prior work (Denton & Fergus, 2018). The GAN-only model mode-collapses and generates samples that lack diversity. Our SAVP method, which incorporates the variational loss, improves both sample diversity and similarities, compared to the GAN-only model. Our SAVP model also achieves higher accuracy than SVG.
|
md/train/HyxGB2AcY7/HyxGB2AcY7.md
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONTINGENCY-AWARE EXPLORATION IN REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Jongwook Choi∗,1 Yijie Guo∗,1 Marcin Moczulski $^ { * , 2 }$ Junhyuk $\mathbf { O h } ^ { 1 , \dagger }$ Neal Wu2 Mohammad Norouzi2 Honglak Lee2,1
|
| 4 |
+
|
| 5 |
+
1University of Michigan 2Google Brain {jwook,guoyijie}@umich.edu moczulski@google.com {junhyuk,nealwu,mnorouzi,honglak}@google.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
This paper investigates whether learning contingency-awareness and controllable aspects of an environment can lead to better exploration in reinforcement learning. To investigate this question, we consider an instantiation of this hypothesis evaluated on the Arcade Learning Element (ALE). In this study, we develop an attentive dynamics model (ADM) that discovers controllable elements of the observations, which are often associated with the location of the character in Atari games. The ADM is trained in a self-supervised fashion to predict the actions taken by the agent. The learned contingency information is used as a part of the state representation for exploration purposes. We demonstrate that combining actor-critic algorithm with count-based exploration using our representation achieves impressive results on a set of notoriously challenging Atari games due to sparse rewards.1 For example, we report a state-of-the-art score of ${ > } 1 1 { , } 0 0 0$ points on MONTEZUMA’S REVENGE without using expert demonstrations, explicit high-level information (e.g., RAM states), or supervisory data. Our experiments confirm that contingency-awareness is indeed an extremely powerful concept for tackling exploration problems in reinforcement learning and opens up interesting research questions for further investigations.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
The success of reinforcement learning (RL) algorithms in complex environments hinges on the way they balance exploration and exploitation. There has been a surge of recent interest in developing effective exploration strategies for problems with high-dimensional state spaces and sparse rewards (Schmidhuber, 1991; Oudeyer & Kaplan, 2009; Houthooft et al., 2016; Bellemare et al., 2016; Osband et al., 2016; Pathak et al., 2017; Plappert et al., 2018; Zheng et al., 2018). Deep neural networks have seen great success as expressive function approximators within RL and as powerful representation learning methods for many domains. In addition, there have been recent studies on using neural network representations for exploration (Tang et al., 2017; Martin et al., 2017; Pathak et al., 2017). For example, count-based exploration with neural density estimation (Bellemare et al., 2016; Tang et al., 2017; Ostrovski et al., 2017) presents one of the state-of-the-art techniques on the most challenging Atari games with sparse rewards.
|
| 14 |
+
|
| 15 |
+
Despite the success of recent exploration methods, it is still an open question on how to construct an optimal representation for exploration. For example, the concept of visual similarity is used for learning density models as a basis for calculating pseudo-counts (Bellemare et al., 2016; Ostrovski et al., 2017). However, as Tang et al. (2017) noted, the ideal way to represent states should be based on what is relevant to solving the MDP, rather than only relying on visual similarity. In addition, there remains another question on whether the representations used for recent exploration works are easily interpretable. To address these questions, we investigate whether we can learn a complementary, more intuitive, and interpretable high-level abstraction that can be very effective in exploration by using the ideas of contingency awareness and controllable dynamics.
|
| 16 |
+
|
| 17 |
+
The key idea that we focus on in this work is the notion of contingency awareness (Watson, 1966; Bellemare et al., 2012) — the agent’s understanding of the environmental dynamics and recognizing that some aspects of the dynamics are under the agent’s control. Intuitively speaking, this can represent the segmentation mask of the agent operating in the 2D or 3D environments (yet one can think of more abstract and general state spaces). In this study, we investigate the concept of contingency awareness based on self-localization, i.e., the awareness of where the agent is located in the abstract state space. We are interested in discovering parts of the world that are directly dependent on the agent’s immediate action, which often reveal the agent’s approximate location.
|
| 18 |
+
|
| 19 |
+
For further motivation on the problem, we note that contingency awareness is a very important concept in neuroscience and psychology. In other words, being self-aware of one’s location is an important property within many observed intelligent organisms and systems. For example, recent breakthroughs in neuroscience, such as the Nobel Prize winning work on the grid cells (Moser et al., 2015; Banino et al., 2018), show that organisms that perform very well in spatially-challenging tasks are self-aware of their location. This allows rats to navigate, remember paths to previously visited places and important sub-goals, and find shortcuts. In addition, the notion of contingency awareness has been shown as an important factor in developmental psychology (Watson, 1966; Baeyens et al., 1990). We can think of self-localization (and more broadly self-awareness) as a principled and fundamental direction towards intelligent agents.
|
| 20 |
+
|
| 21 |
+
Based on these discussions, we hypothesize that contingency awareness can be a powerful mechanism for tackling exploration problems in reinforcement learning. We consider an instantiation of this hypothesis evaluated on the Arcade Learning Element (ALE). For example, in the context of 2D Atari games, contingency-awareness roughly corresponds to understanding the notion of controllable entities (e.g., the player’s avatar), which Bellemare et al. (2012) refer to as contingent regions. More concretely, as shown in Figure 1, in the game FREEWAY, only the chicken sprite is under the agent’s control and not the multiple moving cars; therefore the chicken’s location should be an informative element for exploration (Bellemare et al., 2012; Pathak et al., 2017).
|
| 22 |
+
|
| 23 |
+
In this study, we also investigate whether contingency awareness can be learned without any external annotations or supervision. For this, we provide an instantiation of an algorithm for automatically learning such information and using it for improving exploration on a 2D ALE environment (Bellemare et al., 2013). Concretely, we employ an attentive dynamics model (ADM) to predict the agent’s action chosen between consecutive states. It allows us to approximate the agent’s position in 2D environments, but unlike other approaches such as (Bellemare et al., 2012), it does not require any additional supervision to do so. The ADM learns in an online and self-supervised fashion with pure observations as the agent’s policy is updated and does not require hand-crafted features, an environment simulator, or supervision labels for training.
|
| 24 |
+
|
| 25 |
+
In experimental evaluation, our methods significantly improve the performance of A2C on hardexploration Atari games in comparison with competitive methods such as density-based exploration (Bellemare et al., 2016; Ostrovski et al., 2017) and SimHash (Tang et al., 2017). We report very strong results on sparse-reward Atari games, including the state-of-the-art performance on the notoriously difficult MONTEZUMA’S REVENGE, when combining our proposed exploration strategy with PPO (Schulman et al., 2017), without using expert demonstrations, explicit high-level information (e.g., RAM states), or resetting the environment to an arbitrary state.
|
| 26 |
+
|
| 27 |
+
We summarize our contributions as follows:
|
| 28 |
+
|
| 29 |
+
• We demonstrate the importance of learning contingency awareness for efficient exploration in challenging sparse-reward RL problems. • We develop a novel instance of attentive dynamics model using contingency and controllable dynamics to provide robust localization abilities across the most challenging Atari environments. • We achieve a strong performance on difficult sparse-reward Atari games, including the state-ofthe-art score on the notoriously challenging MONTEZUMA’S REVENGE.
|
| 30 |
+
|
| 31 |
+
Overall, we believe that our experiments confirm the hypothesis that contingency awareness is an extremely powerful concept for tackling exploration problems in reinforcement learning, which opens up interesting research questions for further investigations.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: Left: Contingent region in FREEWAY; an object in a red box denotes what is under the agent’s control, whereas the rest is not. Right: A diagram for the proposed ADM architecture.
|
| 35 |
+
|
| 36 |
+
# 2 RELATED WORK
|
| 37 |
+
|
| 38 |
+
Self-Localization. The discovery of grid cells (Moser et al., 2015) motivates working on agents that are self-aware of their location. Banino et al. (2018) emphasize the importance of self-localization and train a neural network which learns a similar mechanism to grid cells to perform tasks related to spatial navigation. The presence of grid cells is correlated with high performance. Although grid cells seem tailored to 2D or 3D problems that animals encounter in their life, it is speculated that their use can be extended to more abstract spaces. A set of potential approaches to self-localization ranges from ideas specific to a given environment, e.g., SLAM (Durrant-Whyte & Bailey, 2006), to methods with potential generalizability (Mirowski et al., 2017; Jaderberg et al., 2017; Mirowski et al., 2018).
|
| 39 |
+
|
| 40 |
+
Self-supervised Dynamics Model and Controllable Dynamics. Several works have used forward and/or inverse dynamics models of the environment (Oh et al., 2015; Agrawal et al., 2016; Shelhamer et al., 2017). Pathak et al. (2017) employ a similar dynamics model to learn feature representations of states that captures controllable aspects of the environment. This dense representation is used to design a curiosity-driven intrinsic reward. The idea of learning representations on relevant aspects of the environment by learning auxiliary tasks is also explored in (Jaderberg et al., 2017; Bengio et al., 2017; Sawada, 2018). Our presented approach is different as we focus on explicitly discovering controllable aspects using an attention mechanism, resulting in better interpretability.
|
| 41 |
+
|
| 42 |
+
Exploration and Intrinsic Motivation. The idea of providing an exploration bonus reward depending on the state-action visit-count was proposed by Strehl & Littman (2008) (MBIE-EB), originally under a tabular setting. Later it has been combined with different techniques to deal with high-dimensional state spaces. Bellemare et al. (2016) use a Context-Tree Switching (CTS) density model to derive a state pseudo-count, whereas Ostrovski et al. (2017) use PixelCNN as a state density estimator. Martin et al. (2017) also construct a visitation density model over a compressed feature space rather than the raw observation space. Alternatively, Tang et al. (2017) propose a localitysensitive hashing (LSH) method to cluster states and maintain a state-visitation counter based on a form of similarity between frames. We train an agent with a similar count-based exploration bonus, but the way of maintaining state counter seems relatively simpler in that key feature information (i.e., controllable region) is explicitly extracted from the observation and directly used for counting states.
|
| 43 |
+
|
| 44 |
+
Another popular family of exploration strategies in RL uses intrinsic motivation (Schmidhuber, 1991; Singh et al., 2004; Oudeyer & Kaplan, 2009; Barto, 2013). These methods encourage the agent to look for something surprising in the environment which motivates its search for novel states, such as surprise (Achiam & Sastry, 2017), curiosity (Pathak et al., 2017; Burda et al., 2018), and diversity (Eysenbach et al., 2018), or via feature control (Jaderberg et al., 2017; Dilokthanakul et al., 2017).
|
| 45 |
+
|
| 46 |
+
# 3 APPROACH
|
| 47 |
+
|
| 48 |
+
# 3.1 DISCOVERING CONTINGENCY VIA ATTENTIVE DYNAMICS MODEL
|
| 49 |
+
|
| 50 |
+
To discover the region of the observation that is controllable by the agent, we develop an instance of attentive dynamics model (ADM) based on inverse dynamics $f _ { \mathrm { i n v } }$ . The model takes two consecutive input frames (observations) $s _ { t - 1 } , s _ { t } \in S$ as input and aims to predict the action $( a _ { t - 1 } \in \mathcal { A } )$ taken by
|
| 51 |
+
|
| 52 |
+
the agent to transition from $s _ { t - 1 }$ to $s _ { t }$
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\widehat { a } _ { t - 1 } = f _ { \mathrm { i n v } } ( s _ { t - 1 } , s _ { t } ) .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Our key intuition is that the inverse dynamics model should attend to the most relevant part of the observation, which is controllable by the agent, to be able to classify the actions. We determine whether each region in a $H \times W$ grid is controllable, or in other words, useful for predicting the agent’s action, by using a spatial attention mechanism (Bahdanau et al., 2015; Xu et al., 2015). An overview of the model is shown in Figure 1.
|
| 59 |
+
|
| 60 |
+
Model. To perform action classification, we first compute a convolutional feature map $\phi _ { t } ^ { s } = \phi ( s _ { t } ) \in$ $\mathbb { R } ^ { H \times W \times K }$ based on the observation $s _ { t }$ using a convolutional neural network $\phi$ . We estimate a set of logit (score) vectors, denoted $e _ { t } ( i , j ) \in \mathbb { R } ^ { | \mathcal { A } | }$ , for action classification from each grid cell $( i , j )$ of the convolutional feature map. The local convolution features and feature differences for consecutive frames are fed into a shared multi-layer perceptron (MLP) to derive the logits as:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r } { e _ { t } ( i , j ) = \mathrm { M L P } \Big ( \big [ \phi _ { t } ^ { s } ( i , j ) - \phi _ { t - 1 } ^ { s } ( i , j ) ; ~ \phi _ { t } ^ { s } ( i , j ) \big ] \Big ) \in \mathbb { R } ^ { | \cal { A } | } . } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
We then compute an attention mask $\alpha _ { t } \in \mathbb { R } ^ { H \times W }$ corresponding to frame $t$ , which indicates the controllable parts of the observation $s _ { t }$ . Such attention masks are computed via a separate MLP from the features of each region $( i , j )$ , and then converted into a probability distribution using softmax or sparsemax operators (Martins $\&$ Astudillo, 2016):
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\alpha _ { t } = \mathrm { s p a r s e m a x } ( \widetilde { \alpha } _ { t } ) \quad \mathrm { w h e r e } \quad \widetilde { \alpha } _ { t } ( i , j ) = \mathrm { M L P } \big ( \phi _ { t } ^ { s } ( i , j ) \big ) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
so that $\begin{array} { r } { \sum _ { i , j } \alpha _ { t } ( i , j ) = 1 } \end{array}$ . The sparsemax operator is similar to softmax but yields a sparse attention, leading to more stable performance. Finally, the logits $e _ { t } ( i , j )$ from all regions are linearly combined using the attention probabilities $\alpha _ { t }$ :
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r } { p ( \widehat { a } _ { t - 1 } \mid s _ { t - 1 } , s _ { t } ) = \mathrm { s o f t m a x } \Big ( \sum _ { i , j } \alpha _ { t } ( i , j ) \cdot e _ { t } ( i , j ) \Big ) \in \mathbb { R } ^ { | \mathcal { A } | } . } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Training. The model can be optimized with the standard cross-entropy loss $\mathcal { L } _ { \mathrm { a c t i o n } } \big ( a _ { t - 1 } ^ { * } , \widehat { a } _ { t - 1 } \big )$ with respect to the ground-truth action $a _ { t - 1 } ^ { * } \in { \mathcal { A } }$ bthat the agent actually has taken. Based on this formulation, the attention probability $\alpha _ { t } ( i , j )$ should be high only on regions $( i , j )$ that are predictive of the agent’s actions. Our formulation enables learning to localize controllable entities in a selfsupervised way without any additional supervisory signal, unlike some prior work (e.g., (Bellemare et al., 2012)) that adopts simulators to collect extra supervisory labels.
|
| 79 |
+
|
| 80 |
+
Optimizing the parameters of ADM on on-policy data is challenging for several reasons. First, the ground-truth action may be unpredictable for given pairs of frames, leading to noisy labels. For example, actions taken in uncontrollable situations do not have any effect (e.g., when the agent is in the middle of jumping in MONTEZUMA’S REVENGE). Second, since we train the ADM online along with the policy, the training examples are not independently and identically distributed, and the data distribution can shift dramatically over time. Third, the action distribution from the agent’s policy can run into a low entropy2, being biased towards certain actions. These issues may prevent the ADM from generalization to novel observations, which hurts exploration. Generally, we prefer models that quickly adapt to the policy and learn to localize the controllable regions in a robust manner.
|
| 81 |
+
|
| 82 |
+
To mitigate the aforementioned issues, we adopt a few additional objective functions. We encourage the attention distribution to attain a high entropy by including an attention entropy regularization loss, i.e., ${ \mathcal { L } } _ { \mathrm { e n t } } = - { \mathcal { H } } ( \alpha _ { t } )$ . This term penalizes over-confident attention masks, making the attention closer to uniform whenever action prediction is not possible. We also train the logits corresponding to each grid cell independently using a separate cross-entropy loss: $p ( \widehat { a } _ { t - 1 } ^ { i , j } \mid e _ { t } ( i , j ) ) = \mathrm { s o f t m a x } ( e _ { t } ( i , j ) )$ . These additional cross-entropy losses, denoted $\mathcal { L } _ { \mathrm { c e l l } } ^ { i , j }$ b , allow the model to learn from unseen observations even when attention fails to perform well at first. The entire training objective becomes:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r } { \mathcal { L } ^ { \mathrm { A D M } } = \mathcal { L } _ { \mathrm { a c t i o n } } + \sum _ { i , j } \mathcal { L } _ { \mathrm { c e l l } } ^ { i , j } + \lambda _ { \mathrm { e n t } } \mathcal { L } _ { \mathrm { e n t } } } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $\lambda _ { \mathrm { e n t } }$ is a mixing hyperparameter.
|
| 89 |
+
|
| 90 |
+
# 3.2 COUNT-BASED EXPLORATION WITH CONTINGENT REGIONS
|
| 91 |
+
|
| 92 |
+
One natural way to take advantage of discovered contingent regions for exploration is count-based exploration. The ADM can be used to localize the controllable entity (e.g., the agent’s avatar)
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 2: Learning curves on several Atari games: $_ { \mathrm { A 2 C + C o E X } }$ and A2C. The $\mathbf { X }$ -axis represents total environment steps and the y-axis the mean episode reward averaged over 40 recent episodes. The mean curve is obtained by averaging over 3 random seeds, each shown in a light color.
|
| 96 |
+
|
| 97 |
+
from an observation $s _ { t }$ experienced by the agent. In 2D environments, a natural discretization $( x , y ) = \mathrm { a r g m a x } _ { ( j , i ) } \alpha _ { t } ( i , j )$ provides a good approximation of the agent’s location within the current observation3. This provides a key piece of information about the current state of the agent.
|
| 98 |
+
|
| 99 |
+
Inspired by previous work (Bellemare et al., 2016; Tang et al., 2017), we add an exploration bonus of $r ^ { + }$ to the environment reward, where $r ^ { + } ( s ) = 1 / \sqrt { \# ( \psi ( s ) ) }$ and $\# ( \psi ( s ) )$ denotes the visitation count of the (discrete) mapped state $\psi ( s )$ , which consists of the contingent region $( x , y )$ . We want to find a policy $\pi$ that maximizes the expected discounted sum of environment rewards $r ^ { \mathrm { e x t } }$ plus count-based exploration rewards $r ^ { + }$ , denoted $\begin{array} { r } { \mathcal { R } = \mathbb { E } _ { \pi } \big [ \sum _ { t } \gamma ^ { t } \left( \beta _ { 1 } r ^ { \mathrm { e x t } } ( s _ { t } , a _ { t } ) + \beta _ { 2 } r ^ { + } ( s _ { t } ) \right) \big ] } \end{array}$ , where $\beta _ { 1 } , \beta _ { 2 } \geq 0$ are hyperparameters that balance the weight of environment reward and exploration bonus. For every state $s _ { t }$ encountered at time step $t$ , we increase the counter value $\# ( \psi ( s _ { t } ) )$ by 1 during training. The full procedure is summarized in Algorithm 1 in Appendix A.
|
| 100 |
+
|
| 101 |
+
# 4 EXPERIMENTS
|
| 102 |
+
|
| 103 |
+
In the experiments below we investigate the following key questions:
|
| 104 |
+
|
| 105 |
+
• Does the contingency awareness in terms of self-localization provide a useful state abstraction for exploration? • How well can the self-supervised model discover the ground-truth abstract states? • How well does the proposed exploration strategy perform against other exploration methods?
|
| 106 |
+
|
| 107 |
+
# 4.1 EXPERIMENTS WITH A2C
|
| 108 |
+
|
| 109 |
+
We evaluate the proposed exploration strategy on several difficult exploration Atari 2600 games from the Arcade Learning Environment (ALE) (Bellemare et al., 2013). We focus on 8 Atari games including FREEWAY, FROSTBITE, HERO, PRIVATEEYE, MONTEZUMA’S REVENGE, QBERT, SEAQUEST, and VENTURE. In these games, an agent without an effective exploration strategy can often converge to a suboptimal policy. For example, as depicted in Figure 2, the Advantage Actor-Critic (A2C) baseline (Mnih et al., 2016) achieves a reward close to 0 on MONTEZUMA’S REVENGE, VENTURE, FREEWAY, FROSTBITE, and PRIVATEEYE, even after 100M steps of training. By contrast, our proposed technique, which augments A2C with count-based exploration with the location information learned by the attentive dynamics model, denoted $\mathbf { A 2 C + C o E X }$ (CoEX stands for “Contingency-aware Exploration”), significantly outperforms the A2C baseline on six out of the 8 games.
|
| 110 |
+
|
| 111 |
+
We compare our proposed $_ { \mathrm { A 2 C + C o E X } }$ technique against the following baselines:4 • A2C: an implementation adopted from OpenAI baselines (Dhariwal et al., 2017) using the default hyperparameters, which serves as the building block of our more complicated baselines. • A2C+Pixel-SimHash: Following (Tang et al., 2017), we map $5 2 \times 5 2$ gray-scale observations to 128-bit binary codes using random projection followed by quantization (Charikar, 2002). Then, we add a count-based exploration bonus based on quantized observations.
|
| 112 |
+
|
| 113 |
+
Table 1: Performance of our method and its baselines on Atari games: maximum mean scores (averaged over 40 recent episodes) achieved over total 100M environment timesteps (400M frames) of training, averaged over 3 seeds. The best entry in the group of experiments without supervision is shown in bold. ∗ denotes that $\mathrm { A 2 C + C o E X + R A M }$ acts as a control experiment, which includes some supervision. More experimental results on $\mathrm { A 2 C + C o E X + R A M }$ are shown in Appendix C.
|
| 114 |
+
|
| 115 |
+
<table><tr><td>Method</td><td>Freeway</td><td>Frostbite</td><td>Hero</td><td>Montezuma</td><td>PrivateEye</td><td>Qbert</td><td>Seaquest</td><td>Venture</td></tr><tr><td>A2C</td><td>7.2</td><td>1099</td><td>34352</td><td>13</td><td>574</td><td>19620</td><td>2401</td><td>0</td></tr><tr><td>A2C+Pixel-SimHash</td><td>0.0</td><td>829</td><td>28181</td><td>412</td><td>276</td><td>18180</td><td>2177</td><td>31</td></tr><tr><td>A2C+CoEX</td><td>34.0</td><td>4260</td><td>36827</td><td>6635</td><td>5316</td><td>23962</td><td>5169</td><td>204</td></tr><tr><td>A2C+CoEX+RAM*</td><td>34.0</td><td>4418</td><td>36765</td><td>6600</td><td>24296</td><td>24422</td><td>6113</td><td>1100</td></tr></table>
|
| 116 |
+
|
| 117 |
+
Table 2: Performance of our method and state-of-the-art exploration methods on Atari games. For fair comparison, we report the maximum mean score achieved over the specific number of timesteps during training, averaged over 3 seeds. The best entry is shown in bold. Baselines (for reference) are: $\mathrm { D D Q N + }$ and ${ \bf A } 3 { \bf C } +$ (Bellemare et al., 2016), TRPO-AE-SimHash (Tang et al., 2017), Sarsa- $\phi$ -EB (Martin et al., 2017), DQN-PixelCNN (Ostrovski et al., 2017), and Curiosity-Driven (Burda et al., 2018). The numbers for $\mathrm { D D Q N + }$ were taken from (Tang et al., 2017) or were read from a plot.
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Method</td><td>#Steps</td><td>Freeway</td><td>Frostbite</td><td>Hero</td><td>Montezuma</td><td>aPrivateEye</td><td>Qbert</td><td>Seaquest</td><td>Venture</td></tr><tr><td>A2C+CoEX (Ours)</td><td>50M</td><td>33.9</td><td>3900</td><td>31367</td><td>4100</td><td>5316</td><td>17724</td><td>2620</td><td>128</td></tr><tr><td>A2C+CoEX(Ours)</td><td>100M</td><td>34.0</td><td>4260</td><td>36827</td><td>6635</td><td>5316</td><td>23962</td><td>5169</td><td>204</td></tr><tr><td>DDQN+</td><td>25M</td><td>29.2</td><td></td><td>20300</td><td>3439</td><td>1880</td><td>-</td><td>-</td><td>369</td></tr><tr><td>A3C+</td><td>50M</td><td>27.3</td><td>507</td><td>15210</td><td>142</td><td>100</td><td>15805</td><td>2274</td><td>0</td></tr><tr><td>TRPO-AE-SimHash</td><td>50M</td><td>33.5</td><td>5214</td><td></td><td>75</td><td>-</td><td>1</td><td>-</td><td>445</td></tr><tr><td>Sarsa-Φ-EB</td><td>25M</td><td>0.0</td><td>2770</td><td></td><td>2745</td><td>-</td><td>4112</td><td></td><td>1169</td></tr><tr><td>DQN-PixelCNN</td><td>37.5M</td><td>31.7</td><td>-</td><td></td><td>2514</td><td>15806</td><td>5501</td><td></td><td>1356</td></tr><tr><td>Curiosity-Driven</td><td>25M</td><td>32.8</td><td>=</td><td>=</td><td>2505</td><td>3037</td><td>-</td><td>=</td><td>416</td></tr></table>
|
| 120 |
+
|
| 121 |
+
As a control experiment, we evaluate $\mathbf { A 2 C + C o E X + R A M ^ { * } }$ , our contingency-aware exploration method together with the ground-truth location information obtained from game’s RAM. It is roughly an upper-bound of the performance of our approach.
|
| 122 |
+
|
| 123 |
+
# 4.2 IMPLEMENTATION DETAILS
|
| 124 |
+
|
| 125 |
+
For the A2C (Mnih et al., 2016) algorithm, we use 16 parallel actors to collect the agent’s experience, with 5-step rollout, which yields a minibatch of size 80 for on-policy transitions. We use the last 4 observation frames stacked as input, each of which is resized to $8 4 \times 8 4$ and converted to grayscale as in (Mnih et al., 2015; 2016). We set the end of an episode to when the game ends, rather than when the agent loses a life. Each episode is initialized with a random number of no-ops (Mnih et al., 2015). More implementation details can be found in Appendix A and B.
|
| 126 |
+
|
| 127 |
+
For the ADM, we take observation frames of size $1 6 0 \times 1 6 0$ as input (resized from the raw observation of size $2 1 0 \times 1 6 0 $ ).5 We employ a 4-layer convolutional neural network that produces a feature map $\phi ( s _ { t } )$ with a spatial grid size of $\boldsymbol { H } \times \boldsymbol { W } = 9 \times 9$ . As a result, the prediction of location coordinates lies in the $9 \times 9$ grid.
|
| 128 |
+
|
| 129 |
+
In some environments, the contingent regions within the visual observation alone are not sufficient to determine the exact location of the agent within the game; for example, the coordinate cannot solely distinguish between different rooms in HERO, MONTEZUMA’S REVENGE, and PRIVATEEYE, etc. Therefore, we introduce a discrete context representation $c \in \mathbb { Z }$ that summarizes the high-level visual context in which the agent currently lies. We use a simple clustering method similar to (Kulis & Jordan, 2012), which we refer to as observation embedding clustering that clusters the random projection vectors of the input frames as in (Tang et al., 2017), so that different contexts are assigned to different clusters. We further explain this heuristic approach more in detail in Appendix D.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 3: Performance plot of ADM trained using on-policy samples from the $_ { \mathrm { A 2 C + C o E X } }$ agent.
|
| 133 |
+
|
| 134 |
+
In sparse-reward problems, the act of collecting a reward is rare but frequently instrumental for the future states of the environment. The cumulative reward $\begin{array} { r } { R _ { t } = \sum _ { t ^ { \prime } = 0 } ^ { t - 1 } r ^ { \mathrm { e x t } } \bar { ( } s _ { t ^ { \prime } } , \bar { a _ { t ^ { \prime } } } ) } \end{array}$ from the beginning , can provide a useful high-level behavioral context because collecting rewards can trigger significant changes to the agent’s state and as a result the optimal behavior can change as well. In this sense, the agent should revisit the previously visited location for exploration when the context changes. For example, in MONTEZUMA’S REVENGE, if the agent is in the first room and the cumulative reward is 0, we know the agent has not picked up the key and the optimal policy is to reach the key. However, if the cumulative reward in the first room is 100, it means the agent has picked up the key and the next optimal goal is to open a door and move on to the next room. Therefore, we could include the cumulative reward as a part of state abstraction for exploration, which leads to empirically better performance.
|
| 135 |
+
|
| 136 |
+
To sum up, for the purpose of count-based exploration, we utilize the location $( x , y )$ of the controllable entity (i.e., the agent) in the current observation discovered by ADM (Section 3.1), a context representation $c \in \mathbb { Z }$ that denotes the high level visual context, and a cumulative environment reward $R \in \mathbb { Z }$ that represents the exploration behavioral state. In such setting, we may denote $\psi ( s ) = ( x , y , c , R )$ .
|
| 137 |
+
|
| 138 |
+
# 4.3 PERFORMANCE OF COUNT-BASED EXPLORATION
|
| 139 |
+
|
| 140 |
+
Figure 2 shows the learning curves of the proposed methods on 8 Atari games. The performance of our method $_ { \mathrm { A 2 C + C o E X } }$ and A2C+CoEX $^ { + }$ RAM as well as the baselines A2C and $\mathbf { A } 2 \mathbf { C } +$ PixelSimHash are summarized in Table 1. In order to find a balance between the environment reward and the exploration bonus reward, we perform a hyper-parameter search for the proper weight of the environment reward $\beta _ { 1 }$ and the exploration reward $\beta _ { 2 }$ for $_ { \mathrm { A 2 C + C o E X + R A M } }$ , as well as for $_ { \mathrm { A 2 C + C o E X } }$ . The hyper-parameters for the two ended up being the same, which is consistent with our results. For fair comparison, we also search for the proper weight of environment reward for A2C baseline. The best hyper-parameters for each game are shown in Table 5 in Appendix B.
|
| 141 |
+
|
| 142 |
+
Compared to the vanilla A2C, the proposed exploration strategy improves the score on all the hard-exploration games. As shown in Table 1, provided the representation $( x , y , c , R )$ is perfect, $\mathrm { A 2 C + C o E X + R A M }$ achieves a significant improvement over A2C by encouraging the agent to visit novel locations, and could nearly solve these hard exploration games as training goes on.
|
| 143 |
+
|
| 144 |
+
Furthermore, $_ { \mathrm { A 2 C + C o E X } }$ using representations learned with our proposed attentive dynamics model and observation embedding clustering also outperforms the A2C baseline. Especially on FREEWAY, FROSTBITE, HERO, MONTEZUMA’S REVENGE, QBERT and SEAQUEST, the performance is comparable with A2C+CoEX $\cdot +$ RAM, demonstrating the usefulness of the contigency-awareness information discovered by ADM.
|
| 145 |
+
|
| 146 |
+
Comparison to other count-based exploration methods. Table 2 compares the proposed method with previous state-of-the-art results, where our proposed method outperforms the other methods on 5 out of 8 games. DQN-PixelCNN is the strongest alternative achieving a state-of-the-art performance on some of the most difficult sparse-reward games. We argue that using Q-learning as the base learner with DQN-PixelCNN makes the direct comparison with $_ { \mathrm { A 2 C + C o E X } }$ not completely adequate. Note that the closest alternative count-based exploration method to $_ { \mathrm { A 2 C + C o E X } }$ would be ${ \bf A } 3 { \bf C } +$ (Bellemare et al., 2016), which augments A3C (Mnih et al., 2016) with exploration bonus derived from pseudocount, because A2C and A3C share a similar policy learning method. With that in mind, one can observe a clear improvement of $_ { \mathrm { A 2 C + C o E X } }$ over ${ \bf A } 3 { \bf C } +$ on all of the 8 Atari games.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 4: Curves of ARI score during training of $_ { \mathrm { A 2 C + C o E X } }$ , averaged over 100 recent observations.
|
| 150 |
+
|
| 151 |
+
# 4.4 ANALYSIS OF ATTENTIVE DYNAMICS MODEL
|
| 152 |
+
|
| 153 |
+
We also analyze the performance of the ADM that learns the controllable dynamics of the environment. As a performance metric, we report the average distance between the ground-truth agent location $( x ^ { * } , y ^ { * } )$ and the predicted location $( x , y )$ within the $9 \times 9$ grid: $\lVert ( x , y ) - ( x ^ { * } , y ^ { * } ) \rVert _ { 2 }$ . The ground-truth location of the agent is extracted from $\mathrm { \bf { R A M } } ^ { 6 }$ , then rescaled so that the observation image frame fits into the $9 \times 9$ grid.
|
| 154 |
+
|
| 155 |
+
Figure 3 shows the results on 4 Atari games (MONTEZUMA’S REVENGE, SEAQUEST, HERO, and VENTURE). The ADM is able to quickly capture the location of the agent without any supervision of localization, despite the agent constantly visiting new places. Typically the predicted location is on average 1 or 2 grid cells away from the ground-truth location. Whenever a novel scene is encountered (e.g., the second room in MONTEZUMA’S REVENGE at around 10M steps), the average distance temporarily increases but quickly drops again as the model learns the new room. We provide videos of the agents playing and localization information as the supplementary material.7
|
| 156 |
+
|
| 157 |
+
# 4.5 ANALYSIS OF OBSERVATION EMBEDDING CLUSTERING
|
| 158 |
+
|
| 159 |
+
To make the agent aware of a change in high-level visual context (i.e., rooms in Atari games) in some games such as MONTEZUMA’S REVENGE, VENTURE, HERO, and PRIVATEEYE, we obtain a representation of the high-level context and use it for exploration. The high-level visual contexts are different from each other (different layouts, objects, colors, etc.), so the embedding generated by a random projection is quite distinguishable and the clustering is accurate and robust.
|
| 160 |
+
|
| 161 |
+
For evaluation, given an observation in Atari games, we compare the discrete representation (i.e., which cluster it is assigned to) based on the embedding from random projection to the ground-truth room number extracted from RAM. The Adjusted Rand Index (ARI) (Rand, 1971) measures the similarity between these two data clusterings. The ARI may only yield a value between 0 and 1, and is exactly 1 when the clusterings are identical.
|
| 162 |
+
|
| 163 |
+
The curves of the Adjusted Rand Index are shown in Figure 4. For MONTEZUMA’S REVENGE and VENTURE, the discrete representation as room number is roughly as good as the ground-truth. For HERO and PRIVATEEYE, since there are many rooms quite similar to one another, it is more challenging to accurately cluster the embeddings. The samples shown in Figure 7 in Appendix D show reasonable performances of the clustering method on all these games.
|
| 164 |
+
|
| 165 |
+
# 4.6 ADDITIONAL EXPERIMENTS WITH PPO
|
| 166 |
+
|
| 167 |
+
We also evaluate the proposed exploration algorithm on MONTEZUMA’S REVENGE using the sticky actions environment setup (Machado et al., 2017) identical to the setup found in (Burda et al., 2019). In the sticky action setup, the agent randomly repeats the previous action with probability of 0.25, preventing the algorithm from simply memorizing the correct sequence of actions and relying on determinism. The agent is trained with Proximal Policy Optimization (PPO) (Schulman et al., 2017) in conjunction with the proposed exploration method using 128 parallel actors to collect the experience. We used reward normalization and advantage normalization as in (Burda et al., 2018).
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 5: The learning curve of $\mathrm { P P O + C o E X }$ on several Atari games with sticky actions setup. The $\mathbf { X }$ -axis represents the total number of environment steps and the y-axis the mean episode reward averaged over 40 recent episodes. The mean curve is obtained by averaging over 3 random seeds, each shown in a light color.
|
| 171 |
+
|
| 172 |
+
Table 3: Performance of PPO and $\mathrm { P P O + C o E X }$ : maximum mean scores (average over 40 recent episodes) achieved over total 500M environment steps (2B frames) of training, averaged over 3 seeds.
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Method</td><td>#Steps</td><td>Freeway</td><td>Frostbite</td><td>Hero</td><td>Montezuma</td><td>PrivateEye</td><td>Qbert</td><td>Seaquest</td><td>Venture</td></tr><tr><td>PPO</td><td>500M</td><td>34.0</td><td>7340</td><td>36263</td><td>29</td><td>942</td><td>19980</td><td>2806</td><td>1875</td></tr><tr><td>PPO+CoEX</td><td>500M</td><td>34.0</td><td>9076</td><td>36664</td><td>11618</td><td>11000</td><td>22647</td><td>11794</td><td>1916</td></tr></table>
|
| 175 |
+
|
| 176 |
+
The method, denoted $\mathbf { P P O + C o E X }$ , achieves the score of 11,618 at 500M environment steps (2 billion frames) on MONTEZUMA’S REVENGE, when averaged over 3 runs. The learning curve is illustrated in Figure 5. Since the vanilla PPO baseline achieves a score near 0 (our runs) or 1,797 (Burda et al., 2019), this result is not solely due to the benefits of PPO. There is another approach "Exploration by Random Network Distillation" (Burda et al., 2019) concurrent with our work which achieves similar performance by following a slightly different philosophy.
|
| 177 |
+
|
| 178 |
+
# 4.7 DISCUSSIONS AND FUTURE WORK
|
| 179 |
+
|
| 180 |
+
This paper investigates whether discovering controllable dynamics via an attentive dynamics model (ADM) can help exploration in challenging sparse-reward environments. We demonstrate the effectiveness of this approach by achieving significant improvements on notoriously difficult video games. That being said, we acknowledge that our approach has certain limitations. Our currently presented instance of state abstraction method mainly focuses on controllable dynamics and employs a simple clustering scheme to abstract away uncontrollable elements of the scene. In more general setting, one can imagine using attentive (forward or inverse) dynamics models to learn an effective and compact abstraction of the controllable and uncontrollable dynamics as well, but we leave this to future work.
|
| 181 |
+
|
| 182 |
+
Key elements of the current ADM method include the use of spatial attention and modelling of the dynamics. These ideas can be generalized by a set of attention-based dynamics models (ADM) operating in forward, inverse, or combined mode. Such models could use attention over a lowerdimensional embedding that corresponds to an intrinsic manifold structure from the environment (i.e., intuitively speaking, this also corresponds to being self-aware of (e.g., locating) where the agent is in the abstract state space). Our experiments with the inverse dynamics model suggest that the mechanism does not have to be perfectly precise, allowing for some error in practice. We speculate that mapping to such subspace could be obtained by techniques of embedding learning.
|
| 183 |
+
|
| 184 |
+
We note that RL environments with different visual characteristics may require different forms of attention-based techniques and properties of the model (e.g., partial observability). Even though this paper focuses on 2D video games, we believe that the presented high-level ideas of learning contingency-awareness (with attention and dynamics models) are more general and could be applicable to more complex 3D environments with some extension. We leave this as future work.
|
| 185 |
+
|
| 186 |
+
# 5 CONCLUSION
|
| 187 |
+
|
| 188 |
+
We proposed a method of providing contingency-awareness through an attentive dynamics model (ADM). It enables approximate self-localization for an RL agent in 2D environments (as a specific perspective). The agent is able to estimate its position in the space and therefore benefits from a compact and informative representation of the world. This idea combined with a variant of countbased exploration achieves strong results in various sparse-reward Atari games. Furthermore, we report state-of-the-art results of ${ > } 1 1 { , } 0 0 0$ points on the infamously challenging MONTEZUMA’S REVENGE without using expert demonstrations or supervision. Though in this work we focus mostly on 2D environments in the form of sparse-reward Atari games, we view our presented high-level concept and approach as a stepping stone towards more universal algorithms capable of similar abilities in various RL environments.
|
| 189 |
+
|
| 190 |
+
# REFERENCES
|
| 191 |
+
|
| 192 |
+
Joshua Achiam and Shankar Sastry. Surprise-Based Intrinsic Motivation for Deep Reinforcement Learning. arXiv preprint arXiv:1703.01732, 2017.
|
| 193 |
+
|
| 194 |
+
Pulkit Agrawal, Ashvin Nair, Pieter Abbeel, Jitendra Malik, and Sergey Levine. Learning to Poke by Poking: Experiential Learning of Intuitive Physics. In NIPS, 2016.
|
| 195 |
+
|
| 196 |
+
Frank Baeyens, Paul Eelen, and Omer van den Bergh. Contingency awareness in evaluative conditioning: A case for unaware affective-evaluative learning. Cognition and emotion, 4(1):3–18, 1990.
|
| 197 |
+
|
| 198 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. In ICLR, 2015.
|
| 199 |
+
|
| 200 |
+
Andrea Banino, Caswell Barry, Benigno Uria, Charles Blundell, Timothy Lillicrap, Piotr Mirowski, Alexander Pritzel, Martin J Chadwick, Thomas Degris, Joseph Modayil, Greg Wayne, Hubert Soyer, Fabio Viola, Brian Zhang, Ross Goroshin, Neil Rabinowitz, Razvan Pascanu, Charlie Beattie, Stig Petersen, Amir Sadik, Stephen Gaffney, Helen King, Koray Kavukcuoglu, Demis Hassabis, Raia Hadsell, and Dharshan Kumaran. Vector-based navigation using grid-like representations in artificial agents. Nature, 557(7705):429–433, 2018.
|
| 201 |
+
|
| 202 |
+
Andrew G Barto. Intrinsic motivation and reinforcement learning. In Intrinsically motivated learning in natural and artificial systems, pp. 17–47. Springer, 2013.
|
| 203 |
+
|
| 204 |
+
Marc G Bellemare, Joel Veness, and Michael Bowling. Investigating Contingency Awareness Using Atari 2600 Games. In AAAI, 2012.
|
| 205 |
+
|
| 206 |
+
Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The Arcade Learning Environment: An Evaluation Platform for General Agents. Journal of Artificial Intelligence Research 47, 2013.
|
| 207 |
+
|
| 208 |
+
Marc G. Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying Count-Based Exploration and Intrinsic Motivation. In NIPS, 2016.
|
| 209 |
+
|
| 210 |
+
Emmanuel Bengio, Valentin Thomas, Joelle Pineau, Doina Precup, and Yoshua Bengio. Independently Controllable Features. arXiv preprint arXiv:1703.07718, 2017.
|
| 211 |
+
|
| 212 |
+
Yuri Burda, Harri Edwards, Deepak Pathak, Amos Storkey, Trevor Darrell, and Alexei A. Efros. Large-scale study of curiosity-driven learning. arXiv preprint arXiv:1808.04355, 2018.
|
| 213 |
+
|
| 214 |
+
Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. In ICLR, 2019. URL https://openreview.net/forum?id=H1lJJnR5Ym.
|
| 215 |
+
|
| 216 |
+
Moses S Charikar. Similarity estimation techniques from rounding algorithms. In Proceedings of the thiry-fourth annual ACM symposium on Theory of computing, pp. 380–388. ACM, 2002.
|
| 217 |
+
|
| 218 |
+
Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, and Yuhuai Wu. OpenAI Baselines. https://github.com/openai/ baselines, 2017.
|
| 219 |
+
|
| 220 |
+
Nat Dilokthanakul, Christos Kaplanis, Nick Pawlowski, and Murray Shanahan. Feature Control as Intrinsic Motivation for Hierarchical Reinforcement Learning. arXiv preprint arXiv:1705.06769, 2017.
|
| 221 |
+
|
| 222 |
+
Hugh Durrant-Whyte and Tim Bailey. Simultaneous Localization and Mapping: Part I. IEEE robotics & automation magazine, 13(2):99–110, 2006.
|
| 223 |
+
|
| 224 |
+
Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is All You Need: Learning Skills without a Reward Function. 2018.
|
| 225 |
+
|
| 226 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. VIME: Variational Information Maximizing Exploration. In NIPS, 2016.
|
| 227 |
+
|
| 228 |
+
Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement Learning with Unsupervised Auxiliary Tasks. In ICLR, 2017.
|
| 229 |
+
|
| 230 |
+
Brian Kulis and Michael I . Jordan. Revisiting k-means: New Algorithms via Bayesian Nonparametrics. In ICML, 2012.
|
| 231 |
+
|
| 232 |
+
Marlos C Machado, Marc G Bellemare, Erik Talvitie, Joel Veness, Matthew Hausknecht, and Michael Bowling. Revisiting the arcade learning environment: Evaluation protocols and open problems for general agents. Journal of Artificial Intelligence Research, 61:523–562, 2017.
|
| 233 |
+
|
| 234 |
+
Jarryd Martin, Suraj Narayanan Sasikumar, Tom Everitt, and Marcus Hutter. Count-Based Exploration in Feature Space for Reinforcement Learning. In IJCAI, 2017.
|
| 235 |
+
|
| 236 |
+
André F T Martins and Ramón Fernandez Astudillo. From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification. In ICML, 2016.
|
| 237 |
+
|
| 238 |
+
Piotr Mirowski, Razvan Pascanu, Fabio Viola, Hubert Soyer, Andrew J Ballard, Andrea Banino, Misha Denil, Ross Goroshin, Laurent Sifre, Koray Kavukcuoglu, Dharshan Kumaran, and Raia Hadsell. Learning to Navigate in Complex Environments. In ICLR, 2017.
|
| 239 |
+
|
| 240 |
+
Piotr Mirowski, Matthew Koichi Grimes, Mateusz Malinowski, Karl Moritz Hermann, Keith Anderson, Denis Teplyashin, Karen Simonyan, Koray Kavukcuoglu, Andrew Zisserman, and Raia Hadsell. Learning to Navigate in Cities Without a Map. In NIPS, 2018.
|
| 241 |
+
|
| 242 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 2015.
|
| 243 |
+
|
| 244 |
+
Volodymyr Mnih, Adrià Puigdomènech Badia, Mehdi Mirza, Alex Graves, Timothy P Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous Methods for Deep Reinforcement Learning. In ICML, 2016.
|
| 245 |
+
|
| 246 |
+
May-Britt Moser, David Rowland, and Edvard I Moser. Place Cells, Grid Cells, and Memory. Cold Spring Harbor perspectives in medicine, 5, 2015.
|
| 247 |
+
|
| 248 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder P Singh. Action-Conditional Video Prediction using Deep Networks in Atari Games. In NIPS, 2015.
|
| 249 |
+
|
| 250 |
+
Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep Exploration via Bootstrapped DQN. In NIPS, 2016.
|
| 251 |
+
|
| 252 |
+
Georg Ostrovski, Marc G. Bellemare, Aaron van den Oord, and Remi Munos. Count-Based Exploration with Neural Density Models. In ICML, 2017.
|
| 253 |
+
|
| 254 |
+
Pierre-Yves Oudeyer and Frederic Kaplan. What is intrinsic motivation? A typology of computational approaches. Frontiers in Neurorobotics, 2009.
|
| 255 |
+
|
| 256 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven Exploration by Self-supervised Prediction. In ICML, 2017.
|
| 257 |
+
|
| 258 |
+
Matthias Plappert, Rein Houthooft, Prafulla Dhariwal, Szymon Sidor, Richard Y Chen, Xi Chen, Tamim Asfour, Pieter Abbeel, and Marcin Andrychowicz. Parameter Space Noise for Exploration. In ICLR, 2018.
|
| 259 |
+
|
| 260 |
+
William M. Rand. Objective criteria for the evaluation of clustering methods. Journal of the American Statistical Association, 66(336):846–850, 1971.
|
| 261 |
+
|
| 262 |
+
Yoshihide Sawada. Disentangling Controllable and Uncontrollable Factors of Variation by Interacting with the World. arXiv preprint arXiv:1804.06955, 2018.
|
| 263 |
+
|
| 264 |
+
Jürgen Schmidhuber. Adaptive confidence and adaptive curiosity. 1991.
|
| 265 |
+
|
| 266 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 267 |
+
|
| 268 |
+
Evan Shelhamer, Parsa Mahmoudieh, Max Argus, and Trevor Darrell. Loss is its own Reward: Self-Supervision for Reinforcement Learning. arXiv preprint arXiv:1612.07307, 2017.
|
| 269 |
+
|
| 270 |
+
Satinder Singh, Nuttapong Chentanez, and Andrew G. Barto. Intrinsically Motivated Reinforcement Learning. In NIPS, 2004.
|
| 271 |
+
|
| 272 |
+
Alexander L. Strehl and Michael L. Littman. An analysis of model-based interval estimation for markov decision processes. Journal of Computer and System Sciences, 74(8), 2008.
|
| 273 |
+
|
| 274 |
+
Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. #Exploration: A Study of Count-Based Exploration for Deep Reinforcement Learning. In NIPS, 2017.
|
| 275 |
+
|
| 276 |
+
John S Watson. The development and generalization of "contingency awareness" in early infancy: Some hypotheses. Merrill-Palmer Quarterly of Behavior and Development, 12(2):123–135, 1966.
|
| 277 |
+
|
| 278 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C. Courville, Ruslan Salakhutdinov, Richard S Zemel, and Yoshua Bengio. Show, Attend and Tell: Neural Image Caption Generation with Visual Attention. In ICML, 2015.
|
| 279 |
+
|
| 280 |
+
Zeyu Zheng, Junhyuk Oh, and Satinder Singh. On Learning Intrinsic Rewards for Policy Gradient Methods. In NIPS, 2018.
|
| 281 |
+
|
| 282 |
+
# APPENDIX
|
| 283 |
+
|
| 284 |
+
A SUMMARY OF TRAINING ALGORITHM
|
| 285 |
+
|
| 286 |
+
# Algorithm $\mathbf { 1 } \mathrm { A } 2 \mathrm { C } \mathrm { + } \mathrm { C o E X }$
|
| 287 |
+
|
| 288 |
+
<table><tr><td>Initialize parameter 0ADm for attentive dynamics model fADM Initialize parameter θA2c for actor-critic network Initialize parameter θc for context embedding projector if applicable (which is not trainable) Initialize transition bufferε←@ for each iteration do Collect on-policy transition samples,distributed over K parallel actors</td></tr><tr><td>for each step t do St ← Observe state at~Tθ(at|st) St+1,rext ← Perform action at in the environment</td></tr><tr><td>DCompute the contingent region information αt+1 ← Compute the attention map of St+1 using fADM c(St+1)← Compute the observation embedding cluster of St+1 (Algorithm 2)</td></tr><tr><td>DIncrement state visitation counter based on the representation (st+1)←(argmax(,j)t+1(𝑖,j),c(St+1),[∑=0r1)</td></tr><tr><td>#((St+1))←#((St+1))+1 r ↑ 1 #((st+1))</td></tr><tr><td>Store transitionε ← εU {(st,at, St+1,β1clip(rext,-1,1) + β2rt)} end for</td></tr><tr><td>DPerform actor-critic using on-policy samples in ε 0A2C ←0A2C -nVθA2CCA2C DTrain the attentive dynamics model using on-policy samples in ε</td></tr></table>
|
| 289 |
+
|
| 290 |
+
# end for
|
| 291 |
+
|
| 292 |
+
The learning objective $\mathcal { L } ^ { \mathrm { A D M } }$ is from Equation (5). The objective ${ \mathcal { L } } ^ { \mathrm { A 2 C } }$ of Advantage Actor-Critic (A2C) is as in (Mnih et al., 2016; Dhariwal et al., 2017):
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\begin{array} { r l } & { \mathcal { L } ^ { \mathrm { A 2 C } } = \mathbb { E } _ { ( s , a , r ) \sim \mathcal { E } } \bigg [ \mathcal { L } _ { \mathrm { p o l i c y } } ^ { \mathrm { A 2 C } } + \frac { 1 } { 2 } \mathcal { L } _ { \mathrm { v a l u e } } ^ { \mathrm { A 2 C } } \bigg ] } \\ & { \mathcal { L } _ { \mathrm { p o l i c y } } ^ { \mathrm { A 2 C } } = - \log \pi _ { \theta } ( a _ { t } | s _ { t } ) ( R _ { t } ^ { n } - V _ { \theta } ( s _ { t } ) ) - \alpha \mathcal { H } _ { t } ( \pi _ { \theta } ) } \\ & { \mathcal { L } _ { \mathrm { v a l u e } } ^ { \mathrm { A 2 C } } = \frac { 1 } { 2 } \Big ( V _ { \theta } ( s _ { t } ) - R _ { t } ^ { n } \Big ) ^ { 2 } } \\ & { \mathcal { H } _ { t } ( \pi _ { \theta } ) = - \sum _ { a } \pi _ { \theta } ( a | s _ { t } ) \log \pi _ { \theta } ( a | s _ { t } ) } \end{array}
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
where $\begin{array} { r } { R _ { t } ^ { n } = \sum _ { i = 0 } ^ { n - 1 } \gamma ^ { i } r _ { t + i } + \gamma ^ { n } V _ { \theta } ( s _ { t + n } ) } \end{array}$ is the $n$ -step bootstrapped return and $\alpha$ is a weight for the standard entropy regularization loss term $\mathcal { H } _ { t } ( \pi _ { \theta } )$ $\theta = \theta _ { \mathrm { { A 2 C } } }$
|
| 299 |
+
|
| 300 |
+
# B ARCHITECTURE AND HYPERPARAMETER DETAILS
|
| 301 |
+
|
| 302 |
+
The architecture details of the attentive dynamics model (ADM), the policy network, and hyperparameters are as follows.
|
| 303 |
+
|
| 304 |
+
Table 4: Network architecture and hyperparameters
|
| 305 |
+
|
| 306 |
+
<table><tr><td>Hyperparameters</td><td colspan="2">Value</td></tr><tr><td>Policy and Value Network Architecture</td><td colspan="2">Input: 84x84x1</td></tr><tr><td></td><td>- Conv(32-8x8-4)</td><td>/ReLU</td></tr><tr><td></td><td>- Conv(64-4x4-2)</td><td>/ReLU</td></tr><tr><td></td><td>- Conv(64-3x3-1)</td><td>/ReLU</td></tr><tr><td></td><td>- FC(512)</td><td>/ReLU</td></tr><tr><td></td><td>- FC(|AI), FC(1)</td><td></td></tr><tr><td>ADM Encoder Architecture</td><td colspan="2">Input: 160x160x3</td></tr><tr><td></td><td>- Conv(8-4x4-2)</td><td>/LeakyReLU</td></tr><tr><td></td><td>- Conv(8-3x3-2)</td><td>/LeakyReLU</td></tr><tr><td></td><td>- Conv(16-3x3-2)</td><td>/LeakyReLU</td></tr><tr><td></td><td>- Conv(16-3x3-2)</td><td>/LeakyReLU</td></tr><tr><td>MLP Architecture for et(𝑖, j)</td><td>FC(1296,256)</td><td>/ReLU</td></tr><tr><td></td><td>- FC(256,128)</td><td>/ReLU</td></tr><tr><td></td><td>- FC(128,JA|)</td><td></td></tr><tr><td>MLP Architecture for &t(𝑖, j)</td><td>FC(1296,64)</td><td>/ReLU</td></tr><tr><td></td><td>- FC(64,64)</td><td>/ReLU</td></tr><tr><td></td><td>- FC(64,1)</td><td></td></tr><tr><td>Xent for Loss</td><td>0.001</td><td></td></tr><tr><td>A2C Discount Factor </td><td>0.99</td><td></td></tr><tr><td>Learning Rate (RMSProp)</td><td>0.0007</td><td></td></tr><tr><td>Number of Parallel Environments</td><td>16</td><td></td></tr><tr><td>Number of Roll-out Steps per Iteration</td><td>5</td><td></td></tr><tr><td>Entropy Regularization of Policy (α)</td><td>0.01</td><td></td></tr><tr><td>PPO Discount Factor </td><td>0.99</td><td></td></tr><tr><td>入 for GAE</td><td>0.95</td><td></td></tr><tr><td>Learning rate (Adam)</td><td>0.00001</td><td></td></tr><tr><td>Number of Parallel Environments</td><td>128</td><td></td></tr><tr><td>Rollout Length</td><td>128</td><td></td></tr><tr><td>Number of Minibatches</td><td>4</td><td></td></tr><tr><td>Number of Optimization Epochs</td><td></td><td></td></tr><tr><td>Coefficient of Extrinsic and Intrinsic reward</td><td>4 β=2,β=1</td><td></td></tr><tr><td>Entropy Regularization of Policy (α)</td><td>0.01</td><td></td></tr></table>
|
| 307 |
+
|
| 308 |
+
Table 5: The list of hyperparameters used for $_ { \mathrm { A 2 C + C o E X } }$ in each game. For the four games where there is no change of high-level visual context (FREEWAY, FROSTBITE, QBERT and SEAQUEST), we do not include $c$ in the state representation $\psi ( s )$ , hence there is no $\tau$ . The same values of $\tau$ are used in $\mathrm { P P O + C o E X }$ .
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Games</td><td>β1 in A2C+CoEX</td><td>β2 in A2C+CoEX</td><td>β1 in A2C</td><td>T for clustering</td></tr><tr><td>FREEWAY</td><td>10</td><td>10</td><td>10</td><td>-</td></tr><tr><td>FROSTBITE</td><td>10</td><td>10</td><td>10</td><td>-</td></tr><tr><td>HERO</td><td>1</td><td>0.1</td><td>1</td><td>0.7</td></tr><tr><td>MONTEZUMA'SREVENGE</td><td>10</td><td>10</td><td>10</td><td>0.7</td></tr><tr><td>PRIVATEEYE</td><td>10</td><td>10</td><td>10</td><td>0.55</td></tr><tr><td>QBERT</td><td>1</td><td>0.5</td><td>1</td><td>-</td></tr><tr><td>SEAQUEST</td><td>1</td><td>0.5</td><td>10</td><td>-</td></tr><tr><td>VENTURE</td><td>10</td><td>10</td><td>10</td><td>0.7</td></tr></table>
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 6: Learning curves on several Atari games: A2C, $_ { \mathrm { A 2 C + C o E X } }$ , and $_ { \mathrm { A 2 C + C o E X + R A M } }$ .
|
| 314 |
+
|
| 315 |
+
# C EXPERIMENT WITH RAM INFORMATION
|
| 316 |
+
|
| 317 |
+
In order to understand the performance of exploration with perfect representation, we extract the ground-truth location of the agent and the room number from RAM, and then run count-based exploration with the perfect $( x , y , c , R )$ . Figure 6 shows the learning curves of the experiments; we could see $\mathrm { A 2 C + C o E X + R A M }$ acts as an upper bound performance of our proposed method.
|
| 318 |
+
|
| 319 |
+
# D OBSERVATION EMBEDDING CLUSTERING
|
| 320 |
+
|
| 321 |
+
We describe the detail of a method to obtain the observation embedding. Given an observation of shape (84, 84, 3), we flatten the observation and project it to an embedding of dimension 64. We randomly initialize the parameter of the fully-connected layer for projection, and keep the values unchanged during the training to make the embedding stationary.
|
| 322 |
+
|
| 323 |
+
For the embedding of these observations, we cluster them based on a threshold value $\tau$ . The value of $\tau$ for each game with change of rooms is listed in Table 5. If the distance between the current embedding and the center ${ \mathrm { m e a n } } ( c )$ of a cluster $c$ is less than the threshold, we assign this embedding to the cluster with the smallest distance and update its center with the mean value of all embeddings belonging to this cluster. If the distance between the current embedding and the center of any cluster is larger than the threshold, we create a new cluster and this embedding is assigned to this new cluster.
|
| 324 |
+
|
| 325 |
+
# Algorithm 2 Observation Embedding Clustering
|
| 326 |
+
|
| 327 |
+
<table><tr><td>Initialize parameter θc for context embedding projector if applicable (which is not trainable) Initialize thresholdT for clustering Initialize clusters set C←@</td></tr><tr><td>for each observation s do DGet embedding of the observation from the random projection</td></tr><tr><td>U←fθ(s)</td></tr><tr><td>DFind a cluster to which the current embedding fits,if any Find a cluster c ∈ C with smallest |lmean(c) - vll ≤ T,or NIL if there is no such</td></tr><tr><td>if c≠NIL then</td></tr><tr><td>c↑cUv else</td></tr><tr><td>Dif there's no existing cluster that v should be assigned to,create a new one</td></tr><tr><td>C↑Cu{u}</td></tr><tr><td>end if</td></tr><tr><td>end for</td></tr><tr><td></td></tr><tr><td></td></tr></table>
|
| 328 |
+
|
| 329 |
+
In Figure 7, we also show the samples of observation in each cluster. We could see observations from the same room are assigned to the same cluster and different clusters correspond to different rooms.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
|
| 333 |
+

|
| 334 |
+
Figure 7: Sample of clustering results for VENTURE, HERO, PRIVATEEYE, and MONTEZUMA’S REVENGE. Each column is one cluster, and we show 3 random samples assigned into this cluster.
|
| 335 |
+
|
| 336 |
+
# E ABLATION STUDY ON ATTENTIVE DYNAMICS MODEL
|
| 337 |
+
|
| 338 |
+
We conduct a simple ablation study on the learning objectives of ADM, described in Equation (5). We evaluate the performance of ADM when trained on the same trajectory data under different combinations of loss terms, simulating batches of on-policy transition data to be replayed. The sample trajectory was obtained from an instance of $\mathbf { A } 2 \mathbf { C } + \mathbf { C } \mathbf { o } \mathbf { E } \mathbf { X } + \mathbf { R } \mathbf { A } \mathbf { M }$ and kept same across all the runs, which allows a fair comparison between different variants. We compare the following four methods:
|
| 339 |
+
|
| 340 |
+
• ADM (action) : train ADM using $\mathcal { L } _ { \mathrm { a c t i o n } }$ only • ADM (action, cell) : train ADM using $\mathcal { L } _ { \mathrm { a c t i o n } }$ and $\mathcal { L } _ { \mathrm { c e l l } }$ • ADM (action, ent) : train ADM using $\mathcal { L } _ { \mathrm { a c t i o n } }$ and $\mathcal { L } _ { \mathrm { e n t } }$ • ADM (action, cell, ent) $:$ train ADM using all losses $( \mathcal { L } _ { \mathrm { a c t i o n } } , \mathcal { L } _ { \mathrm { c e l l } } , \mathcal { L } _ { \mathrm { e n t } } )$
|
| 341 |
+
|
| 342 |
+
Figure 8 shows the average distance between the ground-truth location of the agent and the predicted one by ADM during the early stages of training. On MONTEZUMA’S REVENGE, there is only little difference between the variants although the full model worked slightly better on average. On FREEWAY, the effect of loss terms is more clear; in the beginning the agent tends to behave suboptimally by taking mostly single actions only (UP out of three action choices — UP, DOWN, and NO-OP), hence very low entropy $\mathcal { H } ( \pi ( \cdot | s ) )$ , which can confuse the ADM of telling which part is actually controllable as the action classifier would give correct answer regardless of attention. We can observe additional loss terms help the model quickly correct the attention to localize the controllable object among the uncontrollable clutters with better stability.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 8: Performance of ADM in terms of mean distance under different loss combinations in early stages, trained using the same online trajectory data. Plots were obtained by averaging runs over 5 random seeds.
|
| 346 |
+
|
| 347 |
+
In another ablation study, we compare the end performance of the $_ { \mathrm { A 2 C + C o E X } }$ agent with the ADM jointly trained under different loss objectives on these three games (MONTEZUMA’S REVENGE, FREEWAY and SEAQUEST). In our experiments, the variant with full ADM worked best on MONTEZUMA’S REVENGE and FREEWAY. The minimal training objective of ADM (i.e., $\mathcal { L } _ { \mathrm { a c t i o n } } )$ also solely works reasonably well, but with the combination of other loss terms we can attain a more stable performance.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 9: Learning curves of $_ { \mathrm { A 2 C + C o E X } }$ with ADM trained under different training objectives. The curve in solid line shows the mean episode over 40 recent episodes, averaged over 3 random seeds.
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 10: Learning curves for the ablation study of state representation. The exploration algorithm without the contingent region information (purple) performs significantly worse, yielding almost no improvement on hard-exploration games such as MONTEZUMA’S REVENGE, VENTURE, and FROSTBITE. The mean curve is obtained by averaging over 3 random seeds. See Table 6 for numbers.
|
| 354 |
+
|
| 355 |
+
<table><tr><td>Method</td><td>Freeway</td><td>Frostbite</td><td>Hero</td><td>Montezuma</td><td>PrivateEye</td><td>Qbert</td><td>Seaquest</td><td> Venture</td></tr><tr><td>A2C</td><td>7.2</td><td>1099</td><td>34352</td><td>12.5</td><td>574</td><td>19620</td><td>2401</td><td>0</td></tr><tr><td>A2C+CoEX (c)</td><td>10.7</td><td>1313</td><td>34269</td><td>14.7</td><td>2692</td><td>20942</td><td>1810</td><td>94</td></tr><tr><td>A2C+CoEX (c,R)</td><td>34.0</td><td>941</td><td>34046</td><td>9.2</td><td>5458</td><td>21587</td><td>2056</td><td>77</td></tr><tr><td>A2C+CoEX(x,y,c)</td><td>33.7</td><td>5066</td><td>36934</td><td>6558</td><td>5377</td><td>21130</td><td>1978</td><td>1374</td></tr><tr><td>A2C+CoEX (x, y,c, R)</td><td>34.0</td><td>4260</td><td>36827</td><td>6635</td><td>5316</td><td>23962</td><td>5169</td><td>204</td></tr></table>
|
| 356 |
+
|
| 357 |
+
Table 6: Summary of the results of the ablation study of the state representation. We report the maximum mean score (averaged over 40 recent episodes) achieved over 100M environment steps, averaged over 3 random seeds.
|
| 358 |
+
|
| 359 |
+
# F ABLATION STUDY ON THE STATE REPRESENTATION
|
| 360 |
+
|
| 361 |
+
We present a result of additional ablation study on the state representation $\psi ( s )$ used in count-based exploration. The following baselines are considered:
|
| 362 |
+
|
| 363 |
+
• $_ { Ḋ } \mathrm { A } 2 \mathrm { C } \mathrm { + } \mathrm { C o E X } ( c )$ : Uses only the context embedding for exploration, i.e., $\psi ( s ) = ( c )$ . • $\mathbf { A } 2 \mathbf { C } \mathbf { + } \mathbf { C o E X } ( c , R )$ : Uses only the context embedding and the cumulative reward for exploration without contingent region information, i.e., $\boldsymbol { \psi } ( s ) = \ : \mathbf { \bar { ( } } c , R )$ . • $\mathbf { A } 2 \mathbf { C } + \mathbf { C o E X } ( x , y , c )$ : Uses the contingent region information $( x , y )$ as well as the context embedding $c$ , however without the cumulative reward component, i.e., $\psi ( s ) = ( x , y , c )$ .
|
| 364 |
+
|
| 365 |
+
One can also consider another baseline similar to $\mathbf { A } 2 \mathbf { C } \mathbf { + } \mathbf { C o E X } ( c , R )$ with $\psi ( s ) = ( x , y , c , R )$ , where the location information $( x , y )$ is replaced with random coordinates uniformly sampled from the grid. It ablates the learned contingent regions. However, we found that it performs similarly to the presented $\mathbf { A } 2 \mathbf { C } \substack { + } \mathbf { C o E X } ( c , R )$ baseline.
|
| 366 |
+
|
| 367 |
+
The experimental results are summarized in Table 6 and Figure 10. The variants without contingent regions (i.e., $_ { \mathrm { A 2 C + C o E X } ( c ) }$ and $\mathbf { A } 2 \mathbf { C } \substack { + } \mathbf { C o E X } ( c , R )$ performed significantly worse in most of the games than $\mathrm { A } 2 \mathrm { C } + \mathrm { C o E X } ( x , y , c )$ and $\mathsf { A 2 C + C o E X } ( x , y , c , R )$ giving little improvement over the A2C baseline. Most notably, in the games with the hardest exploration such as MONTEZUMA’S REVENGE and VENTURE, the performance is hardly better than the vanilla A2C or a random policy, achieving a score as low as zero. The variants with contingent region information worked best and comparable to each other. We observe that using the cumulative reward (total score) for exploration gives a slight improvement on some environments. These results support the effectiveness of the learned contingency-awareness information in count-based exploration.
|
md/train/PbEHqvFtcS/PbEHqvFtcS.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/PmVfnB0nkqr/PmVfnB0nkqr.md
ADDED
|
@@ -0,0 +1,607 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AUTONOMOUS LEARNING OF OBJECT-CENTRIC ABSTRACTIONS FOR HIGH-LEVEL PLANNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a method for autonomously learning an object-centric representation of a continuous and high-dimensional environment that is suitable for planning. Such representations can immediately be transferred between tasks that share the same types of objects, resulting in agents that require fewer samples to learn a model of a new task. We first demonstrate our approach on a simple domain where the agent learns a compact, lifted representation that generalises across objects. We then apply it to a series of Minecraft tasks to learn object-centric representations, including object types—directly from pixel data—that can be leveraged to solve new tasks quickly. The resulting learned representations enable the use of a tasklevel planner, resulting in an agent capable of forming complex, long-term plans with considerably fewer environment interactions.1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Model-based methods are a promising approach to improving sample efficiency in reinforcement learning. However, they require the agent to either learn a highly detailed model—which is infeasible for sufficiently complex problems (Ho et al., 2019)—or to build a compact, high-level model that abstracts away unimportant details while retaining only the information required to plan. This raises the question of how best to build such an abstract model. Fortunately, recent work has shown how to learn an abstraction of a task that is provably suitable for planning with a given set of skills (Konidaris et al., 2018). However, these representations are highly task-specific and must be relearned for any new task, or even any small change to an existing task. This makes them fatally impractical, especially for agents that must solve multiple complex tasks.
|
| 12 |
+
|
| 13 |
+
We extend these methods by incorporating additional structure—namely, that the world consists of objects, and that similar objects are common amongst tasks. This can substantially improve learning efficiency, because an object-centric model can be reused wherever that same object appears (within the same task, or across different tasks) and can also be generalised across objects that behave similarly—object types. We assume that the agent is able to individuate the objects in its environment, and propose a framework for building portable object-centric abstractions given only the data collected by executing high-level skills. These abstractions specify both the abstract object attributes that support high-level planning, and an object-relative lifted transition model that can be instantiated in a new task. This reduces the number of samples required to learn a new task by allowing the agent to avoid relearning the dynamics of previously seen object types.
|
| 14 |
+
|
| 15 |
+
We make the following contributions: under the assumption that the agent can individuate objects in its environment, we develop a framework for building portable, object-centric abstractions, and for estimating object types, given only the data collected by executing high-level skills. We also show how to integrate problem-specific information to instantiate these representations in a new task. This reduces the samples required to learn a new task by allowing the agent to avoid relearning the dynamics of previously-seen objects.
|
| 16 |
+
|
| 17 |
+
We demonstrate our approach on a Blocks World domain, and then apply it to a series of Minecraft tasks where an agent autonomously learns an abstract representation of a high-dimensional task from raw pixel input. In particular, we use the probabilistic planning domain definition language (PPDDL) (Younes & Littman, 2004) to represent our learned abstraction, which allows for the use of existing task-level planners. Our results show that an agent can leverage these portable abstractions to learn a representation of new Minecraft tasks using a diminishing number of samples, allowing it to quickly construct plans consisting of hundreds of low-level actions.
|
| 18 |
+
|
| 19 |
+
# 2 BACKGROUND
|
| 20 |
+
|
| 21 |
+
We assume that tasks are modelled as semi-Markov decision processes ${ \mathcal { M } } = \langle { \mathcal { S } } , { \mathcal { O } } , { \mathcal { T } } , { \mathcal { R } } \rangle$ where (i) $s$ is the state space; (ii) $\mathcal { O } ( s )$ is the set of temporally-extended actions known as options available at state $s$ ; (iii) $\tau$ describes the transition dynamics, specifying the probability of arriving in state $s ^ { \prime }$ after option $o$ is executed from $s$ ; and (iv) $\mathcal { R }$ specifies the reward for reaching state $s ^ { \prime }$ after executing option $o$ in state $s$ . An option $o$ is defined by the tuple $\left. I _ { o } , \pi _ { o } ; \beta _ { o } \right.$ , where $I _ { o }$ is the initiation set that specifies the states in which the option can be executed, $\pi _ { o }$ is the option policy which specifies the action to execute, and $\beta _ { o }$ specifies the probability of the option terminating execution in each state (Sutton et al., 1999).
|
| 22 |
+
|
| 23 |
+
We adopt the object-centric formulation from Ugur & Piater (2015): in a task with $n$ objects, the state is represented by the set $\left\{ \mathbf { f } _ { a } , \mathbf { f } _ { 1 } , \mathbf { f } _ { 2 } , \ldots . . . , \mathbf { f } _ { n } \right\}$ , where ${ \bf f } _ { a }$ is a vector of the agent’s features and $\mathbf { f } _ { i }$ is a vector of features particular to object $i$ . Note that the feature vector describing each object can itself be arbitrarily complex, such as an image or voxel grid—in this work we use pixels.
|
| 24 |
+
|
| 25 |
+
Our state space representation assumes that individual objects have already been factored into their constituent low-level attributes. Practically, this means that the agent is aware that the world consists of objects, but is unaware of what the objects are, or if there are multiple instantiations of the same object present. It is also easy to see that different tasks will likely have differing numbers of objects with potentially arbitrary ordering; any learned abstract representation should be agnostic to this.
|
| 26 |
+
|
| 27 |
+
# 2.1 STATE ABSTRACTIONS FOR PLANNING
|
| 28 |
+
|
| 29 |
+
We intend to learn an abstract representation suitable for planning. Prior work has shown that a sound and complete abstract representation must necessarily be able to estimate the set of initiating and terminating states for each option (Konidaris et al., 2018). In classical planning, this corresponds to the precondition and effect of each high-level action operator (McDermott et al., 1998).
|
| 30 |
+
|
| 31 |
+
The precondition is defined as ${ \mathrm { P r e } } ( o ) = { \mathrm { P r } } ( s \in I _ { o } )$ , which is a probabilistic classifier that expresses the probability that option $o$ can be executed at state $s$ . Similarly, the effect or image represents the distribution of states an agent may find itself in after executing $o$ from states drawn from distribution $Z$ (Konidaris et al., 2018): $\begin{array} { r } { \mathrm { I m } ( Z , o ) = \frac { 1 } { G } \int _ { \cal S } \mathrm { P r } ( s ^ { \prime } \mid s , \breve { o } ) Z ( s ) \mathrm { P r } ( s \in I _ { o } ) d s , } \end{array}$ , where $\begin{array} { r } { G = \int _ { \mathcal { S } } Z ( s ) \mathrm { P r } ( s \in I _ { o } ) } \end{array}$ . Since the precondition is a probabilistic classifier and the effect is a probabilistic density estimator, they can be learned directly from option execution data.
|
| 32 |
+
|
| 33 |
+
We can use preconditions and effects to evaluate the probability of a sequence of options—a plan— executing successfully. Given an initial state distribution, the precondition is used to evaluate the probability that the first option can execute, and the effects are used to determine the resulting state distribution. We can apply the same logic to the subsequent options to compute the probability of the entire plan executing successfully. It follows that these representations are sufficient for evaluating the probability of successfully executing any plan (Konidaris et al., 2018).
|
| 34 |
+
|
| 35 |
+
Partitioned Options For large or continuous state spaces, estimating $\operatorname* { P r } ( s ^ { \prime } \mid s , o )$ is difficult because the worst case requires learning a distribution conditioned on every state. However, if we assume that terminating states are independent of starting states, we can make the simplification $\operatorname* { P r } ( s ^ { \prime } \mid s , o ) = \operatorname* { P r } ( s ^ { \prime } \mid \mathbf { \bar { \phi } } o )$ . These subgoal options (Precup, 2000) are not overly restrictive, since they refer to options that drive an agent to some set of states with high reliability. Nonetheless, many options are not subgoal. It is often possible, however, to partition an option’s initiation set into a finite number of subsets, so that it is approximately subgoal when executed from any of the individual subsets. That is, we partition an option $o$ ’s start states into finite regions $\mathcal { C }$ such that $\operatorname* { P r } ( s ^ { \prime } \mid s , o , c ) \approx \operatorname* { P r } ( s ^ { \prime } \mid o , c ) , \bar { c } \in \mathcal { C }$ (Konidaris et al., 2018). As in prior work (Andersen $\&$ Konidaris, 2017; Konidaris et al., 2018; Ames et al., 2018), we achieve this in practice by clustering options based on their terminating states.
|
| 36 |
+
|
| 37 |
+
Factors We adopt the frame assumption, which states that aspects of the world not explicitly affected by an agent’s action remain the same (Pasula et al., 2004). Prior work leverages this to learn a factored or STRIPS-like (Fikes & Nilsson, 1971) representation by computing the option’s mask: the state variables explicitly changed by the option (Konidaris et al., 2018). In our formulation, the state space is already factorised into objects, so computing the mask amounts to determining which objects are affected by a given option.
|
| 38 |
+
|
| 39 |
+
# 3 LEARNING PORTABLE OBJECT-CENTRIC REPRESENTATIONS
|
| 40 |
+
|
| 41 |
+
Although prior work (Konidaris et al., 2018) allows an agent to autonomously learn an abstract representation supporting fast task-level planning, that representation lacks generalisability—since the symbols are distributions over states in the current task, they cannot be reused in new ones. This approach can be fatally expensive in complex domains, where learning an abstract model may be as hard as solving a task from scratch, and is therefore pointless if we only want to solve a single task. However, an agent able to reuse aspects of its learned representation can amortise the cost of learning over many interactions, accelerating learning in later tasks. The key question is what forms of representation support transfer in this way.
|
| 42 |
+
|
| 43 |
+
One approach is to assume that the world consists of objects, and that similar objects are shared across tasks. Approaches like object-oriented MDPs (Diuk et al., 2008) exploit the presence of objects by providing the agent with an object-oriented representation, resulting in compact representations that are transferable between tasks sharing the same object classes and dynamics (Guestrin et al., 2003; Diuk et al., 2008; Marom & Rosman, 2018). Similarly, the classical planning literature has long represented problems in terms of the objects that constitute a domain, and operators that can affect their states (McDermott et al., 1998). In both cases, however, the question arises as to the most appropriate way of building an object-oriented representation of a problem, especially one experienced by the agent at the pixel level. This includes deciding which attributes should be chosen to characterise a particular type, as well as which objects should belong to each type.
|
| 44 |
+
|
| 45 |
+
We now introduce an object-centric generalisation of a learned symbolic representation that admits transfer in tasks when the state space representation consists of features centred on objects in the environment. This is common in robotics, where each object is often isolated from the environment and represented as a point cloud or subsequently a voxelised occupancy grid. We summarise our proposed approach in Figure 1 and the remainder of this section, and provide a detailed pseudocode description in Appendix F.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: Learning lifted representations from data. Red nodes represent problem-specific representations, while green nodes are abstractions that can be transferred between tasks.
|
| 49 |
+
|
| 50 |
+
3.1 GENERATING A PROPOSITIONAL MODEL (STEPS 1–2) (AS IN KONIDARIS ET AL., 2018)
|
| 51 |
+
|
| 52 |
+
The agent begins by executing options using an exploration policy to collect transition data. The first step is to partition the options into approximately subgoal options. For each option $o$ and empirical sets of initial and terminating states $\mathit { \tilde { I } _ { o } }$ and $\tilde { \beta } _ { o }$ , the agent partitions $I _ { o }$ into subsets $K \subseteq \tilde { I } _ { o }$ such that $\mathrm { P r } ( s ^ { \prime } \mid s _ { i } , o ) = \mathrm { P r } ( s ^ { \prime } \mid s _ { j } , o ) \forall s _ { i }$ , $s _ { j } \in K , s ^ { \prime } \in \bar { \tilde { \beta } } _ { o }$ . In practice, this can be achieved by first clustering state transition samples based on terminating states, and then assigning each cluster to a partition. Finally, pairs of partitions whose initiating states overlap are merged to handle probabilistic effects.
|
| 53 |
+
|
| 54 |
+
The agent next learns a precondition classifier for each approximately partitioned option. Partitions’ initiating states are used as positive examples, and all other states as negative ones. A feature selection procedure determines which objects are relevant to the precondition, and a classifier is fit using only those objects. A density estimator is then used to estimate the effect distribution for each partitioned option. The agent learns distributions over only the objects affected by the option, learning one estimator per object. Together these state distributions form our propositional PPDDL vocabulary $\nu$ .
|
| 55 |
+
|
| 56 |
+
For each partitioned option $o$ , the agent has learned a precondition classifier $\hat { I _ { o } }$ and effect estimator $\hat { \beta } _ { o }$ . However, to construct a PPDDL representation, both the precondition and effects must be specified in terms of state distributions (propositions) only. Effects are modelled as such, and so pose no problem, but the learned precondition is a classifier rather than a state distribution. The agent must therefore iterate through all possible effect distributions to compute whether the skill can be executed there. This is achieved by replacing $o$ ’s precondition classifier with every ${ \mathcal { P } } \in { \mathcal { C } } ( \nu )$ such that $\begin{array} { r } { \int _ { \mathcal { S } } \hat { I } _ { o } ( s ) \mathcal { G } ( s ) d s > 0 , \mathcal { G } = \prod _ { p \in \mathcal { P } } p , } \end{array}$ , where $\wp ( \nu )$ denotes the powerset of $\nu$ . In other words, the agent considers every combination of effect state distributions and draws samples from their conjunction. If these samples are classified as positive by $\hat { I _ { o } }$ , then the conjunction $\mathcal { P }$ is used to represent the precondition. The preconditions and effects are now specified using distributions over state variables, where each distribution is a proposition. We have now learned a PPDDL representation, which is sound and suitable for planning.
|
| 57 |
+
|
| 58 |
+
# 3.2 GENERATING A LIFTED, TYPED MODEL (STEPS 3–4)
|
| 59 |
+
|
| 60 |
+
At this point, the agent has learned an abstract, but task-specific, representation. Unfortunately, there is no opportunity for transfer (both within the task and between different tasks), because each object is treated as unique. To overcome this, we now propose a method for determining object types.
|
| 61 |
+
|
| 62 |
+
Definition 1. Assume that option $o$ has been partitioned into $n$ subgoal options $o ( 1 ) , \ldots , o ( n )$ . Object $i$ ’s profile under option $o$ is denoted by
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r } { \mathrm { P r o f l l e } ( i , o ) = \big \{ \{ \mathrm { P r e } _ { i } ^ { o ( 1 ) } , \mathcal { E } _ { i } ^ { o ( 1 ) } \} , \dots , \{ \mathrm { P r e } _ { i } ^ { o ( n ) } , \mathcal { E } _ { i } ^ { o ( n ) } \} \big \} , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $\mathrm { P r e } _ { i } ^ { o ( k ) }$ is the distribution over object $i$ ’s states present in the precondition for partition $k$ , and $\mathcal { E } _ { i } ^ { o ( k ) }$ is object ’s effect distribution.2
|
| 69 |
+
|
| 70 |
+
Definition 2. Two objects $i$ and $j$ are option-equivalent if, for a given option $o$ , Profile $( i , o ) =$ Profile $( j , o )$ . Furthermore, two objects are equivalent if they are option-equivalent for every $o$ in $\mathcal { O }$ .
|
| 71 |
+
|
| 72 |
+
The above definition implies that objects are equivalent if one object can be substituted for another while preserving every operator’s abstract preconditions and effects. Such objects can be grouped into the same object type, since they are functionally indistinguishable for the purposes of planning. In practice, however, we can use a weaker condition to construct object types. Since an object-centric skill will usually modify only the object being acted upon, and because we have subgoal options that do not depend on the initial state, we can take a similar approach to Ugur & Piater (2015) and group objects by effects only:
|
| 73 |
+
|
| 74 |
+
Definition 3. Assume that option $o$ has been partitioned into $n$ subgoal options. Object $i$ ’s effect profile under option $o$ is denoted by
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { \operatorname { E f f e c t P r o f i l e } ( i , o ) = \{ \mathcal { E } _ { i } ^ { o ( 1 ) } , \dots , \mathcal { E } _ { i } ^ { o ( n ) } \} , } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\mathcal { E } _ { i } ^ { o ( k ) }$ is object $i$ ’s effect distribution. Two objects $i$ and $j$ are effect-equivalent if EffectProfile $( i , o ) = \mathrm { E f f e c t P r o f i l e } ( j , o )$ for every $o$ in $\mathcal { O }$ .
|
| 81 |
+
|
| 82 |
+
By computing effect profiles using the propositional representation, the agent can determine whether objects $i$ and $j$ are similar (using an appropriate measure of distribution similarity) and, if so, merge them into the same object type. Propositions representing distributions over individual objects can now be replaced with predicates that are parameterised by types. For example, if there are four doors in a domain, then the agent can replace four propositions representing each door closed with a single ClosedDoor predicate parameterised by an object of type door.
|
| 83 |
+
|
| 84 |
+
# 3.3 PROBLEM-SPECIFIC INSTANTIATION (STEP 5)
|
| 85 |
+
|
| 86 |
+
If the task dynamics are completely described by the state of each object, as is the case in objectoriented MDPs (Diuk et al., 2008), then our typed representation is sufficient for planning. However, in many domains the object-centric state space is not Markov. For example, in a task where only a particular key opens a particular door, the state of the objects alone is insufficient to describe dynamics—the identities of the key and door are necessary too. A common strategy in this case is to augment an ego- or object-centric state space with problem-specific, allocentric information to preserve the Markov property (Konidaris et al., 2012; James et al., 2020). We denote $\mathcal { X }$ as the space of problem-specific state variables. $s$ remains the original object-centric state space. The above complication does not negate the benefit of learning transferable abstract representations, as our existing operators learned in $s$ can be augmented with propositions over $\mathcal { X }$ on a per-task basis. In general, local information relative to individual objects will transfer between tasks, but problem-specific information, such as an object’s global location, must be relearned each time.
|
| 87 |
+
|
| 88 |
+
For each partitioned option $o$ with sets of start and end states $I _ { o } , \beta _ { o } \subseteq { \mathcal { S } } \times { \mathcal { X } }$ , the agent re-partitions $I _ { o }$ such that $\operatorname* { P r } ( x ^ { \prime } \mid x _ { i } , o ) = \operatorname* { P r } ( x ^ { \prime } \mid x _ { j } , o ) \forall x _ { i } , x _ { j } \in \kappa , ( \cdot , x ^ { \prime } ) \in \beta _ { o }$ for $\kappa \subseteq I _ { o }$ . This forms partitioned subgoal options in both $s$ and $\mathcal { X }$ . Denoting $\lambda \subseteq { \mathcal { X } }$ as the set of end states after re-partitioning, the agent can ground the operator by appending $\kappa$ to the precondition and $\lambda$ to the effect (if it differs from $\kappa$ ), where $\kappa$ and $\lambda$ are treated as problem-specific propositions. Finally, these problem-specific propositions must be linked with the grounded objects being acted upon. The agent therefore adds a precondition predicate conditioned on the identity of the grounded objects (see Appendix $\mathbf { G }$ for examples).
|
| 89 |
+
|
| 90 |
+
# 4 EXPERIMENTS
|
| 91 |
+
|
| 92 |
+
We first demonstrate our framework on the classic Blocks World domain (Section 4.1). While the high-level operators and predicates describing the domain are usually given, we show how such a representation can be learned autonomously from scratch. We then demonstrate that our method scales to significantly harder problems by applying it to a high-dimensional Minecraft task (Section 4.2). Finally, we investigate the transferability of the learned abstractions by transferring them to additional procedurally-generated Minecraft tasks (Section 4.3). Owing to space constraints, we defer the exact implementation and domain details to the appendix.
|
| 93 |
+
|
| 94 |
+
# 4.1 LEARNING A REPRESENTATION OF BLOCKS WORLD
|
| 95 |
+
|
| 96 |
+
The Blocks World domain consists of a number of blocks which can be stacked on top of one another by an agent (hand). The agent possesses options that allow it to pick up a block (Pick), put a block back on the table (Put), and stack one block on another (Stack). Blocks cannot be picked up if they are covered or if the hand is occupied, and can only be put down or stacked if already gripped. We consider the task consisting of three blocks A, B and C, where each block is described by whether there is nothing, another block, or a table directly above or below it. This representation allows us to determine whether a given block is on a table, on another block, or grasped in the hand, and similarly whether another block has been stacked upon it. The hand is characterised by a single boolean indicating whether it is holding a block. Thus a state is described by $\{ \mathbf { f } _ { H } , \mathbf { f } _ { A } , \mathbf { f } _ { B } , \mathbf { f } _ { C } \}$ , corresponding to the hand and blocks’ features respectively. Note that the agent is initially unaware that the blocks are functionally identical and can be treated interchangeably.
|
| 97 |
+
|
| 98 |
+
Generating a Propositional Model (Steps 1–2) Using the approach outlined in Section 3.1, the agent partitions the options using transition data collected from the environment. This results in a total of 15 partitions of the Pick option, 3 partitions of the Put option, and 12 partitions of the Stack option.3 It then fits a classifier to each partition’s initiation states, and a density estimator to its terminating states. Finally, the agent generates a propositional PDDL using these learned preconditions and effects. Figure 2 illustrates a learned propositional operator, while the full PDDL, learned entirely from data, is provided in Appendix B.
|
| 99 |
+
|
| 100 |
+
Generating a Lifted Typed Model (Steps 3–4) Using the effects from the propositional representation, the agent determines that objects A, B and C all possess the same effect profiles for all options and so can be grouped into a single type, while the hand belongs to its own type. The agent can now lift its representation by replacing the learned propositions with predicates parameterised by
|
| 101 |
+
|
| 102 |
+
(:action Pick-partition-10
|
| 103 |
+
:parameters()
|
| 104 |
+
:precondition (and (symbol_10) (symbol_15) (symbol_6))
|
| 105 |
+
:effect (and (symbol_3) (symbol_4) (symbol_1) (not symbol_6) (not symbol_10) (not symbol_15))
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 2: The learned propositional operator for a Pick action describing picking B off C. In order to execute the action, the hand must be empty (symbol 10), C must be on the table and covered by a block (symbol 15), and B must be on top of a block and uncovered (symbol 6). After execution, B is in the hand (symbol 3), C is on the table and clear (symbol 4), and the hand is full (symbol 1). We visualise the symbols by sampling from the propositional symbol, and randomly sampling the remaining independent state variables (since each symbol is a distribution over a subset of state variables). The transparency is due to the averaging over the independent state variables. Note that we must learn one operator for every pair of blocks.
|
| 109 |
+
|
| 110 |
+
(g) Propositional PDDL operator for one of the Pick option partitions.
|
| 111 |
+
|
| 112 |
+
the above types. For example, after generating the model, there are three propositions: AOnTable, BOnTable, and COnTable. Since these are distributions over objects determined to be the same type, the agent can replace them all with a single predicate OnTable(X), which accepts block objects. As a result, the agent can reduce the number of operators from 30 to 6, resulting in a more compact representation with a smaller branching factor. Figure 3 illustrates how the propositional operator in Figure 2 has been lifted to describe picking any block X off any block Y.
|
| 113 |
+
|
| 114 |
+
The number of learned operators is a function of the number of blocks in the domain. Since the propositional approach treats each block as its own unique object, it must learn the dynamics and interaction of each new block it encounters. For $n$ blocks, this requires $O ( n ^ { 2 } )$ operators. However, once the agent has learned the object types and constructed predicates based on these, it needs at most 6 operators to represent the dynamics for any number of blocks. See Appendix C for the full parameterised PDDL.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 3: The learned lifted operator for a Pick action describing picking a block off another. In order to pick up block Y, it must be on block X which itself is on the table, and the hand must be empty. As a result, the hand is not empty, Y is now in the hand, and X is on the table and clear. $\tt t y p e 0$ refers to the “hand” type, while $\tt t y p e 1$ refers to the “block” type.
|
| 118 |
+
|
| 119 |
+
# 4.2 LEARNING A REPRESENTATION OF A MINECRAFT TASK
|
| 120 |
+
|
| 121 |
+
In the above example, objects were represented using pre-specified features and were sufficient to describe the environment dynamics. However, our approach is capable of scaling beyond this simple case and learning these features from pixels. We now demonstrate this in a complex Minecraft task (Johnson et al., 2016) consisting of five rooms with various items positioned throughout. Rooms are connected with either regular doors which can be opened by direct interaction, or puzzle doors which require the agent to pull a lever to open. The world is described by the state of each of the objects (given directly by each object’s appearance as a $6 0 0 \times 8 0 0$ RGB image), the agent’s view, and current inventory. To simplify learning, we compress the state space by downscaling images and applying PCA (Pearson, 1901) to a greyscaled version, preserving the top 40 principal components.
|
| 122 |
+
|
| 123 |
+
The agent is given high-level skills, such as ToggleDoor and WalkToItem. Execution is stochastic—opening doors occasionally fails, and the navigation skills are noisy in their execution. To solve the task, an agent must first collect the pickaxe, use it to break the gold and redstone blocks and collect the resulting items. It must then navigate to the crafting table, where it uses the collected items to first craft gold ingots and subsequently a clock. Finally, it must navigate to the chest and open it to complete the task. This requires a long-horizon, hierarchical plan—the shortest plan that solves the task consists of 28 options consisting of hundreds of low-level continuous actions.
|
| 124 |
+
|
| 125 |
+
Generating a Propositional Model (Steps 1–2) As previously, the agent begins by learning a model using the method outlined in Section 3.1 and in prior work (Konidaris et al., 2018; Ames et al., 2018). The agent partitions options using DBSCAN (Ester et al., 1996) to cluster option data based on terminating states. For each partitioned option, it then fits an SVM (Cortes & Vapnik, 1995) with Platt scaling (Platt, 1999) to estimate the preconditions, and a kernel density estimator (Rosenblatt, 1956) for effects, which are then used to construct the propositional PPDDL.
|
| 126 |
+
|
| 127 |
+
Generating a Lifted, Typed Model (Steps 3–4) Using the effects from the propositional representation, the agent next groups objects into types based on their effect profiles. This is made easier because certain objects do not undergo effects under certain options. For example, the chest cannot be toggled, while a door can, and thus it is immediately clear that they are not of the same type. Having determined the types, the agent replaces all similar propositions (where similarity is measured using the KL-divergence) with a single predicate parameterised by an object of that type.
|
| 128 |
+
|
| 129 |
+
Problem-Specific Instantiation (Step 5) The agent now has a representation whose operators can be transferred between tasks. However, unlike Blocks World, a complication arises because the object-centric state space is not Markov. For example, a state where all the doors are closed and the agent is in front of the first door is indistinguishable from a state where the agent is in front of the second door. As described in Section 3.3, the agent must ground the representations in the current task by incorporating additional problem-specific state variables to preserve the Markov property. These state variables are fixed across the family of MDPs; in this case, they are the agent’s $x y z$ -location.
|
| 130 |
+
|
| 131 |
+
For each partitioned option, the agent again uses DBSCAN to cluster end states $\mathcal { X }$ to form partitioned subgoal options in both $s$ and $\mathcal { X }$ . Each of these clusters in $\mathcal { X }$ is a problem-specific proposition, which can be added to the learned operators to ground the problem. In Figure 4, we illustrate a learned operator for opening a particular door, where the problem-specific symbol has been tied to the door being opened in this manner. Without modifying the operator’s parameter, it would be possible to open any door at that location. The final plan discovered by the agent is illustrated by Figure 5.
|
| 132 |
+
|
| 133 |
+
# 4.3 INTER-TASK TRANSFER IN MINECRAFT
|
| 134 |
+
|
| 135 |
+
We next investigate transferring operators between five procedurally-generated tasks, where each task differs in the location of the objects and doors; the agent cannot thus simply use a plan found in one task to solve another. For a given task, the agent transfers all operators learned from previous tasks, and continues to collect samples using uniform random exploration until it produces a model which predicts that the optimal plan can be executed. Figure 6a shows the operators transferred between tasks, while Figure 6b shows the number of interactions required to learn a model in a new task.
|
| 136 |
+
|
| 137 |
+
The minimum number of samples required to learn a model for a new task is bounded by the exploration strategy, since we must discover all problem-specific symbols to complete the model. Figure 6b shows that the number of samples required to learn a model decreases over time towards this lower bound. Inter-task transfer could be further improved by leveraging the agent’s existing knowledge to perform non-uniform exploration, but we leave this to future work.
|
| 138 |
+
|
| 139 |
+
(:action Toggle-Door-partition-1a
|
| 140 |
+
:parameters (?w - type0 ?x - type1)
|
| 141 |
+
:precondition (and (notfailed) (symbol_37 ?w) (symbol_9 ?x) (= (id ?x) 1) (psymbol_24))
|
| 142 |
+
:effect (and (symbol_64 ?x) (symbol_65 ?w) (not (symbol_9 ?x)) (not (symbol_37 ?w)))
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 4: Our approach learns that, in order to open a particular door, the agent must be standing in front of a closed door (symbol 37) at a particular location (psymbol 24), and the door must be closed (symbol 9). The effect of the skill is that the agent finds itself in front of an open door (symbol 64) and the door is open (symbol 65). type0 and type1 refer to the “agent” and “door” classes, while id is a fluent specifying the identity of the grounded door object, and is linked to the problem-specific symbol underlined in red.
|
| 146 |
+
|
| 147 |
+
(f) A learned typed PDDL operator for one partition of the Toggle-Door option. The predicates underlined in red must be relearned for each new task, while the rest of the operator can be safely transferred.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 5: Path traced by the agent executing different options while solving the first task.
|
| 151 |
+
|
| 152 |
+
(a) Orange bars represent the number of operators that must be learned to produce a sufficiently accurate model to solve the task. Blue bars represent the number of operators transferred between tasks. As the number of tasks increases, the number of new operators that must be learned decreases.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
(b) Number of samples required to learn sufficiently accurate models as a function of the number of tasks encountered. The red line represents the number of samples required to learn all the operators and the instantiation, while the green line accounts for the instantiation phase only.
|
| 156 |
+
|
| 157 |
+
Figure 6: Results of learning and transferring high-level abstractions between tasks. We report the mean and standard deviation averaged over 80 runs with random task orderings.
|
| 158 |
+
|
| 159 |
+
# 5 RELATED WORK AND CONCLUSION
|
| 160 |
+
|
| 161 |
+
There has been work autonomously learning parameterised, transferable representations of skills. Ugur & Piater (2015) learn object-centric PDDL representations for robotic object manipulation tasks. They are able to learn object types which are similar to ours directly from data, but the object features are specified prior to learning, and discrete relations between object properties such as width and height are given. Similarly, certain predicates are manually inserted to generate a sound representation. Asai (2019) learns object-centric abstractions directly from pixels, but it is unclear how to extend the approach to the stochastic setting. Furthermore, the representations lack soundness guarantees, and cannot be transformed into a language that can be used by existing task-level planners. Finney et al. (2002), Pasula et al. (2004) and Zettlemoyer et al. (2005) are able to learn operators that transfer across tasks, but the high-level symbols that constitute the state space are given. James et al. (2020) learn a PPDDL representation for planning using agent-relative and problem-specific data, but the operators are not lifted and there is no notion of objects or types, which limit generalisability.
|
| 162 |
+
|
| 163 |
+
Alternatively, object-oriented MDPs (Diuk et al., 2008) specify the state space as a set of objects belonging to classes with associated attributes. The agent must learn the transition dynamics, which are usually restricted to a small number of effects. We show how to learn an object-centric representation along with the object types, as well as the abstract high-level dynamics model.
|
| 164 |
+
|
| 165 |
+
By contrast, we have shown how to learn the vocabulary and the type system and the model from raw sensory input. Our representations are useful for planning, generalise across objects and can be transferred to new tasks. Although we have injected structure by assuming the existence of objects, this reflects the nature of many environments: fields such as computer vision assume that the world consists of objects, while there is evidence to suggest that infants do the same (Spelke, 1990). This assumption allows us to convert complex, high-dimensional environments to abstract representations that serve as input to task-level planners. Our approach provides an avenue for solving sparse-reward, long-term planning problems—such as the MineRL competition (Guss et al., 2019)—currently beyond the reach of model-free approaches.
|
| 166 |
+
|
| 167 |
+
# REFERENCES
|
| 168 |
+
|
| 169 |
+
B. Ames, A. Thackston, and G.D. Konidaris. Learning symbolic representations for planning with parameterized skills. In Proceedings of the 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems, 2018.
|
| 170 |
+
G. Andersen and G.D. Konidaris. Active exploration for learning symbolic representations. In Advances in Neural Information Processing Systems, pp. 5016–5026, 2017.
|
| 171 |
+
Masataro Asai. Unsupervised grounding of plannable first-order logic representation from images. In Proceedings of the International Conference on Automated Planning and Scheduling, volume 29, pp. 583–591, 2019.
|
| 172 |
+
C. Cortes and V. Vapnik. Support-vector networks. Machine Learning, 20(3):273–297, 1995.
|
| 173 |
+
C. Diuk, A. Cohen, and M.L. Littman. An object-oriented representation for efficient reinforcement learning. In Proceedings of the 25th International Conference on Machine Learning, pp. 240–247, 2008.
|
| 174 |
+
M. Ester, H. Kriegel, J. Sander, and X. Xu. A density-based algorithm for discovering clusters in large spatial databases with noise. In 2nd International Conference on Knowledge Discovery and Data Mining, volume 96, pp. 226–231, 1996.
|
| 175 |
+
R.E. Fikes and N.J. Nilsson. STRIPS: A new approach to the application of theorem proving to problem solving. Artificial Intelligence, 2(3-4):189–208, 1971.
|
| 176 |
+
S. Finney, N.H. Gardiol, L.P. Kaelbling, and T. Oates. The thing that we tried didn’t work very well: deictic representation in reinforcement learning. In Proceedings of the Eighteenth Conference on Uncertainty in Artificial Intelligence, pp. 154–161, 2002.
|
| 177 |
+
C. Guestrin, D. Koller, C. Gearhart, and N. Kanodia. Generalizing plans to new environments in relational MDPs. In Proceedings of the 18th International Joint Conference on Artificial Intelligence, pp. 1003–1010. Morgan Kaufmann Publishers Inc., 2003.
|
| 178 |
+
W. Guss, C. Codel, K. Hofmann, B. Houghton, N. Kuno, S. Milani, S. Mohanty, D. Liebana, R. Salakhutdinov, N. Topin, et al. The MineRL competition on sample efficient reinforcement learning using human priors. arXiv preprint arXiv:1904.10079, 2019.
|
| 179 |
+
Mark K Ho, David Abel, Thomas L Griffiths, and Michael L Littman. The value of abstraction. Current Opinion in Behavioral Sciences, 29:111–116, 2019.
|
| 180 |
+
S. James, B. Rosman, and G.D. Konidaris. Learning to plan with portable symbols. In International Conference on Machine Learning, 2020.
|
| 181 |
+
M. Johnson, K. Hofmann, T. Hutton, and D. Bignell. The Malmo platform for artificial intelligence experimentation. In Proceedings of the 25th International Joint Conference on Artificial Intelligence, pp. 4246–4247, 2016.
|
| 182 |
+
G.D. Konidaris, I. Scheidwasser, and A.G. Barto. Transfer in reinforcement learning via shared features. Journal of Machine Learning Research, 13(May):1333–1371, 2012.
|
| 183 |
+
G.D. Konidaris, L.P. Kaelbling, and T. Lozano-Perez. From skills to symbols: Learning symbolic ´ representations for abstract high-level planning. Journal of Artificial Intelligence Research, 61 (January):215–289, 2018.
|
| 184 |
+
O. Marom and B. Rosman. Zero-shot transfer with deictic object-oriented representation in reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2297–2305, 2018.
|
| 185 |
+
D. McDermott, M. Ghallab, A. Howe, C. Knoblock, A. Ram, M. Veloso, D. Weld, and D. Wilkins. PDDL—the planning domain definition language, 1998.
|
| 186 |
+
H. Pasula, L.S. Zettlemoyer, and L.P. Kaelbling. Learning probabilistic relational planning rules. In Proceedings of the Fourteenth International Conference on Automated Planning and Scheduling, pp. 73–81, 2004.
|
| 187 |
+
K. Pearson. On lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559–572, 1901.
|
| 188 |
+
J. Platt. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in Large Margin Classifiers, 10(3):61–74, 1999.
|
| 189 |
+
D. Precup. Temporal abstraction in reinforcement learning. PhD thesis, University of Massachusetts Amherst, 2000.
|
| 190 |
+
N. Rosenblatt. Remarks on some nonparametric estimates of a density function. The Annals of Mathematical Statistics, pp. 832–837, 1956.
|
| 191 |
+
E. Spelke. Principles of object perception. Cognitive Science, 14(1):29–56, 1990.
|
| 192 |
+
R.S. Sutton, D. Precup, and S. Singh. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112(1-2):181–211, 1999.
|
| 193 |
+
E. Ugur and J. Piater. Bottom-up learning of object categories, action effects and logical rules: from continuous manipulative exploration to symbolic planning. In Proceedings of the 2015 IEEE International Conference on Robotics and Automation, pp. 2627–2633, 2015.
|
| 194 |
+
H.L.S. Younes and M.L. Littman. PPDDL 1.0: An extension to PDDL for expressing planning domains with probabilistic effects. Technical report, 2004.
|
| 195 |
+
L.S. Zettlemoyer, H. Pasula, and L.P. Kaelbling. Learning planning rules in noisy stochastic worlds. In Proceedings of the Twentieth National Conference on Artificial Intelligence, pp. 911–918, 2005.
|
| 196 |
+
|
| 197 |
+
# A ENUMERATING SUBGOAL OPTIONS FOR THE BLOCKS WORLD DOMAIN
|
| 198 |
+
|
| 199 |
+
Given the description of the Blocks World domain in the main text, we must partition the given options (Pick, Put and Stack) so that they adhere to the subgoal condition. When there are three blocks in the environment, we see that there are 30 partitioned options, which are described in the table below
|
| 200 |
+
|
| 201 |
+
Table 1: Descriptions of the different option partitions. The description of start and end states includes only the relevant information.
|
| 202 |
+
|
| 203 |
+
<table><tr><td>Option</td><td># partitions</td><td>Description of start states</td><td>Description of end states</td></tr><tr><td>PickOffTable(X)</td><td>3</td><td>X is on the table, X is clear, and the hand is empty.</td><td>X is grasped in the hand.</td></tr><tr><td>PickOffSingleBlock(X,Y)6</td><td></td><td>X is on block Y which is on the table,X is clear,and the hand is empty.</td><td>X is grasped in the hand and Y is clear and on the table.</td></tr><tr><td>PickOffDoubleBlock(X,Y)6</td><td></td><td>X is on block Y which is on another block, X is clear, and the hand is empty.</td><td>X is grasped in the hand and Y is clear and on another block.</td></tr><tr><td>StackOnSingleBlock(X,Y)6</td><td></td><td>X is in the hand, and Y is clear and on the table.</td><td>X is on block Y which is on the table,and the hand is empty.</td></tr><tr><td>StackOnDoubleBlock(X,Y)6</td><td></td><td>X is in the hand,and Y is clear and on an- other block.</td><td>Xis on block Y which is on another block,and the hand is</td></tr><tr><td>Put (X)</td><td>3</td><td>X is grasped in the hand.</td><td>empty. X is on the table and the hand is empty.</td></tr></table>
|
| 204 |
+
|
| 205 |
+
# B PROPOSITIONAL PDDL DESCRIPTION FOR THE BLOCKS WORLD TASK
|
| 206 |
+
|
| 207 |
+
Below is the automatically generated propositional PDDL description of the Blocks World domain with 3 blocks. In practice, the agent generates this description with arbitrary names for the propositions, but for readability purposes we have manually renamed them to match their semantics.
|
| 208 |
+
|
| 209 |
+
(define (domain BlocksWorld) (:requirements :strips) (:predicates (notfailed) (AInHand) (HandFull) (COnBlock) (BInHand) (COnTable) (AOnTable) (BOnBlock) (AOnBlock) (BOnTable) (CInHand) (HandEmpty) (BOnTable_BCovered) (COnBlock_CCovered) (AOnBlock_ACovered) (BOnBlock_BCovered) (COnTable_CCovered) (AOnTable_ACovered)
|
| 210 |
+
|
| 211 |
+
(:action Pick_0
|
| 212 |
+
:parameters() :precondition (and (HandEmpty) (AOnTable) (notfailed))
|
| 213 |
+
:effect (and (AInHand) (HandFull) (not AOnTable) (not HandEmpty) (not AOnTable) (not HandEmpty))
|
| 214 |
+
)
|
| 215 |
+
(:action Pick_1 :parameters() :precondition (and (HandEmpty) (AOnBlock) (COnBlock_CCovered) (notfailed))
|
| 216 |
+
:effect (and (COnBlock) (AInHand) (HandFull) (not AOnBlock) (not HandEmpty) (not COnBlock_CCovered) (not AOnBlock) (not HandEmpty) (not COnBlock_CCovered))
|
| 217 |
+
)
|
| 218 |
+
(:action Pick_2 :parameters() :precondition (and (HandEmpty) (COnTable_CCovered) (BOnBlock) (notfailed)) :effect (and (BInHand) (COnTable) (HandFull) (not BOnBlock) (not HandEmpty) (not COnTable_CCovered) (not BOnBlock) (not HandEmpty) (not COnTable_CCovered))
|
| 219 |
+
)
|
| 220 |
+
(:action Pick_3 :parameters()
|
| 221 |
+
:precondition (and (HandEmpty) (AOnTable_ACovered) (BOnBlock) (notfailed)) :effect (and (BInHand) (AOnTable) (HandFull) (not BOnBlock) (not HandEmpty) (not AOnTable_ACovered) (not BOnBlock) (not HandEmpty) (not AOnTable_ACovered))
|
| 222 |
+
)
|
| 223 |
+
(:action Pick_4 :parameters() :precondition (and (HandEmpty) (AOnBlock) (BOnBlock_BCovered) (notfailed)) :effect (and (BOnBlock) (AInHand) (HandFull) (not AOnBlock) (not HandEmpty) (not BOnBlock_BCovered) (not AOnBlock) (not HandEmpty) (not BOnBlock_BCovered))
|
| 224 |
+
)
|
| 225 |
+
(:action Pick_5 :parameters() :precondition (and (HandEmpty) (AOnBlock_ACovered) (BOnBlock) (notfailed))
|
| 226 |
+
:effect (and (BInHand) (AOnBlock) (HandFull) (not BOnBlock) (not HandEmpty) (not AOnBlock_ACovered) (not BOnBlock) (not HandEmpty) (not AOnBlock_ACovered))
|
| 227 |
+
)
|
| 228 |
+
(:action Pick_6
|
| 229 |
+
:parameters() :precondition (and (HandEmpty) (AOnBlock) (BOnTable_BCovered) (notfailed))
|
| 230 |
+
:effect (and (BOnTable) (AInHand) (HandFull) (not AOnBlock) (not HandEmpty) (not BOnTable_BCovered) (not AOnBlock) (not HandEmpty) (not BOnTable_BCovered))
|
| 231 |
+
)
|
| 232 |
+
(:action Pick_7 :parameters() :precondition (and (HandEmpty) (BOnTable) (notfailed)) :effect (and (BInHand) (HandFull) (not BOnTable) (not HandEmpty) (not BOnTable) (not HandEmpty))
|
| 233 |
+
)
|
| 234 |
+
(:action Pick_8 :parameters()
|
| 235 |
+
:precondition (and (HandEmpty) (COnTable) (notfailed)) :effect (and (CInHand) (HandFull) (not COnTable) (not HandEmpty) (not COnTable) (not HandEmpty))
|
| 236 |
+
)
|
| 237 |
+
(:action Pick_9 :parameters() :precondition (and (HandEmpty) (AOnTable_ACovered) (COnBlock) (notfailed))
|
| 238 |
+
:effect (and (CInHand) (AOnTable) (HandFull) (not COnBlock) (not HandEmpty) (not AOnTable_ACovered) (not COnBlock) (not HandEmpty) (not AOnTable_ACovered))
|
| 239 |
+
)
|
| 240 |
+
(:action Pick_10 :parameters() :precondition (and (HandEmpty) (AOnBlock) (COnTable_CCovered) (notfailed)) :effect (and (COnTable) (AInHand) (HandFull) (not AOnBlock) (not HandEmpty) (not COnTable_CCovered) (not AOnBlock) (not HandEmpty) (not COnTable_CCovered))
|
| 241 |
+
)
|
| 242 |
+
(:action Pick_11 :parameters() :precondition (and (HandEmpty) (AOnBlock_ACovered) (COnBlock) (notfailed))
|
| 243 |
+
:effect (and (CInHand) (AOnBlock) (HandFull) (not COnBlock) (not HandEmpty) (not AOnBlock_ACovered) (not COnBlock) (not HandEmpty) (not AOnBlock_ACovered))
|
| 244 |
+
)
|
| 245 |
+
(:action Pick_12 :parameters() :precondition (and (HandEmpty) (COnBlock) (BOnTable_BCovered) (notfailed)) :effect (and (BOnTable) (CInHand) (HandFull) (not COnBlock) (not HandEmpty) (not BOnTable_BCovered) (not COnBlock) (not HandEmpty) (not BOnTable_BCovered))
|
| 246 |
+
)
|
| 247 |
+
(:action Pick_13
|
| 248 |
+
:parameters() :precondition (and (HandEmpty) (COnBlock_CCovered) (BOnBlock) (notfailed))
|
| 249 |
+
:effect (and (BInHand) (COnBlock) (HandFull) (not BOnBlock) (not HandEmpty) (not COnBlock_CCovered) (not BOnBlock) (not HandEmpty) (not COnBlock_CCovered))
|
| 250 |
+
)
|
| 251 |
+
(:action Pick_14 :parameters() :precondition (and (HandEmpty) (COnBlock) (BOnBlock_BCovered) (notfailed))
|
| 252 |
+
:effect (and (BOnBlock) (CInHand) (HandFull) (not COnBlock) (not HandEmpty) (not BOnBlock_BCovered) (not COnBlock) (not HandEmpty) (not BOnBlock_BCovered))
|
| 253 |
+
)
|
| 254 |
+
(:action Put_15
|
| 255 |
+
:parameters() :precondition (and (HandFull) (AInHand) (notfailed)) :effect (and (AOnTable) (HandEmpty) (not AInHand) (not HandFull) (not AInHand) (not HandFull))
|
| 256 |
+
)
|
| 257 |
+
(:action Put_16 :parameters() :precondition (and (HandFull) (BInHand) (notfailed)) :effect (and (BOnTable) (HandEmpty) (not HandFull) (not BInHand) (not HandFull) (not BInHand))
|
| 258 |
+
)
|
| 259 |
+
(:action Put_17 :parameters() :precondition (and (HandFull) (CInHand) (notfailed)) :effect (and (COnTable) (HandEmpty) (not HandFull) (not CInHand) (not HandFull) (not CInHand))
|
| 260 |
+
)
|
| 261 |
+
(:action Stack_18 :parameters()
|
| 262 |
+
:precondition (and (HandFull) (CInHand) (BOnTable) (notfailed)) :effect (and (BOnTable_BCovered) (COnBlock) (HandEmpty) (not HandFull) (not BOnTable) (not CInHand) (not HandFull) (not BOnTable) (not CInHand))
|
| 263 |
+
)
|
| 264 |
+
(:action Stack_19 :parameters() :precondition (and (HandFull) (COnBlock) (BInHand) (notfailed))
|
| 265 |
+
:effect (and (BOnBlock) (COnBlock_CCovered) (HandEmpty) (not HandFull) (not COnBlock) (not BInHand) (not HandFull) (not COnBlock) (not BInHand))
|
| 266 |
+
)
|
| 267 |
+
(:action Stack_20
|
| 268 |
+
:parameters()
|
| 269 |
+
:precondition (and (HandFull) (AOnBlock) (BInHand) (notfailed)) :effect (and (BOnBlock) (AOnBlock_ACovered) (HandEmpty) (not HandFull) (not BInHand) (not AOnBlock) (not HandFull) (not BInHand) (not AOnBlock))
|
| 270 |
+
)
|
| 271 |
+
(:action Stack_21 :parameters() :precondition (and (HandFull) (AInHand) (BOnTable) (notfailed)) :effect (and (BOnTable_BCovered) (AOnBlock) (HandEmpty) (not AInHand) (not HandFull) (not BOnTable) (not AInHand) (not HandFull) (not BOnTable))
|
| 272 |
+
)
|
| 273 |
+
(:action Stack_22 :parameters()
|
| 274 |
+
:precondition (and (HandFull) (CInHand) (BOnBlock) (notfailed)) :effect (and (BOnBlock_BCovered) (COnBlock) (HandEmpty) (not HandFull) (not BOnBlock) (not CInHand) (not HandFull) (not BOnBlock) (not CInHand))
|
| 275 |
+
)
|
| 276 |
+
(:action Stack_23 :parameters()
|
| 277 |
+
:precondition (and (HandFull) (COnTable) (BInHand) (notfailed)) :effect (and (BOnBlock) (COnTable_CCovered) (HandEmpty) (not HandFull) (not BInHand) (not COnTable) (not HandFull) (not BInHand) (not COnTable))
|
| 278 |
+
)
|
| 279 |
+
(:action Stack_24 :parameters() :precondition (and (HandFull) (AInHand) (COnBlock) (notfailed)) :effect (and (COnBlock_CCovered) (AOnBlock) (HandEmpty) (not AInHand) (not HandFull) (not COnBlock) (not AInHand) (not HandFull) (not COnBlock))
|
| 280 |
+
)
|
| 281 |
+
(:action Stack_25 :parameters() :precondition (and (HandFull) (AOnTable) (CInHand) (notfailed)) :effect (and (COnBlock) (AOnTable_ACovered) (HandEmpty) (not HandFull) (not AOnTable) (not CInHand) (not HandFull) (not AOnTable) (not CInHand))
|
| 282 |
+
)
|
| 283 |
+
(:action Stack_26 :parameters() :precondition (and (HandFull) (AInHand) (COnTable) (notfailed)) :effect (and (COnTable_CCovered) (AOnBlock) (HandEmpty) (not AInHand) (not HandFull) (not COnTable) (not AInHand) (not HandFull) (not COnTable))
|
| 284 |
+
)
|
| 285 |
+
(:action Stack_27 :parameters() :precondition (and (HandFull) (AOnBlock) (CInHand) (notfailed)) :effect (and (COnBlock) (AOnBlock_ACovered) (HandEmpty) (not HandFull) (not AOnBlock) (not CInHand) (not HandFull) (not AOnBlock) (not CInHand))
|
| 286 |
+
)
|
| 287 |
+
(:action Stack_28 :parameters() :precondition (and (HandFull) (AOnTable) (BInHand) (notfailed)) :effect (and (BOnBlock) (AOnTable_ACovered) (HandEmpty) (not HandFull) (not BInHand) (not AOnTable) (not HandFull) (not BInHand) (not AOnTable))
|
| 288 |
+
)
|
| 289 |
+
(:action Stack_29 :parameters() :precondition (and (HandFull) (AInHand) (BOnBlock) (notfailed)) :effect (and (BOnBlock_BCovered) (AOnBlock) (HandEmpty) (not AInHand) (not HandFull) (not BOnBlock) (not AInHand) (not HandFull) (not BOnBlock))
|
| 290 |
+
)
|
| 291 |
+
|
| 292 |
+
# C LIFTED PDDL DESCRIPTION FOR THE BLOCKS WORLD TASK
|
| 293 |
+
|
| 294 |
+
In contrast, the lifted representation learned below is far more compact. Here, operators are parameterised by objects, which allows for better generalisation across instances with varying numbers of blocks. Figure 7 shows how the number of partitioned options (and hence number of preconditions and effects) scales with the number of objects in the domain.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 7: The number of learned action operators as a function of the number of blocks in the domain. Since the propositional approach treats each block as its own, unique object, it must learn the dynamics and interaction of each new block it encounters. For $n$ blocks, this requires $O ( n ^ { 2 } )$ operators. However, if we learn the object types and construct predicates based on these, then we need at most 6 operators to represent the dynamics for any number of blocks.
|
| 298 |
+
|
| 299 |
+
Below we provide the learned representation for the domain. Again, we manually rename the predicates and types to help with readability.
|
| 300 |
+
|
| 301 |
+
(define (domain BlocksWorld) (:requirements :strips :typing) (:types hand block) (:predicates (BlockInHand ?w - block) (HandFull ?w - hand) (BlockOnBlock ?w - block) (BlockOnTable ?w - block) (HandEmpty ?w - hand) (BlockOnTable_BlockCovered ?w - block) (BlockOnBlock_BlockCovered ?w - block) (notfailed) ) (:action Pick-partition-0 :parameters (?w - hand ?x - block) :precondition (and (notfailed) (HandEmpty ?w) (BlockOnTable ?x)) :effect (and (BlockInHand ?x) (HandFull ?w) (not (BlockOnTable ?x)) (not (HandEmpty ?w))) ) (:action Pick-partition-1 :parameters (?w - hand ?x - block ?y - block) :precondition (and (notfailed) (HandEmpty ?w) (BlockOnBlock ?x) (BlockOnBlock_BlockCovered ?y)) :effect (and (BlockOnBlock ?y) (BlockInHand ?x) (HandFull ?w) (not (BlockOnBlock ?x)) (not (HandEmpty ?w)) (not (BlockOnBlock_BlockCovered ?y))) ) (:action Pick-partition-10 :parameters (?w - hand ?x - block ?y - block)
|
| 302 |
+
|
| 303 |
+
:precondition (and (notfailed) (HandEmpty ?w) (BlockOnTable_BlockCovered ?x) (BlockOnBlock ?y)) :effect (and (BlockInHand ?y) (BlockOnTable ?x) (HandFull ?w) (not (BlockOnBlock ?y)) (not (HandEmpty ?w)) (not (BlockOnTable_BlockCovered ?x)))
|
| 304 |
+
)
|
| 305 |
+
(:action Put-partition-0
|
| 306 |
+
:parameters (?w - hand ?x - block)
|
| 307 |
+
:precondition (and (notfailed) (HandFull ?w) (BlockInHand ?x))
|
| 308 |
+
:effect (and (BlockOnTable ?x) (HandEmpty ?w) (not (BlockInHand ?x)) (not (HandFull ?w)))
|
| 309 |
+
(:action Stack-partition-0
|
| 310 |
+
:parameters (?w - hand ?x - block ?y - block)
|
| 311 |
+
:precondition (and (notfailed) (HandFull ?w) (BlockInHand ?x) (BlockOnTable ?y))
|
| 312 |
+
:effect (and (BlockOnTable_BlockCovered ?y) (BlockOnBlock ?x) (HandEmpty ?w) (not (HandFull ?w)) (not (BlockOnTable ?y)) (not (BlockInHand ?x)))
|
| 313 |
+
)
|
| 314 |
+
(:action Stack-partition-1
|
| 315 |
+
:parameters (?w - hand ?x - block ?y - block)
|
| 316 |
+
:precondition (and (notfailed) (HandFull ?w) (BlockOnBlock ?x) (BlockInHand ?y))
|
| 317 |
+
:effect (and (BlockOnBlock ?y) (BlockOnBlock_BlockCovered ?x) (HandEmpty ?w) (not (HandFull ?w)) (not (BlockOnBlock ?x)) (not (BlockInHand ?y)))
|
| 318 |
+
)
|
| 319 |
+
|
| 320 |
+
)
|
| 321 |
+
|
| 322 |
+
A task might then be specified as follows:
|
| 323 |
+
|
| 324 |
+
(define (problem stack) (:domain BlocksWorld) (:objects hand - Hand A B C - Block ) (:init (BlockOnTable A) (BlockOnTable B) (BlockOnTable C) (HandEmpty hand) (notfailed) ) (:goal (and (BlockOnBlock A) (BlockOnBlock_BlockCovered C) (BlockOnTable_BlockCovered B)))
|
| 325 |
+
|
| 326 |
+
# D MINECRAFT TASK DETAILS
|
| 327 |
+
|
| 328 |
+
Our Minecraft tasks are procedurally generated, consisting of five rooms with various items positioned throughout. Rooms are connected with either regular doors which can be opened by direct interaction, or puzzle doors which require the agent to pull a lever to open. The world is described by the state of each of the objects (given directly by each object’s appearance as a $6 0 0 \times 8 0 0$ RGB image), the agent’s view, and current inventory. Figure 8 illustrates the state of each object in the world at the beginning of one of the tasks.
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 8: The state of each object in the world at the start of the task. From left to right, the images represent the agent’s point of view, the four doors, the pickaxe, the chest, and the redstone and gold blocks. The inventory is not shown here.
|
| 332 |
+
|
| 333 |
+
The agent is provided with the following high-level skills:
|
| 334 |
+
|
| 335 |
+
(i) WalkToItem—the agent will approach an item if it is in the same room. (ii) AttackBlock—the agent will break a block, provided it is near the block and holding the pickaxe. (iii) PickupItem—the agent will collect the item if it is standing in front of it. (iv) WalkToNorthDoor—the agent will approach the northern door in the current room. (v) WalkToSouthDoor—the agent will approach the southern door in the current room. (vi) WalkThroughDoor—the agent will walk through a door to the next room, provided the door is open. (vii) CraftItem—the agent will create a new item from ingredients in its inventory, provided it is near the crafting table. (viii) OpenChest—the agent will open the chest, provided it is standing in front of it and possesses the clock. (ix) ToggleDoor—the agent will open or close the door directly in front of it.
|
| 336 |
+
|
| 337 |
+
Execution is stochastic—opening doors occasionally fails, and the navigation skills are noisy in their execution.
|
| 338 |
+
|
| 339 |
+
# E LEARNING A PORTABLE REPRESENTATION FOR MINECRAFT
|
| 340 |
+
|
| 341 |
+
In this section, we describe the exact details for learning a representation of a Minecraft task.
|
| 342 |
+
Pseudocode for the approach (independent of the domain) is provided in Section F.
|
| 343 |
+
|
| 344 |
+
In order to learn a high-level representation, we first apply a series preprocessing steps to reduce the dimensionality of the state space. We downscale images to $1 6 0 \times 1 2 0$ and then convert the resulting images to greyscale. We apply principal component analysis (Pearson, 1901) to a batch of images collected from the different tasks and keep the top 40 principal components. This allows us to represent each object (except the inventory, which is a one-hot encoded vector of length 5) as a vector of length 40.
|
| 345 |
+
|
| 346 |
+
Partitioning We collect data from a task by executing options uniformly at random. We record state transition data as well as, for each state, which options could be executed. We then partition options using the DBSCAN clustering algorithm (Ester et al., 1996) to cluster the terminating states of each option into separate effects. This approximately preserves the subgoal property, as described in Section 2 and previous work (Andersen & Konidaris, 2017; Konidaris et al., 2018; Ames et al., 2018). For each pair of partitioned options, we check whether their is significant overlap in their initiating states (again using DBSCAN). If the initiating states overlap significantly, the partitions are merged to account for probabilistic effects.
|
| 347 |
+
|
| 348 |
+
Preconditions Next, the agent learns a precondition classifier for each of these approximately partitioned options using an SVM (Cortes & Vapnik, 1995) with Platt scaling (Platt, 1999). We use states initially collected as negative examples, and data from the actual transitions as positive examples. We employ a simple feature selection procedure to determine which objects are relevant to the option’s precondition. We first compute the accuracy of the SVM applied to the object the option operates on, performing a grid search to find the best hyperparameters for the SVM using 3-fold cross validation. Then, for every other object in the environment, we compute the SVM’s accuracy when that object’s features are added to the SVM. Any object that increases the SVM accuracy is kept. Pseudocode for this procedure is outline in Figure 9.
|
| 349 |
+
|
| 350 |
+
Having determined the relevant objects, we fit a probabilistic SVM to the relevant objects’ data. Note that we learn a single SVM for a given precondition. Thus if the precondition includes two objects, then the SVM will learn a classifier over both objects’ features jointly.
|
| 351 |
+
|
| 352 |
+
1: procedure FEATURESELECTION
|
| 353 |
+
2: Given: affected objects Mask , positive start states $p$ , negative start states $n$ , set of objects $\mathcal { M }$
|
| 354 |
+
3: $\triangleright$ Fit a classifier over only objects in the mask
|
| 355 |
+
4: classifier $\gets$ FITCLASSIFIER(start, negative, mask)
|
| 356 |
+
5: initScore $\gets$ classifier .score
|
| 357 |
+
6: $K e e p \emptyset$
|
| 358 |
+
7: for each object $\in \mathcal { M } \setminus M a s k \ : .$ do
|
| 359 |
+
8: classifier FITCLASSIFIER(start, negative, Mask ∪ {object})
|
| 360 |
+
9: newScore $\gets$ classifier .score
|
| 361 |
+
10: if newScore $>$ initScore then
|
| 362 |
+
11: $\triangleright$ Keep the object if it improves the score
|
| 363 |
+
12: $K e e p \gets K e e p \cup \{ o b j e c t \}$
|
| 364 |
+
13: end if
|
| 365 |
+
14: end for
|
| 366 |
+
15: return Mask ∪ Keep
|
| 367 |
+
16: end procedure
|
| 368 |
+
|
| 369 |
+
Effects A kernel density estimator (KDE) (Rosenblatt, 1956) with Gaussian kernel is used to estimate the effect of each partitioned option. We learn distributions over only the objects affected by the option, learning one KDE for each object. We use a grid search with 3-fold cross validation to find the best bandwidth hyperparameter for each estimator. We fit a single KDE to each object separately, since the state space has already been factored into these objects. Each of these KDEs is an abstract symbol in our propositional PDDL representation.
|
| 370 |
+
|
| 371 |
+
Propositional PDDL For each partitioned option, we now have a classifier and set of effect distributions (propositions). However, to generate the PDDL, the precondition must be specified in terms of these propositions. We use the same approach as Konidaris et al. (2018) to generate the PDDL: for all combinations of valid effect distributions, we test whether data sampled from their conjunction is evaluated positively by our classifiers. If they are, then that combination of distributions serves as the precondition of the high-level operator. This procedure is described in Figure 10.
|
| 372 |
+
|
| 373 |
+
1: procedure BUILDPPDDLOPERATOR
|
| 374 |
+
2: Given: precondition classifier classifier , current effect effect, all effects Effects
|
| 375 |
+
3: Operators $\gets \emptyset$
|
| 376 |
+
4: Symbols $ \emptyset$
|
| 377 |
+
5: for each candidate $\in \wp ( E f f e c t s )$ do . For all possible effect combinations
|
| 378 |
+
6: samples ← SAMPLE(candidate) $\triangleright$ Sample from the distributions
|
| 379 |
+
7: prob ← PREDICT(classifier , sample) $\triangleright$ Query the classifier with the data
|
| 380 |
+
8: if prob $, > 0$ then
|
| 381 |
+
9: if $p r o b = 1$ then
|
| 382 |
+
10: $\triangleright$ Construct the new operator with the existing effects
|
| 383 |
+
11: operator $\mathbf { \beta } \cdot \gets \{ c a n d i d a t e , e f f e c t \}$
|
| 384 |
+
12: else
|
| 385 |
+
13: $\triangleright$ Add a probabilistic failure case
|
| 386 |
+
14: $\begin{array} { r l } & { n e w E f f e c t \{ \begin{array} { l l } { \pounds \mathrm { a i } 1 , \mathrm { w i t h ~ p r o b a b i l i t y ~ } ( 1 - p r o b ) } \\ { e f f e c t , \mathrm { w i t h ~ p r o b a b i l i t y ~ } p r o b } \end{array} } \\ & { o p e r a t o r \{ c a n d i d a t e , n e w E f f e c t \} } \end{array}$
|
| 387 |
+
15:
|
| 388 |
+
16: end if
|
| 389 |
+
17: Operators Operators ∪ {operator}
|
| 390 |
+
18: $\ 5 y m b o l s \gets S y m b o l s \cup \{ c a n d i d a t e \} \cup \{ e f f e c t \}$
|
| 391 |
+
19: end if
|
| 392 |
+
20: end for
|
| 393 |
+
21: return Operators, Symbols
|
| 394 |
+
22: end procedure
|
| 395 |
+
|
| 396 |
+
Type Inference To determine the type of each object, we first assume that they all belong to their own type. For each object, we compute its effect profile by extracting the effect propositions that occur under each option. Figure 11 illustrates this process.
|
| 397 |
+
|
| 398 |
+
For each pair of objects, we then determine whether the effect profiles are similar. This task is made easier because certain objects do not undergo effects with certain options. For example, the gold block cannot be toggled, while a door can. Thus it is easy to see that they are not of the same type. To determine whether two distributions are similar, we simply check whether the KL-divergence is less than a certain threshold. Having determined the types, we can simply replace all similar propositions with a predicate parameterised by an object of that type, as described by Figure 12.
|
| 399 |
+
|
| 400 |
+
1: procedure COMPUTEEFFECTS
|
| 401 |
+
2: Given: object $i$ , option $o$ , PPDDL operators Operators
|
| 402 |
+
3: $\triangleright$ Get only the operators that model option $o$
|
| 403 |
+
4: Operators $ \{$ {operator | ∀operator $\in$ Operators, REFERSTO(operator , o)}
|
| 404 |
+
5: $E f f e c t s \gets \emptyset$
|
| 405 |
+
6: for each $\left\{ \cdot , e f f e c t \right\} \in$ Operators do
|
| 406 |
+
7: $\triangleright$ Extract the effect propositions that refer to distributions over object $i$
|
| 407 |
+
8: Opera $t o r E f f e c t \gets \{ p r o p \ | \ \forall p r o p \in \ e f f e c t , \mathbf { R E F E R S T O } ( p r o p , i ) \}$
|
| 408 |
+
9: Effects ← Effects ∪ {OperatorEffect}
|
| 409 |
+
10: end for
|
| 410 |
+
11: return Effects
|
| 411 |
+
12: end procedure
|
| 412 |
+
1: procedure MERGE
|
| 413 |
+
2: Given: objects $\mathcal { M }$ , type $T$ , PPDDL operators Operators, propositions Propositions
|
| 414 |
+
3: $\triangleright$ Find the first object matching the type
|
| 415 |
+
4: archetype $\gets \emptyset$
|
| 416 |
+
5: for each object $\in \mathcal { M }$ do
|
| 417 |
+
6: if ISTYPE(object, $T$ ) then
|
| 418 |
+
7: archetype $\gets$ object
|
| 419 |
+
8: break
|
| 420 |
+
9: end if
|
| 421 |
+
10: end for
|
| 422 |
+
11: $\triangleright$ Remove propositions with objects of type $T$ that are not the archetype
|
| 423 |
+
12: $R e m o v e d \gets \{ p r o p \ | \ \forall p r o p \in $ Propositions, ISTYPE(prop, T ),
|
| 424 |
+
¬REFERSTO(prop, archetype)}
|
| 425 |
+
13: $\triangleright$ Keep operators that do not contain the removed propositions
|
| 426 |
+
14: Operators $ \{ o p \mid \forall o p \in ($ Operators, Removed ${ \bar { \cap } } { \bar { o p } } = \emptyset \}$
|
| 427 |
+
15: return Operators, Propositions \ Removed
|
| 428 |
+
16: end procedure
|
| 429 |
+
|
| 430 |
+
Problem-Specific Instantiation Finally, we again use DBSCAN to partition our subgoal options, but this time using problem-specific state variables. Each of these clusters is then added to our representation as a problem-specific proposition. To ground the operators, we add the start and end clusters (problem-specific propositions) to the precondition and effects of the PPDDL operator. We also record the grounded object that appears in the parameter list of each operator, and add a precondition predicate (fluent) to ensure that only those particular objects can be modified. Without this final step, the agent would, for example, believe it can open any door while standing in front of a door at a particular location. We have thus linked the particular door to a particular location in the domain.
|
| 431 |
+
|
| 432 |
+
# F PSEUDOCODE
|
| 433 |
+
|
| 434 |
+
Below we present pseudocode describing our approach to building a typed, object-centric PPDDL representation for an arbitrary domain. Some subroutines used in the pseudocode below are outlined in the previous section.
|
| 435 |
+
|
| 436 |
+
1: procedure LEARNREPRESENTATION
|
| 437 |
+
2: Given: $T$ state-option transitions $\mathcal { D } = \{ ( s _ { i } , x _ { i } , o _ { i } , s _ { i } ^ { \prime } , x _ { i } ^ { \prime } ) \ | \ 0 \leq i \leq T \}$ , set of objects $\mathcal { M }$
|
| 438 |
+
3: $\triangleright$ Partition options into subgoal options
|
| 439 |
+
4: SubgoalOptions ← ∅
|
| 440 |
+
5: for each $o \in \mathcal { O }$ do
|
| 441 |
+
6: $\begin{array} { r l } & { I \{ s \mid ( s , \cdot , o , \cdot , \cdot ) \in \mathcal { D } \} } \\ & { \beta \{ s ^ { \prime } \mid ( \cdot , \cdot , o , s ^ { \prime } , \cdot ) \in \mathcal { D } \} } \end{array}$ . Set of initial states for option $o$
|
| 442 |
+
7: . Set of terminating states for option $o$
|
| 443 |
+
8: for all $K \subseteq I$ such that $\mathrm { P r } ( s ^ { \prime } \mid s _ { i } , o ) = \mathrm { P r } ( s ^ { \prime } \mid s _ { j } , o ) \forall s _ { i } , s _ { j } \in I , s ^ { \prime } \in \beta$ do
|
| 444 |
+
9: $P \{ o , K , \{ s ^ { \prime } \mid \forall s \in K , ( s , \cdot , o , s ^ { \prime } , \cdot ) \in \mathcal { D } \} \} \triangleright \mathrm { S t }$ art and end states for a partition
|
| 445 |
+
10: SubgoalOptions $\gets$ SubgoalOptions $\cup \left\{ P \right\}$
|
| 446 |
+
11: end for
|
| 447 |
+
12: end for
|
| 448 |
+
13: $\triangleright$ Estimate preconditions and effects
|
| 449 |
+
14: Preconditions, $E f f e c t s \gets \emptyset$
|
| 450 |
+
15: for each $\{ \cdot$ ·, start, end} ∈ SubgoalOptions do
|
| 451 |
+
16: mask ← COMPUTEMASK(start, end) . List the objects that change state
|
| 452 |
+
17: negative $ S$ \ start
|
| 453 |
+
18: features $\gets$ FEATURESELECTION(mask, start, negative)
|
| 454 |
+
19: classifier FITCLASSIFIER(start, negative, features)
|
| 455 |
+
20: Preconditions Preconditions ∪ {classifier}
|
| 456 |
+
21: estimator $\gets$ FITESTIMATOR(mask, end) $\triangleright$ Fit over only objects that change
|
| 457 |
+
22: $E f f e c t s \gets E f f e c t s \cup \{ e s t i m a t o r \}$
|
| 458 |
+
23: end for
|
| 459 |
+
24: . Build propositional PPDDL
|
| 460 |
+
25: Operators, Propositions ← ∅
|
| 461 |
+
26: for each precondition, effect $\in$ (Preconditions × Effects) do
|
| 462 |
+
27: op, symbols $\gets$ BUILDPPDDLOPERATOR(precondition, effect, Effects)
|
| 463 |
+
28: Operators $\gets$ Operators ∪ {op}
|
| 464 |
+
29: Propositions $\gets$ Propositions ∪ symbols
|
| 465 |
+
30: end for
|
| 466 |
+
31: $\triangleright$ Infer object types
|
| 467 |
+
32: $E J \overline { { f P r o f i l e \emptyset } }$
|
| 468 |
+
33: for each object $m$ do
|
| 469 |
+
34: for each $o \in \mathcal { O }$ do
|
| 470 |
+
35: $\mathit { E f f P r o f i l e } ( m , o ) \gets \mathrm { C O M P U T E E F E C T S } ( m , o , O p e r a t o r s )$
|
| 471 |
+
36: end for
|
| 472 |
+
37: end for
|
| 473 |
+
38: $T y p e s \gets \{ K \mid E f f P r o f l e ( m _ { i } , o ) \approx E f f P r o f l e ( m _ { j } , o ) \forall o \in \mathcal { O } , m _ { i } , m _ { j } \in K , K \subseteq \mathcal { M } \}$
|
| 474 |
+
39: $\triangleright$ Generate typed PPDDL
|
| 475 |
+
40: TypedOperators, Predicates ← ∅
|
| 476 |
+
41: for each type $\in$ Types do
|
| 477 |
+
42: $\triangleright$ Replace propositions and operators over objects of same type with lifted versions
|
| 478 |
+
43: ops, predicates ← MERGE( $\mathcal { M }$ , type, Operators, Propositions)
|
| 479 |
+
44: TypedOperators TypedOperators ∪ ops
|
| 480 |
+
45: Predicates Predicates $\cup$ predicates
|
| 481 |
+
46: end for
|
| 482 |
+
47: $\triangleright$ Instantiate typed PPDDL in new task
|
| 483 |
+
48: for each $\left\{ o , s t a r t , e n d \right\} \in S u b g o a l O p t$ ions do
|
| 484 |
+
49: $I _ { \mathcal { X } } \{ x \mid \forall s \in s t a r t$ , $s ^ { \prime } \in e n d$ , $( s , x , o , s ^ { \prime } , \cdot ) \in \mathcal { D } \}$
|
| 485 |
+
50: βX ← {x0 | ∀s ∈ start, $s ^ { \prime } \in e n d , x \in I _ { \mathcal { X } } , ( s , x , o , s ^ { \prime } , x ^ { \prime } ) \in \mathcal { D } \}$
|
| 486 |
+
51: for all $\kappa \subseteq I x$ such that $\mathrm { P r } ( x ^ { \prime } \mid x _ { i } , o ) = \mathrm { P r } ( x ^ { \prime } \mid x _ { j } , o ) \forall x _ { i } , x$ xj ∈ IX , x0 ∈ βX do
|
| 487 |
+
52: $\lambda \{ x ^ { \prime } \mid \forall s \in s t a r t$ , $s ^ { \prime } \in e n d , x \in \kappa , ( s , x , o , s ^ { \prime } , x ^ { \prime } ) \in \mathcal { D } \}$
|
| 488 |
+
53: $P r e d i c a t e s \gets P r e d i c a t e s \cup \{ \kappa \} \cup \{ \lambda \}$ $\triangleright$ Add problem-specific symbols
|
| 489 |
+
54: mask ← COMPUTEMASK(start, end) $\triangleright$ Computes the affected objects
|
| 490 |
+
55: $\triangleright$ Link problem-specific symbols in precondition and effect to the affected objects
|
| 491 |
+
56: TypedOperators $\gets$ GROUND(TypedOperators, κ, λ, mask)
|
| 492 |
+
57: end for
|
| 493 |
+
58: end for
|
| 494 |
+
59: return TypedOperators, Predicates
|
| 495 |
+
60: end procedure
|
| 496 |
+
|
| 497 |
+
# G VISUALISING OPERATORS FOR MINECRAFT
|
| 498 |
+
|
| 499 |
+
Here we illustrate some learned operators for the Minecraft tasks. To see all predicates and operators, please see the following URL: https://sites.google.com/view/mine-pddl.
|
| 500 |
+
|
| 501 |
+
(:action Open-Chest-partition-0
|
| 502 |
+
:parameters (?w - type0 ?x - type6 ?y - type9)
|
| 503 |
+
:precondition (and (notfailed) (symbol_13 ?w) (symbol_4 ?x) (symbol_55 ?y) (psymbol_8))
|
| 504 |
+
:effect (and (symbol_58 ?x) (symbol_59 ?w) (not (symbol_4 ?x)) (not (symbol_13 ?w)))
|
| 505 |
+
)
|
| 506 |
+
|
| 507 |
+

|
| 508 |
+
Figure 13: Our approach learns that, in order to open a chest, the agent must be standing in front of a chest (symbol 13), the chest must be closed (symbol 4), the inventory must contain a clock (symbol 55) and the agent must be standing at a certain location (psymbol 8). The result is that the agent finds itself in front of an open chest (symbol 58) and the chest is open (symbol 59). $\tt t y p e 0$ refers to the “agent” type, type6 the “chest” type and type9 the “inventory” type.
|
| 509 |
+
|
| 510 |
+
(g) A learned typed PDDL operator for the Open-Chest skill. The predicate underlined in red indicates a problem-specific symbol that must be relearned for each new task, while the rest of the operator can be safely transferred.
|
| 511 |
+
|
| 512 |
+
(:action Walk-to-partition-0-2a
|
| 513 |
+
:parameters (?w - type0)
|
| 514 |
+
:precondition (and (notfailed) (symbol_46 ?w) (psymbol_0))
|
| 515 |
+
:effect (and (symbol_11 ?w) (psymbol_1) (not (symbol_46 ?w)) (not (psymbol_0)))
|
| 516 |
+
)
|
| 517 |
+
|
| 518 |
+
(e) Typed PDDL operator for a partition of the $W \mathrm { a l k - T o }$ option. The predicate underlined in red indicates a problem-specific symbol that must be relearned for each new task, while the rest of the operator can be safely transferred.
|
| 519 |
+
|
| 520 |
+

|
| 521 |
+
Figure 14: Abstract operator that models the agent walking to the crafting table. In order to do so, the agent must be standing in the middle of a room (symbol 46) at a particular location (psymbol 0). As a result, the agent finds itself in front of the crafting table (symbol 1) at a particular location (psymbol 1).
|
| 522 |
+
|
| 523 |
+

|
| 524 |
+
Figure 15: Abstract operator that models the agent walking through a door. In order to do so, the agent must be standing in front of an open door (symbol 38) at a particular location (psymbol 24), and the door must be open (symbol 64). As a result, the agent finds itself in the middle of a room (symbol 50) at a particular location (psymbol 12).
|
| 525 |
+
|
| 526 |
+
(:action Through-Door-partition-3-207a
|
| 527 |
+
:parameters (?w - type0 ?x - type1)
|
| 528 |
+
:precondition (and (notfailed) (symbol_38 ?w) (symbol_64 ?x) (= (id ?x) 1) (psymbol_24))
|
| 529 |
+
:effect (and (symbol_50 ?w) (not (symbol_38 ?w)) (psymbol_12) (not (psymbol_24)))
|
| 530 |
+
|
| 531 |
+
(f) Typed PDDL operator for a partition of the Through-Door option. The predicate underlined in red indicates a problem-specific symbol that must be relearned for each new task, while the rest of the operator can be safely transferred.
|
| 532 |
+
|
| 533 |
+
(:action Attack-partition-0-76a
|
| 534 |
+
:parameters (?w - type0 ?x - type7)
|
| 535 |
+
:precondition (and (notfailed) (symbol_15 ?w) (symbol_2 ?x) (psymbol_17))
|
| 536 |
+
:effect (and (symbol_19 ?x) (symbol_20 ?w) (not (symbol_2 ?x)) (not (symbol_15 ?w)))
|
| 537 |
+
|
| 538 |
+

|
| 539 |
+
Figure 16: Abstract operator that models the agent attacking an object. In order to do so, the agent must be standing in front of a gold block (symbol 15) at a particular location (psymbol 17), and the gold block must be whole (symbol 2). As a result, the agent finds itself in front of a disintegrated block (symbol 20), and the gold block is disintegrated (symbol 19).
|
| 540 |
+
|
| 541 |
+
(f) Typed PDDL operator for a partition of the Attack option. The predicate underlined in red indicates a problem-specific symbol that must be relearned for each new task, while the rest of the operator can be safely transferred.
|
| 542 |
+
|
| 543 |
+
# H EXAMPLES OF FAILURE CASES
|
| 544 |
+
|
| 545 |
+
Below are some examples of errors that occur when constructing our abstract representation. Since there are several phases involving clustering, classification and density estimation, we can expect various learning errors to occur throughout. These errors could have numerous causes, such as insufficient data or suboptimal hyperparameters.
|
| 546 |
+
|
| 547 |
+
# H.1 PARTITIONING ERRORS
|
| 548 |
+
|
| 549 |
+

|
| 550 |
+
|
| 551 |
+

|
| 552 |
+
|
| 553 |
+
(a) Set of start states for one partition of the Attack option.
|
| 554 |
+
|
| 555 |
+
(b) Set of end states for one partition of the Attack option.
|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
|
| 559 |
+

|
| 560 |
+
(d) Set of end states for another partition of the Attack option.
|
| 561 |
+
|
| 562 |
+
(c) Set of start states for another partition of the Attack option.
|
| 563 |
+
|
| 564 |
+
Figure 17: In the above example, the partitioning procedure has generated two partitioned options for breaking the gold block, where there should only be one. They are functionally equivalent, but because of the strange shadows on the left of the image patch and the subsequent PCA representation, the clustering algorithm has produced one extra partition.
|
| 565 |
+
|
| 566 |
+

|
| 567 |
+
|
| 568 |
+

|
| 569 |
+
|
| 570 |
+
(a) Set of start states for one partition of the ToggleDoor option.
|
| 571 |
+
|
| 572 |
+
(b) Set of end states for one partition of the ToggleDoor option.
|
| 573 |
+
|
| 574 |
+

|
| 575 |
+
|
| 576 |
+

|
| 577 |
+
(d) Set of end states for another partition of the ToggleDoor option.
|
| 578 |
+
|
| 579 |
+
(c) Set of start states for another partition of the ToggleDoor option.
|
| 580 |
+
|
| 581 |
+
Figure 18: In this example, the partitioning has clustered noisy samples into an additional partition of the ToggleDoor option. While the top row shows the case where the state of the door changes from open to closed, the bottom row is a relatively useless noisy operator. We will subsequently learn a precondition and effect for this partition, but it likely will not be used by the planner.
|
| 582 |
+
|
| 583 |
+

|
| 584 |
+
(a) The precondition for attacking the gold block. The top image represents the agent’s view (in front of the block) while the bottom image is the state of the block (unbroken).
|
| 585 |
+
(b) The precondition for walking to a closed door. The top image represents the agent’s view (in a room) while the bottom image is the state of the door (closed) and the state of the inventory.
|
| 586 |
+
|
| 587 |
+
Figure 19: In the left example, the classifier predicts that the gold block can be broken when the agent is in front of it. However, this is not quite correct, since the agent must also have the pickaxe to break the block. In this case, the issue occurs because the data only included states where the agent reached the gold block with the pickaxe. Therefore, the agent did not observe states where it was in front of the block without the pickaxe, and thus concluded that the pickaxe is irrelevant to the precondition. In the right example, the classifier has overfitted to the data and predicts that the agent can only walk to the door when it has the pickaxe.
|
| 588 |
+
|
| 589 |
+
# H.3 PPDDL CONSTRUCTION ERROR
|
| 590 |
+
|
| 591 |
+
The quality of the PPDDL operators depends on how accurately the precondition classifiers and effect estimators are learned. Any error in learning can result in imperfect PPDDL operators, as seen below.
|
| 592 |
+
|
| 593 |
+

|
| 594 |
+
Figure 20: Abstract operator that models the agent crafting a gold ingot. In order to do so, the agent must be standing in front of the crafting table (symbol 56) at a particular location (psymbol 1), and must have the gold block in its inventory (symbol 29). As a result, the agent finds itself in front of the crafting table (symbol 11), and now has a gold ingot in its inventory (symbol 57). This option is deterministic; however, due to estimation errors, the PPDDL operator predicts that it will only succeed with probability 0.79.
|
| 595 |
+
|
| 596 |
+
(:action Craft-partition-1-240a :parameters (?w - type0 ?x - type9) :precondition (and (notfailed) (symbol_56 ?w) (symbol_29 ?x) (psymbol_1)) :effect (probabilistic 0.21 (not (notfailed)) 0.79 (and (symbol_57 ?x) (symbol_11 ?w) (not (symbol_29 ?x)) (not (symbol_56 ?w))))
|
| 597 |
+
)
|
| 598 |
+
|
| 599 |
+
(f) Typed PPDDL operator for a partition of the Craft option.
|
| 600 |
+
|
| 601 |
+
# H.4 TYPE INFERENCE ERROR
|
| 602 |
+
|
| 603 |
+
We observe that occasionally the procedure will not discover the correct types. In the example below, instead of discovering a single type for all four doors, our approach predicts that one door is different from the others and is placed in its own class
|
| 604 |
+
|
| 605 |
+
Table 2: A grouping of objects into types. Note that one of the doors is allocated its own type.
|
| 606 |
+
|
| 607 |
+
<table><tr><td>Type</td><td> Name</td><td>Object(s)</td></tr><tr><td>0</td><td>Agent</td><td>0</td></tr><tr><td>1</td><td>Pickaxe</td><td>1</td></tr><tr><td>2</td><td>Door1</td><td>2,3,4</td></tr><tr><td>3</td><td>Door2</td><td>5</td></tr><tr><td>4</td><td>Redstone Block</td><td>6</td></tr><tr><td>5</td><td>Gold Block</td><td>7</td></tr><tr><td>6</td><td>Chest</td><td>8</td></tr><tr><td>7</td><td>Inventory</td><td>9</td></tr></table>
|
md/train/S1EHOsC9tX/S1EHOsC9tX.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS THE FIRST ADVERSARIALLY ROBUST NEURAL NETWORK MODEL ON MNIST
|
| 2 |
+
|
| 3 |
+
Lukas Schott1-3∗, Jonas Rauber1-3∗, Matthias Bethge1,3,4† & Wieland Brendel1,3†
|
| 4 |
+
|
| 5 |
+
1Centre for Integrative Neuroscience, University of Tübingen 2International Max Planck Research School for Intelligent Systems 3Bernstein Center for Computational Neuroscience Tübingen 4Max Planck Institute for Biological Cybernetics ∗Joint first authors †Joint senior authors firstname.lastname@bethgelab.org
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Despite much effort, deep neural networks remain highly susceptible to tiny input perturbations and even for MNIST, one of the most common toy datasets in computer vision, no neural network model exists for which adversarial perturbations are large and make semantic sense to humans. We show that even the widely recognized and by far most successful $L _ { \infty }$ defense by Madry et al. (1) has lower $L _ { 0 }$ robustness than undefended networks and is still highly susceptible to $L _ { 2 }$ perturbations, (2) classifies unrecognizable images with high certainty, (3) performs not much better than simple input binarization and (4) features adversarial perturbations that make little sense to humans. These results suggest that MNIST is far from being solved in terms of adversarial robustness. We present a novel robust classification model that performs analysis by synthesis using learned class-conditional data distributions. We derive bounds on the robustness and go to great length to empirically evaluate our model using maximally effective adversarial attacks by (a) applying decision-based, score-based, gradient-based and transfer-based attacks for several different $L _ { p }$ norms, (b) by designing a new attack that exploits the structure of our defended model and (c) by devising a novel decision-based attack that seeks to minimize the number of perturbed pixels $( L _ { 0 } )$ . The results suggest that our approach yields state-of-the-art robustness on MNIST against $L _ { 0 }$ , $L _ { 2 }$ and $L _ { \infty }$ perturbations and we demonstrate that most adversarial examples are strongly perturbed towards the perceptual boundary between the original and the adversarial class.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Deep neural networks (DNNs) are strikingly susceptible to minimal adversarial perturbations (Szegedy et al., 2013), perturbations that are (almost) imperceptible to humans but which can switch the class prediction of DNNs to basically any desired target class.
|
| 14 |
+
|
| 15 |
+
One key problem in finding successful defenses is the difficulty of reliably evaluating model robustness. It has been shown time and again (Athalye et al., 2018; Athalye & Carlini, 2018; Brendel & Bethge, 2017) that basically all defenses previously proposed did not increase model robustness but prevented existing attacks from finding minimal adversarial examples, the most common reason being masking of the gradients on which most attacks rely. The few verifiable defenses can only guarantee robustness within a small linear regime around the data points (Hein & Andriushchenko, 2017; Raghunathan et al., 2018).
|
| 16 |
+
|
| 17 |
+
The only defense currently considered effective (Athalye et al., 2018) is a particular type of adversarial training (Madry et al., 2018). On MNIST, as of today this method is able to reach an accuracy of $8 8 . 7 9 \%$ for adversarial perturbations with an $L _ { \infty }$ norm bounded by $\epsilon = 0 . 3$ (Zheng et al., 2018). In other words, if we allow an attacker to perturb the brightness of each pixel by up to 0.3 (range $[ 0 , 1 ] \cdot$ ), then he can only trick the model on $\approx 1 0 \%$ of the samples. This is a great success, but does the model really learn more causal features to classify MNIST? We here demonstrate that this is not the case: For one, the defense by Madry et al. (SOTA on $L _ { \infty }$ ) has lower $L _ { 0 }$ robustness than undefended networks and is still highly susceptible in the $L _ { 2 }$ metric. Second, the robustness results by Madry et al. can also be achieved with a simple input quantization because of the binary nature of single pixels in MNIST (which are typically either completely black or white) (Schmidt et al., 2018). Third, it is straight-forward to find unrecognizable images that are classified as a digit with high certainty. Finally, the minimum adversarial examples we find for the defense by Madry et al. make little to no sense to humans.
|
| 18 |
+
|
| 19 |
+
Taken together, even MNIST cannot be considered solved with respect to adversarial robustness. By “solved” we mean a model that reaches at least $9 9 \%$ accuracy (see accuracy-vs-robustness trade-off (Tsipras et al., 2018; Bubeck et al., 2018)) and whose adversarial examples carry semantic meaning to humans (by which we mean that they start looking like samples that could belong to either class). Hence, despite the fact that MNIST is considered “too easy” by many and a mere toy example, finding adversarially robust models on MNIST is still an open problem.
|
| 20 |
+
|
| 21 |
+
A potential solution we explore in this paper is inspired by unrecognizable images (Nguyen et al., 2015) or distal adversarials. Distal adversarials are images that do not resemble images from the training set but which typically look like noise while still being classified by the model with high confidence. It seems difficult to prevent such images in feedforward networks as we have little control over how inputs are classified that are far outside of the training domain. In contrast, generative models can learn the distribution of their inputs and are thus able to gauge their confidence accordingly. By additionally learning the image distribution within each class we can check that the classification makes sense in terms of the image features being present in the input (e.g. an image of a bus should contain actual bus features). Following this line of thought from an information-theoretic perspective, one arrives at the well-known concept of Bayesian classifiers. We here introduce a fine-tuned variant based on variational autoencoders (Kingma & Welling, 2013) that combines robustness with high accuracy.
|
| 22 |
+
|
| 23 |
+
In summary, the contributions of this paper are as follows:
|
| 24 |
+
|
| 25 |
+
• We show that MNIST is unsolved from the point of adversarial robustness: the SOTA defense of Madry et al. (2018) is still highly vulnerable to tiny perturbations that are meaningless to humans. • We introduce a new robust classification model and derive instance-specific robustness guarantees. • We develop a strong attack that leverages the generative structure of our classification model. • We introduce a novel decision-based attack that minimizes $L _ { 0 }$ . We perform an extensive evaluation of our defense across many attacks to show that it surpasses SOTA on $L _ { 0 }$ , $L _ { 2 }$ and $L _ { \infty }$ and features many adversarials that carry semantic meaning to humans.
|
| 26 |
+
|
| 27 |
+
We have evaluated the proposed defense to the best of our knowledge, but we are aware of the (currently unavoidable) limitations of evaluating robustness. We will release the model architecture and trained weights as a friendly invitation to fellow researchers to evaluate our model independently.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
The many defenses against adversarial attacks can roughly be subdivided into four categories:
|
| 32 |
+
|
| 33 |
+
Adversarial training: The training data is augmented with adversarial examples to make models more robust (Madry et al., 2018; Szegedy et al., 2013; Tramèr et al., 2017; Ilyas et al., 2017).
|
| 34 |
+
• Manifold projections: An input sample is projected onto a learned data manifold (Samangouei et al., 2018; Ilyas et al., 2017; Shen et al., 2017; Song et al., 2018).
|
| 35 |
+
• Stochasticity: Certain inputs or hidden activations are shuffled or randomized (Prakash et al., 2018; Dhillon et al., 2018; Xie et al., 2018).
|
| 36 |
+
• Preprocessing: Inputs or hidden activations are quantized, projected into a different representation or are otherwise preprocessed (Buckman et al., 2018; Guo et al., 2018; Kabilan et al., 2018).
|
| 37 |
+
|
| 38 |
+
There has been much work showing that basically all defenses suggested so far in the literature do not substantially increase robustness over undefended neural networks (Athalye et al., 2018; Brendel &
|
| 39 |
+
|
| 40 |
+
I. Optimize latent distribution ${ \sf p } ( { \sf z } | { \bf x } )$ in each digit model to find likelihood of sample $\pmb { \times }$ under each model.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
II. Decide based on most likely class
|
| 44 |
+
Figure 1: Overview over model architecture. In a nutshell: I) for each sample x we compute a lower bound on the log-likelihood (ELBO) under each class using gradient descent in the latent space. II) A class-dependent scalar weighting of the class-conditional ELBOs forms the final class prediction.
|
| 45 |
+
|
| 46 |
+
Bethge, 2017). The only widely accepted exception according to Athalye et al. (2018) is the defense by Madry et al. (2018) which is based on data augmentation with adversarials found by iterative projected gradient descent with random starting points. However, as we see in the results section, this defense is limited to the metric it is trained on $( L _ { \infty } )$ and it is straight-forward to generate small adversarial perturbations that carry little semantic meaning for humans.
|
| 47 |
+
|
| 48 |
+
Some other defenses have been based on generative models. Typically these defenses use the generative model to project onto the (learned) manifold of “natural” inputs. This includes in particular DefenseGAN (Samangouei et al., 2018), Adversarial Perturbation Elimination GAN (Shen et al., 2017) and Robust Manifold Defense (Ilyas et al., 2017), all of which project an image onto the manifold defined by a generator network $G$ . The generated image is then classified by a discriminator in the usual way. A similar idea is used by PixelDefend (Song et al., 2018) which uses an autoregressive probabilistic method to learn the data manifold. Other ideas in similar directions include the use of denoising autoencoders (Liao et al., 2017) as well as MagNets (Meng & Chen, 2017), which projects or rejects inputs depending on their distance to the data manifold. All of these proposed defenses except for the defense by Ilyas et al. (2017) have been tested by Athalye et al. (2018); Athalye & Carlini (2018); Carlini & Wagner (2017) and others, and shown to be ineffective. It is straight-forward to understand why: For one, many adversarials still look like normal data points to humans. Second, the classifier on top of the projected image is as vulnerable to adversarial examples as before. Hence, for any data set with a natural amount of variation there will almost always be a certain perturbation against which the classifier is vulnerable and which can be induced by the right inputs.
|
| 49 |
+
|
| 50 |
+
We here follow a different approach by modeling the input distribution within each class (instead of modeling a single distribution for the complete data), and by classifying a new sample according to the class under which it has the highest likelihood. This approach, commonly referred to as a Bayesian classifier, gets away without any additional and vulnerable classifier. A very different but related approach is the work by George et al. (2017) which suggested a generative compositional model of digits to solve cluttered digit scenes like Captchas (adversarial robustness was not evaluated).
|
| 51 |
+
|
| 52 |
+
# 3 MODEL DESCRIPTION
|
| 53 |
+
|
| 54 |
+
Intuitively, we want to learn a causal model of the inputs (Schölkopf, 2017). Consider a cat: we want a model to learn that cats have four legs and two pointed ears, and then use this model to check whether a given input can be generated with these features. This intuition can be formalized as follows. Let $\left( \mathbf { x } , y \right)$ with $\mathbf { x } \in \mathbb { R } ^ { N }$ be an input-label datum. Instead of directly learning a posterior $p ( y | \mathbf { x } )$ from inputs to labels we now learn generative distributions $p ( \mathbf { x } | y )$ and classify new inputs using Bayes formula,
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
p ( y | \mathbf x ) = \frac { p ( \mathbf x | y ) p ( y ) } { p ( \mathbf x ) } \propto p ( \mathbf x | y ) p ( y ) .
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
The label distribution $p ( y )$ can be estimated from the training data. To learn the class-conditional sample distributions $p ( \mathbf { x } | y )$ we use variational autoencoders (VAEs) (Kingma & Welling, 2013). VAEs estimate the log-likelihood $\log p ( \mathbf { x } )$ by learning a probabilistic generative model $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$
|
| 61 |
+
|
| 62 |
+
with latent variables $\mathbf { z } \sim p ( \mathbf { z } )$ and parameters $\theta$ (see Appendix A.3 for the full derivation). For class-conditional VAEs we can derive a lower bound on the log-likelihood $\log p ( \mathbf { x } | y )$ as
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r } { \log p ( \mathbf { x } | y ) \geq \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } , y ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } , y ) \right] - \mathcal { D } _ { K L } \left[ q _ { \phi } ( \mathbf { z } | \mathbf { x } , y ) | | p ( \mathbf { z } ) \right] = : \ell _ { y } ( \mathbf { x } ) , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $p ( \mathbf { z } ) = \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } )$ is a simple normal prior and $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ is the variational posterior with parameters $\phi$ . The first term on the RHS is basically a reconstruction error while the second term on the RHS is the mismatch between the variational and the true posterior. The term on the RHS is the so-called evidence lower bound (ELBO) on the log-likelihood (Kingma & Welling, 2013). We implement the conditional distributions $p _ { \theta } ( \mathbf { x } | \mathbf { z } , y )$ and $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ as normal distributions for which the means are parametrized as DNNs (all details and hyperparameters are reported in Appendix A.7).
|
| 69 |
+
|
| 70 |
+
Our Analysis by Synthesis model (ABS) is illustrated in Figure 1. It combines several elements to simultaneously achieve high accuracy and robustness against adversarial perturbations:
|
| 71 |
+
|
| 72 |
+
• Class-conditional distributions: For each class $y$ we train a variational autoencoder $\mathrm { V A E } _ { y }$ on the samples of class $y$ to learn the class-conditional distribution $p ( \mathbf { x } | y )$ . This allows us to estimate a lower bound $\ell _ { y } ( \mathbf { x } )$ on the log-likelihood of sample $\mathbf { x }$ under each class $y$ .
|
| 73 |
+
|
| 74 |
+
• Optimization-based inference: The variational inference $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ is itself a neural network susceptible to adversarial perturbations. We therefore only use variational inference during training and perform “exact” inference over $p _ { \theta } ( \mathbf { x } | \mathbf { z } , y )$ during evaluation. This “exact” inference is implemented using gradient descent in the latent space (with fixed posterior width) to find the optimal $\mathbf { z } _ { y }$ which maximizes the lower bound on the log-likelihood for each class:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\ell _ { y } ^ { * } ( \mathbf { x } ) = \mathop { \operatorname* { m a x } } _ { \mathbf { z } } ~ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } , y ) - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Note that we replaced the expectation in equation 2 with a maximum likelihood sample to avoid stochastic sampling and to simplify optimization. To avoid local minima we evaluate 8000 random points in the latent space of each VAE, from which we pick the best as a starting point for a gradient descent with 50 iterations using the Adam optimizer (Kingma & Ba, 2014).
|
| 81 |
+
|
| 82 |
+
• Classification and confidence: Finally, to perform the actual classification, we scale all $\ell _ { y } ^ { * } ( \mathbf x )$ with a factor $\alpha$ , exponentiate, add an offset $\eta$ and divide by the total evidence (like in a softmax),
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
p ( y | \mathbf { x } ) = \left( e ^ { \alpha \ell _ { y } ^ { * } ( \mathbf { x } ) } + \eta \right) / \sum _ { c } \left( e ^ { \alpha \ell _ { c } ^ { * } ( \mathbf { x } ) } + \eta \right) .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
We introduced $\eta$ for the following reason: even on points far outside the data domain, where all likelihoods $q ( \mathbf { x } , y ) = e ^ { \alpha \ell _ { y } ^ { * } ( \mathbf { x } ) } + \eta$ are small, the standard softmax $( \eta = 0$ ) can lead to sharp posteriors $p ( y | \mathbf { x } )$ with high confidence scores for one class. This behavior is in stark contrast to humans, who would report a uniform distribution over classes for unrecognizable images. To model this behavior we set $\eta > 0$ : in this case the posterior $p ( y | \mathbf { x } )$ converges to a uniform distribution whenever the maximum $q ( \mathbf { x } , y )$ gets small relative to $\eta$ . We chose $\eta$ such that the median confidence $p ( \boldsymbol { y } | \mathbf { x } )$ is 0.9 for the predicted class on clean test samples. Furthermore, for a better comparison with cross-entropy trained networks, the scale $\alpha$ is trained to minimize the cross-entropy loss. We also tested this graded softmax in standard feedforward CNNs but did not find any improvement with respect to unrecognizable images.
|
| 89 |
+
|
| 90 |
+
Binarization (Binary ABS only): The pixel intensities of MNIST images are almost binary. We exploit this by projecting the intensity $b$ of each pixel to 0 if $b < 0 . 5$ or 1 if $b \geq 0 . 5$ during testing.
|
| 91 |
+
|
| 92 |
+
• Discriminative finetuning (Binary ABS only): To improve the accuracy of the Binary ABS model we multiply $\ell _ { y } ^ { * } ( \mathbf x )$ with an additional class-dependent scalar $\gamma _ { y }$ . The scalars are learned discriminatively (see A.7) and reach values in the range $\gamma _ { y } \in [ 0 . 9 6 , 1 . 0 6 ]$ for all classes $y$ .
|
| 93 |
+
|
| 94 |
+
On important ingredient for the robustness of the ABS model is the Gaussian posterior in the reconstruction term which ensures that small changes in the input (in terms of L2) can only entail small changes to the posterior likelihood and thus to the model decision.
|
| 95 |
+
|
| 96 |
+
# 4 TIGHT ESTIMATES OF THE LOWER BOUND FOR ADVERSARIAL EXAMPLES
|
| 97 |
+
|
| 98 |
+
The decision of the model depends on the likelihood in each class, which for clean samples is mostly dominated by the posterior likelihood $p ( \mathbf { x } | \mathbf { z } )$ . Because we chose this posterior to be Gaussian, the
|
| 99 |
+
|
| 100 |
+
class-conditional likelihoods can only change gracefully with changes in $\mathbf { x }$ , a property which allows us to derive lower bounds on the model robustness. To see this, note that equation 3 can be written as,
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\ell _ { c } ^ { * } ( \mathbf { x } ) = \underset { \mathbf { z } } { \mathrm { m a x } } - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] - \frac { 1 } { 2 \sigma ^ { 2 } } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 } ^ { 2 } + C ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where we absorbed the normalization constants of $p ( \mathbf { x } | \mathbf { z } )$ into $C$ and $\mathbf { G } _ { c } ( \mathbf { z } )$ is the mean of $p ( \mathbf { x } | \mathbf { z } , c )$ Let $y$ be the ground-truth class and let $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ be the optimal latent for the clean sample $\mathbf { x }$ for class $y$ . We can then estimate a lower bound on $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for a perturbation $\pmb { \delta }$ with size $\epsilon = { \left\| \delta \right\| } _ { 2 }$ (see derivation in Appendix A.4),
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\ell _ { y } ^ { * } ( \mathbf { x } + \boldsymbol { \delta } ) \geq \ell _ { y } ^ { * } ( \mathbf { x } ) - \frac { 1 } { \sigma ^ { 2 } } \epsilon \| \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \| _ { 2 } - \frac { 1 } { 2 \sigma ^ { 2 } } \epsilon ^ { 2 } + C .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Likewise, we can derive an upper bound of $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for all other classes $c \neq y$ (see Appendix A.5),
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\ell _ { c } ^ { * } ( \mathbf { x } + \delta ) \leq - { \mathcal { D } _ { K L } } \left[ { \mathcal { N } } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | { \mathcal { N } } ( \mathbf { 0 } , \mathbb { 1 } ) \right] + C - \left\{ \begin{array} { l l } { \frac { 1 } { 2 \sigma ^ { 2 } } ( d _ { c } - \epsilon ) ^ { 2 } } & { \mathrm { i f ~ } d _ { c } \geq \epsilon } \\ { 0 } & { \mathrm { e l s e } } \end{array} \right. .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
for $d _ { c } = \operatorname* { m i n } _ { z } \left\| \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right\| _ { 2 }$ . Now we can find $\epsilon$ for a given image $\mathbf { x }$ by equating $( 7 ) = ( 6 )$ ,
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\epsilon _ { x } = \underset { c \neq y } { \mathrm { m i n } } \mathrm { m a x } \left. 0 , \frac { d _ { c } + \ell _ { y } ^ { \ast } ( \mathbf { x } ) - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] } { 2 ( d _ { c } + \| \mathbf { G } _ { y } ( \mathbf { z _ { x } ^ { \ast } } ) - \mathbf { x } \| _ { 2 } ) } \right. .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Note that one assumption we make is that we can find the global minimum of $\| \mathbf G _ { c } ( \mathbf z ) - \mathbf x \| _ { 2 } ^ { 2 }$ . In practice we generally find a very tight estimate of the global minimum (and thus the lower bound) because we optimize in a smooth and low-dimensional space and because we perform an additional brute-force sampling step. We provide quantitative values for $\epsilon$ in section 7.
|
| 125 |
+
|
| 126 |
+
# 5 ADVERSARIAL ATTACKS
|
| 127 |
+
|
| 128 |
+
Reliably evaluating model robustness is difficult because each attack only provides an upper bound on the size of the adversarial perturbations (Uesato et al., 2018). To make this bound as tight as possible we apply many different attacks and choose the best one for each sample and model combination (using the implementations in Foolbox v1.3 (Rauber et al., 2017) which often perform internal hyperparameter optimization). We also created a novel decision-based $L _ { 0 }$ attack as well as a customized attack that specifically exploits the structure of our model. Nevertheless, we cannot rule out that more effective attacks exist and we will release the trained model for future testing.
|
| 129 |
+
|
| 130 |
+
Latent Descent attack This novel attack exploits the structure of the ABS model. Let $\mathbf { x } _ { t }$ be the perturbed sample $\mathbf { x }$ in iteration $t$ . We perform variational inference $p ( \mathbf { z } | \mathbf { x } _ { t } , y ) = \mathcal { N } ( \mu _ { y } ( \mathbf { x } _ { t } ) , \sigma _ { q } I )$ to find the most likely class $\tilde { y }$ that is different from the ground-truth class. We then make a step towards the maximum likelihood posterior $p ( \mathbf { x } | \mathbf { z } , \tilde { y } )$ of that class which we denote as $\tilde { \mathbf { x } } _ { \tilde { y } }$ ,
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\mathbf { x } _ { t } \mapsto ( 1 - \epsilon ) \mathbf { x } _ { t } + \epsilon \tilde { \mathbf { x } } _ { \tilde { y } } .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
We choose $\epsilon = 1 0 ^ { - 2 }$ and iterate until we find an adversarial. For a more precise estimate we perform a subsequent binary search of 10 steps within the last $\epsilon$ interval. Finally, we perform another binary search between the adversarial and the original image to reduce the perturbation as much as possible.
|
| 137 |
+
|
| 138 |
+
Decision-based attacks We use several decision-based attacks because they do not rely on gradient information and are thus insensitive to gradient masking or missing gradients. In particular, we apply the Boundary Attack (Brendel et al., 2018), which is competitive with gradient-based attacks in minimizing the $L _ { 2 }$ norm, and introduce the Pointwise Attack, a novel decision-based attack that greedily minimizes the $L _ { 0 }$ norm. It first adds salt-and-pepper noise until the image is misclassified and then repeatedly iterates over all perturbed pixels, resetting them to the clean image if the perturbed image stays adversarial. The attack ends when no pixel can be reset anymore. We provide an implementation of the attack in Foolbox (Rauber et al., 2017). Finally, we apply two simple noise attacks, the Gaussian Noise attack and the Salt&Pepper Noise attack as baselines.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 2: Accuracy-distortion plots for each distance metric and all models. In (b) we see that a threshold at 0.3 favors Madry et al. while a threshold of 0.35 would have favored the Binary ABS.
|
| 142 |
+
|
| 143 |
+
Transfer-based attacks Transfer attacks also don’t rely on gradients of the target model but instead compute them on a substitute: given an input $\mathbf { x }$ we first compute adversarial perturbations $\pmb { \delta }$ on the substitute using different gradient-based attacks ( $\ L _ { 2 }$ and $L _ { \infty }$ Basic Iterative Method (BIM), Fast Gradient Sign Method (FGSM) and $L _ { 2 }$ Fast Gradient Method) and then perform a line search to find the smallest $\epsilon$ for which ${ \bf x } + \epsilon \delta$ (clipped to the range [0, 1]) is still an adversarial for the target model.
|
| 144 |
+
|
| 145 |
+
Gradient-based attacks We apply the Momentum Iterative Method (MIM) (Dong et al., 2017) that won the NIPS 2017 adversarial attack challenge, the Basic Iterative Method (BIM) (Kurakin et al., 2016) (also known as Projected Gradient Descent (PGD))—for both the $L _ { 2 }$ and the $L _ { \infty }$ norm—as well as the Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014) and its $L _ { 2 }$ variant, the Fast Gradient Method (FGM). For models with input binarization (Binary CNN, Binary ABS), we obtain gradients using the straight-through estimator (Bengio et al., 2013).
|
| 146 |
+
|
| 147 |
+
Score-based attacks We additionally run all attacks listed under Gradient-based attacks using numerically estimated gradients (possible for all models). We use a simple coordinate-wise finite difference method (NES estimates (Ilyas et al., 2018) performed comparable or worse) and repeat the attacks with different values for the step size of the gradient estimator.
|
| 148 |
+
|
| 149 |
+
Postprocessing (binary models only) For models with input binarization (sec. 6) we postprocess all adversarials by setting pixel intensities either to the corresponding value of the clean image or the binarization threshold (0.5). This reduces the perturbation size without changing model decisions.
|
| 150 |
+
|
| 151 |
+
# 6 EXPERIMENTS
|
| 152 |
+
|
| 153 |
+
We compare our ABS model as well as two ablations—ABS with input binarization during test time (Binary ABS) and a CNN with input binarization during train and test time (Binary CNN)—against three other models: the SOTA $L _ { \infty }$ defense (Madry et al., 2018)1, a Nearest Neighbour (NN) model (as a somewhat robust but not accurate baseline) and a vanilla CNN (as an accurate but not robust baseline), see Appendix A.7. We run all attacks (see sec. 5) against all applicable models.
|
| 154 |
+
|
| 155 |
+
For each model and $L _ { p }$ norm, we show how the accuracy of the models decreases with increasing adversarial perturbation size (Figure 2) and report two metrics: the median adversarial distance (Table 1, left values) and the model’s accuracy against bounded adversarial perturbations (Table 1, right values). The median of the perturbation sizes (Table 1, left values) is robust to outliers and summarizes most of the distributions quite well. It represents the perturbation size for which the particular model achieves $5 0 \%$ accuracy and does not require the choice of a threshold. Clean samples that are already misclassified are counted as adversarials with a perturbation size equal to 0, failed attacks as $\infty$ . The commonly reported model accuracy on bounded adversarial perturbations, on the other hand, requires a metric-specific threshold that can bias the results. We still report it (Table 1, right values) for completeness and set $\epsilon _ { L _ { 2 } } = 1 . 5$ , $\epsilon _ { L _ { \infty } } = 0 . 3$ and $\epsilon _ { L _ { 0 } } = 1 2 $ as thresholds.
|
| 156 |
+
|
| 157 |
+
<table><tr><td></td><td>CNN</td><td>Binary CNN</td><td>Nearest Neighbor</td><td>Madry et al.</td><td>Binary ABS</td><td>ABS</td></tr><tr><td>Clean</td><td>99.1%</td><td>98.5%</td><td>96.9%</td><td>98.8%</td><td>99.0%</td><td>99.0%</td></tr><tr><td>L2-metric (ε = 1.5)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Transfer Attacks</td><td>1.1/14%</td><td>1.4 /38%</td><td>5.4/90%</td><td>3.7/94%</td><td>2.5/86%</td><td>4.6 /94%</td></tr><tr><td>Gaussian Noise</td><td>5.2/96%</td><td>3.4/92%</td><td>0/91%</td><td>5.4/96%</td><td>5.6/89%</td><td>10.9/98%</td></tr><tr><td>Boundary Attack</td><td>1.2/ 21%</td><td>3.3/84%</td><td>2.9/73%</td><td>1.4/37%</td><td>6.0/91%</td><td>2.6/83%</td></tr><tr><td>Pointwise Attack</td><td>3.4/91%</td><td>1.9 /71%</td><td>3.5/89%</td><td>1.9 /71%</td><td>3.1/86%</td><td>4.6 /94%</td></tr><tr><td>FGM</td><td>1.4/48%</td><td>1.4/50%</td><td></td><td>080/96%</td><td></td><td></td></tr><tr><td>FGM w/ GE</td><td>1.4/42%</td><td>2.8/51%</td><td>3.7/79%</td><td>8/88%</td><td>1.9 /68%</td><td>3.5/89%</td></tr><tr><td>DeepFool</td><td>1.2/18%</td><td>1.0 /11%</td><td></td><td>9.0/91%</td><td></td><td></td></tr><tr><td>DeepFool w/ GE</td><td>1.3 /30%</td><td>0.9/ 5%</td><td>1.6/ 55%</td><td>5.1/90%</td><td>1.4 / 41%</td><td>2.4/83%</td></tr><tr><td>L2 BIM</td><td>1.1/13%</td><td>1.0 /11%</td><td></td><td>4.8/88%</td><td></td><td></td></tr><tr><td>L2 BIM w/ GE</td><td>1.1/37%</td><td>00/50%</td><td>1.7 / 62%</td><td>3.4/88%</td><td>1.6 / 63%</td><td>3.1/87%</td></tr><tr><td>Latent Descent Attack</td><td></td><td></td><td></td><td></td><td>2.6/97%</td><td>2.7/85%</td></tr><tr><td>All L2 Attacks</td><td>1.1/ 8%</td><td>0.9/ 3%</td><td>1.5/53%</td><td>1.4/35%</td><td>1.3/39%</td><td>2.3 / 80%</td></tr><tr><td>Lo-metric (ε= 0.3)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Transfer Attacks</td><td>0.08/0%</td><td>0.44/ 85%</td><td></td><td>0.42/78%</td><td>0.39 /92%</td><td>0.49 /88%</td><td>0.34 / 73%</td></tr><tr><td>FGSM</td><td>0.10/ 4%</td><td>0.43 / 77%</td><td></td><td></td><td>0.45/93%</td><td></td><td></td></tr><tr><td>FGSM w/GE</td><td>0.10 /21%</td><td>0.42/ 71%</td><td></td><td>0.38/68%</td><td>0.47/89%</td><td>60.49/85%</td><td>0.27 /34%</td></tr><tr><td>LoDeepFool</td><td>0.08/ 0%</td><td>0.38 /74%</td><td></td><td></td><td>0.42/90%</td><td></td><td></td></tr><tr><td>LDeepFool w/ GE</td><td>0.09/ 0%</td><td>0.37 / 67%</td><td></td><td>0.21/26%</td><td>0.53/90%</td><td>0.46 /78%</td><td>0.27/39%</td></tr><tr><td>BIM</td><td>0.08/ 0%</td><td>0.36/ 70%</td><td></td><td></td><td>0.36 /90%</td><td></td><td></td></tr><tr><td>BIM w/ GE</td><td>0.08/37%</td><td></td><td>0/70%</td><td>0.25 /43%</td><td>0.46 /89%</td><td>0.49 /86%</td><td>0.25 /13%</td></tr><tr><td>MIM</td><td>0.08/ 0%</td><td></td><td>0.37 / 71%</td><td></td><td>0.34/90%</td><td></td><td></td></tr><tr><td>MIM w/ GE</td><td>0.09 /36%</td><td></td><td>00/69%</td><td>0.19 /26%</td><td>0.36 /89%</td><td>0.46 /85%</td><td>0.26 /17%</td></tr><tr><td>All L Attacks</td><td>0.08/0%</td><td>0.34/ 64%</td><td></td><td>0.19 /22%</td><td>0.34/88%</td><td>0.44 / 77%</td><td>0.23/ 8%</td></tr><tr><td>Lo-metric (ε = 12)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Salt&Pepper Noise</td><td>44.0 /91%</td><td></td><td></td><td>44.0/88% 161.0/88%</td><td></td><td></td><td>13.5 /56% 146.0/94% 165.0/94%</td></tr><tr><td>Pointwise Attack 10x</td><td>9.0/19%</td><td></td><td>11.0 /39%</td><td>10.0/34%</td><td>4.0/0%</td><td>22.0/77%</td><td>16.5/69%</td></tr><tr><td>All Lo Attacks</td><td>9.0/19%</td><td></td><td>11.0 /38%</td><td>10.0 /34%</td><td>4.0/ 0%</td><td>21.5 / 77%</td><td>16.5 /69%</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 1: Results for different models, adversarial attacks and distance metrics. Each entry shows the median adversarial distance across all samples (left value, black) as well as the model’s accuracy against adversarial perturbations bounded by the thresholds $\epsilon _ { L _ { 2 } } = 1 . 5$ , $\epsilon _ { L _ { \infty } } = 0 . 3$ and $\epsilon _ { L _ { 0 } } = 1 2 $ (right value, gray). $" \mathrm { { w } } / G E ^ { \prime \prime }$ indicates attacks that use numerical gradient estimation.
|
| 160 |
+
|
| 161 |
+
# 7 RESULTS
|
| 162 |
+
|
| 163 |
+
Minimal Adversarials Our robustness evaluation results of all models are reported in Table 1 and Figure 2. All models except the Nearest Neighbour classifier perform close to $9 9 \%$ accuracy on clean test samples. We report results for three different norms: $L _ { 2 }$ , $L _ { \infty }$ and $L _ { 0 }$ .
|
| 164 |
+
|
| 165 |
+
• For $L _ { 2 }$ our ABS model outperforms all other models by a large margin. • For $L _ { \infty }$ , our Binary ABS model is state-of-the-art in terms of median perturbation size. In terms of accuracy (perturbations $< 0 . 3$ ), Madry et al. seems more robust. However, as revealed by the accuracy-distortion curves in Figure 2, this is an artifact of the specific threshold (Madry et al. is optimized for 0.3). A slightly larger one (e.g. 0.35) would strongly favor the Binary ABS model. For $L _ { 0 }$ , both ABS and Binary ABS are much more robust than all other models. Interestingly, the model by Madry et al. is the least robust, even less than the baseline CNN.
|
| 166 |
+
|
| 167 |
+
In Figure 3 we show adversarial examples. For each sample we show the minimally perturbed $L _ { 2 }$ adversarial found by any attack. Adversarials for the baseline CNN and the Binary CNN are almost imperceptible. The Nearest Neighbour model, almost by design, exposes (some) adversarials that interpolate between two numbers. The model by Madry et al. requires perturbations that are clearly visible but make little semantic sense to humans. Finally, adversarials generated for the ABS models are semantically meaningful for humans and are sitting close to the perceptual boundary between the original and the adversarial class. For a more thorough comparison see appendix Figures 5, 6 and 7.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: Adversarial examples for the ABS models are perceptually meaningful: For each sample (randomly chosen from each class) we show the minimally perturbed $L _ { 2 }$ adversarial found by any attack. Our ABS models have clearly visible and often semantically meaningful adversarials. Madry et al. requires perturbations that are clearly visible, but their semantics are less clear.
|
| 171 |
+
|
| 172 |
+
Lower bounds on Robustness For the ABS models and the $L _ { 2 }$ metric we estimate a lower bound of the robustness. The lower bound for the mean perturbation2 for the MNIST test set is $\epsilon =$ $0 . 6 9 0 \pm 0 . 0 0 5$ for the ABS and $\epsilon = 0 . 6 0 1 \pm 0 . 0 0 5$ for the binary ABS. We estimated the error by using different random seeds for our optimization procedure and standard error propagation over 10 runs. With adversarial training Hein & Andriushchenko (2017) achieve a mean $L _ { 2 }$ robustness guarantee of $\epsilon = 0 . 4 8$ while reaching $9 9 \%$ accuracy. In the $\operatorname { \cal L } _ { i n f }$ metric we find a median robustness of 0.06.
|
| 173 |
+
|
| 174 |
+
Distal Adversarials We probe the behavior of CNN, Madry et al. and our ABS model outside the data distribution. We start from random noise images and perform gradient ascent to maximize the output probability of a fixed label until $p ( y | \mathbf { x } ) \geq 0 . 9$ (as computed by the modified softmax from equation (8)). The results are visualized in Figure 4. Standard CNNs and Madry et al.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 4: Images of ones classified with a probability above $90 \%$ .
|
| 178 |
+
|
| 179 |
+
provide high confidence class probabilities for unrecognizable images. Our ABS model does not provide high confidence predictions in out-of-distribution regions.
|
| 180 |
+
|
| 181 |
+
# 8 DISCUSSION & CONCLUSION
|
| 182 |
+
|
| 183 |
+
In this paper we demonstrated that, despite years of work, we as a community failed to create neural networks that can be considered robust on MNIST from the point of human perception. In particular, we showed that even today’s best defense is susceptible to small adversarial perturbations that make little to no semantic sense to humans. We presented a new approach based on analysis by synthesis that seeks to explain its inference by means of the actual image features. We performed an extensive analysis to show that minimal adversarial perturbations in this model are large across all tested $L _ { p }$ norms and semantically meaningful to humans. Note that our architecture derives its robustness from its design and does not require any additionally training with adversarial examples.
|
| 184 |
+
|
| 185 |
+
We acknowledge that it is not easy to reliably evaluate a model’s adversarial robustness and most defenses proposed in the literature have later been shown to be ineffective. In particular, the structure of the ABS model prevents the computation of gradients which might give the model an unfair advantage. We put a lot of effort into an extensive evaluation of adversarial robustness using a large collection of powerful attacks, including one specifically designed to be particularly effective against the ABS model (the Latent Descent attack), and we will release the model architecture and trained weights as a friendly invitation to fellow researchers to evaluate our model.
|
| 186 |
+
|
| 187 |
+
Looking at the results of individual attacks (Table 1) we find that there is no single attack that works best on all models, thus highlighting the importance for a broad range of attacks. Without the Boundary Attack, for example, Madry et al. would have looked more robust to $L _ { 2 }$ adversarials than it is. For similar reasons Figure 6b of Madry et al. (2018) reports a median $L _ { 2 }$ perturbation size larger than 5, compared to the 1.4 achieved by the Boundary Attack. Moreover,the combination of all attacks of one metric $( A l l L _ { 2 } / L _ { \infty } / L _ { 0 }$ Attacks) is often better than any individual attack, indicating that different attacks are optimal on different samples.
|
| 188 |
+
|
| 189 |
+
Our conceptual implementation of the ABS model with one VAE per class neither scales efficiently to more classes nor to more complex datasets (a preliminary experiment on CIFAR10 provided only $54 \%$ test accuracy). However, first experiments on two class CIFAR indicate that the proposed model is also robust on CIFAR (we reach a median L2 robustness of 2.6 compared to 0.8 for a vanilla CNN, see Appendix A.1) for details). To increase the accuracy, there are many ways in which the ABS model can be improved, ranging from better and faster generative models (e.g. flow-based) to better training procedures.
|
| 190 |
+
|
| 191 |
+
In a nutshell, we demonstrated that MNIST is still not solved from the point of adversarial robustness and showed that our novel approach based on analysis by synthesis has great potential to reduce the vulnerability against adversarial attacks and to align machine perception with human perception.
|
| 192 |
+
|
| 193 |
+
# ACKNOWLEDGMENTS
|
| 194 |
+
|
| 195 |
+
This work has been funded, in part, by the German Federal Ministry of Education and Research (BMBF) through the Bernstein Computational Neuroscience Program Tübingen (FKZ: 01GQ1002) as well as the German Research Foundation (DFG CRC 1233 on “Robust Vision”). The authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting L.S. and J.R.; J.R. acknowledges support by the Bosch Forschungsstiftung (Stifterverband, T113/30057/17); W.B. was supported by the Carl Zeiss Foundation (0563-2.8/558/3); M.B. acknowledges support by the Centre for Integrative Neuroscience Tübingen (EXC 307); W.B. and M.B. were supported by the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior / Interior Business Center (DoI/IBC) contract number D16PC00003.
|
| 196 |
+
|
| 197 |
+
# REFERENCES
|
| 198 |
+
|
| 199 |
+
Anish Athalye and Nicholas Carlini. On the robustness of the cvpr 2018 white-box adversarial example defenses. arXiv preprint arXiv:1804.03286, 2018.
|
| 200 |
+
|
| 201 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018.
|
| 202 |
+
|
| 203 |
+
Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 204 |
+
|
| 205 |
+
W. Brendel and M. Bethge. Comment on “biologically inspired protection of deep networks from adversarial attacks”. arXiv preprint arXiv:1704.01547, 2017.
|
| 206 |
+
|
| 207 |
+
Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\equiv$ SyZI0GWCZ.
|
| 208 |
+
|
| 209 |
+
Sébastien Bubeck, Eric Price, and Ilya Razenshteyn. Adversarial examples from computational constraints. arXiv preprint arXiv:1805.10204, 2018.
|
| 210 |
+
|
| 211 |
+
Jacob Buckman, Aurko Roy, Colin Raffel, and Ian Goodfellow. Thermometer encoding: One hot way to resist adversarial examples. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ S18Su--CW.
|
| 212 |
+
|
| 213 |
+
Nicholas Carlini and David Wagner. Magnet and" efficient defenses against adversarial attacks" are not robust to adversarial examples. arXiv preprint arXiv:1711.08478, 2017.
|
| 214 |
+
|
| 215 |
+
Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
|
| 216 |
+
|
| 217 |
+
Guneet S. Dhillon, Kamyar Azizzadenesheli, Jeremy D. Bernstein, Jean Kossaifi, Aran Khanna, Zachary C. Lipton, and Animashree Anandkumar. Stochastic activation pruning for robust adversarial defense. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1uR4GZRZ.
|
| 218 |
+
|
| 219 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Xiaolin Hu, Jianguo Li, and Jun Zhu. Boosting adversarial attacks with momentum. arxiv preprint. arXiv preprint arXiv:1710.06081, 2017.
|
| 220 |
+
|
| 221 |
+
Dileep George, Wolfgang Lehrach, Ken Kansky, Miguel Lázaro-Gredilla, Christopher Laan, Bhaskara Marthi, Xinghua Lou, Zhaoshi Meng, Yi Liu, Huayan Wang, Alex Lavin, and D. Scott Phoenix. A generative vision model that trains with high data efficiency and breaks text-based captchas. Science, 358(6368), 2017. ISSN 0036-8075. doi: 10.1126/science.aag2612. URL http://science.sciencemag.org/content/ 358/6368/eaag2612.
|
| 222 |
+
|
| 223 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 224 |
+
|
| 225 |
+
Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ SyJ7ClWCb.
|
| 226 |
+
|
| 227 |
+
Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems 30, pp. 2266–2276. Curran Associates, Inc., 2017.
|
| 228 |
+
|
| 229 |
+
Andrew Ilyas, Ajil Jalal, Eirini Asteri, Constantinos Daskalakis, and Alexandros G Dimakis. The robust manifold defense: Adversarial training using generative models. arXiv preprint arXiv:1712.09196, 2017.
|
| 230 |
+
|
| 231 |
+
Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. arXiv preprint arXiv:1804.08598, 2018.
|
| 232 |
+
|
| 233 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 234 |
+
|
| 235 |
+
Vishaal Munusamy Kabilan, Brandon Morris, and Anh Nguyen. Vectordefense: Vectorization as a defense to adversarial examples. arXiv preprint arXiv:1804.08529, 2018.
|
| 236 |
+
|
| 237 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 238 |
+
|
| 239 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 240 |
+
|
| 241 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 242 |
+
|
| 243 |
+
Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Jun Zhu, and Xiaolin Hu. Defense against adversarial attacks using high-level representation guided denoiser. arXiv preprint arXiv:1712.02976, 2017.
|
| 244 |
+
|
| 245 |
+
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, 2018. URL https://openreview.net/forum?id=rJzIBfZAb.
|
| 246 |
+
|
| 247 |
+
Dongyu Meng and Hao Chen. Magnet: a two-pronged defense against adversarial examples. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 135–147. ACM, 2017.
|
| 248 |
+
|
| 249 |
+
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015.
|
| 250 |
+
|
| 251 |
+
Aaditya Prakash, Nick Moran, Solomon Garber, Antonella DiLillo, and James Storer. Deflecting adversarial attacks with pixel deflection. arXiv preprint arXiv:1801.08926, 2018.
|
| 252 |
+
|
| 253 |
+
Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. In International Conference on Learning Representations, 2018. URL https://openreview.net/ forum?id $\equiv$ Bys4ob-Rb.
|
| 254 |
+
|
| 255 |
+
Jonas Rauber, Wieland Brendel, and Matthias Bethge. Foolbox: A python toolbox to benchmark the robustness of machine learning models. arXiv preprint arXiv:1707.04131, 2017. URL http://arxiv.org/abs/ 1707.04131.
|
| 256 |
+
|
| 257 |
+
Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-GAN: Protecting classifiers against adversarial attacks using generative models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ BkJ3ibb0-.
|
| 258 |
+
|
| 259 |
+
Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. CoRR, abs/1804.11285, 2018. URL http://arxiv.org/abs/ 1804.11285.
|
| 260 |
+
|
| 261 |
+
Bernhard Schölkopf. Causal learning, 2017. URL https://icml.cc/Conferences/2017/ Schedule?showEvent $= 9 3 1$ . Thirty-fourth International Conference on Machine Learning.
|
| 262 |
+
|
| 263 |
+
Shiwei Shen, Guoqing Jin, Ke Gao, and Yongdong Zhang. Ape-gan: Adversarial perturbation elimination with gan. arXiv preprint arXiv:1707.05474, 2017.
|
| 264 |
+
|
| 265 |
+
Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rJUYGxbCW.
|
| 266 |
+
|
| 267 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 268 |
+
|
| 269 |
+
Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
|
| 270 |
+
|
| 271 |
+
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. There is no free lunch in adversarial robustness (but there are unexpected benefits). arXiv preprint arXiv:1805.12152, 2018.
|
| 272 |
+
|
| 273 |
+
Jonathan Uesato, Brendan O’Donoghue, Pushmeet Kohli, and Aaron van den Oord. Adversarial risk and the dangers of evaluating against weak attacks. In Proceedings of the 35th International Conference on Machine Learning, 2018. URL http://proceedings.mlr.press/v80/uesato18a.html.
|
| 274 |
+
|
| 275 |
+
Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ Sk9yuql0Z.
|
| 276 |
+
|
| 277 |
+
Tianhang Zheng, Changyou Chen, and Kui Ren. Distributionally adversarial attack. arXiv preprint arXiv:1808.05537, 2018.
|
| 278 |
+
|
| 279 |
+
A APPENDIX
|
| 280 |
+
|
| 281 |
+
# A.1 TWO CLASS CIFAR
|
| 282 |
+
|
| 283 |
+
We estimate the robustness of our ABS model on two class CIFAR (airplane vs. automobile). Preliminary results suggest that our robustness is not limited to MNIST.
|
| 284 |
+
|
| 285 |
+
In order to adapt to CIFAR, we modified the ABS slightly by modifying encoder and decoder to fit $( 3 2 \mathbf { x } 3 2 \mathbf { x } 3 )$ CIFAR images. We also increased the number of dimensions in the latent space form 8 to 20.
|
| 286 |
+
|
| 287 |
+
Table 2: Accuracy and estimated robustness on two class CIFAR.
|
| 288 |
+
|
| 289 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>CNN</td><td rowspan=1 colspan=1>ABS</td></tr><tr><td rowspan=1 colspan=1>Accuracy</td><td rowspan=1 colspan=1>97.1%</td><td rowspan=1 colspan=1>89.7%</td></tr><tr><td rowspan=1 colspan=1>Median L2 distance</td><td rowspan=1 colspan=1>0.8 (with BIM)</td><td rowspan=1 colspan=1>2.5 (with Latent Descent attack)</td></tr></table>
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 5: $L _ { 0 }$ error quantiles: We always choose the minimally perturbed $L _ { 0 }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ). Where $1 0 0 \%$ corresponds to the maximal (over samples) minimum (over attacks) perturbation found for each model.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 6: $L _ { 2 }$ error quantiles: We always choose the minimally perturbed $L _ { 2 }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample 4 images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ).
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure 7: $L _ { \infty }$ error quantiles: We always choose the minimally perturbed $L _ { \infty }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ).
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 8: Distribution of minimal adversarials for each model and distance metric. In (b) we see that a threshold at 0.3 favors Madry et al. while a threshold of 0.35 would have favored the Binary ABS.
|
| 302 |
+
|
| 303 |
+
# A.3 DERIVATION I
|
| 304 |
+
|
| 305 |
+
Derivation of the ELBO in equation 2.
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\log p _ { \boldsymbol \theta } ( \mathbf { x } ) = \log \int \mathbf { d z } p _ { \boldsymbol \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) ,
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
where $p ( \mathbf { z } ) = \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } )$ is a simple normal prior. Based on the idea of importance sampling using a variational posterior $q _ { \phi } ( { \bf z } | { \bf x } )$ with parameters $\phi$ and using Jensen’s inequality we arrive at
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r l } & { = \log \int \mathrm { d } z \frac { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) , } \\ & { = \log \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \frac { p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { \geq \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log \frac { p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { = \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) + \log \frac { p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { = \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) \right] - \mathcal { D } _ { K L } \left[ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \right] \left. p ( \mathbf { z } ) \right] . } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
This lower bound is commonly referred to as ELBO.
|
| 318 |
+
|
| 319 |
+
# A.4 DERIVATION II: LOWER BOUND FOR $L _ { 2 }$ ROBUSTNESS ESTIMATION
|
| 320 |
+
|
| 321 |
+
Derivation of equation 6. Starting from equation 3 we find that for a perturbation $\pmb { \delta }$ with size $\epsilon = { \left\| \delta \right\| } _ { 2 }$ of sample $\mathbf { x }$ the lower bound $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ can itself be bounded by,
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { r l r } { { \ell _ { y } ^ { * } ( \mathbf x + \delta ) = \operatorname* { m a x } _ { \mathbf z } - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } } \\ & { } & { \geq - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z _ { \mathbf x } ^ { * } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z _ { \mathbf x } ^ { * } ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
where $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ is the optimal latent vector for the clean sample $\mathbf { x }$ for class $_ y$ ,
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\begin{array} { r l } & { = \ell _ { y } ^ { * } ( \mathbf { x } ) + \frac { 1 } { \sigma ^ { 2 } } \boldsymbol { \delta } ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \frac { 1 } { 2 \sigma ^ { 2 } } \boldsymbol { \epsilon } ^ { 2 } + C , } \\ & { \geq \ell _ { y } ^ { * } ( \mathbf { x } ) - \frac { 1 } { \sigma ^ { 2 } } \boldsymbol { \epsilon } \| \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \| _ { 2 } - \frac { 1 } { 2 \sigma ^ { 2 } } \boldsymbol { \epsilon } ^ { 2 } + C . } \end{array}
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
A.5 DERIVATION III: UPPER BOUND FOR $L _ { 2 }$ ROBUSTNESS ESTIMATION
|
| 334 |
+
|
| 335 |
+
Derivation of equation 7.
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\begin{array} { r l r } { { \ell _ { c } ^ { * } ( \mathbf { x } + \delta ) = \operatorname* { m a x } _ { \mathbf { \mu } _ { \mathbf { z } } } - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { y } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } + C , } } \\ & { } & { \leq - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \underset { \mathbf { z } } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } , } \\ & { } & { \leq - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \underset { \mathbf { z } , \delta } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } , } \\ & { } & { = - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \{ \frac { 1 } { 2 \sigma ^ { 2 } } ( d _ { c } - \epsilon ) ^ { 2 } \quad \mathrm { i f ~ } d _ { c } \geq \epsilon . } \end{array}
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
for $d _ { c } = \mathrm { m i n } _ { z } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 }$ . The last equation comes from the solution of the constrained optimization problem $\operatorname* { m i n } _ { d } ( d - \epsilon ) ^ { 2 } d$ s.t. $d > d _ { c }$ . Note that a tighter bound might be achieved by assuming single $\pmb { \delta }$ for upper and lower bound.
|
| 342 |
+
|
| 343 |
+
# A.6 $L _ { \infty }$ ROBUSTNESS ESTIMATION
|
| 344 |
+
|
| 345 |
+
We proceed in the same way as for $L _ { 2 }$ . Starting again from
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\ell _ { c } ^ { * } ( \mathbf { x } ) = \underset { \mathbf { z } } { \mathrm { m a x } } - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] - \frac { 1 } { 2 \sigma ^ { 2 } } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 } ^ { 2 } + C ,
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
let $_ y$ be the predicted class and let $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ be the optimal latent for the clean sample $\mathbf { x }$ for class $y$ . We can then estimate a lower bound on $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for a perturbation $\pmb { \delta }$ with size $\epsilon = \| \pmb { \delta } \| _ { \infty }$ ,
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\begin{array} { r l r } { { \ell _ { y } ^ { * } ( \mathbf x + \delta ) = \operatorname* { m a x } _ { \mathbf z } - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } } \\ & { } & { \geq - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z _ { \mathbf x } ^ { * } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z _ { \mathbf x } ^ { * } ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } \end{array}
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
where $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ is the optimal latent for the clean sample $\mathbf { x }$ for class $y$ .
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\begin{array} { l } { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + \frac { 1 } { \sigma ^ { 2 } } \delta ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \frac { 1 } { 2 \sigma ^ { 2 } } \| \delta \| _ { 2 } ^ { 2 } + C , } \\ { \displaystyle \geq \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \operatorname* { m i n } \left( 2 \delta ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \| \delta \| _ { 2 } ^ { 2 } \right) , } \\ { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \operatorname* { m i n } \left( 2 \delta _ { i } [ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ] _ { i } - \delta _ { i } ^ { 2 } \right) , } \\ { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \left\{ \left[ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \right] _ { i } ^ { 2 } \right. \qquad \mathrm { i f ~ } [ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ] _ { i } | \leq \epsilon \ . } \end{array}
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
Similarly, we can estimate an upper bound on $\ell _ { c } ^ { * } ( \mathbf { x } + \delta )$ on all other classes $c \neq y$ ,
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\begin{array} { l } { { \displaystyle \ell _ { c } ^ { * } ( { \bf x } + \delta ) \leq - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) ] + C - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } { \bf G } _ { c } ( { \bf z } ) - { \bf x } - \delta _ { 2 } ^ { 2 } , } } \\ { { \displaystyle \leq - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C - \underset { \bf z , \delta } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } { \bf G } _ { c } ( { \bf z } ) - { \bf x } - \delta _ { 2 } ^ { 2 } , } } \\ { ~ } \\ { { \displaystyle = - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \underset { \sigma _ { i } } { \operatorname* { m i n } } ( [ { \bf G } _ { c } ( { \bf z } ) - { \bf x } ] _ { i } - \delta _ { i } ) ^ { 2 } , } } \\ { { \displaystyle = - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C } ~ } \\ \displaystyle ~ - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \{ \begin{array} { l l } { \displaystyle 0 ( \mathbf { E } _ { y } ( { \bf z } _ { \mathbf { x } } ^ { * } ) - { \bf x } ) _ { i } - \boldsymbol { \cal K } ^ { 2 } \} } & { { \displaystyle \mathrm { i f } [ \mathbf { G } _ { y } ( { \bf z } _ { \mathbf { x } } ^ { * } ) - { \bf x } ] _ { i } \leq \epsilon } } \\ \displaystyle ( [ \end{array} \end{array}
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
In this case there is no closed-form solution for the minimization problem on the RHS (in terms of the minimum of $\| \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \| _ { 2 } )$ but we can still compute the solution for each given $\epsilon$ which allows us perform a line search along $\epsilon$ to find the point where equation $1 3 =$ equation 14.
|
| 370 |
+
|
| 371 |
+
# A.7 MODEL & TRAINING DETAILS
|
| 372 |
+
|
| 373 |
+
Hyperparameters and training details for the ABS model The binary ABS and ABS have the same weights and architecture: The encoder has 4 layers with kernel s $\mathrm { i z e s } = [ 5 , 4 , 3 , 5 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ and feature map sizes $=$ [32, 32, 64, 2∗8]. The first 3 layers have ELU activation functions (Clevert et al., 2015), the last layer is linear. All except the last layer use Batch Normalization (Ioffe & Szegedy, 2015). The Decoder architecture has also 4 layers with kernel $\mathrm { s i z e s } = [ 4 , 5 , 5 , 3 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ and feature map size $=$ [32, 16, 16, 1]. The first 3 layers have ELU activation functions, the last layer has a sigmoid activation function, and all layers except the last one use Batch Normalization.
|
| 374 |
+
|
| 375 |
+
We trained the VAEs with the Adam optimizer (Kingma & Ba, 2014). We tuned the dimension $L$ of the latent space of the class-conditional VAEs (ending up with $L = 8$ ) to achieve $9 9 \%$ test error; started with a high weight for the KL-divergence term at the beginning of training (which was gradually decreased from a factor of 10 to 1 over 50 epochs); estimated the weighting $\gamma = [ 1 , 0 . 9 6 , 1 . 0 0 1 , 1 . 0 6 , 0 . 9 8 , 0 . 9 6 , 1 . 0 3 , 1 , 1 , 1 ]$ of the lower bound via a line search on the training accuracy. The parameters maximizing the test cross entropy3 and providing a median confidence of $p ( y | x ) = 0 . 9$ for our modified softmax (equation 8) are $\eta = 0 . 0 0 0 0 3 9$ and $\alpha = 4 4 0$ . For our latent prior, we chose $\sigma _ { q } = 1$ and for the posterior width we choose $\sigma = 1 / \sqrt { 2 }$
|
| 376 |
+
|
| 377 |
+
Hyperparameters for the CNNs The CNN and Binary CNN share the same architecture but have different weights. The architecture has kernel size $\mathfrak { s } = [ 5 , 4 , 3 , 5 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ , and feature map sizes $= [ 2 0 , 7 0 , 2 5 6 , 1 0 ]$ . All layers use ELU activation functions and all layers except the last one apply Batch Normalization. The CNNs are both trained on the cross entropy loss with the Adam optimizer (Kingma & Ba, 2014). The parameters maximizing the test cross entropy and providing a median confidence of $p ( y | x ) = 0 . 9$ of the CNN for our modified softmax (equation 8) are $\eta = 1 4 3 9 0 0$ and $\alpha = 1$ .
|
| 378 |
+
|
| 379 |
+
Hyperparameters for Madry et al. We adapted the pre-trained model provided by Madry et al4. Basically the architecture contains two convolutional, two pooling and two fully connected layers. The network is trained on clean and adversarial examples minimizing the cross cross-entropy loss. The parameters maximizing the test cross entropy and providing a median confidence of $p ( y | x ) = 0 . 9$ for our modified softmax (equation 8) are $\eta = 6 0$ and $\alpha = 1$ .
|
| 380 |
+
|
| 381 |
+
Hyperparameters for the Nearest Neighbour classifier For a comparison with neural networks, we imitate logits by replacing them with the negative minimal distance between the input and all samples within each class. The parameters maximizing the test cross entropy and providing a median confidence of $\hat { p ( y | x ) } = 0 . 9$ for our modified softmax (equation 8) are $\eta = 0 . 0 0 0 0 0 0 0 0 0 0 0 0 4$ and $\alpha = 5$ .
|
md/train/S1x2PCNKDB/S1x2PCNKDB.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TASK-RELEVANT ADVERSARIAL IMITATION LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We show that a critical problem in adversarial imitation from high-dimensional sensory data is the tendency of discriminator networks to distinguish agent and expert behaviour using task-irrelevant features beyond the control of the agent. We analyze this problem in detail and propose a solution as well as several baselines that outperform standard Generative Adversarial Imitation Learning (GAIL). Our proposed solution, Task-Relevant Adversarial Imitation Learning (TRAIL), uses a constrained optimization objective to overcome task-irrelevant features. Comprehensive experiments show that TRAIL can solve challenging manipulation tasks from pixels by imitating human operators, where other agents such as behaviour cloning (BC), standard GAIL, improved GAIL variants including our newly proposed baselines, and Deterministic Policy Gradients from Demonstrations (DPGfD) fail to find solutions, even when the other agents have access to task reward.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generative Adversarial Networks (GANs) have produced breath-taking conditional image synthesis results (Goodfellow et al., 2014; Brock et al., 2019), and have inspired adversarial learning approaches to imitating behavior. In Generative Adversarial Imitation Learning (GAIL) (Ho & Ermon, 2016), a discriminator network is trained to distinguish agent and expert behaviour through its observations, and is then used as a reward function. GAIL agents can overcome the exploration challenge by taking advantage of expert demonstrations, while also achieving high asymptotic performance by learning from agent experience.
|
| 12 |
+
|
| 13 |
+
Despite the huge promise of GAIL, it has not yet had the same impact as GANs; in particular, robust GAIL from pixels for control applications remains a challenge. Here, we study a key shortcoming of GAIL: the tendency of the discriminator to mainly exploit task-irrelevant features. For example, by focusing on slight background differences, a discriminator can achieve perfect generalization, assigning zero reward to all held-out agent observations. However, this discriminator does not yield an informative reward function because it ignores behavior.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: GAIL and TRAIL succeed at lifting (a), but when distractor objects are added, GAIL fails while TRAIL succeeds (b). Due to robustness to initial conditions, TRAIL can stack from pixels while standard GAIL fails (c). We witness this difference again in insertion with distractors (d). A video showing agents performing these tasks can be seen at https://youtu.be/Rz5G15rDKcg .
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
Figure 2: Illustration of several task-irrelevant changes between the expert demonstrations and the distribution of agent observations, for the lift (red cube) task. The naively-trained discriminator network will use these differences rather than task performance to distinguish agent and expert.
|
| 20 |
+
|
| 21 |
+
Assuming there is an expert policy $\pi _ { E }$ that is optimal for an unknown reward function, here we refer to a feature as task-irrelevant if it does not affect that reward. For example, if the task is to lift a red block, the positions of other blocks would be task-irrelevant; see Figures 1 and 2.
|
| 22 |
+
|
| 23 |
+
This paper makes the following contributions:
|
| 24 |
+
|
| 25 |
+
1. It reveals a fundamental limitation of GAIL by showing that discriminators do in practice exploit task-irrelevant information, thereby resulting in poor task performance.
|
| 26 |
+
2. It introduces powerful GAIL baselines. In particular, it shows that standard regularization and data augmentation are generally useful and improve upon standard GAIL.
|
| 27 |
+
3. It shows that these improvements to GAIL, as well as other improvements proposed by Reed et al. (2018), do not completely solve the problem, allowing GAIL agents to fail catastrophically with the addition of task-irrelevant distractors.
|
| 28 |
+
4. It introduces Task Relevant Adversarial Imitation Learning (TRAIL), using constrained optimization to force the discriminator to focus on the relevant aspects of the task, which improves performance dramatically on manipulation tasks from pixels (see Figure 1).
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
The use of demonstrations to help agent training has been studied extensively in robotics (Bakker & Kuniyoshi, 1996; Kawato et al., 1994; Miyamoto et al., 1996) with approaches ranging from Q-learning (Schaal, 1997) to behavioral cloning (BC) (Pomerleau, 1989).
|
| 33 |
+
|
| 34 |
+
BC: BC is effective in solving many control problems (Pomerleau, 1989; Finn et al., 2017; Duan et al., 2017; Rahmatizadeh et al., 2018). It has also been successfully applied to initialize RL training (Rajeswaran et al., 2017). It, however, suffers from compounding errors as initial small deviations from the expert behaviors tend to cause bigger differences (Ross et al., 2011). This often necessitates a large number of demonstrations for satisfactory performance. Furthermore, BC typically does not lead to agents that are superior to their demonstrators.
|
| 35 |
+
|
| 36 |
+
Inverse RL: Ziebart et al. (2008); $\mathrm { N g }$ et al. (2000); Abbeel & $\mathrm { N g } \left( 2 0 0 4 \right)$ propose inverse reinforcement learning (IRL) as a way of learning reward functions from demonstrations. Reinforcement learning can then be used to optimize that learned reward. Recently, Finn et al. (2016b) approached continuous robotic control problems with success by applying Maximum Entropy IRL algorithms which are very closely related to GAIL (Finn et al., 2016a) and have similar drawbacks.
|
| 37 |
+
|
| 38 |
+
Learning from Demonstrations: Hester et al. (2018) developed deep Q-Learning from demonstration (DQfD), in which expert trajectories are added to experience replay and jointly used to train agents along with their own experiences. This was later extended by Vecerik et al. (2017) and Pohlen et al. (2018) to better handle sparse-reward problems in control and Atari games respectively. Despite their efficiency, this class of methods still requires access to rewards in order to learn.
|
| 39 |
+
|
| 40 |
+
GAIL: Following the success of Generative Adversarial Networks (Goodfellow et al., 2014) in image generation, GAIL (Ho & Ermon, 2016) applies adversarial learning to the problem of imitation. Although many variants are introduced in the literature (Li et al., 2017; Fu et al., 2018; Merel et al., 2017; Zhu et al., 2018; Baram et al., 2017), making GAIL work for high-dimensional input spaces, particularly raw pixels, remains a challenge.
|
| 41 |
+
|
| 42 |
+
A few papers (Peng et al., 2018; Reed et al., 2018; Blondé & Kalousis, 2018) seek to address the problem of overfitting the discriminator. Peng et al. (2018) introduces the Variational Bottleneck to regularize the discriminator. Reed et al. (2018) proposes to not train the vision module of the discriminator (e.g. use the vision module of the critic network instead) and only train a tiny network on top of the vision module to discriminate. Blondé & Kalousis (2018) follow a similar approach. Unstructured regularization, however, cannot stop the discriminator from fitting to features that are systematically different between the agents’ and the demonstration’s behavior, like those illustrated in Figure 2. TRAIL, on the other hand, is much less prone to overfitting to these features.
|
| 43 |
+
|
| 44 |
+
Stadie et al. (2017) extend GAIL to the setting of third person imitation, in which the demonstrator and agent observations come from different views. To prevent the discriminator from discriminating based on viewpoint domain, they use gradient flipping from an auxiliary classifier to learn domain-invariant features. Our approach is not to learn domain-invariant features, but instead learn domain-agnostic discriminators that only focus on behavior.
|
| 45 |
+
|
| 46 |
+
Several recent works have focused on improving the sample efficiency of GAIL (Blondé & Kalousis, 2018; Sasaki et al., 2018). Common to these approaches and to this work, is the use of off-policy actor critic agents and experience replay, to improve the utilization of available experience.
|
| 47 |
+
|
| 48 |
+
# 3 REINFORCEMENT LEARNING AND ADVERSARIAL IMITATION
|
| 49 |
+
|
| 50 |
+
Following the notation of Sutton & Barto (2018), a Markov Decision Process (MDP) is a tuple $( \mathcal { S } , \mathcal { A } , R , \mathbf { \bar { P } } , \gamma )$ with states $s$ , actions $\mathcal { A }$ , reward function $R ( s , a )$ , transition distribution $P ( s ^ { \prime } | s , a )$ , and discount $\gamma$ . An agent in state $s \in S$ takes action $a \in A$ according to its policy $\pi$ and moves to state $s ^ { \prime } \in \varDelta$ according to the transition distribution. The goal of RL algorithms is to find a policy that maximizes the expected sum of discounted rewards, represented by the action value function $\begin{array} { r } { Q ^ { \pi } ( s , a ) = \mathbb { E } ^ { \pi } [ \sum _ { t = 0 } ^ { \infty } \overset { \cdot } { \gamma } ^ { t } R ( s _ { t } , a _ { t } ) ] } \end{array}$ , where $\mathbb { E } ^ { \pi }$ is an expectation over trajectories starting from $s _ { 0 } = s$ and taking action $a _ { 0 } = a$ and thereafter running the policy $\pi$ .
|
| 51 |
+
|
| 52 |
+
To apply RL, it is essential that we have access to the reward function which is often hard to design and evaluate (Singh et al., 2019). In addition, sparse rewards can cause exploration difficulties that pose great challenges to RL algorithms. We therefore look to imitation learning and particularly GAIL to derive a reward function from expert demonstrations. In GAIL, a reward function is learned by training a discriminator network $D ( s , a )$ to distinguish between agent and expert state-action pairs. The GAIL objective is thus formulated as follows:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\operatorname* { m i n } _ { \pi } \operatorname* { m a x } _ { D } \mathbb { E } _ { ( s , a ) \sim \pi _ { E } } [ \log D ( s , a ) ] + \mathbb { E } _ { ( s , a ) \sim \pi } [ \log ( 1 - D ( s , a ) ) ] - \lambda _ { H } H ( \pi ) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\pi$ is the agent policy, $\pi _ { E }$ the expert policy, and $H ( \pi )$ an (optional) entropy regularizer. The reward function is defined simply: $R ( s , a ) = - \log ( 1 - D ( s , a ) )$ .
|
| 59 |
+
|
| 60 |
+
GAIL is theoretically appealing and practically simple. The discriminator, however, can focus on any features to discriminate, whether these features are task-relevant or not. In the next subsection we describe a way to constrain the discriminator network in order to prevent it from using task-irrelevant details to distinguish agent and expert data.
|
| 61 |
+
|
| 62 |
+
# 4 TASK-RELEVANT ADVERSARIAL IMITATION LEARNING (TRAIL)
|
| 63 |
+
|
| 64 |
+
We want the discriminator to focus on task-relevant features. Our proposed solution, TRAIL, prevents the discriminator from being able to distinguish expert and agent behaviour based on selected aspects of the data. For instance, the discriminator should distinguish agent and expert frames only when meaningful behavior is present in those frames. In the absence of behavior useful to solve the task, e.g. in initial frames prior to the execution of the behavior, the discriminator should be agnostic.
|
| 65 |
+
|
| 66 |
+
To this end, we propose a constraint for the discriminator, such that its accuracy must not be greater than chance on a particular set of observations $\mathcal { L }$ that we will call the invariant set. $\mathcal { T }$ will include only observations that can be distinguished as agent or expert in task-irrelevant ways. Precisely, we formulate TRAIL in terms of the following constrained optimization problem:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r l } { \displaystyle \mathop { \operatorname* { m a x } } _ { \psi } } & { \mathbb { E } _ { s \sim \pi _ { E } } \left[ \log D _ { \psi } ( s ) \right] + \mathbb { E } _ { s \sim \pi _ { \theta } } \left[ \log ( 1 - D _ { \psi } ( s ) ) \right] } \\ { \displaystyle s . t . } & { \frac { 1 } { 2 } \mathbb { E } _ { s \sim \pi _ { E } } \left[ { \mathbf 1 } _ { { \mathbf D } _ { \psi } ( { \mathbf s } ) \geq \frac { 1 } { 2 } } \mid s \in { \mathbb Z } \right] + \frac { 1 } { 2 } \mathbb { E } _ { s \sim \pi _ { \theta } } \left[ { \mathbf 1 } _ { { \mathbf D } _ { \psi } ( { \mathbf s } ) < \frac { 1 } { 2 } } \mid s \in { \mathbb Z } \right] \le \frac { 1 } { 2 } . } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
To apply the above constraint in practice, we can optimize the reverse of the objective function on $\mathcal { T }$ That is, given a batch of $N$ examples $s _ { e } \sim \pi _ { E } , s _ { \theta } \sim \pi _ { \theta }$ from the expert and agent, and $\hat { s } _ { e } \sim \pi _ { E }$ and $\hat { s } _ { \theta } \sim \pi _ { \theta }$ both in the set $\mathcal { T }$ , we maximize the following augmented objective function:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r l } & { \mathcal { L } _ { \psi } \big ( s _ { e } , s _ { \theta } , \hat { s } _ { e } , \hat { s } _ { \theta } \big ) = \sum _ { i = 1 } ^ { N } \log D _ { \psi } \left( s _ { e } ^ { ( i ) } \right) + \log \left( 1 - D _ { \psi } \left( s _ { \theta } ^ { ( i ) } \right) \right) } \\ & { \qquad - \lambda \left[ \sum _ { i = 1 } ^ { N } \log D _ { \psi } \left( \hat { s } _ { e } ^ { ( i ) } \right) + \log \left( 1 - D _ { \psi } \left( \hat { s } _ { \theta } ^ { ( i ) } \right) \right) \right] \mathbf { 1 } _ { a c c u r a c y ( \hat { s } _ { e } , \hat { s } _ { \theta } ) \geq \frac { 1 } { 2 } } , } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $a c c u r a c y ( \cdot , \cdot )$ is defined as the average of discriminator accuracies:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
a c c u r a c y ( \hat { s } _ { e } , \hat { s } _ { \theta } ) = \frac { 1 } { 2 N } \sum _ { i = 1 } ^ { N } \left[ \mathbf { 1 } _ { \mathrm { D } _ { \psi } \left( \hat { \mathbf { s } } _ { e } ^ { ( \mathrm { i } ) } \right) \geq \frac { 1 } { 2 } } + \mathbf { 1 } _ { \mathrm { D } _ { \psi } \left( \hat { \mathbf { s } } _ { \theta } ^ { ( \mathrm { i } ) } \right) < \frac { 1 } { 2 } } \right] .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
The scalar $\lambda \geq 0$ is a tunable hyperparameter.
|
| 85 |
+
|
| 86 |
+
We used single frames as states but sequences can also be used, and we do not require expert actions. Not requiring actions enables learning in very off-policy settings, where the action dimensions and distributions of the demonstrator (another robot or human) are different from those of the agent.
|
| 87 |
+
|
| 88 |
+
# 4.1 THE SELECTION OF THE INVARIANT SET
|
| 89 |
+
|
| 90 |
+
The selection of the invariant set $\mathcal { T }$ is a design choice. In general, we could always contrive nonstationary and adversarial ways of making this choice difficult. However, we argue that in many situations of great interest, including our robotic manipulation setup, it is easy to propose effective and very general invariant sets.
|
| 91 |
+
|
| 92 |
+
A straightforward way to collect robot data is to execute a random policy. We can then use the resulting random episodes, for both expert and agent, to construct the invariant set $\mathcal { T }$ . Another way to construct $\mathcal { T }$ is to use early frames from both expert and agent episodes. Since in early frames little or no task behavior is apparent, this strategy turns out to be effective and no extra data has to be collected. This strategy also improves robustness with respect to variation in the initial conditions of the task; see for example block insertion in Figure 1(d).
|
| 93 |
+
|
| 94 |
+
Importantly, if the set $\mathcal { T }$ captures some forms of irrelevance but not all forms, it will nonetheless always help in improving performance. In this regard, TRAIL will dominate its GAIL predecessor whenever the designer has some prior on what aspects of the data might be task irrelevant.
|
| 95 |
+
|
| 96 |
+
# 5 EXPERIMENTS
|
| 97 |
+
|
| 98 |
+
We focus on solving robot manipulation tasks. The environment implements two work-spaces: one with a Kinova Jaco arm (Jaco), and the other with a Sawyer arm (Sawyer). See supplementary material A.1 for a detailed description. Environment rewards, which are not used by GAIL-based methods, are sparse and equal to $+ 1$ for each step when a given task is solved and 0 otherwise. The maximum reward for the episode is 200, since this is the length of a single evaluation episode.
|
| 99 |
+
|
| 100 |
+
Our agent is based on the off-policy D4PG algorithm (Barth-Maron et al., 2018) because of its stability and data-efficiency (see supplementary material A.6). Following Vecerik et al. (2017), we add expert demonstrations into the agents’ experience replay, and refer to the resulting RL algorithm as D4PG from Demonstrations (D4PGfD). For each task we collect 100 human demonstrations.
|
| 101 |
+
|
| 102 |
+
Data augmentation Traditional data augmentation has proved beneficial in imitation learning (Berseth & Pal, 2019). Surprisingly, to the best of our knowledge, this has not been explicitly studied in prior publications on GAIL. However, we find that data augmentation is a generally useful component to prevent discriminator overfitting. It drastically improves the baseline GAIL agent, and is necessary to solve any of the harder manipulation tasks. We distort images by randomly changing brightness, contrast and saturation; random cropping and rotation; adding Gaussian noise. When multiple sensor inputs are available (e.g. multiple cameras), we also randomly drop out these inputs, but leaving at least one active.
|
| 103 |
+
|
| 104 |
+
All discriminator-based methods in this work (including all baselines) use data augmentation except as indicated in the relevant ablations (see Section 5.2). We also considered regularizing the GAIL discriminator with spectral normalization (Miyato et al., 2018). It performed slightly better than GAIL, but still failed in the presence of distractor objects, and we thus omit spectral normalization in the main experiments for simplicity.
|
| 105 |
+
|
| 106 |
+
Actor early stopping When the agent has learned the desired behavior, and the resulting data is used for training, the discriminator will become unable to distinguish expert and agent observations based only on behavior. This forces the discriminator to rely on task-irrelevant information.
|
| 107 |
+
|
| 108 |
+
To avoid this scenario, we propose to restart each actor episode after a certain number of steps such that successful behavior is rarely represented in agent data. This enables the discriminator to recognize the goal condition, which appears frequently at the end of demonstration episodes, as representative of expert behavior. To avoid hand-tuning the stopping step number, we found that the discriminator score can be used to derive an adaptive stopping criterion. Concretely, we restart an episode if the discriminator score at the current step exceeds the median score of the episode so far for $T _ { p a t i e n c e }$ consecutive steps (in practice we set $T _ { p a t i e n c e } = 1 0$ ).
|
| 109 |
+
|
| 110 |
+
We set invariant set hyperparameter $\lambda = 1$ and use adaptive early stopping for TRAIL. The ablation with $\lambda = 0$ , i.e. adaptive early stopping only, is referred to as TRAIL-0. Hence, the only difference between TRAIL-0 and TRAIL is that the later uses invariant set constraints.
|
| 111 |
+
|
| 112 |
+
# 5.1 BLOCK LIFTING WITH DISTRACTORS
|
| 113 |
+
|
| 114 |
+
In this section, we consider two variants of the lift task in the Sawyer work space: a) lift alone, where only one red cube is present, b) lift distracted, with two extra blocks (blue and green, see Figure 9). We show how adding these additional distractors affects the training procedure.
|
| 115 |
+
|
| 116 |
+
We first compare our method to baselines. In doing so, the invariant set is constructed using the first 10 frames from every episode, as in the rest of the work. This choice does not require us to collect any extra data, and hence the comparison with baselines is fair. In the next section, we elaborate on the choice of the invariant set and provide additional experimental results.
|
| 117 |
+
|
| 118 |
+
As baselines, we run BC and GAIL (with data augmentation). Baseline GAIL is the strongest we were able to implement. The only difference between this baseline and TRAIL is the use of invariant set constrains and actor early stopping (code, agent configurations like number of actors, and network architecture are the same). We additionally consider the approaches proposed by Reed et al. (2018) as GAIL-based baselines; using either a randomly initialized convolutional network, or a convolutional critic network, to provide fixed vision features on top of which a tiny discriminator network is trained. We call these two baselines random and critic respectively. Finally, to show the importance of actor early stopping, we run TRAIL-0 (Fig. 3).
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: Results for lift alone, lift distracted, and lift distracted seeded. Only TRAIL excels.
|
| 122 |
+
|
| 123 |
+
All methods perform satisfactorily on lift alone, but the proposed methods TRAIL-0 and TRAIL do best. As expected, the performance of BC on lift distracted is similar to its performance on lift alone, despite the two additional blocks. The two additional blocks in lift distracted affect the GAIL-based baselines, despite being irrelevant to the task.
|
| 124 |
+
|
| 125 |
+
To understand this effect, we conducted an additional experiment (lift distracted seeded). Here the initial block positions are randomly drawn from the expert demonstrations. Therefore, it is impossible to discriminate between expert and actor episodes using the first few frames of an episode. Note this initialization procedure is not applied to the evaluation actor, keeping the evaluation scores comparable between lift distracted and lift distracted seeded.
|
| 126 |
+
|
| 127 |
+
This experiment exposes one major culprit behind the performance degradation of GAIL: memorization. The discriminator can achieve perfect accuracy by memorizing all 100 initial positions from the demonstration set, making the reward function uninformative. By constraining the discriminator, TRAIL squeezes out this irrelevant information and succeeds in solving the task in the presence of distractions. TRAIL is the only method that is able to handle the variety of initial cube positions during training, achieving better than expert performance on lift distracted.
|
| 128 |
+
|
| 129 |
+
Interestingly, random performs reasonably on lift distracted. Given random’s strong performance, we conducted additional experiments to evaluate its effectiveness when trained with adaptive early stopping and present the results in Figure 12 of the supplementary material.
|
| 130 |
+
|
| 131 |
+
# CONSTRUCTING THE INVARIANT SET $\mathcal { T }$
|
| 132 |
+
|
| 133 |
+
In the previous subsection, early frames were used to construct the invariant set (TRAIL-early). Here, we evaluate another previously mentioned approach for constructing $\mathcal { T }$ ; random policy (TRAILrandom). The lift distracted task caused all baselines to fail, but was solved by TRAIL. We introduce a harder version of the task, where the expert appearance is different, to tease out the differences between TRAIL-early and TRAIL-random. The difference in appearance between the expert and imitator allows the GAIL discriminator to trivially distinguish them. The results and the differences in the expert appearance are presented in Figure 4.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 4: Lift red block, where expert has a different body appearance, and with distractor blocks. TRAIL-random outperforms GAIL, and performs on par with TRAIL-early.
|
| 137 |
+
|
| 138 |
+
The new task is indeed harder and it takes longer for TRAIL methods to achieve performance better than BC baseline, which is not affected by the different body appearance. GAIL is clearly outperformed and does not take off.
|
| 139 |
+
|
| 140 |
+
The difference between TRAIL methods is negligible. We also tried to mix them but the differences remain imperceptible. Hence, in the following experiments we simply use early frames. This choice is pragmatic as it does not require that we collect any extra data, and hence the comparison with GAIL and other baselines is fair. It is also very simple to apply in practice, even if one does not have access to the expert setup anymore. Finally, it is general and powerful enough to be successfully used across all robotic manipulation tasks considered in this work.
|
| 141 |
+
|
| 142 |
+
To decide how many initial frames should be used to construct $\mathcal { T }$ , we conducted an ablation study and found out that the method is not very sensitive to this choice (see supplementary material A.2). Hence, we chose 10 initial frames, and intentionally used the same number for all tasks to further emphasize generality of this choice.
|
| 143 |
+
|
| 144 |
+
# 5.2 ABLATION STUDIES
|
| 145 |
+
|
| 146 |
+
# MEASURING DISCRIMINATOR MEMORIZATION OF TASK-IRRELEVANT FEATURES
|
| 147 |
+
|
| 148 |
+
In this section, we experimentally confirm that memorization is a limiting factor of GAIL methods. We equipped the discriminator with two extra heads whose inputs are the final spatial layer of the
|
| 149 |
+
|
| 150 |
+
ResNet for the lift distracted task. The first head is trained on the first frames only, and has the same target as the main head (i.e. discriminating between agent and expert). To train the second head, we randomly divide the expert demonstrations into two equi-numerous subsets, and the task is to predict to which of these randomly chosen sets the demonstration was assigned to. Both heads are trained via backpropagation but their gradient is not propagated to the ResNet so they do not influence the training procedure directly.
|
| 151 |
+
|
| 152 |
+
If our claim is correct, we expect the extra heads to have higher accuracy for TRAIL-0 as compared to TRAIL, since TRAIL representations are penalized for having features triggering memorization, i.e. the features should not aid discriminating based on the first frames or predicting a random label for each expert demonstration. No reasonably performing method is able to force $50 \%$ accuracy for extra heads since some features are important to solve the task (e.g. the position of the red cube).
|
| 153 |
+
|
| 154 |
+
We also collected 25 extra holdout demonstrations and visualize the average discriminator prediction on them, and compare with predictions on the training demonstrations.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 5: Demonstrating the memorization problem on the lift distracted task (here higher accuracy is worse). Accuracy of different discriminator heads is presented (A-D). In A, the overall accuracy for all timesteps. Then main $\mathrm { ( m ) }$ and extra (e) heads accuracy for the first steps are presented in B and C, respectively. Accuracy of the head predicting randomly assigned demonstration class is shown in D. Average discriminator predictions for training and holdout demonstration are shown in E and F.
|
| 158 |
+
|
| 159 |
+
In Fig. 5, we see the overall accuracy of the main head for TRAIL-0 is significantly higher, and the difference is larger for early steps (when TRAIL achieves only $50 \%$ , as expected). TRAIL representations are less helpful for extra heads (see Figure 5 C-D). Finally, TRAIL-0 clearly overfits on training demonstrations, predicting almost the maximum score, while only $\sim 0 . 2 5$ is predicted for holdout demonstrations. The TRAIL average predictions for both datasets are almost identical.
|
| 160 |
+
|
| 161 |
+
ACTOR EARLY STOPPING (TRAIL-0)
|
| 162 |
+
|
| 163 |
+
In this section, we analyze the importance of adaptive early stopping on 3 tasks in the Jaco workspace: lift red cube $( l i f t )$ , put red cube in box $( b o x )$ , and stack red cube on blue cube (stack). We consider D4PGfD and three GAIL-based models with varying termination policies: a) fixed step (50), b) based on ground truth task rewards, and c) based on adaptive early stopping (TRAIL-0). Using ground truth task rewards, an episode is terminated if the reward at the current step exceeds the median reward of the episode so far for 10 consecutive steps. Results are presented in Figure 6.
|
| 164 |
+
|
| 165 |
+
Termination based on task reward is clearly superior; although unrealistic in practice, it defines the performance upper-bound and clearly shows that early stopping is beneficial. TRAIL-0 is robust and reaches human performance on all tasks. A fixed termination policy, when tuned, can be very effective. The same fixed termination step, however, does not work for all tasks. See Figure 13 in supplementary material for the effects of varying termination steps. Finally, as can be inferred from stack results, the dense rewards provided by TRAIL-0 are helpful in solving this challenging problem which is unsolved with D4PGfD even though D4PGfD uses ground truth task rewards.
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 6: Results for lift, box, and stack on Jaco environment.
|
| 169 |
+
|
| 170 |
+
# DATA AUGMENTATION
|
| 171 |
+
|
| 172 |
+
In Table 5.2, we report the best reward obtained in the first 12 hours of training (averaged for all seeds;
|
| 173 |
+
see Figure 14 for full curves). The results show that data augmentation is needed in lift distracted.
|
| 174 |
+
For the lift alone task, TRAIL-0 with data augmentation performs on par with TRAIL.
|
| 175 |
+
|
| 176 |
+
Table 1: Influence of data augmentation (evaluated on rewards) for lift alone and lift distracted.
|
| 177 |
+
|
| 178 |
+
<table><tr><td>Task</td><td>Regularization</td><td>Data augmentation</td><td>No data augmentation</td></tr><tr><td>lift alone</td><td>TRAIL-0 TRAIL</td><td>~165</td><td>~115</td></tr><tr><td rowspan="2">lift distracted</td><td>TRAIL-0</td><td>~155</td><td>~165</td></tr><tr><td>TRAIL</td><td>~30 ~180</td><td>~5 ~10</td></tr></table>
|
| 179 |
+
|
| 180 |
+
The performance of TRAIL is not affected by the lack of data augmentation on the lift alone task, whereas the performance of TRAIL-0 is.
|
| 181 |
+
|
| 182 |
+
# LEARNING WITH A FIXED, PERFECT DISCRIMINATOR
|
| 183 |
+
|
| 184 |
+
To assess whether learned discriminators are necessary, we compare TRAIL against agents using a fixed reward function corresponding to $R _ { e x p e r t } = 1$ and $R _ { a g e n t } = 0$ for the lift alone and lift distracted tasks. This baseline simulates an oracle discriminator with perfect generalization, but which is agnostic to behavior. On the lift alone task, agents using this fixed reward achieve roughly half the reward of TRAIL asymptotically, and on lift distracted they do not solve the task (average rewards are less than 5). See supplementary Figure 16 for learning curves.
|
| 185 |
+
|
| 186 |
+
# 5.3 LEARNING FROM OTHER EMBODIMENTS AND PROPS
|
| 187 |
+
|
| 188 |
+
Since the TRAIL discriminator is trained to ignore task-irrelevant features, it can learn from demonstrations with different embodiments and props. Figure 7 shows that GAIL even with augmentation fails to learn block lifting from a different embodiment, and performs worse when the expert uses a different prop color. TRAIL solves the task and achieves better performance in both cases.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 7: When the expert differs in body or prop appearance, TRAIL outperforms GAIL.
|
| 192 |
+
|
| 193 |
+
# 5.4 EVALUATION ON DIVERSE MANIPULATION TASKS
|
| 194 |
+
|
| 195 |
+
To further demonstrate benefits of using our proposed method, we present results for TRAIL, TRAIL0, the baseline GAIL, and BC on more challenging tasks. Specifically, we consider stack with the Sawyer robot; and insertion and stack banana in the Jaco work-space. The results are shown in Figure 8. The tasks we consider here are much harder as evidenced by the performance of BC agents. These experiments suggest that TRAIL is generally useful as an improvement over GAIL, even when the tasks are not designed to include task-irrelevant information.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 8: Results comparing TRAIL, TRAIL-0 and GAIL for diverse manipulation tasks.
|
| 199 |
+
|
| 200 |
+
# 6 CONCLUSIONS
|
| 201 |
+
|
| 202 |
+
To make adversarial imitation work on nontrivial tasks from pixels, it is crucial to prevent the discriminator from exploiting task-irrelevant information. Data augmentation is a necessary component that prevents the discriminator from overfitting, but alone is not sufficient to solve more challenging problems. Our proposed method TRAIL proved to be a remedy which effectively focuses the discriminator on the task even when task-irrelevant features are present.
|
| 203 |
+
|
| 204 |
+
We showed through ablations that TRAIL benefits from data augmentation, actor early stopping, and the use of invariant set constraints. The last enables our agent to solve the full task suite in our experiments showing its decisive importance.
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
Pieter Abbeel and Andrew Y Ng. Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 1. ACM, 2004.
|
| 209 |
+
|
| 210 |
+
Paul Bakker and Yasuo Kuniyoshi. Robot see, robot do: An overview of robot imitation. In AISB96 Workshop on Learning in Robots and Animals, 1996.
|
| 211 |
+
|
| 212 |
+
Nir Baram, Oron Anschel, Itai Caspi, and Shie Mannor. End-to-end differentiable adversarial imitation learning. In ICML, 2017.
|
| 213 |
+
|
| 214 |
+
Gabriel Barth-Maron, Matthew W Hoffman, David Budden, Will Dabney, Dan Horgan, Alistair Muldal, Nicolas Heess, and Timothy Lillicrap. Distributed distributional deterministic policy gradients. arXiv preprint arXiv:1804.08617, 2018.
|
| 215 |
+
|
| 216 |
+
Marc G Bellemare, Will Dabney, and Rémi Munos. A distributional perspective on reinforcement learning. arXiv preprint arXiv:1707.06887, 2017.
|
| 217 |
+
|
| 218 |
+
Glen Berseth and Christopher J Pal. Visual imitation learning with recurrent siamese networks. arXiv preprint arXiv:1901.07186, 2019.
|
| 219 |
+
|
| 220 |
+
Lionel Blondé and Alexandros Kalousis. Sample-efficient imitation learning via generative adversarial nets. arXiv preprint arXiv:1809.02064, 2018.
|
| 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, 2019.
|
| 223 |
+
|
| 224 |
+
Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
|
| 225 |
+
|
| 226 |
+
Yan Duan, Marcin Andrychowicz, Bradly Stadie, OpenAI Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. In Advances in neural information processing systems, pp. 1087–1098, 2017.
|
| 227 |
+
|
| 228 |
+
Chelsea Finn, Paul Christiano, Pieter Abbeel, and Sergey Levine. A connection between generative adversarial networks, inverse reinforcement learning, and energy-based models. arXiv preprint arXiv:1611.03852, 2016a.
|
| 229 |
+
|
| 230 |
+
Chelsea Finn, Sergey Levine, and Pieter Abbeel. Guided cost learning: Deep inverse optimal control via policy optimization. In International Conference on Machine Learning, pp. 49–58, 2016b.
|
| 231 |
+
|
| 232 |
+
Chelsea Finn, Tianhe Yu, Tianhao Zhang, Pieter Abbeel, and Sergey Levine. One-shot visual imitation learning via meta-learning. arXiv preprint arXiv:1709.04905, 2017.
|
| 233 |
+
|
| 234 |
+
Justin Fu, Katie Luo, and Sergey Levine. Learning robust rewards with adversarial inverse reinforcement learning. In ICLR, 2018.
|
| 235 |
+
|
| 236 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 237 |
+
|
| 238 |
+
Todd Hester, Matej Vecerik, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Dan Horgan, John Quan, Andrew Sendonaris, Ian Osband, Gabriel Dulac-Arnold, John Agapiou, Joel Z. Leibo, and Audrunas Gruslys. Deep q-learning from demonstrations. In AAAI, 2018.
|
| 239 |
+
|
| 240 |
+
Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. In Advances in Neural Information Processing Systems, pp. 4565–4573, 2016.
|
| 241 |
+
|
| 242 |
+
Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado Van Hasselt, and David Silver. Distributed prioritized experience replay. arXiv preprint arXiv:1803.00933, 2018.
|
| 243 |
+
|
| 244 |
+
Mitsuo Kawato, Francesca Gandolfo, Hiroaki Gomi, and Yasuhiro Wada. Teaching by showing in kendama based on optimization principle. In ICANN. 1994.
|
| 245 |
+
|
| 246 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 247 |
+
|
| 248 |
+
Yunzhu Li, Jiaming Song, and Stefano Ermon. Infogail: Interpretable imitation learning from visual demonstrations. In NIPS, 2017.
|
| 249 |
+
|
| 250 |
+
Josh Merel, Yuval Tassa, Sriram Srinivasan, Jay Lemmon, Ziyu Wang, Greg Wayne, and Nicolas Heess. Learning human behaviors from motion capture by adversarial imitation. arXiv preprint arXiv:1707.02201, 2017.
|
| 251 |
+
|
| 252 |
+
Hiroyuki Miyamoto, Stefan Schaal, Francesca Gandolfo, Hiroaki Gomi, Yasuharu Koike, Rieko Osu, Eri Nakano, Yasuhiro Wada, and Mitsuo Kawato. A kendama learning robot based on bi-directional theory. Neural networks, 1996.
|
| 253 |
+
|
| 254 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In ICLR, 2018.
|
| 255 |
+
|
| 256 |
+
Andrew Y Ng, Stuart J Russell, et al. Algorithms for inverse reinforcement learning. In Icml, pp. 663–670, 2000.
|
| 257 |
+
|
| 258 |
+
Xue Bin Peng, Angjoo Kanazawa, Sam Toyer, Pieter Abbeel, and Sergey Levine. Variational discriminator bottleneck: Improving imitation learning, inverse rl, and gans by constraining information flow. arXiv preprint arXiv:1810.00821, 2018.
|
| 259 |
+
|
| 260 |
+
Tobias Pohlen, Bilal Piot, Todd Hester, Mohammad Gheshlaghi Azar, Dan Horgan, David Budden, Gabriel Barth-Maron, Hado van Hasselt, John Quan, Mel Vecerík, et al. Observe and look further: Achieving ˇ consistent performance on atari. arXiv preprint arXiv:1805.11593, 2018.
|
| 261 |
+
|
| 262 |
+
Dean A Pomerleau. Alvinn: An autonomous land vehicle in a neural network. In Advances in neural information processing systems, pp. 305–313, 1989.
|
| 263 |
+
|
| 264 |
+
Rouhollah Rahmatizadeh, Pooya Abolghasemi, Ladislau Bölöni, and Sergey Levine. Vision-based multitask manipulation for inexpensive robots using end-to-end learning from demonstration. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 3758–3765. IEEE, 2018.
|
| 265 |
+
|
| 266 |
+
Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning complex dexterous manipulation with deep reinforcement learning and demonstrations. arXiv preprint arXiv:1709.10087, 2017.
|
| 267 |
+
|
| 268 |
+
Scott Reed, Yusuf Aytar, Ziyu Wang, Tom Paine, Aäron van den Oord, Tobias Pfaff, Sergio Gomez, Alexander Novikov, David Budden, and Oriol Vinyals. Visual imitation with a minimal adversary. 2018.
|
| 269 |
+
|
| 270 |
+
Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627–635, 2011.
|
| 271 |
+
|
| 272 |
+
Fumihiro Sasaki, Tetsuya Yohira, and Atsuo Kawaguchi. Sample efficient imitation learning for continuous control. 2018.
|
| 273 |
+
|
| 274 |
+
Stefan Schaal. Learning from demonstration. In NIPS, 1997.
|
| 275 |
+
|
| 276 |
+
David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In ICML, 2014.
|
| 277 |
+
|
| 278 |
+
Avi Singh, Larry Yang, Kristian Hartikainen, Chelsea Finn, and Sergey Levine. End-to-end robotic reinforcement learning without reward engineering. arXiv preprint arXiv:1904.07854, 2019.
|
| 279 |
+
|
| 280 |
+
Bradly C Stadie, Pieter Abbeel, and Ilya Sutskever. Third-person imitation learning. arXiv preprint arXiv:1703.01703, 2017.
|
| 281 |
+
|
| 282 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
|
| 283 |
+
|
| 284 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
|
| 285 |
+
|
| 286 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
|
| 287 |
+
|
| 288 |
+
Matej Vecerik, Todd Hester, Jonathan Scholz, Fumin Wang, Olivier Pietquin, Bilal Piot, Nicolas Heess, Thomas Rothörl, Thomas Lampe, and Martin A. Riedmiller. Leveraging demonstrations for deep reinforcement learning on robotics problems with sparse rewards. CoRR, 2017.
|
| 289 |
+
|
| 290 |
+
Yuke Zhu, Ziyu Wang, Josh Merel, Andrei Rusu, Tom Erez, Serkan Cabi, Saran Tunyasuvunakool, János Kramár, Raia Hadsell, Nando de Freitas, et al. Reinforcement and imitation learning for diverse visuomotor skills. In RSS, 2018.
|
| 291 |
+
|
| 292 |
+
Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, volume 8, pp. 1433–1438. Chicago, IL, USA, 2008.
|
| 293 |
+
|
| 294 |
+
# A SUPPLEMENTARY MATERIAL
|
| 295 |
+
|
| 296 |
+
# A.1 DETAILED DESCRIPTION OF ENVIRONMENT
|
| 297 |
+
|
| 298 |
+
All our simulations are conducted using $\mathbf { M u J o C o ^ { 1 } }$ (Todorov et al., 2012). We test our proposed algorithms in a variety of different envrionments using simulated Kinova Jaco2, and Sawyer robot arms3; see Figure 9. We use the Robotiq 2F85 gripper4 in conjuction with the Sawyer arm.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
|
| 302 |
+
Figure 9: Two work spaces, Jaco (left) which uses the Jaco arm and is $2 0 \times 2 0 ~ \mathrm { c m }$ , and Sawyer (right) which uses the Sawyer arm and more closely resembles a real robot cage and is $3 5 \times 3 5 \mathrm { c m }$ .
|
| 303 |
+
|
| 304 |
+
To provide demonstrations, we use the SpaceNavigator 3D motion controller5 to set Cartesion velocities of the robot arm. The gripper actions are implemented via the buttons on the controller. All demonstrations in our experiments are provided via human teleoperation and we collected 100 demonstrations for each experiment.
|
| 305 |
+
|
| 306 |
+
Jaco: When using the Jaco arm, we use joint velocity control (9DOF) where we control all 6 joints of arm and all 3 joints of the hand. The simulation is run with a numerical time step of 10 milliseconds, integrating 5 steps, to get a control frequency of 20HZ. The agent uses a frontal camera of size $6 4 \times 6 4$ (see Figure 10(a)). For a full list of observations the agent sees, please refer to Table 2(a).
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 10: Illustration of the pixels inputs to the agent.
|
| 310 |
+
|
| 311 |
+
Sawyer: When using the Sawyer arm, we use Cartesian velocity control (6DOF) for the robot arm and add one additional action for the gripper resulting in 7 degrees of freedom. The simulation is run with a numerical time step of 10 milliseconds, integrating 10 steps, to get a control frequency of 10HZ. The agent uses two frontal cameras of size $6 4 \times 6 4$ situated on the left and right side of the robot cage respectively (see Figure $1 0 ( \mathrm { b } , \mathrm { c } ) ,$ ). For a full list of observations the agent sees, please refer to Table 2(b).
|
| 312 |
+
|
| 313 |
+
For all environments considered in this paper, we provide sparse rewards (i.e. if task is accomplished, the reward is 1 and 0 otherwise). In experiments regards our proposed methods, rewards are only used for evaluation purposes and not for training the agent.
|
| 314 |
+
|
| 315 |
+
a) Jaco
|
| 316 |
+
|
| 317 |
+
<table><tr><td>Feature Name</td><td>Dimensions</td></tr><tr><td>frontal camera base force and torque sensors</td><td>64×64×3 6</td></tr><tr><td>arm joints position</td><td>6</td></tr><tr><td>arm joints velocity</td><td>6</td></tr><tr><td>wrist force and torque sensors</td><td>6</td></tr><tr><td>hand finger joints position</td><td>3</td></tr><tr><td>hand finger joints velocity</td><td></td></tr><tr><td>hand fingertip sensors</td><td>3</td></tr><tr><td></td><td>3</td></tr><tr><td>grip site position</td><td>3</td></tr><tr><td>pinch site position</td><td>3</td></tr></table>
|
| 318 |
+
|
| 319 |
+
Table 2: Observation and dimensions.
|
| 320 |
+
|
| 321 |
+
<table><tr><td colspan="2">b) Sawyer</td></tr><tr><td>Feature Name frontleft camera</td><td>Dimensions 64×64×3</td></tr><tr><td>front right camera</td><td>64×64×3</td></tr><tr><td>arm joint position</td><td>7</td></tr><tr><td>arm joint velocity</td><td>7</td></tr><tr><td>wrist force sensor</td><td>3</td></tr><tr><td>wrist torque sensor</td><td>3</td></tr><tr><td>hand grasp sensor</td><td></td></tr><tr><td></td><td>1</td></tr><tr><td>hand joint position</td><td>1</td></tr><tr><td>tool center point cartesian orientation</td><td>9</td></tr><tr><td>tool center point cartesian position</td><td></td></tr><tr><td>hand joint velocity</td><td>3 1</td></tr></table>
|
| 322 |
+
|
| 323 |
+
# A.2 EARLY FRAMES ABLATION STUDY
|
| 324 |
+
|
| 325 |
+
Here, we vary the number of early frames of each episode used to form $\mathcal { T }$ . We report that a range of values from 1 up to 20 works well across both tasks (Put in box and Stack banana), with performance gradually degrading as the value increased beyond 20 (Fig. 11).
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 11: TRAIL performance, varying the number of first frames in each episode used to form $\mathcal { T }$ .
|
| 329 |
+
|
| 330 |
+
# A.3 TRAIL-0 WITH random
|
| 331 |
+
|
| 332 |
+
We found out and mentioned in the subsection 5.1 that random benefits from TRAIL-0. Unfortunately, it is still prone to overfitting and hence, worse than our full method – TRAIL. We present random $^ +$ TRAIL-0 accompanied with our methods in Figure 12. Our TRAIL and random $^ +$ TRAIL-0 are the only methods exceeding BC performance on lift distracted. However, TRAIL performance is clearly better (obtains higher rewards and never gets overfitted).
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 12: Results for lift alone, lift distracted, and lift distracted seeded.
|
| 336 |
+
|
| 337 |
+
# A.4 FIXED TERMINATION POLICY
|
| 338 |
+
|
| 339 |
+
As mentioned in the subsection 5.2, the most basic early termination policy – fixed step termination – may be very effective if tuned. Since the tuning may be expensive in practice, we recommend using adaptive early stopping (TRAIL-0). However, for the sake of completeness we provide results for fixed step termination policy depending on the hyperparameter tuned. The results for stack task are presented in Figure 13. The Jaco work space is considered here because Sawyer requires TRAIL to obtain high rewards. As can be inferred from the figure, the performance is very sensitive to the fixed step hyperparameter. We refer to subsection 5.2 for more comments on all methods.
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 13: Results for stack in Jaco work space. Fixed step termination policy can be very effective but the final performance is very sensitive to the hyperparameter. TRAIL-0 does not need tuning nor access to the environment reward.
|
| 343 |
+
|
| 344 |
+
# A.5 DATA AUGMENTATION
|
| 345 |
+
|
| 346 |
+
An extra set of experiments on lift alone and lift distracted tasks (described in subsection 5.1) has been performed to show importance of data augmentation.
|
| 347 |
+
|
| 348 |
+
Because in the subsection 5.2 only the peak performance is presented (Table 5.2), we present here the full curves in Figure 14. The results shows that data augmentation is necessary to obtain high rewards in lift distracted. For easier lift alone, TRAIL-0 with data augmentation perform at par with TRAIL.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 14: Results for lift alone and lift distracted in Sawyer work space. TRAIL and TRAIL-0 are by default with data augmentation. Additional results for these methods without data augmentation are presented to show its importance.
|
| 352 |
+
|
| 353 |
+
# A.6 D4PG
|
| 354 |
+
|
| 355 |
+
We use D4PG (Barth-Maron et al., 2018) as our main training algorithm. Briefly, D4PG is a distributed off-policy reinforcement learning algorithm for continuous control problems. In a nutshell, D4PG uses Q-learning for policy evaluation and Deterministic Policy Gradients (DPG) (Silver et al., 2014) for policy optimization. An important characteristic of D4PG is that it maintains a replay memory $\mathcal { M }$ (possibility prioritized (Horgan et al., 2018)) that stores SARS tuples which allows for off-policy learning. D4PG also adopts target networks for increased training stability. In addition to these principles, D4PG utilized distributed training, distributional value functions, and multi-step returns to further increase efficiency and stability. In this section, we explain the different ingredients of D4PG.
|
| 356 |
+
|
| 357 |
+
D4PG maintains an online value network $Q ( s , a | \theta )$ and an online policy network $\pi ( s | \phi )$ . The target networks are of the same structures as the value and policy network, but are parameterized by different parameters $\theta ^ { \prime }$ and $\phi ^ { \prime }$ which are periodically updated to the current parameters of the online networks.
|
| 358 |
+
|
| 359 |
+
Given the $Q$ function, we can update the policy using DPG:
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\mathcal { I } ( \phi ) = \mathbb { E } _ { s _ { t } \sim \mathcal { M } } \left[ \nabla _ { \phi } Q ( s _ { t } , \pi ( s _ { t } | \phi ) | \theta ) \right] .
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
Instead of using a scalar $Q$ function, D4PG adopts a distributional value function such that $Q ( s _ { t } , a | \theta ) ~ = ~ \bar { \mathbb { E } } \big [ Z ( s _ { t } , a | \theta ) \big ]$ where $Z$ is a random variable such that $Z ~ = ~ z _ { i }$ w.p. $\qquad p _ { i } \propto$ $\exp ( \omega ( s _ { t } , a | \theta ) )$ . The $z _ { i }$ ’s take on $V _ { b i n s }$ discrete values that ranges uniformly between $V _ { m i n }$ and $V _ { m a x }$ such that $\begin{array} { r } { z _ { i } = V _ { m i n } + i \frac { V _ { m a x } - V _ { m i n } } { V _ { b i n s } } } \end{array}$ for $i \in \{ 0 , \cdots , V _ { b i n s } - 1 \}$ .
|
| 366 |
+
|
| 367 |
+
To construct a bootstrap target, D4PG uses $\mathbf { N } .$ -step returns. Given a sampled tuple from the replay memory: $s _ { t } , a _ { t } , \{ r _ { t } , r _ { t + 1 } , \cdot \cdot \cdot , r _ { t + N - 1 } \} , s _ { t + N }$ , we construct a new random variable $Z ^ { \prime }$ such that Z0 = zi + PN−1n=0 w.p. $p _ { i } \propto \exp ( \omega ( s _ { t + N } , \pi ( s _ { t + N } | \phi ^ { \prime } ) | \theta ^ { \prime } ) )$ . Notice, $Z ^ { \prime }$ no longer has the same support. We therefore adopt the same projection $\Phi$ employed by Bellemare et al. (2017). The training loss for the value function
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\mathcal { L } ( \theta ) = \mathbb { E } _ { s _ { t } , a _ { t } , \{ r _ { t } , \cdots , r _ { t + N - 1 } \} , s _ { t + N } \sim \mathcal { M } } \big [ H \big ( \Phi ( Z ^ { \prime } ) , Z ( s _ { t } , a _ { t } | \theta ) \big ) \big ] ,
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
where $H$ is the cross entropy.
|
| 374 |
+
|
| 375 |
+
D4PG is also distributed following Horgan et al. (2018). Since all learning processes only rely on the replay memory, we can easily decouple the ‘actors’ from the ‘learners’. D4PG therefore uses a large number of independent actor processes which act in the environment and write data to a central replay memory process. The learners could then draw samples from the replay memory for learning. The learner also serves as a parameter server to the actors which periodically update their policy parameters from the learner.
|
| 376 |
+
|
| 377 |
+
In our experiments, we always have access to expert demonstrations. We, therefore adopt the practice from DQfD and DDPGfD and put the demonstrations into our replay buffers. For more details see Algorithms 1, 2.
|
| 378 |
+
|
| 379 |
+
# Algorithm 1 Actor
|
| 380 |
+
|
| 381 |
+
Given: • an experience replay memory $\mathcal { M }$
|
| 382 |
+
for $n _ { e p i s o d e s }$ do for $t = 1$ to $T$ do Sample action from task policy: $\boldsymbol { a } _ { t } \gets \pi ( \boldsymbol { s } _ { t } )$ Execute action $a _ { t }$ and observe new state $s _ { t + 1 }$ , and reward $r _ { t }$ Store transition $( s _ { t } , a _ { t } , r _ { t } , s _ { t + 1 } )$ in memory $\mathcal { M }$ end for
|
| 383 |
+
end for
|
| 384 |
+
|
| 385 |
+
# Algorithm 2 Learner
|
| 386 |
+
|
| 387 |
+
# Given:
|
| 388 |
+
|
| 389 |
+
• an off-policy RL algorithm A • a replay buffer $\mathcal { M }$ • a replay buffer of expert demonstrations $\mathcal { M } _ { e }$
|
| 390 |
+
|
| 391 |
+
Initialize A
|
| 392 |
+
for $n _ { u p d a t e s }$ do Sample transitions $\left( { { s _ { t } } , { a _ { t } } , { r _ { t } } , { s _ { t + 1 } } } \right)$ from $\mathcal { M }$ to make a minibatch $B$ . Sample transitions $\left( { { s _ { t } } , { a _ { t } } , { r _ { t } } , { s _ { t + 1 } } } \right)$ from $\mathcal { M } _ { e }$ enlarge the minibatch $B$ . Perform a actor update step with Eqn. (5). Perform a critic update step with Eqn. (6). Update the target actor/critic networks every $k$ steps.
|
| 393 |
+
end for
|
| 394 |
+
|
| 395 |
+
# A.7 NETWORK ARCHITECTURE AND HYPERPARAMETERS
|
| 396 |
+
|
| 397 |
+
Actor and critic share a residual pixel encoder network with eight convolutional layers (3x3 convolutions, three 2-layer blocks with 16, 32, 32 channels), instance normalization (Ulyanov et al., 2016) and exponential linear units (Clevert et al., 2015) between layers.
|
| 398 |
+
|
| 399 |
+
The policy is a 3-layer MLP with ReLU activations with hidden layer sizes (300, 200). The critic is a 3-layer MLP with ReLU activations with hidden layer sizes (400, 300). For a illustration of the network. Please see Figure 15.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 15: Network architecture for the policy and critic.
|
| 403 |
+
|
| 404 |
+
The discriminator network uses a pixel encoder of the same architecture as the actor critic, followed by a 3-layer MLP with ReLU activations and hidden layer sizes (32, 32).
|
| 405 |
+
|
| 406 |
+
Table 3: Hyper parameters used in robot manipulation experiments.
|
| 407 |
+
|
| 408 |
+
<table><tr><td>Parameters</td><td>Values</td></tr><tr><td>Actor/Critic Input Width</td><td>64</td></tr><tr><td>Actor/Critic Input Height</td><td>64</td></tr><tr><td>D4PG Parameters</td><td></td></tr><tr><td>Vmin</td><td>-50</td></tr><tr><td>Vmax</td><td>150</td></tr><tr><td>Vbins</td><td>21</td></tr><tr><td>N step</td><td>1</td></tr><tr><td>Actor learning rate</td><td>10-4</td></tr><tr><td>Critic learning rate</td><td>10-4</td></tr><tr><td>Optimizer</td><td>Adam (Kingma & Ba (2014))</td></tr><tr><td>Batch size</td><td>256</td></tr><tr><td>Target update period</td><td>100</td></tr><tr><td>Discount factor (y)</td><td>0.99</td></tr><tr><td>Replay capacity</td><td>106</td></tr><tr><td>Number of actors</td><td>32 or 128</td></tr><tr><td>Imitation Parameters</td><td></td></tr><tr><td>Discriminator learning rate</td><td>10-4</td></tr><tr><td>Discriminator Input Width</td><td>48</td></tr><tr><td>Discriminator Input Height</td><td>48</td></tr></table>
|
| 409 |
+
|
| 410 |
+
# A.8 COMPARING AGAINST LEARNING WITH FIXED REWARDS
|
| 411 |
+
|
| 412 |
+
To check whether learned discriminators are needed, we compare TRAIL against agents using a fixed reward function corresponding to $R _ { e x p e r t } = 1$ and $R _ { a g e n t } = 0$ for the lift alone and lift distracted tasks. This baseline simulates an oracle discriminator with perfect generalization, but which is agnostic to behavior. On the lift alone task, agents using this fixed reward achieve roughly half the reward of TRAIL asymptotically, and on lift distracted they do not solve the task (average rewards are less than 5). The learning curves are presented in Figure 16.
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 16: With fixed rewards, the agent is able to learn lift alone somewhat, but performs worse than TRAIL. When distractor blocks are added, the fixed reward agent fails to learn completely.
|
md/train/S1xtAjR5tX/S1xtAjR5tX.md
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING SEQUENCE-TO-SEQUENCE LEARNING VIA OPTIMAL TRANSPORT
|
| 2 |
+
|
| 3 |
+
Liqun Chen1, Yizhe Zhang2, Ruiyi Zhang1, Chenyang $\mathbf { T a o } ^ { 1 }$ , Zhe $\mathbf { G a n ^ { 3 } }$ , Haichao Zhang4, Bai $\mathbf { L i } ^ { 1 }$ , Dinghan Shen1, Changyou Chen5, Lawrence Carin1 1Duke University, 2Microsoft Research, 3Microsoft Dynamics 365 AI Research 4Baidu Research, 5SUNY at Buffalo {liqun.chen}@duke.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Sequence-to-sequence models are commonly trained via maximum likelihood estimation (MLE). However, standard MLE training considers a word-level objective, predicting the next word given the previous ground-truth partial sentence. This procedure focuses on modeling local syntactic patterns, and may fail to capture long-range semantic structure. We present a novel solution to alleviate these issues. Our approach imposes global sequence-level guidance via new supervision based on optimal transport, enabling the overall characterization and preservation of semantic features. We further show that this method can be understood as a Wasserstein gradient flow trying to match our model to the ground truth sequence distribution. Extensive experiments are conducted to validate the utility of the proposed approach, showing consistent improvements over a wide variety of NLP tasks, including machine translation, abstractive text summarization, and image captioning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Sequence-to-sequence (Seq2Seq) models are widely used in various natural language processing tasks, such as machine translation (Bahdanau et al., 2015; Cho et al., 2014; Sutskever et al., 2014), text summarization (Chopra et al., 2016; Rush et al., 2015) and image captioning (Vinyals et al., 2015; Xu et al., 2015). Typically, Seq2Seq models are based on an encoder-decoder architecture, with an encoder mapping a source sequence into a latent vector, and a decoder translating the latent vector into a target sequence. The goal of a Seq2Seq model is to optimize this encoder-decoder network to generate sequences close to the target. Therefore, a proper measure of the distance between sequences is crucial for model training.
|
| 12 |
+
|
| 13 |
+
Maximum likelihood estimation (MLE) is often used as the training paradigm in existing Seq2Seq models (Goodfellow et al., 2016; Lamb et al., 2016). The MLE-based approach maximizes the likelihood of the next word conditioned on its previous ground-truth words. Such an approach adopts cross-entropy loss as the objective, essentially measuring the word difference at each position of the target sequence (assuming truth for the preceding words). That is, MLE only provides a word-level training loss (Ranzato et al., 2016). Consequently, MLE-based methods suffer from the so-called exposure bias problem (Bengio et al., 2015; Ranzato et al., 2016), i.e., the discrepancy between training and inference stages. During inference, each word is generated sequentially based on previously generated words. However, ground-truth words are used in each timestep during training (Huszr, 2015; Wiseman & Rush, 2016). Such discrepancy in training and testing leads to accumulated errors along the sequence-generation trajectory, and may therefore produce unstable results in practice. Further, commonly used metrics for evaluating the generated sentences at test time are sequence-level, such as BLEU (Papineni et al., 2002) and ROUGE (Lin, 2004). This also indicates a mismatch of the training loss and test-time evaluation metrics.
|
| 14 |
+
|
| 15 |
+
Attempts have been made to alleviate the above issues, via a sequence-level training loss that enables comparisons between the entire generated and reference sequences. Such efforts roughly fall into two categories: $( i )$ reinforcement-learning-based (RL) methods (Bahdanau et al., 2017; Ranzato et al., 2016) and $( i i )$ adversarial-learning-based methods (Yu et al., 2017; Zhang et al., 2017). These methods overcome the exposure bias issue through criticizing model output during training; however, both schemes have their own vulnerabilities. RL methods often suffer from large variance on policy-gradient estimation, and control variates and carefully designed baselines (such as a selfcritic) are needed to make RL training more robust (Liu et al., 2018; Rennie et al., 2017). Further, the rewards used by RL training are often criticized as a bad proxy for human evaluation, as they are usually highly biased towards certain particular aspects (Wang et al., 2018b). On the other hand, adversarial supervision relies on the delicate balance of a mini-max game, which can be easily undermined by mode-trapping and gradient-vanishing problems (Arjovsky et al., 2017; Zhang et al., 2017). Sophisticated tuning is often desired for successful adversarial training.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Different matching schemes. Left to right: hard matching, soft bipartite matching and OT matching. Dominant edges are shown in dark green for OT matching.
|
| 19 |
+
|
| 20 |
+
We present a novel Seq2Seq learning scheme that leverages optimal transport (OT) to construct sequence-level loss. Specifically, the OT objective aims to find an optimal matching of similar words/phrases between two sequences, providing a way to promote their semantic similarity (Kusner et al., 2015). Compared with the above RL and adversarial schemes, our approach has: $( i )$ semanticinvariance, allowing better preservation of sequence-level semantic information; and $( i i )$ improved robustness, since neither the reinforce gradient nor the mini-max game is involved. The OT loss allows end-to-end supervised training and acts as an effective sequence-level regularization to the MLE loss.
|
| 21 |
+
|
| 22 |
+
Another novel strategy distinguishing our model from previous approaches is that during training we consider not only the OT distance between the generated sentence and ground-truth references, but also the OT distance between the generated sentence and its corresponding input. This enables our model to simultaneously match the generated output sentence with both the source sentence(s) and target reference sentence, thus enforcing the generator to leverage information contained in the input sentence(s) during generation.
|
| 23 |
+
|
| 24 |
+
The main contributions of this paper are summarized as follows. (i) A new sequence-level training algorithm based on optimal transport is proposed for Seq2Seq learning. In practice, the OT distance is introduced as a regularization term to the MLE training loss. (ii) Our model can be interpreted as approximate Wasserstein gradient flows, learning to approximately match the sequence distribution induced by the generator and a target data distribution. (iii) In order to demonstrate the versatility of the proposed method, we conduct extensive empirical evaluations on three tasks: machine translation, text summarization, and image captioning.
|
| 25 |
+
|
| 26 |
+
# 2 SEMANTIC MATCHING WITH OPTIMAL TRANSPORT
|
| 27 |
+
|
| 28 |
+
We consider two components of a sentence: its syntactic and semantic parts. In a Seq2Seq model, it is often desirable to keep the semantic meaning while the syntactic part can be more flexible. Conventional training schemes, such as MLE, are known to be well-suited for capturing the syntactic structure. As such, we focus on the semantic part. An intuitive way to assess semantic similarity is to directly match the “key words” between the synthesized and the reference sequences. Consider the respective sequences as sets A and $\mathbb { B }$ , with vocabularies as their elements. Then the matching can be evaluated by $| \mathbb { A } \cap \mathbb { B } |$ , where $| \cdot |$ is the counting measure for sets. We call this hard matching, as it seeks to exactly match words from both sequences.
|
| 29 |
+
|
| 30 |
+
For language models, the above hard matching could be an over simplification. This is because words have semantic meaning, and two different words can be close to each other in the semantic space. To account for such ambiguity, we can relax the hard matching to soft bipartite matching (SBM). More specifically, assuming all sequences have the same length $n$ , we pair $w _ { i _ { k } } \in \mathbb { A }$ and $\pmb { w } _ { j _ { k } } ^ { \prime } \in \mathbb { B }$ for $k \in [ 1 , K ]$ , such that $K \leq n$ , $\{ i _ { k } \} , \{ j _ { k } \}$ are unique and $\begin{array} { r } { \mathcal { L } _ { \mathrm { S B M } } = \sum _ { k } c ( \bar { \mathbf { w } _ { i _ { k } } } , \mathbf { w } _ { j _ { k } } ^ { \prime } ) } \end{array}$ is minimized. Here $c ( \pmb { w } , \pmb { w } ^ { \prime } )$ is a cost function measuring the semantic dissimilarity between the two words. For instance, the cosine distance $\begin{array} { r } { c ( \pmb { x } , \pmb { y } ) = 1 - \frac { \pmb { x } ^ { \top } \pmb { y } } { \| \pmb { x } \| _ { 2 } \| \pmb { y } \| _ { 2 } } } \end{array}$ between two word embedding vectors $_ { \textbf { \em x } }$ and $\textbf { { y } }$ is a popular choice (Pennington et al., 2014). This minimization can be solved exactly, e.g., via the Hungarian algorithm (Kuhn, 1955). Unfortunately, its $O ( n ^ { 3 } )$ complexity scales badly for common NLP tasks, and the objective is also non-differentiable wrt model parameters. As such, end-to-end supervised training is not feasible with the Hungarian matching scheme. To overcome this difficulty, we propose to further relax the matching criteria while keeping the favorable features of a semantic bipartite matching. OT arises as a natural candidate.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Schematic computation graph of OT loss.
|
| 34 |
+
|
| 35 |
+
# 2.1 OPTIMAL TRANSPORT AND WASSERSTEIN DISTANCE
|
| 36 |
+
|
| 37 |
+
We first provide a brief review of optimal transport, which defines distances between probability measures on a domain $\mathbb { X }$ (the sequence space in our setting). The optimal transport distance for two probability measures $\mu$ and $\nu$ is defined as (Peyre et al., 2017): ´
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\mathcal { D } _ { c } ( \mu , \nu ) = \operatorname* { i n f } _ { \gamma \in \Pi ( \mu , \nu ) } \mathbb { E } _ { ( { \pmb x } , { \pmb y } ) \sim \gamma } \left[ c ( { \pmb x } , { \pmb y } ) \right] ,
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\Pi ( \mu , \nu )$ denotes the set of all joint distributions $\gamma ( \pmb { x } , \pmb { y } )$ with marginals $\mu ( { \pmb x } )$ and $\nu ( \pmb { y } )$ ; $c ( \pmb { x } , \pmb { y } ) : \mathbb { X } \times \mathbb { X } \mathbb { R }$ is the cost function for moving $_ { \textbf { \em x } }$ to $\textbf { { y } }$ , e.g., the Euclidean or cosine distance. Intuitively, the optimal transport distance is the minimum cost that $\gamma$ induces in order to transport from $\mu$ to $\nu$ . When $c ( { \pmb x } , { \pmb y } )$ is a metric on $\mathbb { X }$ , $\mathcal { D } _ { c } ( \mu , \nu )$ induces a proper metric on the space of probability distributions supported on $\mathbb { X }$ , commonly known as the Wasserstein distance (Villani, 2008). One of the most popular choices is the 2−Wasserstein distance $W _ { 2 } ^ { 2 } ( \mu , \nu )$ where the squared Euclidean distance $c ( { \pmb x } , { \pmb y } ) = \| { \pmb x } - { \pmb y } \| ^ { 2 }$ is used as cost.
|
| 44 |
+
|
| 45 |
+
OT distance on discrete domains We mainly focus on applying the OT distance on textual data. Therefore, we only consider OT between discrete distributions. Specifically, consider two discrete distributions $\mu , \pmb { \nu } \in \mathbf { P } ( \mathbb { X } )$ , which can be written as $\begin{array} { r } { \pmb { \mu } = \sum _ { i = 1 } ^ { n } \mathbf { u } _ { i } \delta _ { \mathbf { x } _ { i } } } \end{array}$ and $\begin{array} { r } { \pmb { \nu } ^ { * } = \sum _ { j = 1 } ^ { m } \mathbf { v } _ { j } \delta _ { \mathbf { y } _ { j } } } \end{array}$ with $\delta _ { \mathbf { x } }$ the Dirac function centered on x. The weight vectors u = {ui}ni=1 and $\mathbf { v } = \{ \mathbf { v } _ { i } \} _ { i = 1 } ^ { m } \in \Delta _ { m }$ respectively belong to the $n$ and $m$ -dimensional simplex, i.e., $\textstyle \sum _ { i = 1 } ^ { n ^ { \widehat { \mathbf { \phi } } } } \mathbf { u } _ { i } = \sum _ { j = 1 } ^ { m } \mathbf { v } _ { j } \doteq \bar { 1 }$ , as both $\pmb { \mu }$ and $\pmb { \nu }$ are probability distributions. Under such a setting, computing the OT distance as defined in (1) is equivalent to solving the following network-flow problem (Luise et al., 2018):
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\mathcal { L } _ { \mathrm { o t } } ( \mu , \nu ) = \operatorname* { m i n } _ { \mathbf { T } \in \Pi ( \mathbf { u } , \mathbf { v } ) } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { m } \mathbf { T } _ { i j } \cdot c ( \pmb { x } _ { i } , \pmb { y } _ { j } ) = \operatorname* { m i n } _ { \mathbf { T } \in \Pi ( \mathbf { u } , \mathbf { v } ) } \left. \mathbf { T } , \mathbf { C } \right. ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\Pi ( \mathbf { u } , \mathbf { v } ) \ = \ \{ \mathbf { T } \ \in \ \mathbb { R } _ { + } ^ { n \times m } | \mathbf { T } \mathbf { 1 } _ { m } \ = \ \mathbf { u } , \mathbf { T } ^ { \top } \mathbf { 1 } _ { n } \ = \ \mathbf { v } \}$ , ${ \bf 1 } _ { n }$ denotes an $n$ -dimensional all-one vector, $\mathbf { C }$ is the cost matrix given by ${ \bf C } _ { i j } = c ( { \bf x } _ { i } , { \bf y } _ { j } )$ and $\langle \mathbf { T } , \mathbf { C } \rangle = \operatorname { T r } ( \mathbf { T } ^ { \top } \mathbf { C } )$ represents the Frobenius dot-product. We refer to the minimizer $\mathbf { T } ^ { * }$ of (2) as OT matching. Comparing the two objectives, one can readily recognize that soft bipartite matching represents a special constrained solution to (2), where $\mathbf { T }$ can only take values in $\Gamma = \{ { \bf T } | \operatorname* { m a x } _ { i } \{ \| { \bf \hat { T } e } _ { i } \| _ { 0 } , \| { \bf e } _ { i } ^ { T } { \bf \hat { T } } \| _ { 0 } \} \le 1 , { \bf T } _ { i j } \ \in$ $\{ 0 , 1 \} , \| \mathbf { T } \| _ { 0 } = K \}$ instead of $\scriptstyle \Pi ( \mathbf { u } , \mathbf { v } )$ ; here $\| \cdot \| _ { 0 }$ is the $L _ { 0 }$ norm and $\mathbf { e } _ { i }$ is the unit vector along $i$ -th axis. As such, OT matching can be regarded as a relaxed version of soft bipartite matching. In Figure 1 we illustrate the three matching schemes discussed above.
|
| 52 |
+
|
| 53 |
+
The IPOT algorithm Unfortunately, the exact minimization over $\mathbf { T }$ is in general computational intractable (Arjovsky et al., 2017; Genevay et al., 2018; Salimans et al., 2018). To overcome such intractability, we consider an efficient iterative approach to approximate the OT distance. We propose to use the recently introduced Inexact Proximal point method for Optimal Transport (IPOT) algorithm to compute the OT matrix $\mathbf { T } ^ { * }$ , thus also the OT distance (Xie et al., 2018). IPOT provides a solution to the original OT problem specified in (2). Specifically, IPOT iteratively solves the following optimization problem using the proximal point method (Boyd & Vandenberghe, 2004):
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbf { T } ^ { ( t + 1 ) } = \underset { \mathbf { T } \in \Pi ( \pmb { x } , \pmb { y } ) } { \arg \operatorname* { m i n } } \left. \left. \mathbf { T } , \mathbf { C } \right. + \beta \cdot \mathcal { B } ( \mathbf { T } , \mathbf { T } ^ { ( t ) } ) \right. ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where the proximity metric term $B ( \mathbf { T } , \mathbf { T } ^ { ( t ) } )$ penalizes solutions that are too distant from the latest approximation, and $\frac { 1 } { \beta }$ is understood as the generalized stepsize. This renders a tractable iterative scheme towards the exact OT solution. In this work, we employ the generalized KL Bregman diver$\begin{array} { r } { \mathcal { B } ( \mathbf { T } , \mathbf { T } ^ { ( t ) } ) = \sum _ { i , j } \mathbf { T } _ { i j } \log \frac { \mathbf { T } _ { i j } } { \mathbf { T } _ { i j } ^ { ( t ) } } - \sum _ { i , j } \mathbf { T } _ { i j } + \sum _ { i , j } \mathbf { T } _ { i j } ^ { ( t ) } } \end{array}$ as the proximity metric. Algorithm 1 describes the implementation details for IPOT
|
| 60 |
+
|
| 61 |
+
Note that the Sinkhorn algorithm (Cuturi, 2013) can also be used to compute the OT matrix. Specifically, the Sinkhorn algorithm tries to solve the entropy regularized optimization problem: $\begin{array} { r } { \hat { \mathcal { L } } _ { \mathrm { o t } } ( { \pmb \mu } , { \pmb \nu } ) = \operatorname* { m i n } _ { { \bf T } \in \Pi ( { \bf u } , { \bf v } ) } \left. { \bf T } , { \bf C } \right. - { \frac { 1 } { \epsilon } } H ( { \bf T } ) , } \end{array}$ where $\begin{array} { r } { H ( \mathbf { T } ) = - \sum _ { i , j } \mathbf { T } _ { i j } \big ( \log ( \mathbf { T } _ { i j } ) \big ) - 1 \big ) } \end{array}$ is the entropy regularization term and $\epsilon > 0$ is the regularization strength. However, in our experiments, we empirically found that the numerical stability and performance of the Sinkhorn algorithm is quite sensitive to the choice of the hyper-parameter $\epsilon$ , thus only IPOT is considered in our model training.
|
| 62 |
+
|
| 63 |
+
# Algorithm 1 IPOT algorithm
|
| 64 |
+
|
| 65 |
+
1: Input: Feature vectors $\mathbf { S } = \{ z _ { i } \} _ { 1 } ^ { n }$ , ${ \bf S } ^ { \prime } = \{ z _ { j } ^ { \prime } \} _ { 1 } ^ { m }$
|
| 66 |
+
and generalized stepsize $1 / \beta$ ,
|
| 67 |
+
2: $\begin{array} { r } { \pmb { \sigma } = \frac { 1 } { m } \pmb { 1 } _ { \mathbf { m } } } \end{array}$ , $\mathbf { T } ^ { ( 1 ) } = \mathbf { 1 _ { n } } { \mathbf { 1 _ { m } } } ^ { \top }$
|
| 68 |
+
3: $\mathbf { C } _ { i j } = c ( z _ { i } , z _ { j } ^ { \prime } )$ , $\mathbf { A } _ { i j } = \mathrm { e } ^ { - \frac { \mathbf { C } _ { i j } } { \beta } }$
|
| 69 |
+
4: for $t = 1 , 2 , 3 \ldots { } \mathbf { d o }$
|
| 70 |
+
5: $\mathbf { Q } = \mathbf { A } \odot \mathbf { T } ^ { \left( t \right) } / / \odot$ is Hadamard product
|
| 71 |
+
6: for $k = 1 , \dots K$ do // $K = 1$ in practice
|
| 72 |
+
7: $\begin{array} { r } { \pmb { \delta } = \frac { 1 } { n \mathbf { Q } \sigma } , \pmb { \sigma } = \frac { 1 } { m \mathbf { Q } ^ { \top } \pmb { \delta } } } \end{array}$
|
| 73 |
+
8: end for
|
| 74 |
+
9: $\mathbf { T } ^ { ( t + 1 ) } = \mathrm { d i a g } ( \delta ) \mathbf { Q } \mathrm { d i a g } ( { \boldsymbol { \sigma } } )$
|
| 75 |
+
10: end for
|
| 76 |
+
11: Return $\langle \mathbf { T } , \mathbf { C } \rangle$
|
| 77 |
+
|
| 78 |
+
# 2.2 OPTIMAL TRANSPORT DISTANCE AS A SEQUENCE LEVEL LOSS
|
| 79 |
+
|
| 80 |
+
Figure 2 illustrates how OT is computed to construct the sequence-level loss. Given two sentences, we can construct their word-level or phrase-level embedding matrices $\mathbf { S }$ and $\mathbf { S } ^ { \prime }$ , where ${ \bf { S } } = \{ { z } _ { i } \}$ is usually recognized as the reference sequence embedding and $\mathbf { S } ^ { \prime } = \{ z _ { j } ^ { \prime } \}$ for the model output sequence embedding. The cost matrix C is then computed by $\mathbf { C } _ { i j } = c ( z _ { i } , z _ { j } ^ { \prime } )$ and passed on to the IPOT algorithm to get the OT distance. Our full algorithm is summarized in Algorithm 2, and more detailed model specifications are given below.
|
| 81 |
+
|
| 82 |
+
Encoding model belief with a differentiable sequence generator We first describe how to design a differentiable sequence generator so that the gradients can be backpropagated from the OT losses to update the model belief. The Long Short-Term Memory (LSTM) recurrent neural network (Hochreiter & Schmidhuber, 1997) is used as our sequence model. At each timestep $t$ , the LSTM decoder outputs a logit vector ${ \mathbf { } } v _ { t }$ for the vocabularies, based on its context. Directly sampling from the multinomial distribution $\hat { \pmb { w } } _ { t } \sim \mathrm { S o f t m a x } ( \pmb { v } _ { t } )$ is a non-differentiable operation1, so we consider the following differentiable alternatives:
|
| 83 |
+
|
| 84 |
+
• Soft-argmax: $\hat { \pmb { w } } _ { t } ^ { S A } = \mathrm { S o f t m a x } ( \pmb { v } _ { t } / \tau )$ , where $\tau \in ( 0 , 1 )$ is the annealing parameter (Zhang et al., 2017). This approximates the deterministic sampling scheme $\hat { \pmb { w } } _ { t } ^ { \operatorname* { m a x } } = \arg \operatorname* { m a x } \{ \pmb { v } _ { t } \}$ ; • Gumbel-softmax (GS): $\hat { \pmb { w } } _ { t } ^ { G S } = \mathrm { S o f t m a x } ( ( \pmb { v } _ { t } + \pmb { \xi } _ { t } ) / \tau )$ , where $\xi _ { t }$ are iid Gumbel random variables for each of the vocabulary. It is also known as the Concrete distribution (Jang et al., 2016; Maddison et al., 2017).
|
| 85 |
+
|
| 86 |
+
Unstable training and sub-optimal solutions have been observed for the GS-based scheme for the Seq2Seq tasks we considered (see Appendix G, Table 11), possibly due to the extra uncertainty introduced. As such, we will assume the use of soft-argmax to encode model belief in $\hat { \pmb { w } } _ { t }$ unless otherwise specified. Note $\hat { \mathbf { \Omega } } \hat { \mathbf { \Omega } } ^ { \hat { \mathbf { \Omega } } } \hat { \mathbf { \Omega } } ^ { \hat { \mathbf { \Omega } } } \hat { \mathbf { \Omega } } ^ { \hat { \mathbf { \Omega } } } \hat { \mathbf { \Omega } } \hat { \mathbf { \Omega } } \mathrm { ~ \Omega ~ } \hat { \mathbf { \Omega } } ^ { \hat { \mathbf { \Omega } } } \hat { \mathbf { \Omega } } \mathrm { ~ \Omega ~ } \hat { \mathbf { \Omega } } \mathrm { ~ \Omega ~ } \hat { \mathbf { \Omega } } \mathrm { ~ \Omega ~ } \hat { \mathbf { \Omega } } \mathrm { ~ \Omega ~ } \hat { \mathbf { \Omega } } \mathrm { ~ \Omega ~ }$ is a normalized non-negative vector that sums up to one.
|
| 87 |
+
|
| 88 |
+
Sequence-level OT-matching loss To pass on the model belief to the OT loss, we use the mean word embedding predicted by the model, given by $\hat { z } _ { t } = \mathbf { E } ^ { T } \hat { w } _ { t }$ , where $\mathbf { E } \in \mathbb { R } ^ { V \times d }$ is the word embedding matrix, $V$ is the vocabulary size and $d$ is the dimension for the embedding vector. We collect the predicted sequence embeddings into $\mathbf { S } _ { g } = \{ \hat { z } _ { t } \} _ { t = 1 } ^ { L }$ , where $L$ is the length of sequence. Similarly we denote the reference sequence embeddings as $\mathbf { S } _ { r } = \{ z _ { t } \} _ { t = 1 } ^ { L }$ , using ground truth onehot input token sequence $\{ { \pmb w } _ { t } \}$ . Based on the sequence embeddings $\mathbf { S } _ { r }$ and $\mathbf { S } _ { g }$ , we can compute the sequence-level OT loss between ground-truth and model prediction using the IPOT algorithm described above for different Seq2Seq tasks:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathcal { L } _ { \mathrm { s e q } } \triangleq \operatorname { I P O T } ( \mathbf { S } _ { g } , \mathbf { S } _ { r } ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
1: Input: batch size $m$ , paired input and output sequences $( \mathbf { X } , \mathbf { Y } )$
|
| 95 |
+
2: Load MLE pre-trained Seq2Seq model $\mathcal { M } ( \cdot ; \theta )$ and word embedding $\mathbf { E }$
|
| 96 |
+
3: for iteration $= 1 , \ldots$ MaxIter do
|
| 97 |
+
4: for $i = 1 , \ldots , m$ do
|
| 98 |
+
5: Draw a pair of sequences ${ \pmb x } _ { i } , { \pmb y } _ { i } \sim ( { \bf X } , { \bf Y } )$ , where $\pmb { x } _ { i } = \{ \tilde { \pmb { w } } _ { i , t } \} , \pmb { y } _ { i } = \{ \pmb { w } _ { i , t } \}$
|
| 99 |
+
6: Compute logit vectors from model: $\{ \pmb { v } _ { i , t } \} = \mathcal { M } ( \pmb { x } _ { i } ; \theta )$
|
| 100 |
+
7: Encode model belief: $\hat { \pmb { w } } _ { i , t } = \mathrm { S o f t - a r g m a x } ( \pmb { v } _ { i , t } )$
|
| 101 |
+
8: Feature vector embedding: $\mathbf { S } _ { r , i } = \{ \mathbf { E } ^ { T } \pmb { w } _ { i , t } \} , \mathbf { S } _ { g , i } = \{ \mathbf { E } ^ { T } \pmb { \hat { w } } _ { i , t } \}$
|
| 102 |
+
9: end for
|
| 103 |
+
10: Update the $\mathcal { M } ( \cdot ; \theta )$ by optimizing: $\begin{array} { r } { \frac { 1 } { m } \sum _ { i = 1 } ^ { m } [ \mathcal { L } _ { \mathrm { M L E } } ( \pmb { x } _ { i } , \pmb { y } _ { i } ; \theta ) + \gamma \mathcal { L } _ { \mathrm { s e q } } ( \mathbf { S } _ { r , i } , \mathbf { S } _ { g , i } ) ] } \end{array}$
|
| 104 |
+
11: end for
|
| 105 |
+
|
| 106 |
+
Soft-copying mechanism We additionally consider feature matching using the OT criteria between the source and target. Intuitively, it will encourage the global semantic meaning to be preserved from source to target. This is related to the copy network (Gu et al., 2016). However, in our framework, the copying mechanism can be understood as a soft optimal-transport-based copying, instead of the original hard retrieved-based copying used by Gu et al. (2016). This soft copying mechanism considers semantic similarity in the embedding space, and thus presumably delivers smoother transformation of information. In the case where the source and target sequences do not share vocabulary (e.g., machine translation), this objective can still be applied by sharing the word embedding space between source and target. Ideally, the embedding for the same concept in different languages will automatically be aligned by optimizing such loss, making available a cosinesimilarity-based cost matrix. This is also related to bilingual skip-gram (Luong et al., 2015b). We denote this loss as $\mathcal { L } _ { \mathrm { c o p y } } \triangleq \operatorname { I P O T } ( \mathbf { S } _ { g } , \mathbf { S } _ { s } )$ , where $\mathbf { S } _ { s }$ represents the source sequence embeddings.
|
| 107 |
+
|
| 108 |
+
Complementing MLE training with OT regularization OT training objectives discussed above can not train a proper language model on its own, as they do not explicitly consider word ordering, i.e., the syntactic strucuture of a language model. To overcome this issue, we propose to combine the OT loss with the de facto likelihood loss $\mathcal { L } _ { \mathrm { M L E } }$ , which gives us the final training objective: $\mathcal { L } = \mathcal { L } _ { \mathrm { M L E } } + \gamma \mathcal { L } _ { \mathrm { s e q } }$ , where $\gamma > 0$ is a hyper-parameter to be tuned. For tasks with both input and output sentences, such as machine translation and text summarization, $\mathcal { L } _ { \mathrm { c o p y } }$ can be applied, in which case the final objective can be written as $\mathcal { L } = \mathcal { L } _ { \mathrm { M L E } } + \gamma _ { 1 } \mathcal { L } _ { \mathrm { c o p y } } + \gamma _ { 2 } \mathcal { L } _ { \mathrm { s e q } }$ .
|
| 109 |
+
|
| 110 |
+
# 3 INTERPRETATION AS APPROXIMATE WASSERSTEIN GRADIENT FLOWS
|
| 111 |
+
|
| 112 |
+
To further justify the use of our approach (minimizing the loss $\{ \mathcal { L } _ { \mathrm { M L E } } + \gamma \mathcal { L } _ { o t } \}$ , where $\mathcal { L } _ { o t }$ denotes the Wasserstein loss), we now explain how our model approximately learns to match the ground-truth sequence distribution. Our derivation is based on the theory of Wasserstein gradient flows (WGF) (Villani, 2008). In WGF, the Wasserstein distance describes the local geometry of a trajectory in the space of probability measures converging to a target distribution (Ambrosio et al., 2005). In the following, we show that the proposed method learns to approximately match the data distribution, from the perspective of WGF. For simplicity we only discuss the continuous case, while a similar argument also holds for the discrete case (Li & Montufar, 2018).
|
| 113 |
+
|
| 114 |
+
We denote the induced distribution of the sequences generated from the decoder at the $l$ -th iteration as $\mu _ { l }$ . Assume the sequence data distribution is given by $p _ { d } ( \mathbf { x } )$ . Intuitively, the optimal generator in a Seq2Seq model learns a distribution $\mu ^ { * } ( \mathbf { x } )$ that matches $p _ { d } ( \mathbf { x } )$ . Based on Craig (2014), this can be achieved by composing a sequence of discretized WGFs given by:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mu _ { l } = J _ { h } ( \mu _ { l - 1 } ) = J _ { h } ( J _ { h } ( \cdot \cdot \cdot ( \mu _ { 0 } ) ) ) ,
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
with $J _ { h } ( \cdot )$ defined as
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
J _ { h } ( \mu ) = \underset { \nu \in \mathcal { P } _ { s } } { \arg \operatorname* { m i n } } \left\{ \frac { 1 } { 2 h } W _ { 2 } ^ { 2 } ( \mu , \nu ) + D _ { \mathrm { K L } } ( \nu \parallel \mathbf { \mathit { p } } _ { d } ) \right\} = \underset { \nu \in \mathcal { P } _ { s } } { \arg \operatorname* { m i n } } \{ \mathcal { L } _ { \mathrm { W G F } } ( \mu , \nu ) \} ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\lambda = 1 / ( 2 h )$ is a regularization parameter ( $h$ is the generalized learning rate); $W _ { 2 } ^ { 2 } ( \mu , \nu )$ denotes the 2-Wasserstein distance between $\mu$ and $\nu$ ; $\mathcal { P } _ { s }$ is the space of distributions with finite 2nd-order moments; and $D _ { \mathrm { K L } } ( \nu \parallel p _ { d } ) = \mathbb { E } _ { \mathbf { x } \sim \nu } [ \log \nu ( \mathbf { x } ) - \log p _ { d } ( \mathbf { x } ) ]$ is the Kullback-Leibler (KL)
|
| 127 |
+
|
| 128 |
+
divergence. It is not difficult to see that discreteized WGF is essentially optimizing the KL divergence with a proximal descent scheme, using the 2-Wasserstein distance as the proximity metric.
|
| 129 |
+
|
| 130 |
+
We denote $\mu _ { h } ^ { * } = \operatorname* { l i m } _ { l \to \infty } \mu _ { l }$ with generalized learning rate $h$ . It is well known that $\mathrm { l i m } _ { h 0 } \mu _ { h } ^ { * } =$ $p _ { d }$ (Chen et al., 2018a), that is to say the induced model distribution $\mu _ { l }$ asymptotically converges to the data distribution $p _ { d }$ . In our case, instead of using $\mathcal { L } _ { \mathrm { W G F } } ( \mu , \nu )$ as the loss function, we define a surrogate loss using its upper bound $\mathcal L _ { \operatorname { W G F } } ( \mu , \nu ) \le \mathcal L _ { \operatorname { W G F } } ( p _ { d } , \nu )$ , where the inequality holds because (6) converges to $p _ { d }$ . When our model distribution $\mu$ is parameterized by $\theta , \mu _ { l }$ can be solved with stochastic updates on $\theta$ based on the following equation with stepsize $\eta$ :
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\theta _ { l } \xleftarrow \theta _ { l - 1 } + \eta \nabla _ { \theta } \mathcal { L } _ { \mathrm { W G F } } ( p _ { d } , \mu _ { l - 1 } ) = \theta _ { l - 1 } + \eta \{ \nabla _ { \theta } D _ { \mathrm { K L } } ( \mu _ { l - 1 } ~ \Vert ~ p _ { d } ) + \frac { 1 } { 2 h } \nabla _ { \theta } W _ { 2 } ^ { 2 } ( p _ { d } , \mu _ { l - 1 } ) \} .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
Unfortunately, (7) is an infeasible update as we do not know $p _ { d }$ . However, we argue that this update is still locally valid when current model approximation $\mu _ { l - 1 }$ is close to $p _ { d }$ . To see this, recall that the KL-divergence is a natural Riemannian metric on the space of probability measures (Amari, 1985), therefore it is locally symmetric. So we can safely replace the $D _ { \mathrm { K L } } ( \mu \parallel p _ { d } )$ term with $D _ { \mathrm { K L } } ( p _ { d } \parallel \mathbf { \mu } \mathbf { \mu } )$ when $\mu$ is close to $p _ { d }$ . This recovers the loss function $\mathcal { L } _ { \mathrm { M L E } } + \gamma \mathcal { L } _ { \mathrm { s e q } }$ derived in Section 2.2 as $D _ { \mathrm { K L } } ( p _ { d } \parallel \mu ) = \mathcal { L } _ { \mathrm { M L E } } + H ( p _ { d } )$ , where $H ( p _ { d } )$ is the entropy of $p _ { d }$ , independent of $\mu$ , and $\mathcal { L } _ { \mathrm { s e q } } = W _ { 2 } ^ { 2 } ( p _ { d } , \mu )$ . This justifies the use of our proposed scheme in a model-refinement stage, where model distribution $\mu$ is sufficiently close to $p _ { d }$ . Empirically, we have observed that our scheme also improves training even when $\mu$ is distant from $p _ { d }$ . While the above justification is developed based on Euclidean transport, other non-Euclidean costs such as cosine distance usually yield better empirical performance as they are more adjusted to the geometry of sequence data.
|
| 137 |
+
|
| 138 |
+
# 4 RELATED WORK AND DISCUSSION
|
| 139 |
+
|
| 140 |
+
Optimal transport in NLP Although widely used in other fields such as computer vision (Rubner et al., 2000), OT has only been applied in NLP recently. Pioneered by the work of Kusner et al. (2015) on word mover’s distance (WMD), existing literature primarily considers OT either on a macroscopic level like topic modeling (Huang et al., 2016), or a microscopic level such as word embedding (Xu et al., 2018). Euclidean distance, instead of other more general distance, is often used as the transportation cost, in order to approximate the OT distance with the KantorovichRubinstein duality (Gulrajani et al., 2017) or a more efficient yet less accurate lower bound (Kusner et al., 2015). Our work employs OT for mesoscopic sequence-to-sequence models, presenting an efficient IPOT-based implementation to enable end-to-end learning for general cost functions. The proposed OT not only refines the word embedding matrix but also improves the Seq2Seq model (see Appendix H for details).
|
| 141 |
+
|
| 142 |
+
RL for sequence generation A commonly employed strategy for sequence-level training is via reinforcement learning (RL). Typically, this type of method employs RL by considering the evaluation metrics as the reward to guide the generation (Bahdanau et al., 2017; Huang et al., 2018; Ranzato et al., 2016; Rennie et al., 2017; Zhang et al., 2018a). However, these approaches often introduce procedures that may yield large-variance gradients, resulting in unstable training. Moreover, it has been recognized that these automatic metrics may have poor correlation with human judgments in many scenarios (Wang et al., 2018b). As such, reinforcing the evaluation metrics can potentially boost the quantitative scores but not necessarily improve the generation quality, as such metrics usually encourage exact text snippets overlapping rather than semantic similarity. Some nonstandard metrics like SPICE (Anderson et al., 2016) also consider semantic similarity, however they also can not learn a good model on their own (Liu et al., 2017). Unlike RL methods, our method requires no human-defined rewards, thus preventing the model from over-fitting to one specific metric. As a concrete example, the two semantically similar sentences “do you want to have lunch with us ” and “would you like to join us for lunch” would be considered as a bad match based on automatic metrics like BLEU, however, be rated as reasonable match in OT objective.
|
| 143 |
+
|
| 144 |
+
GAN for sequence generation Another type of method adopts the framework of generative adversarial networks (GANs) (Goodfellow et al., 2014), by providing sequence-level guidance based on a learned discriminator (or, critic). To construct such a loss, Fedus et al. (2018); Guo et al. (2018); Lin et al. (2017); Yu et al. (2017) combine the policy-gradient algorithm with the original GAN training procedure, while Chen et al. (2018b); Zhang et al. (2017) uses a so-called feature mover distance and maximum mean discrepancy (MMD) to match features of real and generated sentences, respectively.
|
| 145 |
+
|
| 146 |
+
Table 1: BLEU scores on VI-EN and EN-VI.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Systems</td><td>NT2012</td><td>NT2013</td></tr><tr><td>VI-EN:GNMT</td><td>20.7</td><td>23.8</td></tr><tr><td>VI-EN: GNMT+ Lseq</td><td>21.9</td><td>25.4</td></tr><tr><td>VI-EN: GNMT+Lseq+Lcopy</td><td>21.9</td><td>25.5</td></tr><tr><td>EN-VI: GNMT</td><td>23.8</td><td>26.1</td></tr><tr><td>EN-VI: GNMT+ Lseq</td><td>24.4</td><td>26.5</td></tr><tr><td>EN-VI: GNMT+Lseq+Lcopy</td><td>24.5</td><td>26.9</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 2: BLEU scores on DE-EN and EN-DE.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Systems</td><td>NT2013</td><td>NT2015</td></tr><tr><td>DE-EN: GNMT</td><td>29.0</td><td>29.9</td></tr><tr><td>DE-EN: GNMT+Lseq</td><td>29.1</td><td>29.9</td></tr><tr><td>DE-EN: GNMT+Lseq+Lcopy</td><td>29.2</td><td>30.1</td></tr><tr><td>EN-DE: GNMT</td><td>24.3</td><td>26.5</td></tr><tr><td>EN-DE: GNMT+Lseq</td><td>24.3</td><td>26.6</td></tr><tr><td>EN-DE: GNMT+Lseq+Lcopy</td><td>24.6</td><td>26.8</td></tr></table>
|
| 153 |
+
|
| 154 |
+
However, mode-collapse and gradient-vanishing problems make the training of these methods challenging. Unlike GAN methods, since no min-max games are involved, the training of our model is more robust. Moreover, compared with GAN, no additional critic is introduced in our model, which makes the model complexity comparable to MLE and less demanding to tune.
|
| 155 |
+
|
| 156 |
+
# 5 EXPERIMENTS
|
| 157 |
+
|
| 158 |
+
We consider a wide range of NLP tasks to experimentally validate the proposed model, and benchmark it with other strong baselines. All experiments are implemented with Tensorflow and run on a single NVIDIA TITAN X GPU. Code for our experiments are available from https: //github.com/LiqunChen0606/Seq2Seq-OT.
|
| 159 |
+
|
| 160 |
+
# 5.1 NEURAL MACHINE TRANSLATION
|
| 161 |
+
|
| 162 |
+
We test our model on two datasets: $( i )$ a small-scale English-Vietnamese parallel corpus of TEDtalks, which has 133K sentence pairs from the IWSLT Evaluation Campaign (Cettolo et al., 2015); and $( i i )$ a large-scale English-German parallel corpus with $4 . 5 \mathrm { M }$ sentence pairs, from the WMT Evaluation Campaign (Vaswani et al., 2017). We used Google’s Neural Machine Translation (GMNT) model (Wu et al., 2016) as our baseline, following the architecture and hyper-parameter settings from the GNMT repository2 to make a fair comparison. For the English-Vietnamese (i.e., VI-EN and EN-VI) tasks, a 2-layer LSTM with 512 units in each layer is adopted as the decoder, with a 1-layer bidirectional-LSTM adopted as the encoder; the word embedding dimension is set to 512. Attention proposed in Luong et al. (2015a) is used together with a dropout rate of 0.2. For the English-German (i.e., DE-EN and EN-DE) tasks, we train a 4-layer LSTM decoder with 1024 units in each layer. A 2-layer bidirectional-LSTM is used as the encoder, and we adopt the attention used in Wu et al. (2016). The word embedding dimension is set to 1024. Standard stochastic gradient descent is used for training with a decreasing learning rate, and we set $\beta = 0 . 5$ for the IPOT algorithm. More training details are provided in Appendix A. In terms of wall-clock time, our model only slightly increases training time. For the German-English task, it took roughly 5.5 days to train the GNMT model, and 6 days to train our proposed model from scratch, which only amounts to a roughly $1 0 \%$ increase.
|
| 163 |
+
|
| 164 |
+
We apply different combinations of $\mathcal { L } _ { \mathrm { c o p y } }$ and $\mathcal { L } _ { \mathrm { s e q } }$ to fine-tune the pre-trained GNMT model (Luong et al., 2018) and the results are summarized in Table 1 and 2. . Additional results for training from scratch are provided in Appendix B. The proposed OT approach consistently improves upon MLE training in all experimental setups.
|
| 165 |
+
|
| 166 |
+
We additionally tested our model with a more expressive 8-layer LSTM model on the EN-DE task. The BLEU score of our method is 28.0 on NT2015. For reference, the GNMT model (same architecture) and a Transformer model (Vaswani et al., 2017) respectively report a score of 27.6 and 27.3. Our method outperforms both baselines, and it is also competitive to the state-of-the-art BLEU score 28.4 reported by Vaswani et al. (2017) using a highly sophisticated model design.
|
| 167 |
+
|
| 168 |
+
The German-to-English translation examples are provided in Table 3 for qualitative assessment. The main differences among the reference translation, our translation and the GNMT translation are highlighted in blue and red. Our OT-augmented translations are more faithful to the reference than its MLE-trained counterpart. The soft-copying mechanism introduced by OT successfully maintains the key semantic content from the reference. Presumably, the OT loss helps refine the word embedding matrices, and promotes matching between words with similar semantic meanings. Vanilla
|
| 169 |
+
|
| 170 |
+
Table 3: Comparison of German-to-English translation examples. Matched key phrases are shown in the same color. First example: “May” is not the date when the new prime minister visited Japan, but actually is the time he won the election. Second example: GNMT’s paraphrase choices are not as accurate as ours. Third example: “nominating committee” is controlled by the government, not a “UN-controlled nomination committee” in GNMT’s result, and it also fails to capture the word “retain”.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Reference: GNMT: Ours:</td><td>India's new prime minister,Narendra Modi, ismeeting his Japanese counterpart,Shinzo Abe,in Tokyo to discuss economic and security ties,on his first major foreign visit since winning May's election. India s new prime minister,Narendra Modi,is meeting his Japanese counterpart,Shinzo Abe,in Tokyo at his first important visit abroad in May to discuss economic and security relations. Indias new Prime Minister Narendra Modi meets his Japanese counterpart,Shinzo Abe,in Tokyo at his first major foreign visit since his election in May in order to discuss economic and security relations .</td></tr><tr><td>Reference: GNMT:</td><td>The next day, turning up for work as usual, she was knocked down by a motorcyclist who had mounted the pavement inwhat passers-by described as a "vicious rage." 57 The next day,when she went to work as usual,she was driven by a motorcyclist who ,as passants</td></tr><tr><td>Ours:</td><td>described,went on foot in a kind of “brutal anger” The next day,when she went to work as usual,she was crossed by a motorcyclist who,was described by passers-by,in a sort of“brutal rage ”on the road </td></tr><tr><td>Reference:</td><td>Chinese leaders presented the Sundayruling asa democratic breakthrough because it gives Hong Kongers a directvote,but the decision also makes clear that Chinese leaders would retain a firm hold on the process through a nominating committee tightly controlled by Beijing. The Chinese leadership presented Sunday’s decision as a democratic breakthrough,because Hong</td></tr><tr><td>GNMT: Ours:</td><td>Kong'scitizens have a direct right to vote,butthe decision also makes itclear that the Chinese leadership is firmly in control of the process through a UN-controlled nomination committee The Chinese leadership presented Sunday’s decision as a democratic breakthrough because it gives</td></tr><tr><td></td><td>the citizens of Hong Kong a direct right to vote,but the decision also makes it clear that the Chinese leadership keeps the process firmly in the hands of a government-controlled Nomination Commitee .</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 4: ROUGE scores on Gigaword.
|
| 175 |
+
|
| 176 |
+
<table><tr><td>Systems</td><td>RG-1</td><td>RG-2</td><td>RG-L</td></tr><tr><td>Seq2Seq</td><td>33.4</td><td>15.7</td><td>32.4</td></tr><tr><td>Seq2Seq+Lseq</td><td>35.8</td><td>17.5</td><td>33.7</td></tr><tr><td>Seq2Seq+Lseq+Lcopy</td><td>36.2</td><td>18.1</td><td>34.0</td></tr></table>
|
| 177 |
+
|
| 178 |
+
Table 5: ROUGE scores on DUC2004.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>Systems</td><td>RG-1</td><td>RG-2</td><td>RG-L</td></tr><tr><td>Seq2Seq</td><td>28.0</td><td>9.4</td><td>24.8</td></tr><tr><td>Seq2Seq+Lseq</td><td>29.5</td><td>9.8</td><td>25.5</td></tr><tr><td>Seq2Seq+Lseq+Lcopy</td><td>30.1</td><td>10.1</td><td>26.0</td></tr></table>
|
| 181 |
+
|
| 182 |
+
GNMT translations, on the other hand, ignores or misinterprets some of the key terms. More examples are provided in Appendix E.
|
| 183 |
+
|
| 184 |
+
We also test the robustness of our method wrt the hyper-parameter $\gamma$ . Results are summarized in Appendix C. Our OT-augmented model is robust to the choice of $\gamma$ . The test BLEU scores are consistently higher than the baseline for $\gamma \in ( 0 , 1 ]$ .
|
| 185 |
+
|
| 186 |
+
# 5.2 ABSTRACTIVE TEXT SUMMARIZATION
|
| 187 |
+
|
| 188 |
+
We consider two datasets for abstractive text summarization. The first one is the Gigaword corpus (Graff et al., 2003), which has around $3 . 8 { \bf M }$ training samples, 190K validation samples, and 1951 test samples. The input pairs consist of the first sentence and the headline of an article. We also evaluate our model on the DUC-2004 test set (Over et al., 2007), which consists of 500 news articles. Our implementation of the Seq2Seq model adopts a simple architecture, which consists of a bidirectional GRU encoder and a GRU decoder with attention mechanism (Bahdanau et al., 2015)3.
|
| 189 |
+
|
| 190 |
+
Results are summarized in Tables 4 and 5. Our OT-regularized model outperforms respective baselines. The state-of-the-art ROUGE result for the Gigawords dataset is 36.92 reported by Wang et al. (2018a). However, much more complex architectures are used to achieve that score. We use a relatively simple Seq2Seq model in our experiments to demonstrate the versatility of the proposed OT method. Applying it for (i) more complicated models and $( i i )$ more recent datasets such as CNN/DailyMail (See et al., 2017) will be interesting future work.
|
| 191 |
+
|
| 192 |
+
Summarization examples are provided in Appendix D. Similar to the machine translation task, our proposed method captures the key semantic information in both the source and reference sentences.
|
| 193 |
+
|
| 194 |
+
# 5.3 IMAGE CAPTIONING
|
| 195 |
+
|
| 196 |
+
We also consider an image captioning task using the COCO dataset (Lin et al., 2014), which contains 123,287 images in total and each image is annotated with at least 5 captions. Following Karpathy’s split (Karpathy & Fei-Fei, 2015), 113,287 images are used for training and 5,000 images are used for validation and testing. We follow the implementation of the Show, Attend (Xu et al., 2015)4, and use Resnet-152 (He et al., 2016), image tagging (Gan et al., 2017), and FastRCNN (Anderson et al., 2018) as the image feature extractor (encoder), and a one-layer LSTM with 1024 units as the decoder. The word embedding dimension is set to 512. Note that in this task, the input are images instead of sequences, therefore $\mathcal { L } _ { \mathrm { c o p y } }$ cannot be applied.
|
| 197 |
+
|
| 198 |
+
Table 6: Results for image captioning on the COCO dataset.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>Method</td><td>BLEU-1</td><td>BLEU-2</td><td>BLEU-3</td><td>BLEU-4</td><td>METEOR</td><td>CIDEr</td></tr><tr><td>Soft Attention (Xu et al.,2015)</td><td>70.7</td><td>49.2</td><td>34.4</td><td>24.3</td><td>23.9</td><td>-</td></tr><tr><td>Hard Attention (Xu et al., 2015)</td><td>71.8</td><td>50.4</td><td>35.7</td><td>25.0</td><td>23.0</td><td>=</td></tr><tr><td>Show & Tell(Vinyals et al.,2015)</td><td>-</td><td>1</td><td>1</td><td>27.7</td><td>23.7</td><td>85.5</td></tr><tr><td>ATT-FCN(You et al.,2016)</td><td>70.9</td><td>53.7</td><td>40.2</td><td>30.4</td><td>24.3</td><td>-</td></tr><tr><td>SCN-LSTM(Gan et al., 2017)</td><td>72.8</td><td>56.6</td><td>43.3</td><td>33.0</td><td>25.7</td><td>101.2</td></tr><tr><td>Adaptive Attention (Lu et al.,2017)</td><td>74.2</td><td>58.0</td><td>43.9</td><td>33.2</td><td>26.6</td><td>108.5</td></tr><tr><td>Top-Down Attention (Anderson et al.,2018)</td><td>77.2</td><td>一</td><td>二</td><td>36.2</td><td>27.0</td><td>113.5</td></tr><tr><td>No attention,Resnet-152</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Show&Tell</td><td>70.3</td><td>53.7</td><td>39.9</td><td>29.5</td><td>23.6</td><td>87.1</td></tr><tr><td>Show & Tell+Lseq (Ours)</td><td>70.9</td><td>54.2</td><td>40.4</td><td>30.1</td><td>23.9</td><td>90.0</td></tr><tr><td>No attention,Tag</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Show&Tell</td><td>72.1</td><td>55.2</td><td>41.3</td><td>30.1</td><td>24.5</td><td>93.4</td></tr><tr><td>Show& Tell+Lseq(Ours)</td><td>72.3</td><td>55.4</td><td>41.5</td><td>31.0</td><td>24.6</td><td>94.7</td></tr><tr><td>Soft attention,FastRCNN</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Show,Attend & Tell</td><td>74.0</td><td>58.0</td><td>44.0</td><td>33.1</td><td>25.2</td><td>99.1</td></tr><tr><td>Show,Attend&Tell+Lseq(Ours)</td><td>74.5</td><td>58.4</td><td>44.5</td><td>33.8</td><td>25.6</td><td>102.9</td></tr></table>
|
| 201 |
+
|
| 202 |
+
We report BLEU- $k$ $k$ from 1 to 4) (Papineni et al., 2002), CIDEr (Vedantam et al., 2015), and METEOR (Banerjee & Lavie, 2005) scores and the results with different settings are shown in Table 6. Consistent across-the-board improvements are observed with the introduction of the OT loss, in contrast to the RL-based methods where drastic improvements can only be observed for the optimized evaluation metric (Rennie et al., 2017). Consequently, the OT loss is a more reliable method to improve the quality of generated captions when compared with RL methods that aim to optimize and therefore potentially overfit one specific metric. Examples of generated captions are provided in Appendix F.
|
| 203 |
+
|
| 204 |
+
# 6 CONCLUSION
|
| 205 |
+
|
| 206 |
+
This work is motivated by the major deficiency in training Seq2Seq models: that the MLE training loss does not operate at sequence-level. Inspired by soft bipartite matching, we propose the usage of optimal transport as a sequence-level loss to improve Seq2Seq learning. By applying this new method to machine translation, text summarization, and image captioning, we demonstrate that our proposed model can be used to help improve the performance compared to strong baselines. We believe the proposed method is a general framework, and will be useful to other sequence generation tasks as well, such as conversational response generation (Li et al., 2017; Zhang et al., 2018c), which is left as future work.
|
| 207 |
+
|
| 208 |
+
# REFERENCES
|
| 209 |
+
|
| 210 |
+
Shun-ichi Amari. Differential-geometrical methods in statistics, volume 28. Springer Science & Business Media, 1985.
|
| 211 |
+
|
| 212 |
+
Luigi Ambrosio, Nicola Gigli, and Giuseppe Savare.´ Gradient flows: in metric spaces and in the space of probability measures. 2005.
|
| 213 |
+
|
| 214 |
+
Peter Anderson, Basura Fernando, Mark Johnson, and Stephen Gould. Spice: Semantic propositional image caption evaluation. In European Conference on Computer Vision, pp. 382–398. Springer, 2016.
|
| 215 |
+
|
| 216 |
+
Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In CVPR, 2018.
|
| 217 |
+
|
| 218 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks.´ In ICML, 2017.
|
| 219 |
+
|
| 220 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
|
| 221 |
+
|
| 222 |
+
Dzmitry Bahdanau, Philemon Brakel, Kelvin Xu, Anirudh Goyal, Ryan Lowe, Joelle Pineau, Aaron Courville, and Yoshua Bengio. An actor-critic algorithm for sequence prediction. In ICLR, 2017.
|
| 223 |
+
|
| 224 |
+
Satanjeev Banerjee and Alon Lavie. Meteor: An automatic metric for mt evaluation with improved correlation with human judgments. In ACL Workshop, 2005.
|
| 225 |
+
|
| 226 |
+
Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In NIPS, 2015.
|
| 227 |
+
|
| 228 |
+
Stephen Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
|
| 229 |
+
|
| 230 |
+
Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, Roldano Cattoni, and Marcello ¨ Federico. The IWSLT 2015 evaluation campaign. In IWSLT 2015, International Workshop on Spoken Language Translation, 2015.
|
| 231 |
+
|
| 232 |
+
Changyou Chen, Ruiyi Zhang, Wenlin Wang, Bai Li, and Liqun Chen. A unified particleoptimization framework for scalable bayesian sampling. In UAI, 2018a.
|
| 233 |
+
|
| 234 |
+
Liqun Chen, Shuyang Dai, Chenyang Tao, Haichao Zhang, Zhe Gan, Dinghan Shen, Yizhe Zhang, Guoyin Wang, Ruiyi Zhang, and Lawrence Carin. Adversarial text generation via feature-mover’s distance. In NeurIPS, 2018b.
|
| 235 |
+
|
| 236 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In EMNLP, 2014.
|
| 237 |
+
|
| 238 |
+
Sumit Chopra, Michael Auli, and Alexander M Rush. Abstractive sentence summarization with attentive recurrent neural networks. In NAACL, 2016.
|
| 239 |
+
|
| 240 |
+
Katy Craig (ed.). The exponential formula for the Wasserstein metric. PhD thesis, The State University of New Jersey, 2014.
|
| 241 |
+
|
| 242 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In NIPS, 2013.
|
| 243 |
+
|
| 244 |
+
William Fedus, Ian Goodfellow, and Andrew M Dai. MaskGAN: Better text generation via filling in the . In ICLR, 2018.
|
| 245 |
+
|
| 246 |
+
Zhe Gan, Chuang Gan, Xiaodong He, Yunchen Pu, Kenneth Tran, Jianfeng Gao, Lawrence Carin, and Li Deng. Semantic compositional networks for visual captioning. In CVPR, 2017.
|
| 247 |
+
|
| 248 |
+
Aude Genevay, Gabriel Peyre, and Marco Cuturi. Learning generative models with sinkhorn diver- ´ gences. In AISTATS, 2018.
|
| 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 NIPS, 2014.
|
| 251 |
+
|
| 252 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT press Cambridge, 2016.
|
| 253 |
+
|
| 254 |
+
David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. English gigaword. Linguistic Data Consortium, Philadelphia, 2003.
|
| 255 |
+
|
| 256 |
+
Jiatao Gu, Zhengdong Lu, Hang Li, and Victor OK Li. Incorporating copying mechanism in sequence-to-sequence learning. In ACL, 2016.
|
| 257 |
+
|
| 258 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of Wasserstein GANs. In NIPS, 2017.
|
| 259 |
+
|
| 260 |
+
Jiaxian Guo, Sidi Lu, Han Cai, Weinan Zhang, Yong Yu, and Jun Wang. Long text generation via adversarial training with leaked information. In AAAI, 2018.
|
| 261 |
+
|
| 262 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 263 |
+
|
| 264 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 1997.
|
| 265 |
+
|
| 266 |
+
Gao Huang, Chuan Guo, Matt J Kusner, Yu Sun, Fei Sha, and Kilian Q Weinberger. Supervised word mover’s distance. In NIPS, 2016.
|
| 267 |
+
|
| 268 |
+
Qiuyuan Huang, Zhe Gan, Asli Celikyilmaz, Dapeng Wu, Jianfeng Wang, and Xiaodong He. Hierarchically structured reinforcement learning for topically coherent visual story generation. arXiv preprint arXiv:1805.08191, 2018.
|
| 269 |
+
|
| 270 |
+
Ferenc Huszr. How (not) to train your generative model: scheduled sampling, likelihood, adversary? In arXiv:1511.05101, 2015.
|
| 271 |
+
|
| 272 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-softmax. In arXiv:1611.01144, 2016.
|
| 273 |
+
|
| 274 |
+
Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In CVPR, 2015.
|
| 275 |
+
|
| 276 |
+
Harold W Kuhn. The Hungarian method for the assignment problem. Naval research logistics quarterly, 1955.
|
| 277 |
+
|
| 278 |
+
Matt Kusner, Yu Sun, Nicholas Kolkin, and Kilian Weinberger. From word embeddings to document distances. In ICML, 2015.
|
| 279 |
+
|
| 280 |
+
Alex Lamb, Anirudh Goyal ALIAS PARTH GOYAL, Ying Zhang, Saizheng Zhang, Aaron C Courville, and Yoshua Bengio. Professor forcing: A new algorithm for training recurrent networks. In NIPS, 2016.
|
| 281 |
+
|
| 282 |
+
Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. In EMNLP, 2017.
|
| 283 |
+
|
| 284 |
+
W. Li and G. Montufar. Natural gradient via optimal transport. arXiv preprint arXiv:1803.07033, 2018.
|
| 285 |
+
|
| 286 |
+
Chin-Yew Lin. Rouge: A package for automatic evaluation of summaries. Text Summarization Branches Out, 2004.
|
| 287 |
+
|
| 288 |
+
Kevin Lin, Dianqi Li, Xiaodong He, Zhengyou Zhang, and Ming-Ting Sun. Adversarial ranking for language generation. In NIPS, 2017.
|
| 289 |
+
|
| 290 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In ´ ECCV, 2014.
|
| 291 |
+
|
| 292 |
+
Hao Liu, Yihao Feng, Yi Mao, Dengyong Zhou, Jian Peng, and Qiang Liu. Action-depedent control variates for policy optimization via stein’s identity. In ICLR, 2018.
|
| 293 |
+
|
| 294 |
+
Siqi Liu, Zhenhai Zhu, Ning Ye, Sergio Guadarrama, and Kevin Murphy. Improved image captioning via policy gradient optimization of spider. In ICCV, 2017.
|
| 295 |
+
|
| 296 |
+
Jiasen Lu, Caiming Xiong, Devi Parikh, and Richard Socher. Knowing when to look: Adaptive attention via a visual sentinel for image captioning. In CVPR, 2017.
|
| 297 |
+
|
| 298 |
+
Giulia Luise, Alessandro Rudi, Massimiliano Pontil, and Carlo Ciliberto. Differential properties of sinkhorn approximation for learning with wasserstein distance. arXiv:1805.11897, 2018.
|
| 299 |
+
|
| 300 |
+
Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attentionbased neural machine translation. arXiv:1508.04025, 2015a.
|
| 301 |
+
|
| 302 |
+
Thang Luong, Hieu Pham, and Christopher D Manning. Bilingual word representations with monolingual quality in mind. In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language Processing, 2015b.
|
| 303 |
+
|
| 304 |
+
Thang Luong, Eugene Brevdo, and Rui Zhao. Neural machine translation (seq2seq) tutorial, 2018. URL https://github.com/tensorflow/nmt.
|
| 305 |
+
|
| 306 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. ICLR, 2017.
|
| 307 |
+
|
| 308 |
+
Paul Over, Hoa Dang, and Donna Harman. DUC in context. Information Processing & Management, 2007.
|
| 309 |
+
|
| 310 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. BLEU: a method for automatic evaluation of machine translation. In ACL, 2002.
|
| 311 |
+
|
| 312 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
|
| 313 |
+
|
| 314 |
+
Gabriel Peyre, Marco Cuturi, et al. Computational optimal transport. Technical report, 2017. ´
|
| 315 |
+
|
| 316 |
+
Marc’Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. In ICLR, 2016.
|
| 317 |
+
|
| 318 |
+
Steven J Rennie, Etienne Marcheret, Youssef Mroueh, Jarret Ross, and Vaibhava Goel. Self-critical sequence training for image captioning. In CVPR, 2017.
|
| 319 |
+
|
| 320 |
+
Yossi Rubner, Carlo Tomasi, and Leonidas J Guibas. The earth mover’s distance as a metric for image retrieval. IJCV, 2000.
|
| 321 |
+
|
| 322 |
+
Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. In EMNLP, 2015.
|
| 323 |
+
|
| 324 |
+
Tim Salimans, Han Zhang, Alec Radford, and Dimitris Metaxas. Improving GANs using optimal transport. In ICLR, 2018.
|
| 325 |
+
|
| 326 |
+
Abigail See, Peter J Liu, and Christopher D Manning. Get to the point: summarization with pointergenerator networks. ACL, 2017.
|
| 327 |
+
|
| 328 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NIPS, 2014.
|
| 329 |
+
|
| 330 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
|
| 331 |
+
|
| 332 |
+
Ramakrishna Vedantam, C Lawrence Zitnick, and Devi Parikh. Cider: Consensus-based image description evaluation. In CVPR, 2015.
|
| 333 |
+
|
| 334 |
+
Cedric Villani. ´ Optimal Transport: Old and New. Grundlehren der mathematischen Wissenschaften. Springer, 2008.
|
| 335 |
+
|
| 336 |
+
Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In CVPR, 2015.
|
| 337 |
+
|
| 338 |
+
Li Wang, Junlin Yao, Yunzhe Tao, Li Zhong, Wei Liu, and Qiang Du. A reinforced topic-aware convolutional sequence-to-sequence model for abstractive text summarization. IJCAI, 2018a.
|
| 339 |
+
|
| 340 |
+
Xin Wang, Wenhu Chen, Yuan-Fang Wang, and William Yang Wang. No metrics are perfect: Adversarial reward learning for visual storytelling. In ACL, 2018b.
|
| 341 |
+
|
| 342 |
+
Sam Wiseman and Alexander M Rush. Sequence-to-sequence learning as beam-search optimization. In EMNLP, 2016.
|
| 343 |
+
|
| 344 |
+
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:1609.08144, 2016.
|
| 345 |
+
|
| 346 |
+
Yujia Xie, Xiangfeng Wang, Ruijia Wang, and Hongyuan Zha. A fast proximal point method for Wasserstein distance. In arXiv:1802.04307, 2018.
|
| 347 |
+
|
| 348 |
+
Hongteng Xu, Wenlin Wang, Wei Liu, and Lawrence Carin. Distilled Wasserstein learning for word embedding and topic modeling. In NeurIPS, 2018.
|
| 349 |
+
|
| 350 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C Courville, Ruslan Salakhutdinov, Richard S Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015.
|
| 351 |
+
|
| 352 |
+
Quanzeng You, Hailin Jin, Zhaowen Wang, Chen Fang, and Jiebo Luo. Image captioning with semantic attention. In CVPR, 2016.
|
| 353 |
+
|
| 354 |
+
Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. SeqGAN: Sequence generative adversarial nets with policy gradient. In AAAI, 2017.
|
| 355 |
+
|
| 356 |
+
Ruiyi Zhang, Changyou Chen, Zhe Gan, Wenlin Wang, Liqun Chen, Dinghan Shen, Guoyin Wang, and Lawrence Carin. Sequence generation with guider network. arXiv preprint arXiv:1811.00696, 2018a.
|
| 357 |
+
|
| 358 |
+
Ruiyi Zhang, Changyou Chen, Chunyuan Li, and Lawrence Carin. Policy optimization as wasserstein gradient flows. In ICML, 2018b.
|
| 359 |
+
|
| 360 |
+
Yizhe Zhang, Zhe Gan, Kai Fan, Zhi Chen, Ricardo Henao, Dinghan Shen, and Lawrence Carin. Adversarial feature matching for text generation. In ICML, 2017.
|
| 361 |
+
|
| 362 |
+
Yizhe Zhang, Michel Galley, Jianfeng Gao, Zhe Gan, Xiujun Li, Chris Brockett, and Bill Dolan. Generating informative and diverse conversational responses via adversarial information maximization. In NeurIPS, 2018c.
|
| 363 |
+
|
| 364 |
+
# APPENDIX
|
| 365 |
+
|
| 366 |
+
# A TRAINING DETAILS FOR NMT TASK
|
| 367 |
+
|
| 368 |
+
The following training details are basically the same as the intructions from the Tensorflow/nmt github repository:
|
| 369 |
+
|
| 370 |
+
EN-VI 2-layer LSTMs of 512 units with bidirectional encoder (i.e., 1 bidirectional layer for the encoder), embedding dim is 512. LuongAttention (Luong et al., 2015a) (scale $\fallingdotseq$ True) is used together with dropout keep-prob $_ { = 0 . 8 }$ . All parameters are uniformly initialized. We use SGD with learning rate 1.0 as follows: train for 12K steps (around 12 epochs); after 8K steps, we start halving learning rate every 1K step.
|
| 371 |
+
|
| 372 |
+
DE-EN The training hyperparameters are similar to the EN-VI experiments except for the following details. The data is split into subword units using BPE (32K operations). We train 4- layer LSTMs of 1024 units with bidirectional encoder (i.e., 2 bidirectional layers for the encoder), embedding dimension is 1024. We train for 350K steps (around 10 epochs); after 170K steps, we start halving learning rate every 17K step.
|
| 373 |
+
|
| 374 |
+
# B END-TO-END NEURAL MACHINE TRANSLATION
|
| 375 |
+
|
| 376 |
+
Table 7: BLEU scores on VI-EN and EN-VI.
|
| 377 |
+
|
| 378 |
+
<table><tr><td>Systems</td><td>NT2012</td><td>NT2013</td></tr><tr><td>VI-EN: GNMT</td><td>20.7</td><td>23.8</td></tr><tr><td>VI-EN: GNMT+OT(Ours)</td><td>21.9</td><td>25.5</td></tr><tr><td>EN-VI: GNMT</td><td>23.0</td><td>25.4</td></tr><tr><td>EN-VI: GNMT+OT(Ours)</td><td>24.1</td><td>26.5</td></tr></table>
|
| 379 |
+
|
| 380 |
+
Table 8: BLEU scores on DE-EN and EN-DE.
|
| 381 |
+
|
| 382 |
+
<table><tr><td>Systems</td><td>NT2013</td><td>NT2015</td></tr><tr><td>DE-EN: GNMT</td><td>28.5</td><td>29.0</td></tr><tr><td>DE-EN: GNMT+OT(Ours)</td><td>28.8</td><td>29.5</td></tr><tr><td>EN-DE: GNMT</td><td>23.7</td><td>25.3</td></tr><tr><td>EN-DE: GNMT+OT(Ours)</td><td>24.1</td><td>26.2</td></tr></table>
|
| 383 |
+
|
| 384 |
+
Table 7 and 8 show the quantitative comparison for training from random initialization.
|
| 385 |
+
|
| 386 |
+
# C BLEU SCORE FOR DIFFERENT HYPER-PARAMETERS
|
| 387 |
+
|
| 388 |
+
We tested different $\gamma$ for the OT loss term and summarized the results in Figure 3. $\gamma = 0 . 1$ gave the best performance for the EN-VI experiment. The results are robust wrt the choice of $\gamma \leq 1 . 0$ .
|
| 389 |
+
|
| 390 |
+

|
| 391 |
+
Figure 3: the performance of EN-VI translation by different $\gamma$
|
| 392 |
+
|
| 393 |
+
# D SUMMARIZATION EXAMPLES
|
| 394 |
+
|
| 395 |
+
Table 9: Examples on Text Summarization.
|
| 396 |
+
Examples
|
| 397 |
+
|
| 398 |
+
<table><tr><td>Source:</td><td> japan 's nec corp.and UNK computer corp. of the united states said wednesday they had agreed to join</td></tr><tr><td>Reference:</td><td>forces in supercomputer sales. nec UNK in computer sales tie-up</td></tr><tr><td>Baseline:</td><td>nec UNK computer corp.</td></tr><tr><td>Ours:</td><td>nec UNK computer corp sales supercomputer.</td></tr><tr><td>Source:</td><td>five east timorese youths who scaled the french embassy'sfence here thursday,left the embassy on their</td></tr><tr><td>Reference:</td><td>way to portugal friday.</td></tr><tr><td rowspan="3">Baseline: Ours:</td><td>UNK latest east timorese asylum seekers leave for portugal</td></tr><tr><td>five east timorese youths leave embassy</td></tr><tr><td>five east timorese seekers leave embassy for portugal theus space shuttle atlantis separated from the orbiting russanmir space station earlysaturday,after threedaysof</td></tr><tr><td rowspan="2">Source: Reference: Baseline:</td><td>test runs for life in a future space facility,nasa announced .</td></tr><tr><td>atlantis mir part ways after three-day space collaboration by emmanuel UNK</td></tr><tr><td rowspan="2">Ours: Source:</td><td>atlantis separate from mir atlantis separate from mir space by UNK</td></tr><tr><td>australia 's newscorp announced monday it was joining brazil's globo,mexico's grupo televisa and the us tele-communications inc.in a venture to broadcast ### channels via satelite to latin america.</td></tr><tr><td rowspan="2">Reference:</td><td></td></tr><tr><td>news corp globo televisa and tele-communications in satellite venture australia 's news corp joins brazil</td></tr><tr><td rowspan="2">Baseline: Ours:</td><td></td></tr><tr><td>australia 's news corp joins brazil in satellite venture</td></tr></table>
|
| 399 |
+
|
| 400 |
+
Examples for abstract summarization are provided in Table 9.
|
| 401 |
+
|
| 402 |
+
# E NEURAL MACHINE TRANSLATION EXAMPLES
|
| 403 |
+
|
| 404 |
+
In Table 10, we show more examples for comparison. From these examples, sentences generated from our model are more faithful to the reference sentences.
|
| 405 |
+
|
| 406 |
+
# F IMAGE CAPTION EXAMPLES
|
| 407 |
+
|
| 408 |
+
Table 4 shows the comparison of our model with other baselines.
|
| 409 |
+
|
| 410 |
+
G ENCODING MODEL BELIEF WITH SOFTMAX AND GUMBEL-SOFTMAX
|
| 411 |
+
|
| 412 |
+

|
| 413 |
+
Figure 4: Examples of image captioning on MS COCO.
|
| 414 |
+
|
| 415 |
+
To find out the best differentiable sequence generating mechanism, we also experimented with Softmax and Gumbel-softmax (a.k.a. concrete distribution). Detailed results are summarized in Table 11. We can see Softmax and Gumbelsoftmax based OT model provide less significant gains in terms of BLEU score compared with the baseline MLE model. In some situation, the performance even degenerate. We hypothesized that this is because Softmax encodes more ambiguity and Gumbel-softmax has a larger variance due to the extra random variable involved. These in turn hurts the learning. More involved variance reduction scheme might offset such negative impacts for Gumbel-softmax, which is left as our future work.
|
| 416 |
+
|
| 417 |
+
Table 11: BLEU scores on VI-EN and EN-VI using different choices of model’s belief.
|
| 418 |
+
|
| 419 |
+
<table><tr><td>Systems</td><td>NT2012</td><td>NT2013</td></tr><tr><td>VI-EN: GNMT</td><td>20.7</td><td>23.8</td></tr><tr><td>VI-EN: :GNMT+OT(GS)</td><td>20.9</td><td>24.5</td></tr><tr><td>VI-EN: GNMT+OT(softmax)</td><td>21.8</td><td>24.3</td></tr><tr><td>VI-EN: GNMT+OT(ours)</td><td>21.9</td><td>25.5</td></tr><tr><td>EN-VI: GNMT</td><td>23.0</td><td>25.4</td></tr><tr><td>EN-VI: GNMT+OT (GS)</td><td>23.3</td><td>25.7</td></tr><tr><td>EN-VI: GNMT+OT (softmax)</td><td>23.5</td><td>26.0</td></tr><tr><td>EN-VI: GNMT+OT(ours)</td><td>24.1</td><td>26.5</td></tr></table>
|
| 420 |
+
|
| 421 |
+
# H OT IMPROVES BOTH MODEL AND WORD EMBEDDING MATRIX
|
| 422 |
+
|
| 423 |
+
To identify the source of performance gains, we designed a toy sequence-to-sequence experiment to show that OT help to refine the language model and word embedding matrix. We use the English corpus from WMT dataset (from our machine translation task) and trained an auto-encoder (Seq2Seq model) on this dataset. We evaluated the reconstruction quality with the BLEU score. In Case 1, we stop the OT gradient from flowing back to the
|
| 424 |
+
|
| 425 |
+
Table 12: Comparison experiment.
|
| 426 |
+
|
| 427 |
+
<table><tr><td>Metric</td><td>Baseline</td><td>Case 1</td><td>Case 2</td></tr><tr><td>BLEU-2</td><td>71.87</td><td>73.60</td><td>75.12</td></tr><tr><td>BLEU-3</td><td>61.18</td><td>63.07</td><td>64.82</td></tr><tr><td>BLEU-4</td><td>56.59</td><td>58.48</td><td>60.27</td></tr><tr><td>BLEU-5</td><td>53.73</td><td>55.69</td><td>57.50</td></tr></table>
|
| 428 |
+
|
| 429 |
+
sequence model ( only affecting the word embedding matrix); while in Case 2, the gradient from OT can affect the entire model. Detailed results are shown in Table G. We can see that Case 1 is better than the baseline model, which means OT helps to refine the word embedding matrix. Case 2 achieves the highest BLEU, which implies OT also helps to improve the language model.
|
| 430 |
+
|
| 431 |
+
Table 10: More DE-EN translation examples.
|
| 432 |
+
|
| 433 |
+
<table><tr><td>Examples</td><td></td></tr><tr><td>Reference:</td><td>When former First Lady Eleanor Roosevelt chaired the International Commission on Human Rights,which drafted the Universal Declaration of Human Rights that would in 1948 be adopted bythe United Nations as a global covenant,Roosevelt and the drafters included a guarantee that "everyone has the right to form and to</td></tr><tr><td>Ours:</td><td>join trade unions for the protection of his interests." When formerFirst Lady Eleanor Roosevelt held the presidency of the International Commission on Human Rights,drafted bythe Universal Declaration of Human Rights,adopted in1948by the United Nations as a</td></tr><tr><td>GNMT:</td><td>global agreement,Roosevelt and the other authors gave a guarantee that”everyone has the right to form or join trade unions to protect their interests .” When former FirstLady Eleanor Roosevelt presided over the International Human Rights Commitee ,which</td></tr><tr><td></td><td>drew up the Universal Declarationof Human Rights,as adopted by the United Nations in 1948as a global agreement ,Roosevelt and the other authors added a guarantee that ”everyone has the right to form trade unions to protect their interests or to accede to them ”.</td></tr><tr><td>Reference:</td><td>India's new prime minister,Narendra Modi,ismeeting his Japanese counterpart,Shinzo Abe,in Tokyo to discuss economic and security ties,on his first major foreign visit since winning May's election.</td></tr><tr><td>Ours:</td><td>India s new Prime Minister Narendra Modi meets his Japanese counterpart,Shinzo Abe,in Tokyoat his first major foreign visit since his election in May in order to discuss economic and security relations</td></tr><tr><td>GNMT:</td><td>Indias new prime minister,Narendra Modi,is meeting his Japanese counterpart,Shinzo Abe,in Tokyo at</td></tr><tr><td></td><td>his first important visit abroad in May to discuss economic and security relations The police used tear gas.</td></tr><tr><td>Reference: Ours:</td><td>The police used tear gas .</td></tr><tr><td>GNMT:</td><td>The police put in tear gas.</td></tr><tr><td>Reference:</td><td>There were three people killed.</td></tr><tr><td>Ours:</td><td>Three people were killed .</td></tr><tr><td>GNMT:</td><td>Three people had been killed</td></tr><tr><td>Reference:</td><td>The next day,turning up for work as usual,she was knocked down by a motorcyclist who had mounted the pavement in what passers-by described as a "vicious rage."</td></tr><tr><td>Ours:</td><td>The next day,when she went to work as usual,she was crossed by a motorcyclist who ,as described by</td></tr><tr><td>GNMT:</td><td>passers-by,was in a sort of”brutal rage ”on the road . The next day,when she went to work as usual,she was driven by a motorcyclist who,as passants described,</td></tr><tr><td>Reference:</td><td>went on foot in a kind of ”brutal anger” Double-check your gear.</td></tr><tr><td>Ours:</td><td>Check your equipment twice .</td></tr><tr><td>GNMT:</td><td>Control your equipment twice . Chinese leaders presented the Sunday ruling as a democratic breakthrough because it gives Hong Kongers a</td></tr><tr><td>Reference:</td><td>direct vote,but the decision also makes clear that Chinese leaders would retain a firm hold on the process</td></tr><tr><td>Ours:</td><td>through a nominating committee tightly controlled by Beijing. The Chinese leadership presented Sunday s decision as a democratic breakthrough because it gives the citizens</td></tr><tr><td></td><td>of Hong Konga directright to vote,but the decision also makes it clearthat the Chinese leadership keeps the process firmly in the hands of a government-controlled Nomination Commitee .</td></tr><tr><td>GNMT:</td><td>The Chinese leadership presented Sunday s decision as a democratic breakthrough ,because Hong Kongs citizens havea directright to vote,butthe decision also makes itclear thatthe Chinese leadership is firmly in control of the process through a UN-controlled nomination committee .</td></tr><tr><td>Reference:</td><td>Her mother arrived at Mount Sinai Hospital Thursday after an emergency callthat she was in cardiac arrest at an Upper East Side clinic,Yorkville Endoscopy,sources said.</td></tr><tr><td>Ours:</td><td>According to sources,her mother was sent to Mount Sinai on Thursday after an emergency due to heart failure in a clinic at the Upper East Side,Yorkville Endoscopy .</td></tr><tr><td>GNMT:</td><td>According to sources,her mother was sent to Mount Sinai hospital on Thursday after an emergency due to heart closure in a clinic at the Upper East Side,Yorkville Endoscopy.</td></tr><tr><td>Reference:</td><td>Ukrainian soldiers had to withdraw from their positions in Ilovaysk after two columns of Russian armor and 1,000 troops last week moved into the Donetsk region to bolsterthe beleaguered separatists,Col.Andriy Ly-</td></tr><tr><td>Ours:</td><td>senko,spokesman for the Ukrainian National Security and Defense Council, told reporters in Kievon Saturday. Ukrainian soldiers hadto withdraw from their positions in lowajsk after two Russan tanks and1,0oo soldiers enteredthe Donetsk region last week to support the belated separatists,said Colonel Andrij Lysenko,Speaker</td></tr><tr><td>GNMT:</td><td>of the Ukrainian National Security and Defence Council Reporters on Saturday in Kiev. Ukrainian soldiers had to withdraw from their positions in Ilowajsk after two Russian tanksand 1,Oo0 sol-</td></tr><tr><td></td><td>diers invaded the Donetsk region last week to support the beloved separatists,said Colonel Andriy Lysenko, Ukrainian National Security and Defence Council spokesman on Saturday in Kiev . Mountain Rescue doctor,Professr Volker Lischke,who was there with his team to provide safety,and who</td></tr><tr><td>Reference:</td><td>was equipped with a four-wheel Bullyand Quad,said: "I know him from Frankfurt - he trains fora specialist</td></tr><tr><td></td><td>sleigh trail - it's just that he pulls the sleigh himself.”The man is,therefore,ina sense his own sleigh dog. Bergwacht doctor Professor Volker Lischke,who,with his team,endowed with Allrad-Bullyand Quad for</td></tr><tr><td>Ours:</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>safety,said :”The kenn ”I from Frankfurt,trained fora special sleigh trail,just that he trains the sleigh</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>himself”,so the man is,in a sense,his own sled dog.</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>GNMT:</td><td>Bergwacht physician Professor Volker Lischke,who with his team,equipped with Allrad-Bully and Quad ,for</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>safety,said :”Den kenn”ichaus Frankfurt,which trained foraspecial Schlitentrail,only to stop the sleigh</td></tr></table>
|
md/train/S9ZyhWC17wJ/S9ZyhWC17wJ.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Learning with Noisy Correspondence for Cross-modal Matching
|
| 2 |
+
|
| 3 |
+
Guocheng Niu Baidu Inc., China niuguocheng@baidu.com
|
| 4 |
+
|
| 5 |
+
Zhenyu Huang∗ College of Computer Science Sichuan University, China zyhuang.gm@gmail.com
|
| 6 |
+
|
| 7 |
+
Xiao Liu TAL Education Group liuxiao15@tal.com
|
| 8 |
+
|
| 9 |
+
Wenbiao Ding TAL Education Group dingwenbiao@tal.com
|
| 10 |
+
|
| 11 |
+
Xinyan Xiao Baidu Inc., China xiaoxinyan@baidu.com
|
| 12 |
+
|
| 13 |
+
Hua Wu Baidu Inc., China wu_hua@baidu.com
|
| 14 |
+
|
| 15 |
+
Xi Peng† College of Computer Science Sichuan University, China pengx.gm@gmail.com
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Cross-modal matching, which aims to establish the correspondence between two different modalities, is fundamental to a variety of tasks such as cross-modal retrieval and vision-and-language understanding. Although a huge number of crossmodal matching methods have been proposed and achieved remarkable progress in recent years, almost all of these methods implicitly assume that the multimodal training data are correctly aligned. In practice, however, such an assumption is extremely expensive even impossible to satisfy. Based on this observation, we reveal and study a latent and challenging direction in cross-modal matching, named noisy correspondence, which could be regarded as a new paradigm of noisy labels. Different from the traditional noisy labels which mainly refer to the errors in category labels, our noisy correspondence refers to the mismatch paired samples. To solve this new problem, we propose a novel method for learning with noisy correspondence, named Noisy Correspondence Rectifier (NCR). In brief, NCR divides the data into clean and noisy partitions based on the memorization effect of neural networks and then rectifies the correspondence via an adaptive prediction model in a co-teaching manner. To verify the effectiveness of our method, we conduct experiments by using the image-text matching as a showcase. Extensive experiments on Flickr30K, MS-COCO, and Conceptual Captions verify the effectiveness of our method. The code could be accessed from www.pengxi. me.
|
| 20 |
+
|
| 21 |
+
# 1 Introduction
|
| 22 |
+
|
| 23 |
+
As one of the most fundamental techniques in multimodal learning, cross-modal matching aims to bridge different modalities. In recent years, some cross-modal matching methods [19, 11, 7, 26] have been proposed based on Deep Neural Networks (DNNs), which achieved remarkable progress in a variety of applications, such as clustering [29, 24], image/video captioning [1, 44, 22], cross-modal retrieval [40, 19, 13], and visual question answering [9].
|
| 24 |
+
|
| 25 |
+
In general, most existing cross-modal matching methods embed different modalities into a common space wherein the similarity of positive cross-modal pairs is maximized and that of the negative ones is minimized. Although these methods have achieved promising results, their success depends on an implicit data assumption, i.e., the training data are correctly aligned across modalities. For example, in the vision-and-language tasks, the text needs to accurately describe the image content, and vice versa. In practice, however, it is extremely expensive and time-consuming to annotate or collect such data pairs. Especially, considering the data collected from the Internet [35, 14], it is inevitable to collect some mismatched pairs which are wrongly treated as the matched ones. To the best of our knowledge, such a special noisy label (correspondence) problem has been ignored so far, which will remarkably degrade the performance of matching methods as shown in our experiments.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Noisy labels vs. Noisy Correspondence. We denote the noisy samples with red lines and clean samples with green lines. The traditional noisy labels mainly refer to the errors in category labels, while the noisy correspondence refers to the alignment errors in paired data. For the noisy correspondence in cross-modal matching, the true positive pair correctly guides the cross-modal matching, while the false positive pair causes incorrect supervision for training.
|
| 29 |
+
|
| 30 |
+
Based on the above observation, we reveal a new paradigm for the noisy labels, named noisy correspondence. Different from the traditional noisy labels, the noisy correspondence refers to the alignment errors in paired data rather than the errors in category annotations (see Fig. 1). To the best of our knowledge, there is no effort has been devoted to study this new problem and the closest paradigm might be the partially view-aligned problem (PVP) [12, 41]. However, PVP is remarkably different from noisy correspondence, and the latter is more practical than the former. To be specific, PVP focuses on that the cross-modal alignment is totally unavailable, whereas the noisy correspondence focuses on that some correspondences are incorrect. In addition, PVP assumes that some correctly aligned data are available for training, whereas our noisy correspondence assumes that the clean and noisy data are mixed.
|
| 31 |
+
|
| 32 |
+
To solve the noisy correspondence problem in cross-modal matching, we propose a novel method, named Noisy Correspondence Rectifier (NCR). Our method is based on the memorization effect of DNNs observed in [3, 39], i.e., DNNs tend to learn the simple patterns before fitting noisy samples. Motivated by this empirical observation, NCR divides the data into two relative accurate data partitions, i.e., “noisy” and “clean” subsets, based on their loss difference. After that, NCR employs an adaptive prediction function for label rectifying so that the false positives and the true positives could be identified from the “clean” and the “noisy” subsets, respectively. Furthermore, we propose a novel triplet loss for robust cross-modal matching by recasting the rectified labels as the soft margin.
|
| 33 |
+
|
| 34 |
+
The main contributions and novelties of this paper could be summarized as below. i) We reveal a new problem in cross-modal analysis, which is also a new paradigm for noisy labels, termed noisy correspondence. Different from the traditional noisy labels, the noisy correspondence refers to the alignment errors in paired data instead of the errors in category annotations. To the best of our knowledge, this work could be the first study on this problem. ii) To solve the noisy correspondence problem, we propose a novel method for learning with noisy correspondence, named Noisy Correspondence Rectifier (NCR). One major novelty of NCR is that the rectified label is elegantly recasted as the soft margin of a triplet loss so that the robust cross-modal matching could be achieved. iii) To verify the effectiveness of our method, we conduct experiments on the image-text matching task. Extensive experiments on three challenging datasets verify the effectiveness of our method in the synthesized and real noises.
|
| 35 |
+
|
| 36 |
+
# 2 Related works
|
| 37 |
+
|
| 38 |
+
In this section, we briefly introduce some recent developments in cross-modal matching and learning with noisy labels.
|
| 39 |
+
|
| 40 |
+
# 2.1 Cross-modal Matching
|
| 41 |
+
|
| 42 |
+
Most existing cross-modal matching works seek to learn a common space wherein different modalities are comparable. In general, existing works could be roughly divided into two categories: 1) Coarsegrained Matching. It often utilizes multiple neural networks to compute a global feature and each network is used for a specific modality [17, 37, 8]. For example, Kiros et al. [17] use a Convolutional Neural Network (CNN) and a Gated Recurrent Unit (GRU) to obtain the image and text features, while enforcing the similarity of positive pairs larger than that of the negative ones. To further boost the matching performance, ${ \mathrm { V S E } } { + } { + }$ [8] uses some representative negatives to improve the discrimination of the model. 2) Fine-grained Matching. It seeks to measure the fine-grained similarity for cross-modal matching [19, 21, 7]. For example, SCAN [19] proposes learning the latent semantic correspondence between the image regions and words that are extracted by bottom-up attention [1] and GRU, respectively. VSRN [21] adopts a graph convolutional network for semantic reasoning. SGRAF [7] proposes constructing a similarity graph to reason the similarity and adopting an attention filtration technique to eliminate the less-meaningful alignments. Recently Chun et al. [6] introduce a new paradigm for cross-modal matching, i.e. possible many-to-many correspondence that existed in the image and captions. To achieve this, they propose to use probabilistic representations to model the possible one-to-many correspondence.
|
| 43 |
+
|
| 44 |
+
Although promising results have been achieved in recent years, the existing methods heavily rely on the correctly aligned data. In practice, however, such well-matched data is expensive and timeconsuming to collect. Moreover, some recent works [35, 14] show that a large-scale dataset collected from the wild could remarkably improve the performance of the model. However, such a data will inevitably contain some mismatched pairs. Hence, it is highly expected to develop some methods which are robust against the noisy correspondence, which has not been studied as far as we know. Different from the many-to-many correspondence [6] between image and captions, NCR reveals the noisy correspondence problem which refers to the alignment errors of image-text pairs and proposes to eliminate the negative impact from noisy pairs for downstream tasks.
|
| 45 |
+
|
| 46 |
+
# 2.2 Learning with Noisy Labels
|
| 47 |
+
|
| 48 |
+
To handle the possible noisy annotations in the training data, a large number of methods have been proposed and almost all of them focus on the classification task [36, 27]. To reduce the negative impact of the noisy labels, the existing works often resort to robust architecture design, regularization, loss adjustment, or sample selection methods. Here, we mainly introduce the last two approaches which are most related to this work. To be specific, the loss adjustment achieves robustness by adjusting the contribution of clean and noisy samples w.r.t. the loss. For example, Reed et al. [32] proposed a bootstrapping loss based on the model predictions for loss correction. Zhang et al. [45] provided some theoretical explanations for the label correction along with a new label correction algorithm. Different from the loss adjustment methods, sample selection methods aim to select clean samples from a noisy dataset. For example, Arpit et al. [3] showed that DNNs tend to learn simple patterns before fitting noisy samples, namely the memorization effect. Motivated from this, Arazo et al. [2] proposed treating the samples with small loss as the clean samples. To avoid the selection bias of clean samples, Co-teaching methods [10, 43] use the samples with small loss to iteratively train two networks. In recent, DivideMix [20] adopts the MixMatch method [4] for semi-supervised learning with the clean and noisy samples.
|
| 49 |
+
|
| 50 |
+
Unlike the above noisy label studies, this paper focuses on the noisy correspondence problem which considers mismatched multimodal data pairs instead of incorrectly annotated data points. Besides the difference in the problem, this work is also different from the aforementioned studies in the methodology. To be specific, in cross-modal matching, it is impossible to directly adopt these noise label learning methods to solve the noisy correspondence problem due to the following two reasons. First, most of the noisy label learning methods propose to use the model’s prediction for label rectifying in the scenario of classification, while it is intractable to directly predict the correspondence of given pairs in matching models. Second, even if we can rectify the noisy correspondence somehow, the rectified real-valued labels are incompatible with the existing matching methods since most of them assume the given labels are binary. To address these problems, NCR proposes an adaptive prediction function and a novel triplet loss by recasting the soft labels as soft margins.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Overview of the proposed method. (a) Training pipeline of NCR. NCR consists of two individual networks (A, B) which work in the manner of co-teaching. In brief, NCR first warmup the networks (A, B) on the original training data using the loss $L _ { w }$ which is also used for per-sample loss computation. Then, based on the memorization effect of DNclean and noisy subsets at each epoch using either A or B, i.e., $S ^ { A } = ( S _ { c } ^ { A } , S _ { n } ^ { A } )$ the and $S ^ { B } = \mathsf { \bar { ( } } S _ { c } ^ { B } , S _ { n } ^ { B } )$ After that, NCR will co-rectify the correspondence of $\{ { \cal S } ^ { A } , { \cal S } ^ { B } \}$ and obtain $\{ \hat { S ^ { A } } , \hat { S ^ { B } } \}$ using an adaptive prediction function. Finally, $\hat { \cal S } ^ { A }$ and $\hat { S ^ { B } }$ will be used to train the network $B$ and $A$ in a swapping way. (b) Robust image-text matching network. For example, the network A projects the image and text by the modal-specific networks $f$ and $g$ , respectively. Then the similarity $S ( I , T )$ is computed on the extracted features $f ( I )$ and $g ( T )$ . To achieve robust image-text matching, the rectified soft labels are recast as the soft margin of our loss $\scriptstyle L _ { s o f t }$ . As shown, for a given anchor, $\boldsymbol { L _ { s o f t } }$ will enforce the true positive to closer to it than the negative by a large margin $\hat { \alpha } _ { 1 }$ , and meanwhile the false positive will has a small margin $\hat { \alpha } _ { 2 }$ .
|
| 54 |
+
|
| 55 |
+
# 3 The Proposed Method
|
| 56 |
+
|
| 57 |
+
In this section, we elaborate on the proposed method, i.e., Noisy Correspondence Rectifier (NCR) which could be the first work to solve the noisy correspondence problem in cross-modal matching. In Section 3.1, we introduce the co-divide module which splits the training data into the clean and noisy subsets. After that, we introduce how to rectify the labels with an adaptive prediction function in Section 3.2. Finally, we detail how to combine the co-divide and co-rectify modules to achieve robust cross-modal matching in Section 3.3.
|
| 58 |
+
|
| 59 |
+
# 3.1 Co-divide
|
| 60 |
+
|
| 61 |
+
Without loss of generality, we first introduce the cross-modal matching task by taking the image-text matching as a showcase. Given the training data $\mathcal { D } = \{ ( I _ { i } , T _ { i } , y _ { i } ) \} _ { i = 1 } ^ { \overline { { N } } }$ , where $N$ is the data size, $( I _ { i } , T _ { i } )$ is an image-text pair and $y _ { i } \in \{ 1 , \bar { 0 } \}$ indicates that the pair belong to the same instance (positive) or not (negative). For the noisy correspondence case, it defines that an unknown portion of $\mathcal { D }$ is mismatched, i.e., $( I _ { i } , T _ { i } )$ is a negative pair but wrongly labeled as $y _ { i } = 1$ . To solve such a noisy correspondence problem, we propose NCR to achieve robust cross-modal matching.
|
| 62 |
+
|
| 63 |
+
To begin, we project the visual and textual modalities into a shared space via two modal-specific networks $f$ and $g$ , respectively. Then the similarity of the given image-text pairs is computed through $S ( f ( I ) , g ( T ) )$ . For simplicity, we denote $S ( f ( \dot { I } ) , g ( T ) )$ as $S ( I , T )$ in the following. Some early empirical studies [3] show that DNNs tend to first learn simple samples and then gradually fit the noisy samples. This so-called memorization effect of DNNs will lead to a relatively low loss for the clean samples. Motivated by this, we utilize the difference of loss distribution between the clean samples and noisy samples to divide the training data like [10, 43, 2, 20]. Specifically, given a matching model $( \bar { f } , g , \bar { S } )$ , we compute the per-sample loss through:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\ell _ { ( f , g , S ) } = \{ \ell _ { i } \} _ { i = 1 } ^ { N } = \{ L _ { w } ( I _ { i } , T _ { i } ) \} _ { i = 1 } ^ { N }
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $L _ { w }$ is defined as:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
L _ { w } ( I , T ) = \sum _ { \hat { T } } [ \alpha - S ( I , T ) + S ( I , \hat { T } ) ] _ { + } + \sum _ { \hat { I } } [ \alpha - S ( I , T ) + S ( \hat { I } , T ) ] _ { + } ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $( I , T )$ is a positive pair, $\alpha > 0$ denotes a given margin, and $[ x ] _ { + } = m a x ( x , 0 )$ . In the loss, the first term treats $I$ as queries taking over all negative text $\hat { T }$ , while the second term treats $T$ as queries taking over all negative images $\hat { I }$ . Then, we fit the per-sample loss of all training data by using a two-component Gaussian Mixture Model [20, 30]:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
p ( \ell | \theta ) = \sum _ { k = 1 } ^ { K } \beta _ { k } \phi ( \ell | k ) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\beta _ { k }$ and $\phi ( \ell | k )$ are the mixture coefficient and the probability density of the $k$ -th component, respectively. Based on the memorization effect of DNNs, we treat the component with a lower mean value (i.e., lower loss) as the clean set, and the other as the noisy set. To optimize the GMM, we adopt the Expectation-Maximization algorithm. Moreover, we compute the posterior probability $w _ { i } \stackrel { - } { = } p ( k | \ell _ { i } ) ^ { - } = p ( k ) p ( \ell _ { i } | k ) / p ( \ell _ { i } )$ as the clean probability of $i$ -th sample, where $k$ is the Gaussian component with the lower mean. By setting a threshold to $\{ w _ { i } \} _ { i = 1 } ^ { N }$ , we divide the data into clean and noisy subsets. For simplicity, we set the threshold to 0.5 through all experiments.
|
| 82 |
+
|
| 83 |
+
As observed in [10], it probably introduces error accumulation if the neural network is trained in a self-divide manner. To avoid such a situation, we adopt the co-teaching paradigm. Specifically, we individually train two networks $A = \{ f ^ { A } , g ^ { A } , S ^ { A } \}$ and $B = \{ f ^ { B } , \bar { g } ^ { B } , S ^ { \bar { B } } \}$ with different initializations and batch sequences. At each epoch, the network $A$ or $B$ will model its per-sample loss distribution with a GMM and divide the dataset into clean and noisy subsets which are then used for training the other network, i.e., co-divide. Note that, before co-divide, a warmup process is conducted on all training data to achieve initial convergence with $L _ { w }$ as defined in Eq. 2.
|
| 84 |
+
|
| 85 |
+
# 3.2 Co-Rectify
|
| 86 |
+
|
| 87 |
+
For either of A and B, the data $\mathcal { D }$ will be divided into the clean subset $\boldsymbol { \mathcal { S } } _ { c } = \{ ( \boldsymbol { I } _ { i } ^ { c } , \boldsymbol { T } _ { i } ^ { c } , y _ { i } ^ { c } , w _ { i } ) \} _ { i = 1 } ^ { N _ { c } }$ and noisy subset $\boldsymbol { \mathcal { S } } _ { n } = \{ I _ { i } ^ { n } , T _ { i } ^ { n } \} _ { i = 1 } ^ { N _ { n } }$ . Then, the co-rectify module will correct the labels to recall the possible true positives from $S _ { n }$ and eliminate the negative impact of the possible false positives in . Formally, the network $k$ $( k \in \{ A , B \} )$ will rectify the labels of $\{ S _ { c } , S _ { n } \}$ into $\{ \hat { \cal S } _ { c } , \hat { \cal S } _ { n } \}$ for training itself. The rectified labels are determined by:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\left\{ \begin{array} { l r } { \hat { y } _ { i } ^ { c } = w _ { i } y _ { i } ^ { c } + ( 1 - w _ { i } ) P ^ { k } ( I _ { i } ^ { c } , T _ { i } ^ { c } ) , \qquad } & { \forall ( I _ { i } ^ { c } , T _ { i } ^ { c } , y _ { i } ^ { c } , w _ { i } ^ { c } ) \in \mathcal { S } _ { c } } \\ { \hat { y } _ { i } ^ { n } = ( P ^ { A } ( I _ { i } ^ { n } , T _ { i } ^ { n } ) + P ^ { B } ( I _ { i } ^ { n } , T _ { i } ^ { n } ) ) / 2 , } & { \forall ( I _ { i } ^ { n } , T _ { i } ^ { n } ) \in \mathcal { S } _ { n } } \end{array} \right.
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $P ^ { A } ( I , T ) / P ^ { B } ( I , T )$ denotes the predictions given by the network $A / B$ . The roles of Eq. 4 are as below. On the one hand, as most pairs of $ { \boldsymbol { S } } _ { c }$ are true positive, Eq. 4 will use the original labels $y _ { i } ^ { c }$ together with the model’s prediction $P ( I _ { i } ^ { c } , T _ { i } ^ { c } )$ to rectify the correspondence. On the other hand, as most pairs of $S _ { n }$ are false positive, Eq. 4 will discard the original labels and rectify the labels by averaging the predictions $P ( I _ { i } ^ { n } , T _ { i } ^ { n } )$ from the networks A and B.
|
| 94 |
+
|
| 95 |
+
Another key contribution of Eq. 4 is designing the prediction function $P ( I , T )$ that could accurately predict whether the given pairs are positive or negative. Unlike the tasks like classification, image-text matching aims at computing the similarity rather than predicting the label of given image-text pairs. To this end, a straightforward approach is to predict the pairs by setting a threshold on the similarity. However, such a method requires to specify the threshold value, which is a daunting task because the optimal value is actually the similarity boundary of positive and negative pairs and hard to be manually specified. Alternatively, the following adaptive prediction function $P ( I , T )$ is proposed, which could work in a data-driven way,
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { l } { \displaystyle P ( \boldsymbol { I } , \boldsymbol { T } ) = \Theta ( s ) / \tau } \\ { \displaystyle s = S ( I , T ) - ( \frac { 1 } { b } \sum _ { \hat { T } } S ( I , \hat { T } ) + \frac { 1 } { b } \sum _ { \hat { I } } S ( \hat { I } , T ) ) / 2 , } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $b$ is the batch size, $\Theta ( \cdot )$ clamps the elements into the range of $[ 0 , \alpha ]$ , $s$ is the similarity margin between the given pair $( I , T )$ to the mean of the negatives in a mini-batch, $\tau$ is the average similarity
|
| 102 |
+
|
| 103 |
+
margin of the largest $1 0 \%$ pairs in terms of $s$ . This implies that the data have at least $1 0 \%$ clean pairs which could be regarded as a similarity anchor for prediction. Intuitively, the pairs with the similarity margin larger than $\tau$ would be predicted as 1, otherwise $[ 0 , 1 )$ .
|
| 104 |
+
|
| 105 |
+
# Algorithm 1: Noisy Correspondence Rectifier
|
| 106 |
+
|
| 107 |
+
<table><tr><td>Input: A given training data D, matching models A = (fA,gA, SA) and B = (fB,gB,SB)</td></tr><tr><td>Warmup the model (A,B) using Lw· 2 forn=1:num_epoch do</td></tr><tr><td></td></tr><tr><td>3 ←GMM(D,B)</td></tr><tr><td>4 ← GMM(D,A) 5 for k={A,Bj do</td></tr><tr><td>Sk={(Ii,Ti,yi,Wi)lwi ≥0.5,∀(Ii,Ti,yi,Wi) ∈(D,Wk)} 6</td></tr><tr><td>S={(Ii,Ti)|ui<0.5,∀(Ii,Ti) ∈(D,W)} 7</td></tr><tr><td>8 for j=num_steps do</td></tr><tr><td>9 Sample a mini-batch (B,Bη) from(Sk, S𝑘);</td></tr><tr><td>Rectify the labels of (Bj, Bγ) into (Bg, B) using Eq. 4-5; 10</td></tr><tr><td>Train the network k on (B, Bη) by optimizing Lsoft. 11</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Result: Matching models $( A , B )$
|
| 110 |
+
|
| 111 |
+
# 3.3 Robust Cross-modal Matching
|
| 112 |
+
|
| 113 |
+
Exiting cross-modal matching methods can only handle the binary labels which are incompatible with the soft labels rectified by NCR. To achieve robust image-text matching, we propose a novel triplet loss $\scriptstyle { L _ { s o f t } }$ by recasting the rectified labels as the soft margin. Mathematically,
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
L _ { s o f t } ( I _ { i } , T _ { i } ) = [ \hat { \alpha } _ { i } - S ( I _ { i } , T _ { i } ) + S ( I _ { i } , \hat { T } _ { h } ) ] _ { + } + [ \hat { \alpha } _ { i } - S ( I _ { i } , T _ { i } ) + S ( \hat { I } _ { h } , T _ { i } ) ] _ { + } ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\hat { I } _ { h } = \mathrm { a r g m a x } _ { I _ { j } \ne I _ { i } } S ( I _ { j } , T _ { i } )$ and $\hat { T } _ { h } = \mathrm { a r g m a x } _ { T _ { j } \neq T _ { i } } S ( I _ { i } , T _ { j } )$ are the most similar negatives in the mini-batch for a given positive pair $( I _ { i } , T _ { i } )$ similar to ${ \mathrm { V S E } } { + } { + }$ [8]. The soft margin $\hat { \alpha } _ { i }$ is adaptively determined by:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\hat { \alpha } _ { i } = \frac { m ^ { \hat { y } _ { i } } - 1 } { m - 1 } \alpha ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $m$ is the curve parameter, and $\hat { y } _ { i }$ is the rectified label. The above formulation is designed to achieve the following goal, i.e., $\hat { \alpha } _ { i }$ will be assigned a small value if $\hat { y } _ { i }$ is close to 0, and a large value otherwise. Thanks to Eq. 6–7, the similarity of the pair $( I , T )$ will be larger than that of the negatives by an adaptive margin $\hat { \alpha } _ { i }$ .
|
| 126 |
+
|
| 127 |
+
Despite the adaptive margin, another major difference between $L _ { w }$ and $L _ { s o f t }$ is that $L _ { s o f t }$ will use the hard negatives which are the most similar negative pairs. Although the hard negatives are helpful in improving the performance, $L _ { w }$ cannot be beneficial from it due to the existence of noisy correspondence. Specifically, it is expected that only the similarity of the true positives is larger than that of the hard negatives. However, in the case of noisy correspondence, the similarity of the false positives will also be larger than that of the hard negatives, thus leading to the unavailability of the hard negatives for $L _ { w }$ during the co-divide stage. The detail of NCR is presented in Algorithm. 1.
|
| 128 |
+
|
| 129 |
+
# 3.4 Discussions on Matching Loss
|
| 130 |
+
|
| 131 |
+
To achieve robust cross-modal matching with the refined soft labels, we design a soft Triplet loss by recasting the labels into soft margins. Recently, there are some works have been proposed to handle the soft labels in the matching model. For example, Wray et al. [38] recast the soft similarity into binary labels by directly setting a threshold on the predicted similarity. Kim et al. [15] proposes a log-ratio matching loss with a regularization defined by the label distance ratio, which is computed by the continuous labels. Liu et al. [25] introduces the hubness problem in image-text matching and proposes to consider all samples in a mini-batch and weights them according to both local and global statistics. Wray et al. [38] recasts the soft similarity into binary labels by directly setting a threshold on the predicted similarity. Different from them, NCR proposes to recast the rectified soft labels into soft margins in the triplet loss by assigning large margins to the true positive pairs and small ones to the false positive pairs. As a result and more importantly, our loss is specifically designed to solve the noisy correspondence problem whereas existing ones are not.
|
| 132 |
+
|
| 133 |
+
# 4 Experiment
|
| 134 |
+
|
| 135 |
+
In this section, we carry out experiments to verify the effectiveness of NCR in robust image-text matching. In the experiments, we use three benchmark datasets including Flickr30K [42], MS-COCO [23], and Conceptual Captions [35]. Among them, Conceptual Captions is with real noisy correspondence from the wild, and Flickr30K and MS-COCO are with simulated noisy correspondence.
|
| 136 |
+
|
| 137 |
+
# 4.1 Datasets and Performance Measurements
|
| 138 |
+
|
| 139 |
+
Three datasets are used in our experiments. To be specific, Flickr30K contains 31,000 images collected from the Flickr website with five captions each. Following [19], we use 1,000 images for validation, 1,000 images for testing, and the rest for training. MS-COCO contains 123,287 images with five captions each. We follow the data partition in [19] which consists of 113,287 training images, 5,000 validation images, and 5,000 test images. As Flickr30K and MS-COCO are well annotated, we simulate the noisy correspondence by randomly shuffling the captions of training images for a specific percentage, denoted by noise ratio. Conceptual Captions is a large-scale data consisting of 3.3M images with a single caption each. As this data set is harvested from the Internet, about $3 \% \sim 2 0 \%$ correspondences are incorrect [35]. In our experiments, we use a subset of Conceptual Captions for evaluation, named CC152K. Specifically, we randomly select 150,000 samples from the training split for training, 1,000 samples from the validation split for validation, and 1,000 samples from the validation split for testing.
|
| 140 |
+
|
| 141 |
+
Following [19], for all images, we take the Faster-RCNN [33] detector provided by [1] to extract the top 36 region proposals of which each is encoded as a 2048-dimensional feature. For evaluation, we take the recall at K $. ( \mathbb { R } ^ { \ @ \mathbb { K } ) }$ as the measurement. In short, ${ \mathrm { R @ K } }$ is the fraction of queries for which the correct item is retrieved in the closest K points to the query. In the experiments, we report $\mathbf { R } \ @ 1$ , $\mathbf { R } @ 5$ , and $\mathbb { R } \ @ 1 0$ for a comprehensive evaluation.
|
| 142 |
+
|
| 143 |
+
# 4.2 Implementation Details
|
| 144 |
+
|
| 145 |
+
NCR is a general framework which could enable almost all existing cross-modal matching methods robust against noisy correspondence. To verify the effectiveness of our framework, SGR [7] is chosen to guarantee the robustness because it is the state of the art in image-text matching. In brief, the image regions and words are projected into a shared embedding space through a full-connected layer $( i . e . , f )$ and a Bi-GRU [34] $( i . e . , g )$ , respectively. For the similarity function $S$ , it will compute the similarity between the given image and text by combining the local and global features with the help of a graph reasoning technique proposed in [18]. Due to the space limitation, we leave more details and results in the supplemental material.
|
| 146 |
+
|
| 147 |
+
We train our network using the Adam optimizer [16] with the default parameters and a batch size of 128. For fair comparisons, the networks $f$ and $g$ are the same with SGR, i.e., the word embedding size is 300 and the joint embedding space size is 2048. In addition, we fix the margin $\alpha = 0 . 2$ and $m = 1 0$ for the soft margin through the experiments. At the inference stage, we average the similarities predicted by network $A$ and $B$ for the retrieval evaluation. To avoid overfitting, we choose the best checkpoint in terms of the sum of the recalls on the validation set.
|
| 148 |
+
|
| 149 |
+
# 4.3 Comparisons with State of The Arts
|
| 150 |
+
|
| 151 |
+
In this section, we conduct comparisons on the three datasets. The baselines include SCAN [19], VSRN [21], IMRAM [5], SGRAF, SGR and SAF [7]. For Flickr30K and MS-COCO, we report the results with three different noise ratios, i.e., $0 \%$ , $20 \%$ , and $50 \%$ . In addition, we also report the results of SGR on the clean Flickr30K and MS-COCO by discarding the noisy pairs, denoted by SGR-C. Clearly, SGR-C is a quite strong baseline since the used data does not contain noisy correspondence. We do not report the results of SGRAF and SAF on the clean datasets since our framework only extends SGR in this paper.
|
| 152 |
+
|
| 153 |
+
When the noise rate is $0 \%$ , we directly refer to the results reported in the corresponding papers. For the noisy cases, we train the baseline models with the recommended settings three times and report the best result. Note that for SGR, we found it is very sensitive to the noisy correspondence, as shown in Table. 2. To obtain a desirable result, we experimentally employ a pre-training process to SGR (denoted by ${ \mathrm { S G R } } ^ { * }$ ), namely, training the model with the vanilla triplet loss without hard negatives and then following the standard pipeline of SGR.
|
| 154 |
+
|
| 155 |
+
Table 1: Image-Text Retrieval on Flickr30K and MS-COCO 1K.
|
| 156 |
+
|
| 157 |
+
<table><tr><td rowspan="2"></td><td rowspan="2"></td><td colspan="5">Flickr30K</td><td colspan="6">MS-COCO</td></tr><tr><td colspan="3">Image→Text</td><td colspan="3">Text→Image</td><td colspan="2">Image→Text</td><td colspan="3">Text→Image</td></tr><tr><td>Noise</td><td>Methods</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1 R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td rowspan="7">0%</td><td>SCAN</td><td>67.4</td><td>90.3</td><td>95.8</td><td>48.6</td><td>77.7</td><td>85.2</td><td>69.2 93.6</td><td>97.6</td><td>56.0</td><td>86.5</td><td>93.5</td></tr><tr><td>VSRN</td><td>71.3</td><td>90.6</td><td>96.0</td><td>54.7</td><td>81.8 88.2</td><td>76.2</td><td>94.8</td><td>98.2</td><td>62.8</td><td>89.7</td><td>95.1</td></tr><tr><td>IMRAM</td><td>74.1</td><td>93.0</td><td>96.6</td><td>53.9</td><td>79.4</td><td>87.2</td><td>76.7 95.6</td><td>98.5</td><td>61.7</td><td>89.1</td><td>95.0</td></tr><tr><td>SAF</td><td>73.7</td><td>93.3</td><td>96.3</td><td>56.1</td><td>81.5</td><td>88.0</td><td>76.1 95.4</td><td>98.3</td><td>61.8</td><td>89.4</td><td>95.3</td></tr><tr><td>SGR</td><td>75.2</td><td>93.3</td><td>96.6</td><td>56.2</td><td>81.0</td><td>86.5</td><td>78.0 95.8</td><td>98.2</td><td>61.4</td><td>89.3</td><td>95.4</td></tr><tr><td>SGRAF NCR</td><td>77.8</td><td>94.1</td><td>97.4</td><td>58.5</td><td>83.0</td><td>88.8</td><td>79.6 96.2</td><td>98.5</td><td>63.2</td><td>90.7</td><td>96.1</td></tr><tr><td></td><td>77.3</td><td>94.0</td><td>97.5</td><td>59.6</td><td>84.4</td><td>89.9</td><td>78.7 95.8</td><td>98.5</td><td>63.3</td><td>90.4</td><td>95.8</td></tr><tr><td rowspan="7">20%</td><td>SCAN</td><td>59.1</td><td>83.4</td><td>90.4</td><td>36.6</td><td>67.0</td><td>77.5 78.2</td><td>66.2 25.1</td><td>91.0 96.4</td><td>45.0</td><td>80.2</td><td>89.3</td></tr><tr><td>VSRN IMRAM</td><td>58.1 63.0</td><td>82.6</td><td>89.3</td><td>40.7</td><td>68.7</td><td></td><td>59.0</td><td>74.8</td><td>17.6</td><td>49.0</td><td>64.1</td></tr><tr><td>SAF</td><td>51.0</td><td>86.0</td><td>91.3</td><td>41.4</td><td>71.2</td><td>80.5 68.6</td><td>92.8</td><td>97.6</td><td>55.7</td><td>85.0</td><td>91.0</td></tr><tr><td>SGR*</td><td>62.8</td><td>79.3</td><td>88.0</td><td>38.3</td><td>66.5</td><td>76.2</td><td>67.3 92.5 91.7</td><td>96.6 96.2</td><td>53.4 52.9</td><td>84.5</td><td>92.4</td></tr><tr><td>SGR-C</td><td>72.8</td><td>86.2 90.8</td><td>92.2 95.4</td><td>44.4 56.4</td><td>72.3</td><td>80.4</td><td>67.8</td><td></td><td></td><td>83.5</td><td>90.1</td></tr><tr><td>NCR</td><td>75.0</td><td>93.9</td><td>97.5</td><td></td><td>82.1</td><td>88.6</td><td>75.4 95.2</td><td>97.9</td><td>60.1</td><td>88.5 89.3</td><td>94.8</td></tr><tr><td></td><td></td><td></td><td></td><td>58.3</td><td>83.0</td><td>89.0</td><td>77.7</td><td>95.5</td><td>98.2</td><td>62.5</td><td></td><td>95.3 21.0</td></tr><tr><td rowspan="7">50%</td><td>SCAN</td><td>27.7</td><td>57.6</td><td>68.8</td><td>16.2</td><td>39.3</td><td>49.8</td><td>40.8</td><td>73.5 84.9</td><td>5.4</td><td></td><td>15.1</td></tr><tr><td>VSRN</td><td>14.3</td><td>37.6</td><td>50.0</td><td>12.1</td><td>30.0</td><td>39.4</td><td>23.5 54.7</td><td>69.3</td><td>16.0</td><td>47.8</td><td>65.9</td></tr><tr><td>IMRAM</td><td>9.1</td><td>26.6</td><td>38.2</td><td>2.7</td><td>8.4</td><td>12.7</td><td>21.3 60.2</td><td>75.9</td><td>22.3</td><td>52.8</td><td>64.3</td></tr><tr><td>SAF</td><td>30.3</td><td>63.6</td><td>75.4</td><td>27.9</td><td>53.7</td><td>65.1</td><td>30.4 67.8</td><td>82.3</td><td>33.5</td><td>69.0</td><td>82.8</td></tr><tr><td>SGR*</td><td>36.9</td><td>68.1</td><td>80.2</td><td>29.3</td><td>56.2</td><td>67.0</td><td>60.6 87.4</td><td>93.6</td><td>46.0</td><td>74.2</td><td>79.0</td></tr><tr><td>SGR-C</td><td>69.8</td><td>90.3</td><td>94.8</td><td>50.1</td><td>77.5</td><td>85.2</td><td>71.7 94.1</td><td>97.7</td><td>57.0</td><td>86.6</td><td>93.7</td></tr><tr><td>NCR</td><td>72.9</td><td>93.0</td><td>96.3</td><td>54.3</td><td>79.8</td><td>86.5</td><td>74.6</td><td>94.6</td><td>97.8 59.1</td><td>87.8</td><td>94.5</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Results on Flickr30K & MS-COCO. Table 1 shows the quantitative results on Flickr30K and MS-COCO. Note that for MS-COCO, we only report the results by averaging over 5 folds of 1K test images due to space limitation, and leave the results on the full 5K test images in the supplemental material. From the results, one could observe that NCR is competitive to SGRAF in the noisefree case, namely, NCR could achieve state-of-the-art performance even though it is proposed to achieve robustness. When the data is contaminated by the noisy correspondence, NCR remarkably outperforms all the baselines by a large margin. Even comparing with SGR-C which is trained on the clean data, NCR improves $\mathbb { R } \ @ 1$ by $2 . 2 \%$ , $3 . 1 \%$ , $2 . 3 \%$ , and $2 . 9 \%$ in these four valuations.
|
| 160 |
+
|
| 161 |
+
Results on CC152K. Table 2 shows the quantitative results on the CC152K which is with real noisy correspondences. From the results, one could see that our NCR consistently outperforms the evaluated models by a considerable margin in terms of all metrics. Specifically, NCR is $4 . 5 \%$ and $5 . 4 \%$ higher than the best baseline in terms of $\mathbf { R } \ @ 1$ in text and image retrieval, respectively. Moreover, the large performance gap between SGR and $\operatorname { S G R } ^ { * }$ shows the noise sensitivity of the original SGR.
|
| 162 |
+
|
| 163 |
+
Table 2: Image-Text Retrieval on CC152K.
|
| 164 |
+
|
| 165 |
+
<table><tr><td></td><td colspan="3">Image→ Text</td><td colspan="3">Text→Image</td></tr><tr><td>Methods</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td>SCAN (ECCV'18)</td><td>30.5</td><td>55.3</td><td>65.3</td><td>26.9</td><td>53.0</td><td>64.7</td></tr><tr><td>VSRN (ICCV'19)</td><td>32.6</td><td>61.3</td><td>70.5</td><td>32.5</td><td>59.4</td><td>70.4</td></tr><tr><td>IMRAM (CVPR'20)</td><td>33.1</td><td>57.6</td><td>68.1</td><td>29.0</td><td>56.8</td><td>67.4</td></tr><tr><td>SAF (AAAI'21)</td><td>31.7</td><td>59.3</td><td>68.2</td><td>31.9</td><td>59.0</td><td>67.9</td></tr><tr><td>SGR (AAAI'21)</td><td>11.3</td><td>29.7</td><td>39.6</td><td>13.1</td><td>30.1</td><td>41.6</td></tr><tr><td>SGR* (AAAI'21)</td><td>35.0</td><td>63.4</td><td>73.3</td><td>34.9</td><td>63.0</td><td>72.8</td></tr><tr><td>NCR</td><td>39.5</td><td>64.5</td><td>73.5</td><td>40.3</td><td>64.6</td><td>73.2</td></tr></table>
|
| 166 |
+
|
| 167 |
+
# 4.4 Comparison to pre-trained model
|
| 168 |
+
|
| 169 |
+
In this section, we perform comparison to the large pre-trained model CLIP [31]. In brief, CLIP is trained on a massive dataset harvested from the Internet and thus presumably has a lot of noisy image-text pairs. Such a comparison is helpful in understanding, big data based model (CLIP) or noisy correspondence modeling technique (NCR), which one is more favorable to handle the mismatching problem. More specifically, CLIP claims that using hundreds of million data could ignore the existence of possible noise, while we believe that a well-designed algorithm is essential to solve the noisy correspondence. Noticed, although some existing works including CLIP have slightly/indirectly realized the existence of the noise, NONE of them explicitly give a solution to solve this problem and explores the characteristics of the noise correspondence.
|
| 170 |
+
|
| 171 |
+
In the experiments, we conduct CLIP on the MS-COCO dataset under the following two settings, i.e., Zero-shot and Fine-tune. In brief, the first setting directly uses the released pre-trained CLIP to perform inference on MS-COCO, and the second fine-tunes the pre-trained model using the noisy training data of MS-COCO. As CLIP only released some pre-trained models and inference code 3, we use the non-official code 4 to fine-tune the model with 32 epochs for the fine-tune setting. Note that CLIP (ViT-L/14†) is unreleased and we report the results from the original paper [31]. One could observe that, although CLIP utilizes 400 million image-text pairs for pre-training, its performance inevitably degenerates during fine-tuning. In contrast, NCR achieves the matching performance with the presence of noisy correspondence, indicating the necessity of algorithm design.
|
| 172 |
+
|
| 173 |
+
Table 3: Comparison with CLIP on MS-COCO 5K.
|
| 174 |
+
|
| 175 |
+
<table><tr><td></td><td></td><td colspan="3">Image→ Text</td><td colspan="3">Text→Image</td></tr><tr><td>Noise Ratio</td><td>Methods</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td rowspan="2">0%, Zero-Shot</td><td>CLIP (ViT-L/14+)</td><td>58.4</td><td>81.5</td><td>88.1</td><td>37.8</td><td>62.4</td><td>72.2</td></tr><tr><td>CLIP (ViT-B/32)</td><td>50.2</td><td>74.6</td><td>83.6</td><td>30.4</td><td>56.0</td><td>66.8</td></tr><tr><td rowspan="2">20%,Fine-tune</td><td>NCR</td><td>58.2</td><td>84.2</td><td>91.5</td><td>41.7</td><td>71.0</td><td>81.3</td></tr><tr><td>CLIP (ViT-B/32) NCR</td><td>21.4 56.9</td><td>49.6 83.6</td><td>63.3 91.0</td><td>14.8 40.6</td><td>37.6 69.8</td><td>49.6 80.1</td></tr><tr><td rowspan="2">50%, Fine-tune</td><td>CLIP (ViT-B/32)</td><td>10.9</td><td>27.8</td><td>38.3</td><td>7.8</td><td>19.5</td><td></td></tr><tr><td>NCR</td><td>53.1</td><td>80.7</td><td>88.5</td><td>37.9</td><td>66.6</td><td>26.8 77.8</td></tr></table>
|
| 176 |
+
|
| 177 |
+
# 4.5 Experimental Analysis
|
| 178 |
+
|
| 179 |
+
In this section, we first conduct experiments to show the robustness and generalizability of the proposed method. Then, we investigate the effect of co-divide and co-rectify with the visualization results. After that, we carry out the ablation study to verify different components of NCR. Finally, we visually demonstrate some noisy cases detected by NCR.
|
| 180 |
+
|
| 181 |
+
# 4.5.1 Study on Robustness and Generalizability
|
| 182 |
+
|
| 183 |
+
To show the robustness of NCR, we conduct experiments on Flickr30K by increasing the noise ratio from $0 \%$ to $6 0 \%$ with an interval of $1 0 \%$ . In addition, to verify the generalizability of NCR to other image-text matching methods, we extend SCAN [19] by NCR, denoted by NCR-SCAN. Fig. 4 shows that NCR and NCR-SCAN perform more stable than SGR and SCAN with increasing noise ratio. Moreover, NCR (NCR-SCAN) is remarkably superior to SGR (SCAN) in all tests, which shows the generalizability of NCR.
|
| 184 |
+
|
| 185 |
+
# 4.5.2 Visualization on the Co-divide and Co-rectify
|
| 186 |
+
|
| 187 |
+
To further investigate the influence of the co-divide and co-rectify modules in our method, we carry out experiments on the Flickr30K dataset by visualizing the per-sample loss distribution and the model predictions on the noisy data, where the noisy ratio is $20 \%$ . For better visualization, here we show the result of NCR-SCAN and leave the result of NCR in the supplemental material. As shown in Fig. 3(b), the loss of most noisy samples is larger than the clean loss, which verifies the memorization effect of DNNs. By fitting the per-sample loss with GMM, NCR could effectively divide the data into clean and noisy splits. Regarding the analysis on the co-rectify, Fig. 3(c) shows that the rectified soft labels of most clean pairs range into [0.3, 1] and those of most noisy pairs range into [0, 0.5]. In other words, one could enforce the similarity of true positives larger than that of the negatives during training, thus eliminating the negative impact of the noisy correspondence.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 3: (a) Retrieval performance of NCR and NCR-SCAN on Flickr30K with varying noise ratio. (b) Per-sample loss distribution and GMM fitting visualization after warmup. (c) Model predictions on the noisy subset.
|
| 191 |
+
|
| 192 |
+
# 4.5.3 Ablation Study
|
| 193 |
+
|
| 194 |
+
In this section, we carry out the ablation study on the Flickr30K with the noise ratio of $50 \%$ . As shown in Table 4, all these three components are important to achieving encouraging results.
|
| 195 |
+
|
| 196 |
+
Table 4: Ablation studies on Flickr30K with $50 \%$ noise.
|
| 197 |
+
|
| 198 |
+
<table><tr><td colspan="3">Method</td><td colspan="3">Image →Text</td><td colspan="3">Text→Image</td></tr><tr><td>Co-divide</td><td>Co-rectify</td><td>Warmup</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td>?</td><td>√</td><td><<></td><td>72.9</td><td>93.0</td><td>96.3</td><td>54.3</td><td>79.8</td><td>86.5</td></tr><tr><td></td><td></td><td></td><td>71.4</td><td>90.8</td><td>95.7</td><td>54.1</td><td>80.3</td><td>86.5</td></tr><tr><td></td><td>?</td><td></td><td>16.0</td><td>38.4</td><td>51.7</td><td>12.6</td><td>31.4</td><td>42.8</td></tr><tr><td>√</td><td></td><td></td><td>0.3</td><td>0.6</td><td>1.0</td><td>0.2</td><td>0.5</td><td>1.1</td></tr></table>
|
| 199 |
+
|
| 200 |
+
# 4.5.4 Noisy Samples
|
| 201 |
+
|
| 202 |
+
Fig. 4 shows some noisy CC152K examples identified by NCR. As shown, the first four image-text pairs are completely unrelated, which will be successfully detected by NCR. For the last pair, it will also be detected as noisy correspondence even though the visual and textual modalities are correlated at a coarse-grained level, e.g., both the image and text involve “beach".
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 4: Some noisy examples correctly divided by NCR.
|
| 206 |
+
|
| 207 |
+
# 5 Conclusion
|
| 208 |
+
|
| 209 |
+
This paper could be the first attempt to study a new problem in cross-modal matching, i.e., the noisy correspondence which could be a potential new direction in noise label. To solve this problem in cross-modal matching, we propose rectifying the noisy correspondence by an adaptive prediction function and a novel triplet loss with a soft margin to achieve robust cross-modal matching. Extensive experiments verify the effectiveness of the proposed method in handling synthesized and real noisy correspondences.
|
| 210 |
+
|
| 211 |
+
# Broader Impact Statement
|
| 212 |
+
|
| 213 |
+
Cross-modal matching is a fundamental topic in multimodal learning, which could be applied to a wide range of applications including data retrieval, recommender systems, and vision-and-language understanding. This work could be one of the first works to aware of the importance and existence of the noisy correspondence problem in numerous applications. There are many benefits to solving the noisy correspondence problem, e.g., reducing the costs for manually annotating and aligning data; more data could be collected and used even though some of them are incorrectly aligned. Besides the benefits, it should pay attention on the potential negative impacts including but not limited to 1) The risk of automation bias [28] for decision making from the data bias, especially in aviation, health care, and autonomous vehicles. 2) The job loss caused by the NCR since it makes possibility to automatically correct the noisy correspondence, thus remarkably reducing the cost of human labor. We would encourage further work to understand and mitigate the above biases and risks.
|
| 214 |
+
|
| 215 |
+
# Acknowledgements
|
| 216 |
+
|
| 217 |
+
The authors would thank to the anonymous reviewers whose valuable suggestions and constructive comments remarkably improve this work. This work was supported in part by the National Key R&D Program of China under Grant 2020AAA0104500; in part by the Key Research and Development Program of Sichuan Province under Grant 2019YFG0497; in part by NFSC under Grant U21B2040, 62176171, U19A2078, 61625204, and 61836006; in part by the Fund of Sichuan University Tomorrow Advancing Life.
|
| 218 |
+
|
| 219 |
+
# References
|
| 220 |
+
|
| 221 |
+
[1] Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6077–6086, 2018.
|
| 222 |
+
[2] Eric Arazo, Diego Ortego, Paul Albert, Noel O’Connor, and Kevin McGuinness. Unsupervised label noise modeling and loss correction. In International Conference on Machine Learning, pages 312–321. PMLR, 2019.
|
| 223 |
+
[3] Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In International Conference on Machine Learning, pages 233–242. PMLR, 2017.
|
| 224 |
+
[4] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. arXiv preprint arXiv:1905.02249, 2019.
|
| 225 |
+
[5] Hui Chen, Guiguang Ding, Xudong Liu, Zijia Lin, Ji Liu, and Jungong Han. Imram: Iterative matching with recurrent attention memory for cross-modal image-text retrieval. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12655–12663, 2020.
|
| 226 |
+
[6] Sanghyuk Chun, Seong Joon Oh, Rafael Sampaio de Rezende, Yannis Kalantidis, and Diane Larlus. Probabilistic embeddings for cross-modal retrieval. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8415–8424, 2021.
|
| 227 |
+
[7] Haiwen Diao, Ying Zhang, Lin Ma, and Huchuan Lu. Similarity reasoning and filtration for image-text matching. In AAAI, 2021.
|
| 228 |
+
[8] Fartash Faghri, David J Fleet, Jamie Ryan Kiros, and Sanja Fidler. Vse++: Improving visualsemantic embeddings with hard negatives. arXiv preprint arXiv:1707.05612, 2017.
|
| 229 |
+
[9] Dalu Guo, Chang Xu, and Dacheng Tao. Image-question-answer synergistic network for visual dialog. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10434–10443, 2019.
|
| 230 |
+
[10] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. arXiv preprint arXiv:1804.06872, 2018.
|
| 231 |
+
[11] Yi Hao, Nannan Wang, Xinbo Gao, Jie Li, and Xiaoyu Wang. Dual-alignment feature embedding for cross-modality person re-identification. In Proceedings of the 27th ACM International Conference on Multimedia, pages 57–65, 2019.
|
| 232 |
+
[12] Zhenyu Huang, Peng Hu, Joey Tianyi Zhou, Jiancheng Lv, and Xi Peng. Partially view-aligned clustering. In Proceedings of the 34th Conference on Neural Information Processing Systems, NeurIPS’2020, volume 33, Virtual-only Conference, Dec 2020.
|
| 233 |
+
[13] Zhenyu Huang, Joey Tianyi Zhou, Hongyuan Zhu, Changqing Zhang, Jiancheng Lv, and Xi Peng. Deep spectral representation learning from multi-view data. IEEE Transactions on Image Processing, 30:5352–5362, 2021.
|
| 234 |
+
[14] Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V Le, Yunhsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. arXiv preprint arXiv:2102.05918, 2021.
|
| 235 |
+
[15] Sungyeon Kim, Minkyo Seo, Ivan Laptev, Minsu Cho, and Suha Kwak. Deep metric learning beyond binary supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2288–2297, 2019.
|
| 236 |
+
[16] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 237 |
+
[17] Ryan Kiros, Ruslan Salakhutdinov, and Richard S Zemel. Unifying visual-semantic embeddings with multimodal neural language models. arXiv preprint arXiv:1411.2539, 2014.
|
| 238 |
+
[18] Zhanghui Kuang, Yiming Gao, Guanbin Li, Ping Luo, Yimin Chen, Liang Lin, and Wayne Zhang. Fashion retrieval via graph reasoning networks on a similarity pyramid. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3066–3075, 2019.
|
| 239 |
+
[19] Kuang-Huei Lee, Xi Chen, Gang Hua, Houdong Hu, and Xiaodong He. Stacked cross attention for image-text matching. In Proceedings of the European Conference on Computer Vision (ECCV), pages 201–216, 2018.
|
| 240 |
+
[20] Junnan Li, Richard Socher, and Steven CH Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. arXiv preprint arXiv:2002.07394, 2020.
|
| 241 |
+
[21] Kunpeng Li, Yulun Zhang, Kai Li, Yuanyuan Li, and Yun Fu. Visual semantic reasoning for image-text matching. In ICCV, 2019.
|
| 242 |
+
[22] Sheng Li, Zhiqiang Tao, Kang Li, and Yun Fu. Visual to text: Survey of image and video captioning. IEEE Transactions on Emerging Topics in Computational Intelligence, 3(4):297– 312, 2019.
|
| 243 |
+
[23] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740–755. Springer, 2014.
|
| 244 |
+
[24] Yijie Lin, Yuanbiao Gou, Zitao Liu, Boyun Li, Jiancheng Lv, and Xi Peng. Completer: Incomplete multi-view clustering via contrastive prediction. In CVPR, June 2021.
|
| 245 |
+
[25] Fangyu Liu, Rongtian Ye, Xun Wang, and Shuaipeng Li. Hal: Improved text-image matching by mitigating visual semantic hubs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 11563–11571, 2020.
|
| 246 |
+
[26] Risheng Liu, Jinyuan Liu, Zhiying Jiang, Xin Fan, and Zhongxuan Luo. A bilevel integrated model with data-driven layer ensemble for multi-modality image fusion. IEEE Transactions on Image Processing, 30:1261–1274, 2020.
|
| 247 |
+
[27] Tongliang Liu and Dacheng Tao. Classification with noisy labels by importance reweighting. IEEE Transactions on pattern analysis and machine intelligence, 38(3):447–461, 2015.
|
| 248 |
+
[28] Kathleen L Mosier, Linda J Skitka, Susan Heers, and Mark Burdick. Automation bias: Decision making and performance in high-tech cockpits. The International journal of aviation psychology, 8(1):47–63, 1998.
|
| 249 |
+
[29] Xi Peng, Zhenyu Huang, Jiancheng Lv, Hongyuan Zhu, and Joey Tianyi Zhou. Comic: Multiview clustering without parameter selection. In International conference on machine learning, pages 5092–5101. PMLR, 2019.
|
| 250 |
+
[30] Haim Permuter, Joseph Francos, and Ian Jermyn. A study of gaussian mixture models of color and texture features for image classification and segmentation. Pattern Recognition, 39(4):695–706, 2006.
|
| 251 |
+
[31] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
|
| 252 |
+
[32] Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014.
|
| 253 |
+
[33] Shaoqing Ren, Kaiming He, Ross B Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, 2015.
|
| 254 |
+
[34] Mike Schuster and Kuldip K Paliwal. Bidirectional recurrent neural networks. IEEE transactions on Signal Processing, 45(11):2673–2681, 1997.
|
| 255 |
+
[35] Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2556–2565, 2018.
|
| 256 |
+
[36] Hwanjun Song, Minseok Kim, Dongmin Park, Yooju Shin, and Jae-Gil Lee. Learning from noisy labels with deep neural networks: A survey. arXiv preprint arXiv:2007.08199, 2020.
|
| 257 |
+
[37] Liwei Wang, Yin Li, and Svetlana Lazebnik. Learning deep structure-preserving image-text embeddings. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5005–5013, 2016.
|
| 258 |
+
[38] Michael Wray, Hazel Doughty, and Dima Damen. On semantic similarity in video retrieval. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3650–3660, 2021.
|
| 259 |
+
[39] Xiaobo Xia, Tongliang Liu, Bo Han, Chen Gong, Nannan Wang, Zongyuan Ge, and Yi Chang. Robust early-learning: Hindering the memorization of noisy labels. In International Conference on Learning Representations, 2021.
|
| 260 |
+
[40] Erkun Yang, Cheng Deng, Wei Liu, Xianglong Liu, Dacheng Tao, and Xinbo Gao. Pairwise relationship guided deep hashing for cross-modal retrieval. In proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017.
|
| 261 |
+
[41] Mouxing Yang, Yunfan Li, Zhenyu Huang, Zitao Liu, Peng Hu, and Xi Peng. Partially view-aligned representation learning with noise-robust contrastive loss. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1134–1143, 2021.
|
| 262 |
+
[42] Peter Young, Alice Lai, Micah Hodosh, and Julia Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. Transactions of the Association for Computational Linguistics, 2:67–78, 2014.
|
| 263 |
+
[43] Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? In International Conference on Machine Learning, pages 7164–7173. PMLR, 2019.
|
| 264 |
+
[44] Zhou Zhao, Qifan Yang, Deng Cai, Xiaofei He, and Yueting Zhuang. Video question answering via hierarchical spatio-temporal attention networks. In IJCAI, pages 3518–3524, 2017.
|
md/train/SOVSJZ9PTO7/SOVSJZ9PTO7.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# JAKET: JOINT PRE-TRAINING OF KNOWLEDGE GRAPH AND LANGUAGE UNDERSTANDING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Knowledge graphs (KGs) contain rich information about world knowledge, entities, and relations. Thus, they can be great supplements to existing pre-trained language models. However, it remains a challenge to efficiently integrate information from KG into language modeling. And the understanding of a knowledge graph requires related context. We propose a novel joint pre-training framework, JAKET, to model both the knowledge graph and language. The knowledge module and language module provide essential information to mutually assist each other: the knowledge module produces embeddings for entities in text while the language module generates context-aware initial embeddings for entities and relations in the graph. Our design enables the pre-trained model to easily adapt to unseen knowledge graphs in new domains. Experimental results on several knowledge-aware NLP tasks show that our proposed framework achieves superior performance by effectively leveraging knowledge in language understanding.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Pre-trained language models (PLM) leverage large-scale unlabeled corpora to conduct selfsupervised training. They have achieved remarkable performance in various NLP tasks, exemplified by BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019b), XLNet (Yang et al., 2019), and GPT series (Radford et al., 2018; 2019; Brown et al., 2020). It has been shown that PLMs can effectively characterize linguistic patterns in text and generate high-quality context-aware representations (Liu et al., 2019a). However, these models struggle to grasp world knowledge about entities and relations (Poerner et al., 2019; Talmor et al., 2019), which are very important in language understanding.
|
| 12 |
+
|
| 13 |
+
Knowledge graphs (KGs) represent entities and relations in a structural way. They can also solve the sparsity problem in text modeling. For instance, a language model may require tens of instances of the phrase “labrador is a kind of dog” in its training corpus before it implicitly learns this fact. In comparison, a knowledge graph can use two entity nodes “labrador”, “dog” and a relation edge “is a” between these nodes to precisely represent this fact.
|
| 14 |
+
|
| 15 |
+
Recently, some efforts have been made to integrate knowledge graphs into PLM. Most of them combine the token representations in PLM with representations of aligned KG entities. The entity embeddings in those methods are either pre-computed based on an external source by a separate model (Zhang et al., 2019; Peters et al., 2019), which may not be easily aligned with the language representation space, or directly learned as model parameters (Fevry et al., 2020; Verga et al., 2020), ´ which often have an over-parameterization issue due to the large number of entities. Moreover, all the previous works share a common challenge: when the pre-trained model is fine-tuned in a new domain with a previously unseen knowledge graph, it struggles to adapt to the new entities, relations and structure.
|
| 16 |
+
|
| 17 |
+
Therefore, we propose JAKET, a Joint pre-trAining framework for KnowledgE graph and Text. Our framework contains a knowledge module and a language module, which mutually assist each other by providing required information to achieve more effective semantic analysis. The knowledge module leverages a graph attention network (Velickovi ˇ c et al., 2017) to provide structure-aware ´ entity embeddings for language modeling. And the language module produces contextual representations as initial embeddings for KG entities and relations given their descriptive text. Thus, in both modules, content understanding is based on related knowledge and rich context. On one hand, the joint pre-training effectively projects entities/relations and text into a shared semantic latent space, which eases the semantic matching between them. On the other hand, as the knowledge module produces representations from descriptive text, it solves the over-parameterization issue since entity embeddings are no longer part of the model’s parameters.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: A simple illustration on the novelty of our proposed model JAKET.
|
| 21 |
+
|
| 22 |
+
In order to solve the cyclic dependency between the two modules, we propose a novel two-step language module $\mathrm { L M _ { 1 } }$ and $\mathrm { L M _ { 2 } }$ , respectively. $\mathrm { L M _ { 1 } }$ provides embeddings for both $\mathrm { L M _ { 2 } }$ and KG. The entity embeddings from KG are also fed into $\mathrm { L M _ { 2 } }$ , which produces the final representation. $\mathrm { L M _ { 1 } }$ and $\mathrm { L M _ { 2 } }$ can be easily established as the first several transformer layers and the rest layers of a pre-trained language model such as BERT and RoBERTa. Furthermore, we design an entity context embedding memory with periodic update which speeds up the pre-training by $1 5 \mathrm { x }$ .
|
| 23 |
+
|
| 24 |
+
The pre-training tasks are all self-supervised, including entity category classification and relation type prediction for the knowledge module, and masked token prediction and masked entity prediction for the language module.
|
| 25 |
+
|
| 26 |
+
A great benefit of our framework is that it can easily adapt to unseen knowledge graphs in the finetuning phase. As the initial embeddings of entities and relations come from their descriptive text, JAKET is not confined to any fixed KG. With the learned ability to integrate structural information during pre-training, the framework is extensible to novel knowledge graphs with previously unseen entities and relations, as illustrated in Figure 1.
|
| 27 |
+
|
| 28 |
+
We conduct empirical studies on several knowledge-aware natural language understanding (NLU) tasks, including few-shot relation classification, question answering and entity classification. The results show that JAKET achieves the best performance compared with strong baseline methods on all the tasks, including those with a previously unseen knowledge graph.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Pre-trained language models have been shown to be very effective in various NLP tasks, including ELMo (Peters et al., 2018), GPT (Radford et al., 2018), BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019b) and XLNet (Yang et al., 2019). Built upon large-scale corpora, these pretrained models learn effective representations for various semantic structures and linguistic relationships. They are trained on self-supervised tasks like masked language modeling and next sentence prediction.
|
| 33 |
+
|
| 34 |
+
Recently, a lot of efforts have been made on investigating how to integrate knowledge into PLMs (Levine et al., 2019; Soares et al., 2019; Liu et al., 2020; Guu et al., 2020). These approaches can be grouped into two categories:
|
| 35 |
+
|
| 36 |
+
1. Explicitly injecting entity representation into the language model, where the representations are either pre-computed from external sources (Zhang et al., 2019; Peters et al., 2019) or directly learned as model parameters (Fevry et al., 2020; Verga et al., 2020). For example, ERNIE (THU) (Zhang ´ et al., 2019) pre-trains the entity embeddings on a knowledge graph using TransE (Bordes et al., 2013), while EAE (Fevry et al., 2020) learns the representation from pre-training objectives with ´ all the other model parameters. K-BERT (Liu et al., 2020) represents the entities by the embeddings of surface form tokens (i.e. entity names), which contains much less semantic information compared with description text. Moreover, it only injects KG during fine-tuning phase instead of joint-pretraining KG and text.
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: A demonstration for the structure of JAKET, where the language module is on the left side marked green while the knowledge module is on the right side marked blue. Symbol $\textcircled{8}$ indicates the steps to compute context representations introduced in Section 3.4. “QX”, “PX” and $\mathbf { \vec { \tau } } ^ { 6 } \mathbf { C } \mathbf { X } ^ { \mathbf { \vec { \tau } } }$ are the indices for entities, relations and categories in KG respectively. Entity mentions in text are underlined and italicized such as Sun.
|
| 40 |
+
|
| 41 |
+
2. Implicitly modeling knowledge information, including entity-level masked language modeling (Sun et al., 2019b; Shen et al., 2020), entity-based replacement prediction (Xiong et al., 2019) and knowledge embedding loss as regularization (Wang et al., 2019b). For example, besides tokenlevel masked language modeling, ERNIE (Baidu) (Sun et al., 2019b) uses phrase-level and entitylevel masking to predict all the masked slots. KEPLER (Wang et al., 2019b) calculates entity embeddings using a pre-trained language model based on the description text, which is similar to our work. However, they use the entity embeddings for the knowledge graph completion task instead of injecting them into the language model.
|
| 42 |
+
|
| 43 |
+
Some works (Ding et al., 2019; Lv et al., 2020) investigated the combination of GNN and PLM. For example, Lv et al. (2020) uses XLNet to generate initial node representation based on node context and feeds them into a GNN. However, these approaches do not integrate knowledge into language modeling, and they are designed for specific NLP tasks such as reading comprehension or commonsense reasoning. In comparison, we jointly pre-train both the knowledge graph representation and language modeling and target for general knowledge-aware NLU tasks.
|
| 44 |
+
|
| 45 |
+
# 3 METHOD
|
| 46 |
+
|
| 47 |
+
In this section, we introduce the JAKET framework of joint pre-training knowledge graph and language understanding. We begin by defining the mathematical notations, and then present our model architecture with the knowledge module and language module. Finally, we introduce how to pretrain our model and fine-tune it for downstream tasks. The framework is illustrated in Figure 2.
|
| 48 |
+
|
| 49 |
+
# 3.1 DEFINITION
|
| 50 |
+
|
| 51 |
+
A knowledge graph is denoted by $\mathcal { K } \mathcal { G } = ( \mathcal { E } , \mathcal { R } , \mathcal { T } )$ , where $\mathcal { E } = \{ e _ { 1 } \ldots e _ { N } \}$ is the set of entities and $\mathcal { R } = \{ r _ { 1 } . . . r _ { P } \}$ is the set of relations. $\mathcal { T } = \{ ( e _ { t _ { i } ^ { 1 } } , r _ { t _ { i } ^ { 2 } } , e _ { t _ { i } ^ { 3 } } ) | 1 \leq i \leq T , e _ { t _ { i } ^ { 1 } } , e _ { t _ { i } ^ { 3 } } \in \mathcal { E } , r _ { t _ { i } ^ { 2 } } \in \mathcal { R } \}$ stands for the set of head-relation-tail triplets. $N _ { v } = \{ ( r , u ) | ( v , r , u ) \in \mathcal { T } \}$ represents the set of neighboring relations and entities of an entity $v$ .
|
| 52 |
+
|
| 53 |
+
We define $\nu = \{ [ \mathrm { M A S K } ]$ , [CLS], [EOS], $w _ { 1 } \ldots . w _ { V } \}$ as a vocabulary of tokens and the contextual text $\mathbf { x } = [ x _ { 1 } , x _ { 2 } , \dots , x _ { L } ]$ as a sequence of tokens where $x _ { i } \in \mathcal V$ . In the vocabulary, [MASK] is the special token for masked language modeling (Devlin et al., 2018) and [CLS], [EOS] are the special tokens indicating the beginning and end of the sequence. We define $F$ as the dimension of token embeddings, which is equal to the dimension of entity/relation embeddings from the KG.
|
| 54 |
+
|
| 55 |
+
The text $\mathbf { x }$ has a list of entity mentions $\textbf { m } = \ [ m _ { 1 } , \dots , m _ { M } ]$ , where each mention $\begin{array} { r l } { m _ { i } } & { { } = } \end{array}$ $( e _ { m _ { i } } , s _ { m _ { i } } , o _ { m _ { i } } )$ : $e _ { m _ { i } }$ is the corresponding entity and $s _ { m _ { i } } , o _ { m _ { i } }$ are the start and end index of this mention in the context. In other words, $[ x _ { s _ { m _ { i } } } , \ldots , x _ { o _ { m _ { i } } } ]$ is linked with entity ${ e _ { m _ { i } } } ^ { 1 }$ . We assume the span of mentions are disjoint for a given text sequence.
|
| 56 |
+
|
| 57 |
+
As entities in the knowledge graph are represented by nodes without context, we use entity description text to describe the concept and meaning of entities. For each entity $e _ { i }$ , its description text $\mathbf { x } ^ { e _ { i } }$ describes this entity. The mention of $e _ { i }$ in $\mathbf { x } ^ { e _ { i } }$ is denoted as $m ^ { e _ { i } } = ( e _ { i } , s _ { i } ^ { e } , o _ { i } ^ { e } )$ , similarly defined as above. For instance, the description text for the entity “sun” can be “[CLS] The Sun is the star at the center of the Solar System [EOS]”. Then the mention is $m ^ { S u n } = ( S u n , 3 , 3 )$ . If there are multiple mentions of $e _ { i }$ in its description text, we choose the first one. If there’s no mention of $e _ { i }$ in its description text, we set $s _ { i } ^ { e } = o _ { i } ^ { e } = 1$ . Similarly, we define relation description text as the text that can describe each relation.
|
| 58 |
+
|
| 59 |
+
# 3.2 KNOWLEDGE MODULE
|
| 60 |
+
|
| 61 |
+
The goal of the knowledge module (KM) is to model the knowledge graph to generate knowledgebased entity representations.
|
| 62 |
+
|
| 63 |
+
To compute entity node embeddings, we employ the graph attention network (GAT) (Velickovi ˇ c´ et al., 2017), which uses the self-attention mechanism to specify different weights for different neighboring nodes. However, the vanilla GAT is designed for homogeneous graphs with singlerelation edges. To leverage the multi-relational information, we adopt the idea of composition operator (Vashishth et al., 2019) to compose entity embeddings and relation embeddings. In detail, in the $l$ -th layer of LM, we update the embedding $\overline { { E _ { v } ^ { ( l ) } } }$ of entity $v$ as follows:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r l } & { E _ { v } ^ { ( l ) } = \mathrm { L a y e r N o r m } \left( \displaystyle \bigoplus _ { k = 1 } ^ { K } \sigma \left( \sum _ { ( r , u ) \in \mathcal { N } _ { v } } \alpha _ { v , r , u } ^ { k } W ^ { k } f ( E _ { u } ^ { ( l - 1 ) } , R _ { r } ) \right) + E _ { v } ^ { ( l - 1 ) } \right) } \\ & { \alpha _ { v , r , u } ^ { k } = \frac { \displaystyle \exp \Big ( \mathrm { L e a k y R e L U ~ } \Big ( \mathbf { a } ^ { T } \left[ W ^ { k } E _ { v } ^ { ( l - 1 ) } \oplus W ^ { k } f ( E _ { u } ^ { ( l - 1 ) } , R _ { r } ) \right] \Big ) \Big ) \Big ) } { \sum _ { ( r ^ { \prime } , u ^ { \prime } ) \in \mathcal { N } _ { v } } \exp \Big ( \mathrm { L e a k y R e L U ~ } \Big ( \mathbf { a } ^ { T } \left[ W ^ { k } E _ { u } ^ { ( l - 1 ) } \oplus W ^ { k } f ( E _ { u ^ { \prime } } ^ { ( l - 1 ) } , R _ { r ^ { \prime } } ) \right] \Big ) \Big ) } } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where LayerNorm stands for layer normalization (Ba et al., 2016). $\oplus$ means concatenation and $K$ is the number of attention heads. $W ^ { k }$ is the model parameter and $R _ { r }$ is the embedding of relation $r$ . Note that the relation embeddings are shared across different layers. The function $f ( \cdot , \cdot ) : \mathbb { R } ^ { F } \times$ $\mathbb { R } ^ { F } \to \mathbb { R } ^ { F }$ merges a pair of entity and relation embeddings into one representation. Here, we set $f ( x , y ) = x + y$ inspired by TransE (Bordes et al., 2013). More complicated functions like MLP network can also be applied.
|
| 70 |
+
|
| 71 |
+
The initial entity embeddings $E ^ { ( 0 ) }$ and relation embeddings $R$ are generated from our language module, which will be introduced in Section 3.4. Then, the output entity embeddings from the last GAT layer are used as the final entity representations $E ^ { \mathrm { K M } }$ . Note that the knowledge graph can be very large, making the embedding update over all the entities in Equation (1) not tractable. Thus we follow the minibatch setting (Hamilton et al., 2017): given a set of input entities, we perform neighborhood sampling to generate their multi-hop neighbor sets and we compute representations only on the entities and relations that are necessary for the embedding update.
|
| 72 |
+
|
| 73 |
+
# 3.3 LANGUAGE MODULE
|
| 74 |
+
|
| 75 |
+
The goal of the language module (LM) is to model text data and learn context-aware representations. The language module can be any model for language understanding, e.g. BERT (Devlin et al., 2018). In this work, we use the pre-trained model RoBERTa-base (Liu et al., 2019b) as the language module.
|
| 76 |
+
|
| 77 |
+
# 3.4 SOLVING THE CYCLIC DEPENDENCY
|
| 78 |
+
|
| 79 |
+
In our framework, the knowledge and language modules mutually benefit each other: the language module LM outputs context-aware embedding to initialize the embeddings of entities and relations in the knowledge graph given the description text; the knowledge module (KM) outputs knowledgebased entity embeddings for the language module.
|
| 80 |
+
|
| 81 |
+
However, there exists a cyclic dependency which prevents computation and optimization in this design. To solve this problem, we propose a decomposed language module which includes two language models: $\mathrm { L M _ { 1 } }$ and $\mathrm { L M _ { 2 } }$ . We employ the first 6 layers of RoBERTa as $\mathrm { L M _ { 1 } }$ and the remaining 6 layers as $\mathrm { L M _ { 2 } }$ . The computation proceeds as follows:
|
| 82 |
+
|
| 83 |
+
1. $\mathrm { L M _ { 1 } }$ operates on the input text $\mathbf { x }$ and generates contextual embeddings $Z$ .
|
| 84 |
+
2. $\mathrm { L M _ { 1 } }$ generates initial entity and relation embeddings for KM given description text.
|
| 85 |
+
3. KM produces its output entity embeddings to be combined with $Z$ and sent into $\mathrm { L M _ { 2 } }$ .
|
| 86 |
+
4. $\mathrm { L M _ { 2 } }$ produces the final embeddings of $\mathbf { x }$ , which includes both contextual and knowledge
|
| 87 |
+
information.
|
| 88 |
+
|
| 89 |
+
In detail, in step 1, suppose the context $\mathbf { x }$ is embedded as $X ^ { e m b e d }$ . $\mathrm { L M _ { 1 } }$ takes $X ^ { e m b e d }$ as input and outputs hidden representations $Z = \operatorname { L M } _ { 1 } ( X ^ { e m b e d } )$ .
|
| 90 |
+
|
| 91 |
+
In step 2, suppose $\mathbf { x } ^ { e _ { j } }$ is the entity description text for entity $e _ { j }$ , and the corresponding mention is ${underline { m } } ^ { e _ { j } } = ( e _ { j } , s _ { j } ^ { e } , o _ { j } ^ { e } )$ . $\mathrm { L M _ { 1 } }$ takes the embedding of $\mathbf { x } ^ { e _ { j } }$ and produces the contextual embedding $Z ^ { e _ { j } }$ . Then, the average of embeddings at position $s _ { j } ^ { e }$ and $o _ { j } ^ { e }$ is used as the initial entity embedding of $e _ { j }$ , i.e. $E _ { j } ^ { ( 0 ) } = ( Z _ { s _ { j } ^ { e } } ^ { e _ { j } } + Z _ { o _ { j } ^ { e } } ^ { e _ { j } } ) / 2$ . The knowledge graph relation embeddings $R$ are generated in a similar way using its description text.
|
| 92 |
+
|
| 93 |
+
In step 3, KM computes the final entity embeddings $E ^ { \mathrm { K M } }$ , which is then combined with the output $Z$ from $\mathrm { L M _ { 1 } }$ . In detail, suppose the mentions in $\mathbf { x }$ are $\mathbf { m } = [ m _ { 1 } , \dots , m _ { M } ]$ . $Z$ and $E ^ { \mathrm { K M } }$ are combined at positions of mentions:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
Z _ { k } ^ { m e r g e } = \left\{ \begin{array} { c l } { { Z _ { k } + E _ { e _ { m _ { i } } } ^ { \mathrm { K M } } } } & { { \mathrm { i f } \exists i \mathrm { s . t . } s _ { m _ { i } } \le k \le o _ { m _ { i } } } } \\ { { Z _ { k } } } & { { \mathrm { o t h e r w i s e } } } \end{array} \right.
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $E _ { e _ { m _ { i } } } ^ { \mathrm { K M } }$ is the output embedding of entity $e _ { m _ { i } }$ from KM. Then we apply layer normalization (Ba et al., 2016) on $Z ^ { m e r g e }$ : $Z ^ { \prime } = \mathrm { L a y e r N o r m } ( Z ^ { m e r g e } )$ . Finally, $Z ^ { \prime }$ is fed into $\mathrm { L M _ { 2 } }$ .
|
| 100 |
+
|
| 101 |
+
In step 4, $\mathrm { L M _ { 2 } }$ operates on the input $Z ^ { \prime }$ and obtains the final embeddings $Z ^ { \mathrm { L M } } = \mathrm { L M } _ { 2 } ( Z ^ { \prime } )$ . The four steps are marked by the symbol $\textcircled{8}$ in Figure 2 for better illustration.
|
| 102 |
+
|
| 103 |
+
# 3.5 ENTITY CONTEXT EMBEDDING MEMORY
|
| 104 |
+
|
| 105 |
+
Many knowledge graphs contain a large number of entities. Thus, even for one sentence, the number of entities plus their multi-hop neighbors can grow exponentially with the number of layers in the graph neural network. As a result, it’s very time-consuming for the language module to compute context embeddings based on the description text of all involved entities in a batch on the fly.
|
| 106 |
+
|
| 107 |
+
To solve this problem, we construct an entity context embedding memory, $E ^ { c o n t e x t }$ , to store the initial embeddings of all KG entities. Firstly, the language module pre-computes the context embeddings for all entities and places them into the memory. The knowledge module only needs to retrieve required embeddings from the memory instead of computing them, i.e. E(0) ← Econtext.
|
| 108 |
+
|
| 109 |
+
However, as embeddings in the memory are computed from the “old” (initial) language module while the token embeddings during training are computed from the updated language module, there will be an undesired discrepancy. Thus, we propose to update the whole embedding memory $E ^ { c o n t e x t }$ with the current language module every $T ( i )$ steps, where $i$ is the number of times that the memory has been updated (starting from 0). $T ( i )$ is set as follows:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
T ( i ) = \mathrm { m i n } ( I _ { i n i t } * a ^ { \lfloor i / r \rfloor } , I _ { m a x } )
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $I _ { i n i t }$ is the initial number of steps before the first update and $a$ is the increasing ratio of updating intervals. $r$ is the number of repeated times of the current updating interval. $I _ { m a x }$ is the maximum number of steps between updates. $\lfloor \cdot \rfloor$ means the operation of rounding down. In our experiments, we set $I _ { i n i t } = 1 0 , a = 2 , r = 3 , I _ { m a x } = 5 0 0$ , and the corresponding sequence of $T$ is $[ 1 0 , 1 0 , 1 0 , 2 0 , 2 0 , 2 0 , 4 0 , 4 0 , 4 0 , . . . , 5 0 0 , 5 0 0 ]$ . Note that we choose $a > 1$ because the model parameters usually change less as training proceeds.
|
| 116 |
+
|
| 117 |
+
Moreover, we propose a momentum update to make $E ^ { c o n t e x t }$ evolve more smoothly. Suppose the newly calculated embedding memory by LM is $E _ { n e w } ^ { c o n t e x t }$ , then the updating rule is:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
E ^ { c o n t e x t } \gets m E ^ { c o n t e x t } + ( 1 - m ) E _ { n e w } ^ { c o n t e x t } ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $m \in [ 0 , 1 )$ is a momentum coefficient which is set as 0.8 in experiment.
|
| 124 |
+
|
| 125 |
+
This memory design speeds up our model by about $1 5 \mathrm { x }$ during pre-training while keeping the effectiveness of entity context embeddings. For consideration of efficiency, we use relation embeddings only during fine-tuning.
|
| 126 |
+
|
| 127 |
+
# 3.6 PRE-TRAINING
|
| 128 |
+
|
| 129 |
+
During pre-training, both the knowledge module and language module are optimized based on several self-supervised learning tasks listed below. The examples of all the training tasks are shown in Figure 2.
|
| 130 |
+
|
| 131 |
+
At each pre-training step, we first sample a batch of root entities and perform random-walk sampling on each root entity. The sampled entities are fed into KM for the following two tasks.
|
| 132 |
+
|
| 133 |
+
Entity category prediction. The knowledge module is trained to predict the category label of entities based on the output entity embeddings $E ^ { \mathrm { K M } }$ . The loss function is cross-entropy for multiclass classification, denoted as $\mathcal { L } _ { c }$ .
|
| 134 |
+
|
| 135 |
+
Relation type prediction. KM is also trained to predict the relation type between a given entity pair based on $\bar { E } ^ { \bar { \mathsf { K M } } }$ . The loss function is cross-entropy for multi-class classification, denoted as $\mathcal { L } _ { r }$ .
|
| 136 |
+
|
| 137 |
+
Then, we uniformly sample a batch of text sequences and their entities for the following two tasks.
|
| 138 |
+
|
| 139 |
+
Masked token prediction. Similar to BERT, We randomly mask tokens in the sequence and predict the original tokens based on the output $Z ^ { \mathrm { L M } }$ of the language module. We denote the loss as $\scriptstyle { \mathcal { L } } _ { t }$ .
|
| 140 |
+
|
| 141 |
+
Masked entity prediction. The language module is also trained to predict the corresponding entity of a given mention. For the input text, we randomly remove $1 5 \%$ of the mentions $\mathbf { m }$ . Then for each removed mention $m _ { r } = ( e _ { r } , s _ { r } , o _ { r } )$ , the model predicts the masked entity $e _ { r }$ based on the mention’s embedding. In detail, it predicts the entity whose embedding in $E ^ { c o n t e x t }$ is closest to $q = g ( ( Z _ { s _ { r } } ^ { \mathrm { L M } } + Z _ { o _ { r } } ^ { \mathrm { L M } } ) / 2 )$ , where osed by $g ( x ) = \mathrm { G E L U } ( x W _ { 1 } ) W _ { 2 }$ is a transformation function. GELU is an016). Since the number of entities can be very large, we use $e _ { r }$ ’s neighbours and other randomly sampled entities as negative samples. The loss function $\mathcal { L } _ { e }$ is cross entropy based on the inner product between $q$ and each candidate entity’s embedding. Figure 2 shows an concrete example, where the mention “Earth” is not marked in the input text since it’s masked and the task is to link the mention “Earth” to entity “Q2: Earth”.
|
| 142 |
+
|
| 143 |
+
# 3.7 FINE-TUNING
|
| 144 |
+
|
| 145 |
+
During fine-tuning, our model supports using either the knowledge graph employed during pretraining or a novel custom knowledge graph with previously unseen entities2. If a custom KG is used, the entity context embedding memory is recomputed by the pre-trained language module using the new entity description text. In this work, we do not update the entity context memory during fine-tuning for consideration of efficiency. We also compute the relation context embedding memory using the pre-trained language model.
|
| 146 |
+
|
| 147 |
+
# 4 EXPERIMENT
|
| 148 |
+
|
| 149 |
+
# 4.1 BASIC SETTINGS
|
| 150 |
+
|
| 151 |
+
Data for Pre-training. We use the English Wikipedia as the text corpus, Wikidata (Vrandeciˇ c &´ Krotzsch, 2014) as the knowledge graph, and SLING (Ringgaard et al., 2017) to identify entity men- ¨ tions. For each entity, we use the first 64 consecutive tokens of its Wikipedia page as its description text and we filter out entities without a corresponding Wikipedia page. We also remove entities that
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Model</td><td>5-way1-shot</td><td>5-way 5-shot</td><td>10-way 1-shot</td></tr><tr><td>PAIR (BERT)*</td><td>85.7</td><td>89.5</td><td>76.8</td></tr><tr><td>PAIR (RoBERTa)</td><td>86.4</td><td>90.3</td><td>77.3</td></tr><tr><td>PAIR (RoBERTa+GNN)</td><td>86.3</td><td>-</td><td>-</td></tr><tr><td>PAIR (RoBERTa+GNN+M)</td><td>86.9</td><td>■</td><td>-</td></tr><tr><td>PAIR (KnowBERT)</td><td>86.2</td><td>90.3</td><td>77.0</td></tr><tr><td>PAIR (JAKET)</td><td>87.4</td><td>92.1</td><td>78.9</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 1: Accuracy results on the dev set of FewRel 1.0. $\star$ indicates the results are taken from Gao et al. (2019). PAIR is the framework proposed by Gao et al. (2019).
|
| 156 |
+
|
| 157 |
+
have fewer than 5 neighbors in the Wikidata KG and fewer than 5 mentions in the Wikipedia corpus. The final knowledge graph contains 3,657,658 entities, 799 relations and 20,113,978 triplets. We use the instance of relation to find the category of each entity. In total, 3,039,909 entities have category labels of 19,901 types. The text corpus contains about 4 billion tokens.
|
| 158 |
+
|
| 159 |
+
Implementation Details. We initialize the language module with the pre-trained RoBERTabase (Liu et al., 2019b) model. The knowledge module is initialized randomly. Our implementation is based on the HuggingFace framework (Wolf et al., 2019) and DGL (Wang et al., 2019a). For the knowledge module, we use a 2-layer graph neural network, which aggregates 2-hop neighbors. The number of sampled neighbors in each hop is 10. More details are presented in the Appendix.
|
| 160 |
+
|
| 161 |
+
Baselines. We compare our proposed model JAKET with the pre-trained RoBERTa-base (Liu et al., 2019b) and two variants of our model: RoBERTa $^ +$ GNN and RoBERTa+GNN+M. The two models have the same model structure as JAKET, but they are not pre-trained on our data. Moreover, the entity and relation context embedding memories of RoBERTa+GNN are randomly generated while the memories of RoBERT $\mathsf { \Omega } _ { \mathsf { l } + \mathsf { G N N + M } }$ are computed by RoBERTa.
|
| 162 |
+
|
| 163 |
+
# 4.2 DOWNSTREAM TASKS
|
| 164 |
+
|
| 165 |
+
Few-shot Relation Classification. Relation classification requires the model to predict the relation between two entities in text. Few-shot relation classification takes the $N$ -way $K$ -shot setting. Relations in the test set are not seen in the training set. For each query instance, $N$ relations with $K$ supporting examples for each relation are given. The model is required to classify the instance into one of the $N$ relations based on the $N \times K$ samples. In this paper we evaluate our model on FewRel (Han et al., 2018), which is a widely used benchmark dataset for few-shot relation classification, containing 100 relations and 70,000 instances.
|
| 166 |
+
|
| 167 |
+
We use the pre-trained knowledge graph for FewRel as it comes with entity mentions from Wikidata knowledge graph. To predict the relation label, we build a sequence classification layer on top of the output of LM. More specifically, we use the PAIR framework proposed by Gao et al. (2019), which pairs each query instance with all the supporting instances, concatenate each pair as one sequence, and send the concatenated sequence to our sequence classification model to get the score of the two instances expressing the same relation. We do not use relation embeddings in this task to avoid information leakage.
|
| 168 |
+
|
| 169 |
+
As shown in Table 1, our model achieves the best results in all three few-shot settings. Comparing the results between RoBERTa and RoBERTa $^ +$ GNN, we see that adding GNN with randomly generated entity features does not improve the performance. The difference between RoBERTa $+$ GNN+M and RoBERTa $^ +$ GNN demonstrates the importance of generating context embedding memory by the language module, while JAKET can further improve the performance by pre-training. We also compare with a strong knowledge-enhanced PLM KnowBERT (Peters et al., 2019), which is also pretrained on English Wikipedia and Wikidata KG. The results show that JAKET consistently outperform KnowBERT in different few-shot settings.
|
| 170 |
+
|
| 171 |
+
KGQA. The Question Answering over KG (KGQA) task is to answer natural language questions related to a knowledge graph. The answer to each question is an entity in the KG. This task requires an understanding over the question and reasoning over multiple entities and relations.
|
| 172 |
+
|
| 173 |
+
We use the vanilla version of the MetaQA (Zhang et al., 2017) dataset, which contains questions requiring multi-hop reasoning over a novel movie-domain knowledge graph. The KG contains $1 3 5 \mathrm { k }$ triplets, $4 3 \mathrm { k }$ entities and 9 relations. Each question is provided with one entity mention and the question is named as a $k$ -hop question if the answer entity is a $k$ -hop neighbor of the question entity. We define all the $k$ -hop neighbor entities of the question entity as the candidate entities for the question. We also consider a more realistic setting where we simulate an incomplete KG by randomly dropping a triplet with a probability $5 0 \%$ . This setting is called $K G \ – 5 O \%$ , compared with the full KG setting KG-Full. For each entity, we randomly sample one question containing it as the entity’s description context. We manually write the description for each relation since the number of relations is very small. We use the output embedding of [CLS] token from LM as the question embedding, and then find the entity with the closest context embedding.
|
| 174 |
+
|
| 175 |
+
Table 2: Results on the MetaQA dataset over 1- hop and 2-hop questions under KG-Full and $K G .$ - $50 \%$ settings. $\mathbf { R o B + G + M }$ is the abbreviation for the baseline model RoBERT $\mathbf { \pi } _ { 1 + \mathrm { G N N } + \mathrm { M } }$ .
|
| 176 |
+
|
| 177 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">KG-Full</td><td colspan="2">KG-50%</td></tr><tr><td>1-hop</td><td>2-hop</td><td>1-hop</td><td>2-hop</td></tr><tr><td>RoBERTa</td><td>90.2</td><td>70.8</td><td>61.5</td><td>39.3</td></tr><tr><td>RoB+G+M</td><td>91.4</td><td>72.6</td><td>62.5</td><td>40.8</td></tr><tr><td> JAKET</td><td>93.9</td><td>73.2</td><td>63.1</td><td>41.9</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Table 3: Results on the entity classification task over an unseen Wikidata knowledge graph. $\mathbf { R o B + G + M }$ is the abbreviation for the baseline model RoBERT $\mathrm { _ { 1 + G N N + M } }$ .
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Model</td><td>100%</td><td>20%</td><td>5%</td></tr><tr><td>GNN</td><td>48.2</td><td>-</td><td>-</td></tr><tr><td>RoBERTa</td><td>33.4</td><td>1</td><td>1</td></tr><tr><td>RoB+G+M</td><td>79.1</td><td>66.7</td><td>53.5</td></tr><tr><td>JAKET</td><td>81.6</td><td>70.6</td><td>58.4</td></tr></table>
|
| 182 |
+
|
| 183 |
+
As shown in Table 2, RoBERT $\mathbf { \Lambda } _ { 1 + \mathbf { G N N + M } }$ outperforms RoBERTa, demonstrating the effectiveness of $_ { \mathrm { K M + L M } }$ structure. JAKET further improves the accuracy by $0 . 6 \%$ to $2 . 5 \%$ under both KG settings, showing the benefits of our proposed joint pre-training.3
|
| 184 |
+
|
| 185 |
+
Entity Classification. To further evaluate our model’s capability to reason over unseen knowledge graphs, we design an entity classification task. Here, the model is given a portion of the Wikidata knowledge graph unseen during pre-training, denoted as $\kappa \mathcal { G } ^ { \prime }$ . It needs to predict the category labels of these novel entities. The entity context embeddings are obtained in the same way as in pretraining. The relation context embeddings are generated by its surface text. The number of entities and relations in the $\kappa \mathcal { G } ^ { \prime }$ are 23,046 and 316 respectively. The number of triplets is 38,060. Among them, 16,529 entities have 1,291 distinct category labels. We conduct experiments under a semisupervised transductive setting by splitting the entities in $\kappa \mathcal { G } ^ { \prime }$ into train/dev/test splits of $20 \%$ , $20 \%$ and $60 \%$ . To test the robustness of models to the size of training data, we evaluate models when using $20 \%$ and $5 \%$ of the original training set.
|
| 186 |
+
|
| 187 |
+
In this task, RoBERTa takes the entity description text as input for label prediction while neglecting the structure information of KG. JAKET and RoBERTa $+ \mathrm { G N N + M }$ make predictions based on the entity representation output from the knowledge module. We also include GNN as a baseline, which uses the same GAT-based structure as our knowledge module, but with randomly initialized model parameters and context embedding memory. GNN then employs the final entity representations for entity category prediction.
|
| 188 |
+
|
| 189 |
+
As shown in Table 3, our model achieves the best performance under all the settings. The performance of GNN or RoBERTa alone is significantly lower than JAKET and RoBERTa $^ +$ GNN+M, which demonstrates the importance of integrating both context and knowledge information using our proposed framework. Also, the gap between JAKET and RoBERTa $+ \mathrm { G N N + M }$ increases when there’s less training data, showing that the joint pre-training can reduce the model’s dependence on downstream training data.
|
| 190 |
+
|
| 191 |
+
# 5 CONCLUSION
|
| 192 |
+
|
| 193 |
+
This paper presents a novel framework, JAKET, to jointly pre-train models for knowledge graph and language understanding. Under our framework, the knowledge module and language module both provide essential information for each other. After pre-training, JAKET can quickly adapt to unseen knowledge graphs in new domains. Moreover, we design the entity context embedding memory which speeds up the pre-training by 15x. Experiments show that JAKET outperforms baseline methods in several knowledge-aware NLU tasks: few-shot relation classification, KGQA and entity classification. In the future, we plan to extend our framework to natural language generation tasks.
|
| 194 |
+
|
| 195 |
+
# REFERENCES
|
| 196 |
+
|
| 197 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 198 |
+
|
| 199 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in neural information processing systems, pp. 2787–2795, 2013.
|
| 200 |
+
|
| 201 |
+
Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 202 |
+
|
| 203 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 204 |
+
|
| 205 |
+
Ming Ding, Chang Zhou, Qibin Chen, Hongxia Yang, and Jie Tang. Cognitive graph for multi-hop reading comprehension at scale. arXiv preprint arXiv:1905.05460, 2019.
|
| 206 |
+
|
| 207 |
+
Thibault Fevry, Livio Baldini Soares, Nicholas FitzGerald, Eunsol Choi, and Tom Kwiatkowski. En-´ tities as experts: Sparse memory access with entity supervision. arXiv preprint arXiv:2004.07202, 2020.
|
| 208 |
+
|
| 209 |
+
Tianyu Gao, Xu Han, Hao Zhu, Zhiyuan Liu, Peng Li, Maosong Sun, and Jie Zhou. Fewrel 2.0: Towards more challenging few-shot relation classification. arXiv preprint arXiv:1910.07124, 2019.
|
| 210 |
+
|
| 211 |
+
Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020.
|
| 212 |
+
|
| 213 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pp. 1024–1034, 2017.
|
| 214 |
+
|
| 215 |
+
Xu Han, Hao Zhu, Pengfei Yu, Ziyun Wang, Yuan Yao, Zhiyuan Liu, and Maosong Sun. Fewrel: A large-scale supervised few-shot relation classification dataset with state-of-the-art evaluation. arXiv preprint arXiv:1810.10147, 2018.
|
| 216 |
+
|
| 217 |
+
Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
|
| 218 |
+
|
| 219 |
+
Yoav Levine, Barak Lenz, Or Dagan, Dan Padnos, Or Sharir, Shai Shalev-Shwartz, Amnon Shashua, and Yoav Shoham. Sensebert: Driving some sense into bert. arXiv preprint arXiv:1908.05646, 2019.
|
| 220 |
+
|
| 221 |
+
Nelson F Liu, Matt Gardner, Yonatan Belinkov, Matthew E Peters, and Noah A Smith. Linguistic knowledge and transferability of contextual representations. arXiv preprint arXiv:1903.08855, 2019a.
|
| 222 |
+
|
| 223 |
+
Weijie Liu, Peng Zhou, Zhe Zhao, Zhiruo Wang, Qi Ju, Haotang Deng, and Ping Wang. K-bert: Enabling language representation with knowledge graph. In AAAI, pp. 2901–2908, 2020.
|
| 224 |
+
|
| 225 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019b.
|
| 226 |
+
|
| 227 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
|
| 228 |
+
|
| 229 |
+
Shangwen Lv, Daya Guo, Jingjing Xu, Duyu Tang, Nan Duan, Ming Gong, Linjun Shou, Daxin Jiang, Guihong Cao, and Songlin Hu. Graph-based reasoning over heterogeneous external knowledge for commonsense question answering. In AAAI, pp. 8449–8456, 2020.
|
| 230 |
+
|
| 231 |
+
Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
|
| 232 |
+
|
| 233 |
+
Matthew E. Peters, Mark Neumann, Robert L Logan, Roy Schwartz, Vidur Joshi, Sameer Singh, and Noah A. Smith. Knowledge enhanced contextual word representations. In EMNLP, 2019.
|
| 234 |
+
|
| 235 |
+
Nina Poerner, Ulli Waltinger, and Hinrich Schutze. Bert is not a knowledge base (yet): Factual ¨ knowledge vs. name-based reasoning in unsupervised qa. arXiv preprint arXiv:1911.03681, 2019.
|
| 236 |
+
|
| 237 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training, 2018.
|
| 238 |
+
|
| 239 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019.
|
| 240 |
+
|
| 241 |
+
Michael Ringgaard, Rahul Gupta, and Fernando CN Pereira. Sling: A framework for frame semantic parsing. arXiv preprint arXiv:1710.07032, 2017.
|
| 242 |
+
|
| 243 |
+
Tao Shen, Yi Mao, Pengcheng He, Guodong Long, Adam Trischler, and Weizhu Chen. Exploiting structured knowledge in text via graph-guided representation learning. arXiv preprint arXiv:2004.14224, 2020.
|
| 244 |
+
|
| 245 |
+
Livio Baldini Soares, Nicholas FitzGerald, Jeffrey Ling, and Tom Kwiatkowski. Matching the blanks: Distributional similarity for relation learning. arXiv preprint arXiv:1906.03158, 2019.
|
| 246 |
+
|
| 247 |
+
Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Kathryn Mazaitis, Ruslan Salakhutdinov, and William W Cohen. Open domain question answering using early fusion of knowledge bases and text. arXiv preprint arXiv:1809.00782, 2018.
|
| 248 |
+
|
| 249 |
+
Haitian Sun, Tania Bedrax-Weiss, and William W Cohen. Pullnet: Open domain question answering with iterative retrieval on knowledge bases and text. arXiv preprint arXiv:1904.09537, 2019a.
|
| 250 |
+
|
| 251 |
+
Yu Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xin Tian, Danxiang Zhu, Hao Tian, and Hua Wu. Ernie: Enhanced representation through knowledge integration. arXiv preprint arXiv:1904.09223, 2019b.
|
| 252 |
+
|
| 253 |
+
Alon Talmor, Yanai Elazar, Yoav Goldberg, and Jonathan Berant. olmpics–on what language model pre-training captures. arXiv preprint arXiv:1912.13283, 2019.
|
| 254 |
+
|
| 255 |
+
Shikhar Vashishth, Soumya Sanyal, Vikram Nitin, and Partha Talukdar. Composition-based multirelational graph convolutional networks. arXiv preprint arXiv:1911.03082, 2019.
|
| 256 |
+
|
| 257 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 258 |
+
|
| 259 |
+
Pat Verga, Haitian Sun, Livio Baldini Soares, and William W Cohen. Facts as experts: Adaptable and interpretable neural memory over symbolic knowledge. arXiv preprint arXiv:2007.00849, 2020.
|
| 260 |
+
|
| 261 |
+
Denny Vrandeciˇ c and Markus Kr ´ otzsch. Wikidata: a free collaborative knowledgebase. ¨ Communications of the ACM, 57(10):78–85, 2014.
|
| 262 |
+
|
| 263 |
+
Minjie Wang, Lingfan Yu, Da Zheng, Quan Gan, Yu Gai, Zihao Ye, Mufei Li, Jinjing Zhou, Qi Huang, Chao Ma, et al. Deep graph library: Towards efficient and scalable deep learning on graphs. arXiv preprint arXiv:1909.01315, 2019a.
|
| 264 |
+
|
| 265 |
+
Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhiyuan Liu, Juanzi Li, and Jian Tang. Kepler: A unified model for knowledge embedding and pre-trained language representation. arXiv preprint arXiv:1911.06136, 2019b.
|
| 266 |
+
|
| 267 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick´ von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Huggingface’s transformers: Stateof-the-art natural language processing. ArXiv, abs/1910.03771, 2019.
|
| 268 |
+
|
| 269 |
+
Wenhan Xiong, Jingfei Du, William Yang Wang, and Veselin Stoyanov. Pretrained encyclopedia: Weakly supervised knowledge-pretrained language model. arXiv preprint arXiv:1912.09637, 2019.
|
| 270 |
+
|
| 271 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in neural information processing systems, pp. 5753–5763, 2019.
|
| 272 |
+
|
| 273 |
+
Yuyu Zhang, Hanjun Dai, Zornitsa Kozareva, Alexander J Smola, and Le Song. Variational reasoning for question answering with knowledge graph. arXiv preprint arXiv:1709.04071, 2017.
|
| 274 |
+
|
| 275 |
+
Zhengyan Zhang, Xu Han, Zhiyuan Liu, Xin Jiang, Maosong Sun, and Qun Liu. Ernie: Enhanced language representation with informative entities. arXiv preprint arXiv:1905.07129, 2019.
|
| 276 |
+
|
| 277 |
+
# A APPENDIX
|
| 278 |
+
|
| 279 |
+
# A.1 IMPLEMENTATION DETAILS
|
| 280 |
+
|
| 281 |
+
The dimension of hidden states in the knowledge module is 768, the same as RoBERTa-base, and the number of attention heads is 8. During pre-training, the batch size and length of text sequences are 1024 and 512 respectively. The batch size of KG entities is 16,384. The number of training epochs is 8. JAKET is optimized by AdamW (Loshchilov & Hutter, 2017) using the following parameters: $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } ~ = ~ 0 . 9 9 9$ , $\epsilon = 1 \mathrm { e } { - } 8$ , and weight decay of 0.01. The learning rate of the language module is warmed up over the first 3,000 steps to a peak value of 1e-5, and then linearly decayed. The learning rate of our knowledge module starts from 1e-4 and then linearly decayed.
|
| 282 |
+
|
| 283 |
+
# A.2 COMPUTATION ANALYSIS
|
| 284 |
+
|
| 285 |
+
The computation of the KG module is much less than the LM module. For BERT-base or RoBERTabase, the number of inference computation flops (#flops) over each sequence (length 128) is over 22 billion [1, 2]. Here, we theoretically compute the number of flops of the KG module as follows: The sequence length $N = 1 2 8$ , and hidden dimension $H = 7 6 8$ . The number of entities in a sequence is usually less than $N / 5$ . The number of sampled neighbors per entity $r = 1 0$ . And the number of layers of the GNN based KG module $L = 2$ . It follows that the #flops of KG module is about $N / 5 \stackrel { \bullet } { \times } r ^ { L } \times 2 H ^ { 2 } \approx 3$ billion, less than $1 / 7$ of LM computation. If we set $r = 5$ , the #flops can be further reduced to about $1 / 3 0$ of LM computation.
|
| 286 |
+
|
| 287 |
+
During pre-training, another computation overhead is entity context embedding memory update (Section 3.5): Firstly, the number of entities is about 3 million and the update step interval is 500. Thus for each step on average the model processes the description text of $3 \mathrm { e } 6 / 5 0 0 = 6 \mathrm { e } 3$ entities. Secondly, the length of description text is 64, much smaller than the length of input text 512, and we only use LM1 (the first half of LM module) for entity context embedding generation, which saves half of the computation time compared to using the whole LM module. Thirdly, the embedding update only requires forward propagation, costing only half of computation compared to training process which requires both forward and backward propagation. Thus, generating context embedding of 6k entities consumes about the same number of flops as training $6 0 \bar { 0 } 0 0 \times 6 4 / ( 5 1 2 \times 2 \times 2 ) \approx 2 0 \bar { 0 }$ input texts, much smaller than the batch size 1024. In short, the entity context embedding memory update only costs $2 0 0 / 1 0 2 4 \approx 1 / 5$ additional computation. Note this computation overhead only exists during pre-training, since entity embedding memory is not updated when fine-tuning.
|
md/train/SklXvs0qt7/SklXvs0qt7.md
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CURIOSITY-DRIVEN EXPERIENCE PRIORITIZATION VIA DENSITY ESTIMATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In Reinforcement Learning (RL), an agent explores the environment and collects trajectories into the memory buffer for later learning. However, the collected trajectories can easily be imbalanced with respect to the achieved goal states. The problem of learning from imbalanced data is a well-known problem in supervised learning, but has not yet been thoroughly researched in RL. To address this problem, we propose a novel Curiosity-Driven Prioritization (CDP) framework to encourage the agent to over-sample those trajectories that have rare achieved goal states. The CDP framework mimics the human learning process and focuses more on relatively uncommon events. We evaluate our methods using the robotic environment provided by OpenAI Gym. The environment contains six robot manipulation tasks. In our experiments, we combined CDP with Deep Deterministic Policy Gradient (DDPG) with or without Hindsight Experience Replay (HER). The experimental results show that CDP improves both performance and sampleefficiency of reinforcement learning agents, compared to state-of-the-art methods.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reinforcement Learning (RL) (Sutton & Barto, 1998) combined with Deep Learning (DL) (Goodfellow et al., 2016) led to great successes in various tasks, such as playing video games (Mnih et al., 2015), challenging the World Go Champion (Silver et al., 2016), and learning autonomously to accomplish different robotic tasks $\mathrm { N g }$ et al., 2006; Peters & Schaal, 2008; Levine et al., 2016; Chebotar et al., 2017; Andrychowicz et al., 2017).
|
| 12 |
+
|
| 13 |
+
One of the biggest challenges in RL is to make the agent learn sample-efficiently in applications with sparse rewards. Recent RL algorithms, such as Deep Deterministic Policy Gradient (DDPG) (Lillicrap et al., 2015), enable the agent to learn continuous control, such as manipulation and locomotion. Furthermore, to make the agent learn faster in the sparse reward settings, Andrychowicz et al. (2017) introduced Hindsight Experience Replay (HER) that encourages the agent to learn from whatever goal states it has achieved. The combination use of DDPG and HER lets the agent learn to accomplish more complex robot manipulation tasks. However, there is still a huge gap between the learning efficiency of humans and RL agents. In most cases, an RL agent needs millions of samples before it becomes good at the tasks, while humans only need a few samples (Mnih et al., 2015).
|
| 14 |
+
|
| 15 |
+
One ability of humans is to learn with curiosity. Imagine a boy learning to play basketball and he attempting to shoot the ball into the hoop. After a day of training, he replayed the memory about the moves he practiced. During his recall, he realized that he missed most of his attempts. However, a few made contact with the hoop. These near successful attempts are more interesting to learn from. He will put more focus on learning from these. This kind of curiosity-driven learning might make the learning process more efficient.
|
| 16 |
+
|
| 17 |
+
Similar curiosity mechanisms could be beneficial for RL agents. We are interested in the RL tasks, in which the goals can be expressed in states. In this case, the agent can analyze the achieved goals and find out which states have been achieved most of the time and which are rare. Based on the analysis, the agent is able to prioritize the trajectories, of which the achieved goal states are novel. For example, the goal states could be the position and the orientation of the target object. We want to encourage the agent to balance the training samples in the memory buffer. The reason is that the policy of the agent could be biased and focuses on a certain group of achieved goal states. This causes the samples to be imbalanced in the memory buffer, which we refer to as memory imbalance.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Robot arm Fetch and Shadow Dexterous hand environment: FetchPush, FetchPickAndPlace, FetchSlide, HandManipulateEgg, HandManipulateBlock, and HandManipulatePen.
|
| 21 |
+
|
| 22 |
+
To overcome the class imbalance issue in supervised learning, such as training deep convolutional neural networks with biased datasets, researchers utilized over-sampling and under-sampling techniques (Deng et al., 2009; Felzenszwalb et al., 2008; Buda et al., 2018; Galar et al., 2012). For instance, the number of one image class is significantly higher than another class. They over-sampled the training images in the smaller class to balance the training set and ultimately to improve the classification accuracy. This idea could be combined with experience replay in RL. We investigate into this research direction and propose a novel curiosity-based prioritization framework for reinforcement learning agents.
|
| 23 |
+
|
| 24 |
+
In this paper, we introduce a framework called Curiosity-Driven Prioritization (CDP) which allows the agent to realize a curiosity-driven learning ability similar to humans. This approach can be combined with any off-policy RL algorithm. It is applicable whenever the achieved goals can be described with state vectors. The pivotal idea of CDP is to first estimate the density of each achieved goal and then prioritize the trajectories with lower density to balance the samples that the agent learns from. To evaluate CDP, we combine CDP with DDPG and DDPG+HER and test them in the robot manipulation environments.
|
| 25 |
+
|
| 26 |
+
# 2 BACKGROUND
|
| 27 |
+
|
| 28 |
+
In this section, we introduce the preliminaries, such as the experiment environments, the reinforcement learning approaches and the density estimation algorithm we used in the experiments.
|
| 29 |
+
|
| 30 |
+
# 2.1 ENVIRONMENTS
|
| 31 |
+
|
| 32 |
+
The environment we used in our experiments is the robotic simulations provided by OpenAI Gym (Brockman et al., 2016; Plappert et al., 2018), using the MuJoCo physics engine (Todorov et al., 2012). The robotic environment is based on currently existing robotic hardware and is designed as a standard benchmark for Multi-goal RL. The robot agent is required to complete several tasks with different goals in each scenario. There are two kinds of robot agents in the environment. One is a 7-DOF Fetch robotic arm with a two-finger gripper as an end-effector. The other is a 24-DOF Shadow Dexterous robotic hand. We use six challenging tasks for evaluation, including push, slide, pick & place with the robot arm, and hand manipulation of the block, egg, and pen, see Figure 1.
|
| 33 |
+
|
| 34 |
+
Goals: The goals $g$ are the desired positions and the orientations of the object.
|
| 35 |
+
|
| 36 |
+
States: The system states $s$ in the simulation consist of positions, orientations, linear and angular velocities of all robot joints and of an object. The state $s$ consists of two sub-vectors, the achieved goal state $s ^ { g }$ and the context state $s ^ { c }$ , i.e. $s = \left( \boldsymbol { x } ^ { g } \| \boldsymbol { x } ^ { c } \right)$ , where $\parallel$ denotes concatenation. In our case, the achieved goal state $s ^ { g }$ represents the positions and the orientations of the object, which has the same dimension as the real goal $g$ . The context state $s ^ { c }$ contains the reset system information, including the linear and angular velocities of all robot joints and of an object. The sate input to the universal value function, see Section 2.2, is the system state $s$ combined with the real goal $g$ , i.e. $( s \| g )$ .
|
| 37 |
+
|
| 38 |
+
Rewards: In all environments, we consider sparse rewards $r$ . There is a tolerant range between the desired goal states and the achieved goal states. If the object is not in the tolerant range of the real goal, the agent receives a reward signal $^ { - 1 }$ for each transition; otherwise, the reward signal is 0.
|
| 39 |
+
|
| 40 |
+
# 2.2 REINFORCEMENT LEARNING
|
| 41 |
+
|
| 42 |
+
Markov Decision Process: We consider an agent interacting with an environment. We assume the environment is fully observable, including a set of state $s$ , a set of action $\mathcal { A }$ , a distribution of initial states $p ( s _ { 0 } )$ , transition probabilities $p ( s _ { t + 1 } | s _ { t } , a _ { t } )$ , a reward function $r \colon S \times \mathcal { A } \mathbb { R }$ , and also a discount factor $\gamma \in [ 0 , \bar { 1 } ]$ . These components formulate a Markov decision process represented as a tuple, $( S , \mathcal { A } , p , r , \gamma )$ . A policy $\pi$ maps a state to an action, $\pi : { \mathcal { S } } A$ .
|
| 43 |
+
|
| 44 |
+
Deep Deterministic Policy Gradient: The objective, expected return $\mathbb { E } _ { s _ { 0 } } [ R _ { 0 } | s _ { 0 } ]$ , can be maximized using temporal difference learning, policy gradients, or the combination of both, i.e. the actor-critic methods (Sutton & Barto, 1998). For continuous control tasks, Deep Deterministic Policy Gradient (DDPG) shows promising performance, which is essentially an off-policy actor-critic method (Lillicrap et al., 2015).
|
| 45 |
+
|
| 46 |
+
Universal Value Function Approximators: For multi-goal continuous control tasks, DDPG can be extended with Universal Value Function Approximators (UVFA) (Schaul et al., 2015a). UVFA essentially generalizes the Q-function to multiple goal states $g \in { \mathcal { G } }$ . Now, the Q-value depends not only on the state-action pairs, but also depends on the goals: $Q ^ { \pi } ( s _ { t } , a _ { t } , g ) = \mathbb { E } [ R _ { t } | s _ { t } , a _ { t } , g ]$ .
|
| 47 |
+
|
| 48 |
+
Hindsight Experience Replay: For robotic tasks, if the goal is challenging and the reward is sparse, then the agent could perform badly for a long time before learning anything. Hindsight Experience Replay (HER) encourages the agent to learn from whatever goal states that it has achieved. Andrychowicz et al. (2017) show that HER makes training possible in challenging robotic environments. However, the episodes are uniformly sampled in the replay buffer, and subsequently, the virtual goals are sampled from the episodes. More sophisticated replay strategies are requested for improving sample-efficiency (Plappert et al., 2018).
|
| 49 |
+
|
| 50 |
+
# 2.3 DENSITY ESTIMATION METHODS
|
| 51 |
+
|
| 52 |
+
For estimating the density $\rho$ of the achieved goals in the memory buffer, we use a Gaussian mix
|
| 53 |
+
ture model because it can be trained reasonably fast for RL agents. GMM is also much faster
|
| 54 |
+
in inference compared to Kernel Density Estimate (KDE) (Rosenblatt, 1956). Gaussian Mixture
|
| 55 |
+
Model (GMM) (Duda & Hart, 1973; Murphy, 2012) is a probabilistic model that assumes all the $K$ GaussianEvery Ga tributionsn density parameters, mathematically: is a component of the GMM
|
| 56 |
+
$\begin{array} { r } { \rho ( \mathbf { x } ) = \sum _ { k = 1 } ^ { K } c _ { k } \mathcal { N } ( \mathbf { x } | \pmb { \mu } _ { k } , \pmb { \Sigma } _ { k } ) } \end{array}$ $\mathcal { N } ( { \bf x } | \mu _ { k } , \Sigma _ { k } )$ $\pmb { \mu } _ { k }$ $\Sigma _ { k }$ $c _ { k }$
|
| 57 |
+
our experiments, we use Variational Gaussian Mixture Model (V-GMM) (Blei et al., 2006). The
|
| 58 |
+
reason is that V-GMM has a natural tendency to set some mixing coefficients $c _ { k }$ close to zero and
|
| 59 |
+
generalizes better. Therefore, we decide to use V-GMM in our framework as a proof of concept.
|
| 60 |
+
|
| 61 |
+
# 3 METHOD
|
| 62 |
+
|
| 63 |
+
In this section, we formally describe our method, including the motivation, the framework, a mathematical grounding, and a comparison with prioritized experience replay (Schaul et al., 2015b).
|
| 64 |
+
|
| 65 |
+
# 3.1 MOTIVATION
|
| 66 |
+
|
| 67 |
+
The motivation of incorporating curiosity mechanisms into RL agents is motivated by the human brain. Recent neuroscience research (Gruber et al., 2014) has shown that curiosity can enhance learning. They discovered that when curiosity motivated learning was activated, there was increased activity in the hippocampus, a brain region that is important for human memory. To learn a new skill, such as playing basketball, people practice repeatedly in a trial-and-error fashion. During memory replay, people are more curious about the episodes that are relatively different and focus more on those. This curiosity mechanism has been shown to speed up learning.
|
| 68 |
+
|
| 69 |
+
Secondly, the inspiration of how to design the curiosity mechanism for RL agents comes from the supervised learning community, in particular the class imbalance dataset problem. Real-world datasets commonly show the particularity to have certain classes to be under-represented compared to other classes. When presented with complex imbalanced datasets, standard learning algorithms, including neural networks, fail to properly represent the distributive characteristics of the data and thus provide unfavorable accuracies across the different classes of the data (He & Garcia, 2008; Galar et al., 2012). One of the effective methods to handle this problem is to over-sample the samples in the under-represented class. Therefore, we prioritize the under-represented trajectories with respect to the achieved goals in the agent’s memory buffer to improve the performance.
|
| 70 |
+
|
| 71 |
+
# 3.2 CURIOSITY-DRIVEN PRIORITIZATION
|
| 72 |
+
|
| 73 |
+
In this section, we formally describe the Curiosity-Driven Prioritization (CDP) framework. In a nutshell, we first estimate the density of each trajectory according to its achieved goal states, then prioritize the trajectories with lower density for replay.
|
| 74 |
+
|
| 75 |
+
# 3.2.1 COLLECTING EXPERIENCE
|
| 76 |
+
|
| 77 |
+
At the beginning of each episode, the agent uses partially random policies, such as $\epsilon$ -greedy, to start to explore the environment and stores the sampled trajectories into a memory buffer for later replay.
|
| 78 |
+
|
| 79 |
+
A complete trajectory $\tau$ in an episode is represented as a tuple $( S , \mathcal { A } , p , r , \gamma )$ . A trajectory contains a series of continuous states $s _ { t }$ , see Section 2.1, where $t$ is the timestep $t \in \{ 0 , 1 , . . , T \}$ . Each state on the goal states, $s _ { t } \in S$ also includes the state of the achieved goal $s _ { 0 } ^ { g } , s _ { 1 } ^ { g } , . . . , s _ { T } ^ { g }$ . $s _ { t } ^ { g }$ . The density of a trajectory, $\rho$ , only depends
|
| 80 |
+
|
| 81 |
+
# 3.2.2 DENSITY ESTIMATION
|
| 82 |
+
|
| 83 |
+
After the agent collected a number of trajectories, we can fit the density model. The density model we use here is the Variational Gaussian Mixture Model (V-GMM) as introduced in Section 2.3. The V-GMM fits on the data in the memory buffer every epoch and refreshes the density for each trajectory in the buffer. During each epoch, when the new trajectory comes in, the density model predicts the density $\rho$ based on the achieved goals of the trajectory as:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\rho = \mathrm { V } \mathrm { - } \mathrm { G M M } ( \tau ) = \sum _ { k = 1 } ^ { K } c _ { k } \mathcal { N } ( \tau | \pmb { \mu } _ { k } , \pmb { \Sigma } _ { k } )
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\tau = ( s _ { 0 } ^ { g } \Vert s _ { 1 } ^ { g } \Vert . . . \Vert s _ { T } ^ { g } )$ and each trajectory $\tau$ has the same length. We normalize the trajectory densities using
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\rho _ { i } = \frac { \rho _ { i } } { \sum _ { n = 1 } ^ { N } \rho _ { n } }
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $N$ is the number of trajectories in the memory buffer. Now the density $\rho$ is between zero and one, i.e. $0 \leq \rho \leq 1$ , After calculating the trajectory density, the agent stores the density value along with the trajectory in the memory buffer for later prioritization.
|
| 96 |
+
|
| 97 |
+
# 3.2.3 PRIORITIZATION
|
| 98 |
+
|
| 99 |
+
During replay, the agent puts more focus on the under-represented achieved states and prioritizes the according trajectories. These under-represented achieved goal states have lower trajectory density. We defined the complementary trajectory density as:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\bar { \rho } \propto 1 - \rho .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
When the agent replays the samples, it first ranks all the trajectories with respect to their complementary density values $\bar { \rho }$ , and then uses the ranking number (starting from zero) directly as the probability for sampling. This means that the low-density trajectories have high ranking numbers, and equivalently, have higher priorities to be replayed. Here we use the ranking instead of the density directly. The reason is that the rank-based variant is more robust because it is not affected by outliers nor by density magnitudes. Furthermore, its heavy-tail property also guarantees that samples will be diverse (Schaul et al., 2015b). Mathematically, the probability of a trajectory to be replayed after the prioritization is:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
p ( \tau _ { i } ) = \frac { \mathrm { r a n k } ( \bar { \rho } ( \tau _ { i } ) ) } { \sum _ { n = 1 } ^ { N } \mathrm { r a n k } ( ( \bar { \rho } ( \tau _ { n } ) ) }
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $N$ is the total number of trajectories in the buffer, and $\mathrm { r a n k } ( \cdot ) \in \{ 0 , 1 , . . . , N - 1 \}$
|
| 112 |
+
|
| 113 |
+
# 3.2.4 COMPLETE ALGORITHM
|
| 114 |
+
|
| 115 |
+
We summarize the complete training algorithm in Algorithm 1.
|
| 116 |
+
|
| 117 |
+
# Algorithm 1 Curiosity-Driven Prioritization (CDP)
|
| 118 |
+
|
| 119 |
+
Given: • an off-policy RL algorithm A $\triangleright$ e.g. DDPG, DDPG+HER $\bullet$ a reward function $r : \mathcal { S } \times \mathcal { A } \times \mathcal { G } \to \mathbb { R }$ . . e.g. $r ( s , a , g ) = - 1$ (fail), 0 (success)
|
| 120 |
+
Initialize neural networks of A, density model V-GMM, and replay buffer $R$
|
| 121 |
+
for epoch $= 1$ , $M$ do for episode $= 1$ , $N$ do Sample a goal $g$ and an initial state $s _ { 0 }$ . Sample a trajectory $\tau = ( s _ { t } \| g , a _ { t } , r _ { t } , s _ { t + 1 } \| g ) _ { t = 0 } ^ { T }$ using $\pi _ { b }$ from A Calculate the densities $\rho$ and $\bar { \rho }$ using Equation (1), (2) and (3) $\triangleright$ estimate density Calculate the priority $p ( \tau )$ using Equation (4) Store transitions $( s _ { t } \dot { } \rvert \rvert g , a _ { t } , r _ { t } , s _ { t + 1 } \rvert \rvert g , p , \bar { \rho } ) _ { t = 0 } ^ { T }$ in $R$ Sample trajectory $\tau$ from $R$ based on the priority, $p ( \tau )$ . prioritization Sample transitions $\left( { { s _ { t } } , { a _ { t } } , { s _ { t + 1 } } } \right)$ from $\tau$ Sample virtual goals $g ^ { \prime } \in \{ s _ { t + 1 } , . . . , s _ { T - 1 } \}$ at a future timestep in $\tau$ $r _ { t } ^ { \prime } : = r ( s _ { t } , a _ { t } , g ^ { \prime } )$ $\triangleright$ recalculate reward (HER) Store the transition $\left( s _ { t } \| g ^ { \prime } , a _ { t } , r _ { t } ^ { \prime } , s _ { t + 1 } \| g ^ { \prime } , p , \bar { \rho } \right)$ in $R$ Perform one step of optimization using A end for Train the density model using the collected trajectories in $R$ $\triangleright$ fit density model Update the density in $R$ using the trained model . refresh density
|
| 122 |
+
end for
|
| 123 |
+
|
| 124 |
+
# 3.3 AN IMPORTANCE SAMPLING PERSPECTIVE
|
| 125 |
+
|
| 126 |
+
The mathematical explanation for the efficiency of CDP is based on importance sampling. Importance sampling is a general technique to estimate an integral $\textstyle \int f ( x ) p ( { \bar { x } } ) d x$ of a function $f ( x )$ , with the exact distribution $p ( x )$ (Murphy, 2012; Owen, 2013). Here, we consider using importance sampling to estimate the integral of the loss function $ { \mathcal { L } } ( \tau )$ of the reinforcement learning agent:
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
I = \mathbb { E } [ \mathcal { L } ] = \int \mathcal { L } ( \tau ) \frac { p ( \tau ) } { q ( \tau ) } q ( \tau ) d \tau \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \omega _ { i } f ( \tau _ { i } ) = \hat { I } ,
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
where $\tau$ is a trajectory, $q ( \tau )$ is a proposal distribution, and $\omega _ { i } = p ( \tau _ { i } ) / q ( \tau _ { i } )$ is an importance weight.
|
| 133 |
+
|
| 134 |
+
The idea here is to draw samples $\tau$ from the buffer in regions which have a high probability, $p ( \tau )$ , but also where $\mathcal { L } | ( \tau ) |$ is large. Since, $p ( \tau )$ is a uniform distribution, i.e. the agent replays trajectories at random, we only need to draw samples which has large errors $\mathcal { L } | ( \tau ) |$ . The result can be highly efficient, meaning the agent needs less samples than sampling from the uniform distribution $p ( \tau )$ . The CDP framework finds the samples that have large errors based on the ‘surprise’ of the trajectory. The variance of the estimate $\hat { I }$ is: $\mathrm { v a r } _ { q } [ \mathcal { L } ( \tau ) \omega ( \tau ) ) ] = \mathbb { E } _ { q } [ \mathcal { L } ^ { 2 } ( \tau ) \omega ^ { 2 } ( \tau ) ] - I ^ { 2 }$ . Since the last term is independent of $q$ , we can ignore it. Using Jensen’s inequality, we have the following lower bound:
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\begin{array} { r } { \mathbb { E } _ { q } [ \mathcal { L } ^ { 2 } ( \tau ) \omega ^ { 2 } ( \tau ) ] \geqslant ( \mathbb { E } _ { q } [ | \mathcal { L } ( \tau ) \omega ( \tau ) | ] ) ^ { 2 } . } \end{array}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
To reduce the variance, we set the importance weight as a constant $\omega ( \tau ) = 1$ . This bias-variance trade-off also saves computational time and does not lead to instabilities in our experiment. With CDP, the agent estimates the loss function more efficiently and therefore learns faster. Any density estimation method that can approximate the trajectory density can provide a more efficient proposal distribution $q ( \tau )$ than the uniform distribution $p ( \tau )$ .
|
| 141 |
+
|
| 142 |
+
# 3.4 COMPARISON WITH PRIORITIZED EXPERIENCE REPLAY
|
| 143 |
+
|
| 144 |
+
To the best our knowledge, the most similar method to CDP is Prioritized Experience Replay (PER) (Schaul et al., 2015b). To combine PER with HER, we calculate the TD-error of each transition based on the randomly selected achieved goals. Then we prioritize the transitions with higher TDerrors for replay. It is known that PER can become very expensive in computational time (Schaul et al., 2015b), especially when the memory size $N$ is very large. The reason is that PER uses TDerrors for prioritization. After each update of the model, the agent needs to update the priorities of the transitions in the replay buffer, which is ${ \cal O } ( \log N )$ . In our experiments, see Section 4, we use the efficient implementation based on the ”sum-tree” data structure, which can be relatively efficiently updated and sampled from (Schaul et al., 2015b).
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 2: Mean test success rate with standard deviation in all six robot environments
|
| 148 |
+
|
| 149 |
+
Compared to PER, CDP is much faster in computational time because it only updates the trajectory density once per epoch. Due to this reason, CDP is much more efficient than PER in computational time and can be easily combined with any multi-goal RL methods, such as DDPG and HER. In the experiments, Section 4, we first compare the performance improvement of CDP and PER. Afterwards, we compare the time-complexity of PER and CDP. We show that CDP improves performance with much less computational time than PER. Furthermore, the motivations of PER and CDP are different. The former uses TD-errors, while the latter is based on the density of the trajectories.
|
| 150 |
+
|
| 151 |
+
# 4 EXPERIMENTS
|
| 152 |
+
|
| 153 |
+
In this section, we investigate the following questions:
|
| 154 |
+
|
| 155 |
+
- Does incorporating CDP bring benefits to DDPG or DDPG $^ +$ HER? - Does CDP improve the sample-efficiency in robotic manipulation tasks? - How does the density $\bar { \rho }$ relate to the TD-errors of the trajectory during training?
|
| 156 |
+
|
| 157 |
+
Performance: To test the performance difference among DDPG, DDPG $^ +$ PER, and DDPG+CDP, we run the experiment in the three robot arm environments. We use the DDPG as the baseline here because the robot arm environment is relatively simple. In the more challenging robot hand environments, we use DDPG $^ +$ HER as the baseline method and test the performance among DDPG $+$ HER, $\mathrm { D D P G + H E R + P E R }$ , and DDPG $+$ HER $^ +$ CDP.
|
| 158 |
+
|
| 159 |
+
We compare the mean success rates. Each experiment is carried out across 5 random seeds and the shaded area represents the standard deviation. The learning curve with respect to training epochs is shown in Figure 2. For all experiments, we use 19 CPUs and train the agent for 200 epochs. After training, we use the best-learned policy as the final policy and test it in the environment. The testing results are the final mean success rates. A comparison of the final performances along with the training time is shown in Table 1.
|
| 160 |
+
|
| 161 |
+
Table 1: Final mean success rate $( \% )$ and the training time (hour) for all six environments
|
| 162 |
+
|
| 163 |
+
<table><tr><td></td><td colspan="2">Push</td><td colspan="2">Pick&Place</td><td colspan="2">Slide</td></tr><tr><td>Method</td><td>success</td><td>time</td><td>success</td><td>time</td><td>success</td><td>time</td></tr><tr><td>DDPG</td><td>99.90%</td><td>5.52h</td><td>39.34%</td><td>5.61h</td><td>75.67%</td><td>5.47h</td></tr><tr><td>DDPG+PER</td><td>99.94%</td><td>30.66h</td><td>67.19%</td><td>25.73h</td><td>66.33%</td><td>25.85h</td></tr><tr><td>DDPG+CDP</td><td>99.96%</td><td>6.76h</td><td>76.02%</td><td>6.92h</td><td>76.77%</td><td>6.66h</td></tr><tr><td></td><td colspan="2">Egg</td><td colspan="2">Block</td><td colspan="2">Pen</td></tr><tr><td>Method</td><td>success</td><td>time</td><td>success</td><td>time</td><td>success</td><td>time</td></tr><tr><td>DDPG+HER</td><td>76.19%</td><td>7.33h</td><td>20.32%</td><td>8.47h</td><td>27.28%</td><td>7.55h</td></tr><tr><td>DDPG+HER+PER</td><td>75.46%</td><td>79.86h</td><td>18.95%</td><td>80.72h</td><td>27.74%</td><td>81.17h</td></tr><tr><td>DDPG+HER+CDP</td><td>81.30%</td><td>17.00h</td><td>25.00%</td><td>19.88h</td><td>31.88%</td><td>25.36h</td></tr></table>
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 3: Number of training samples needed with respect to mean test success rate for all six environments (the lower the better)
|
| 167 |
+
|
| 168 |
+
From Figure 2, we can see that CDP converges faster in all six tasks than both the baseline and PER. The agent trained with CDP also shows a better performance at the end of the training, as shown in Table 1. In Table 1, we can see that the training time of CDP lies in between the baseline and PER. To be more specific, CDP consumes much less computational time than PER does. For example in the robot arm environments, on average DDPG $^ +$ CDP consumes about 1.2 times the training time of DDPG. In comparison, DDPG $^ +$ PER consumes about 5 times the training time as DDPG does. In this case, CDP is 4 times faster than PER.
|
| 169 |
+
|
| 170 |
+
Table 1 shows that baseline methods with CDP give a better performance in all six tasks. The improvement goes up to 39.34 percentage points compared to the baseline methods. The average improvement over the six tasks is 9.15 percentage points. We can see that CDP is a simple yet effective method, improves state-of-the-art methods.
|
| 171 |
+
|
| 172 |
+
Sample-Efficiency: To compare the sample-efficiency of the baseline and CDP, we compare the number of training samples needed for a certain mean test success rate. The comparison is shown in Figure 3. From Figure 3, in the FetchPush-v0 environment, we can see that for the same $9 9 \%$ mean test success rate, the baseline DDPG needs 273,600 samples for training, while $\mathrm { \Delta D D P G + C D P }$ only needs 112,100 samples. In this case, DDPG $^ +$ CDP is more than twice (2.44) as sample-efficient as DDPG. Similarly, in the other five environments, CDP improves sample-efficiency by factors of 2.84, 0.92, 1.37, 1,28 and 2.87, respectively. In conclusion, for all six environments, CDP is able to improve sample-efficiency by an average factor of two (1.95) over the baseline’s sample-efficiency.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 4: Pearson correlation between the density $\bar { \rho }$ and TD-errors in the middle of training
|
| 176 |
+
|
| 177 |
+
Insights: We also investigate the correlation between the complementary trajectory density $\bar { \rho }$ and the TD-errors of the trajectory. The Pearson correlation coefficient, i.e. Pearson’s r (Benesty et al., 2009), between the density $\bar { \rho }$ and the TD-errors of the trajectory is shown in Figure 4. The value of Pearson’s r is between 1 and -1, where 1 is total positive linear correlation, 0 is no linear correlation, -1 is total negative linear correlation. In Figure 4, we can see that the complementary trajectory density is correlated with the TD-errors of the trajectory with an average Pearson’s r of 0.7. This proves that the relatively rare trajectories in the memory buffer are more valuable for learning. Therefore, it is helpful to prioritize the trajectories with lower density during training.
|
| 178 |
+
|
| 179 |
+
# 5 RELATED WORK
|
| 180 |
+
|
| 181 |
+
Experience replay was proposed by Lin (1992) and became popular due to the success of DQN (Mnih et al., 2015). In the same year, prioritized experience replay was introduced by Schaul et al. (2015b) as an improvement of the experience replay in DQN. It prioritized the transitions with higher TD-error in the replay buffer to speed up training. Schaul et al. (2015a) also proposed universal function approximators, generalizing not just over states but also over goals. There are also many other research works about multi-task RL (Schmidhuber & Huber, 1990; Caruana, 1998; Da Silva et al., 2012; Kober et al., 2012; Pinto & Gupta, 2017; Foster & Dayan, 2002; Sutton et al., 2011). Hindsight experience replay (Andrychowicz et al., 2017) is a kind of goal-conditioned RL that substitutes any achieved goals as real goals to encourage the agent to learn something instead of nothing.
|
| 182 |
+
|
| 183 |
+
Curiosity-driven exploration is a well-studied topic in reinforcement learning (Oudeyer & Kaplan, 2009; Oudeyer et al., 2007; Schmidhuber, 1991; 2010; Sun et al., 2011). Pathak et al. (2017) encourage the agent to explore states with high prediction error. The agents are also encouraged to explore ”novel” or uncertain states (Bellemare et al., 2016; Lopes et al., 2012; Poupart et al., 2006; Houthooft et al., 2016; Mohamed & Rezende, 2015; Chentanez et al., 2005; Stadie et al., 2015).
|
| 184 |
+
|
| 185 |
+
However, we integrate curiosity into prioritization and tackle the problem of data imbalance (Galar et al., 2012) in the memory buffer of RL agents. A recent work (Narasimhan et al., 2015) introduced a form of re-sampling for RL agents based on positive and negative rewards. The idea of our method is complementary and can be combined. The motivation of our method is from the curiosity mechanism in the human brain (Gruber et al., 2014). The essence of our method is to assign priority to the achieved trajectories with lower density, which are relatively more valuable to learn from. In supervised learning, similar tricks are used to mitigate the class imbalance challenge, such as over-sampling the data in the under-represented class (Hinton, 2007; He & Garcia, 2008).
|
| 186 |
+
|
| 187 |
+
# 6 CONCLUSION
|
| 188 |
+
|
| 189 |
+
In conclusion, we proposed a simple yet effective curiosity-driven approach to prioritize agent’s experience based on the trajectory density. Curiosity-Driven Prioritization shows promising experimental results in all six challenging robotic manipulation tasks. This method can be combined with any off-policy RL methods, such as DDPG and DDPG $^ +$ HER. We integrated the curiosity mechanism via density estimation into the modern RL paradigm and improved sample-efficiency by a factor of two and the final performance by nine percentage points on top of state-of-the-art methods.
|
| 190 |
+
|
| 191 |
+
# REFERENCES
|
| 192 |
+
|
| 193 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in Neural Information Processing Systems, pp. 5048–5058, 2017.
|
| 194 |
+
|
| 195 |
+
Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016.
|
| 196 |
+
|
| 197 |
+
Jacob Benesty, Jingdong Chen, Yiteng Huang, and Israel Cohen. Pearson correlation coefficient. In Noise reduction in speech processing, pp. 1–4. Springer, 2009.
|
| 198 |
+
|
| 199 |
+
David M Blei, Michael I Jordan, et al. Variational inference for dirichlet process mixtures. Bayesian analysis, 1(1):121–143, 2006.
|
| 200 |
+
|
| 201 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 202 |
+
|
| 203 |
+
Mateusz Buda, Atsuto Maki, and Maciej A Mazurowski. A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks, 106:249–259, 2018.
|
| 204 |
+
|
| 205 |
+
Rich Caruana. Multitask learning. In Learning to learn, pp. 95–133. Springer, 1998.
|
| 206 |
+
|
| 207 |
+
Yevgen Chebotar, Mrinal Kalakrishnan, Ali Yahya, Adrian Li, Stefan Schaal, and Sergey Levine. Path integral guided policy search. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 3381–3388. IEEE, 2017.
|
| 208 |
+
|
| 209 |
+
Nuttapong Chentanez, Andrew G Barto, and Satinder P Singh. Intrinsically motivated reinforcement learning. In Advances in neural information processing systems, pp. 1281–1288, 2005.
|
| 210 |
+
|
| 211 |
+
Bruno Da Silva, George Konidaris, and Andrew Barto. Learning parameterized skills. arXiv preprint arXiv:1206.6398, 2012.
|
| 212 |
+
|
| 213 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. Ieee, 2009.
|
| 214 |
+
|
| 215 |
+
Richard O Duda and Peter E Hart. Pattern classification and scene analysis. A Wiley-Interscience Publication, New York: Wiley, 1973, 1973.
|
| 216 |
+
|
| 217 |
+
Pedro Felzenszwalb, David McAllester, and Deva Ramanan. A discriminatively trained, multiscale, deformable part model. In Computer Vision and Pattern Recognition, 2008. CVPR 2008. IEEE Conference on, pp. 1–8. IEEE, 2008.
|
| 218 |
+
|
| 219 |
+
David Foster and Peter Dayan. Structure in the space of value functions. Machine Learning, 49 (2-3):325–346, 2002.
|
| 220 |
+
|
| 221 |
+
Mikel Galar, Alberto Fernandez, Edurne Barrenechea, Humberto Bustince, and Francisco Herrera. A review on ensembles for the class imbalance problem: bagging-, boosting-, and hybrid-based approaches. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 42(4):463–484, 2012.
|
| 222 |
+
|
| 223 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT press Cambridge, 2016.
|
| 224 |
+
|
| 225 |
+
Matthias J Gruber, Bernard D Gelman, and Charan Ranganath. States of curiosity modulate hippocampus-dependent learning via the dopaminergic circuit. Neuron, 84(2):486–496, 2014.
|
| 226 |
+
|
| 227 |
+
Haibo He and Edwardo A Garcia. Learning from imbalanced data. IEEE Transactions on Knowledge & Data Engineering, (9):1263–1284, 2008.
|
| 228 |
+
|
| 229 |
+
Geoffrey E Hinton. To recognize shapes, first learn to generate images. Progress in brain research, 165:535–547, 2007.
|
| 230 |
+
|
| 231 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pp. 1109–1117, 2016.
|
| 232 |
+
|
| 233 |
+
Jens Kober, Andreas Wilhelm, Erhan Oztop, and Jan Peters. Reinforcement learning to adjust parametrized motor primitives to new situations. Autonomous Robots, 33(4):361–379, 2012.
|
| 234 |
+
|
| 235 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
|
| 236 |
+
|
| 237 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 238 |
+
|
| 239 |
+
Long-Ji Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3-4):293–321, 1992.
|
| 240 |
+
|
| 241 |
+
Manuel Lopes, Tobias Lang, Marc Toussaint, and Pierre-Yves Oudeyer. Exploration in modelbased reinforcement learning by empirically estimating learning progress. In Advances in Neural Information Processing Systems, pp. 206–214, 2012.
|
| 242 |
+
|
| 243 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
|
| 244 |
+
|
| 245 |
+
Shakir Mohamed and Danilo Jimenez Rezende. Variational information maximisation for intrinsically motivated reinforcement learning. In Advances in neural information processing systems, pp. 2125–2133, 2015.
|
| 246 |
+
|
| 247 |
+
Kevin P Murphy. Machine learning: A probabilistic perspective. adaptive computation and machine learning, 2012.
|
| 248 |
+
|
| 249 |
+
Karthik Narasimhan, Tejas Kulkarni, and Regina Barzilay. Language understanding for text-based games using deep reinforcement learning. arXiv preprint arXiv:1506.08941, 2015.
|
| 250 |
+
|
| 251 |
+
Andrew Y Ng, Adam Coates, Mark Diel, Varun Ganapathi, Jamie Schulte, Ben Tse, Eric Berger, and Eric Liang. Autonomous inverted helicopter flight via reinforcement learning. In Experimental Robotics IX, pp. 363–372. Springer, 2006.
|
| 252 |
+
|
| 253 |
+
Pierre-Yves Oudeyer and Frederic Kaplan. What is intrinsic motivation? a typology of computational approaches. Frontiers in neurorobotics, 1:6, 2009.
|
| 254 |
+
|
| 255 |
+
Pierre-Yves Oudeyer, Frdric Kaplan, and Verena V Hafner. Intrinsic motivation systems for autonomous mental development. IEEE transactions on evolutionary computation, 11(2):265–286, 2007.
|
| 256 |
+
|
| 257 |
+
Art B. Owen. Monte Carlo theory, methods and examples. 2013.
|
| 258 |
+
|
| 259 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning (ICML), volume 2017, 2017.
|
| 260 |
+
|
| 261 |
+
Jan Peters and Stefan Schaal. Reinforcement learning of motor skills with policy gradients. Neural networks, 21(4):682–697, 2008.
|
| 262 |
+
|
| 263 |
+
Lerrel Pinto and Abhinav Gupta. Learning to push by grasping: Using multiple tasks for effective learning. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 2161– 2168. IEEE, 2017.
|
| 264 |
+
|
| 265 |
+
Matthias Plappert, Marcin Andrychowicz, Alex Ray, Bob McGrew, Bowen Baker, Glenn Powell, Jonas Schneider, Josh Tobin, Maciek Chociej, Peter Welinder, et al. Multi-goal reinforcement learning: Challenging robotics environments and request for research. arXiv preprint arXiv:1802.09464, 2018.
|
| 266 |
+
|
| 267 |
+
Pascal Poupart, Nikos Vlassis, Jesse Hoey, and Kevin Regan. An analytic solution to discrete bayesian reinforcement learning. In Proceedings of the 23rd international conference on Machine learning, pp. 697–704. ACM, 2006.
|
| 268 |
+
|
| 269 |
+
Murray Rosenblatt. Remarks on some nonparametric estimates of a density function. The Annals of Mathematical Statistics, pp. 832–837, 1956.
|
| 270 |
+
|
| 271 |
+
Tom Schaul, Daniel Horgan, Karol Gregor, and David Silver. Universal value function approximators. In International Conference on Machine Learning, pp. 1312–1320, 2015a.
|
| 272 |
+
|
| 273 |
+
Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015b.
|
| 274 |
+
|
| 275 |
+
Jurgen Schmidhuber. A possibility for implementing curiosity and boredom in model-building neu- ¨ ral controllers. In Proc. of the international conference on simulation of adaptive behavior: From animals to animats, pp. 222–227, 1991.
|
| 276 |
+
|
| 277 |
+
Jurgen Schmidhuber. Formal theory of creativity, fun, and intrinsic motivation (1990–2010). ¨ IEEE Transactions on Autonomous Mental Development, 2(3):230–247, 2010.
|
| 278 |
+
|
| 279 |
+
Jurgen Schmidhuber and Rudolf Huber. ¨ Learning to generate focus trajectories for attentive vision. Institut fur Informatik, 1990. ¨
|
| 280 |
+
|
| 281 |
+
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. nature, 529(7587):484–489, 2016.
|
| 282 |
+
|
| 283 |
+
Bradly C Stadie, Sergey Levine, and Pieter Abbeel. Incentivizing exploration in reinforcement learning with deep predictive models. arXiv preprint arXiv:1507.00814, 2015.
|
| 284 |
+
|
| 285 |
+
Yi Sun, Faustino Gomez, and Jurgen Schmidhuber. Planning to be surprised: Optimal bayesian ¨ exploration in dynamic environments. In International Conference on Artificial General Intelligence, pp. 41–51. Springer, 2011.
|
| 286 |
+
|
| 287 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998.
|
| 288 |
+
|
| 289 |
+
Richard S Sutton, Joseph Modayil, Michael Delp, Thomas Degris, Patrick M Pilarski, Adam White, and Doina Precup. Horde: A scalable real-time architecture for learning knowledge from unsupervised sensorimotor interaction. In The 10th International Conference on Autonomous Agents and Multiagent Systems-Volume 2, pp. 761–768. International Foundation for Autonomous Agents and Multiagent Systems, 2011.
|
| 290 |
+
|
| 291 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026– 5033. IEEE, 2012.
|
md/train/SkqMSCHxe/SkqMSCHxe.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PREDICTION OF POTENTIAL HUMAN INTENTION USING SUPERVISED COMPETITIVE LEARNING
|
| 2 |
+
|
| 3 |
+
Masayoshi Ishikawa, Mariko Okude, Takehisa Nishida & Kazuo Muto
|
| 4 |
+
Hitachi, Ltd
|
| 5 |
+
Omika 7-1-1, Hitachi, Ibaraki, JAPAN
|
| 6 |
+
{masayoshi.ishikawa.gv, mariko.okude.uh}@hitachi.com
|
| 7 |
+
{takehisa.nishida.cu, kazuo.muto.ny}@hitachi.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We propose a learning method to quantify human intention. Generally, a human being will imagine several potential actions for a given scene, but only one of these actions will subsequently be taken. This makes it difficult to quantify human intentions.
|
| 12 |
+
|
| 13 |
+
To solve this problem, we apply competitive learning to human behavior prediction as supervised learning. In our approach, competitive learning generates several outputs that are then associated with several potential situations imagined by a human. We applied the proposed method to human driving behavior and extracted three potential driving patterns. Results showed a squared error is reduced to 1/25 that of a conventional method . We also found that competitive learning can distinguish valid data from disturbance data in order to train a model.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Progress in advanced driving assistance systems (ADASs) has led to an autonomous driving function applicable for highway driving . The vehicle control logic of ADAS is typically developed by hand. There are a few related works on controlling vehicles comfortably , but the complex nature of vehicle environments prevents development by hand. Therefore, recent research has focused on the application of machine learning to autonomous driving systems. The convolutional neural network (CNN) shows particular promise as a core algorithm (Krizhevsky et al. (2012)). C. Chen & Xiao (2015) estimates affordance for driving directly from a front camera image. They train a CNN to generate key perception indicators from images to easily control a vehicle. Similarly, Bojarski et al. (2016) predict the desired steering command directly from front camera images. They train a CNN with a human command as training data and drive in traffic on local roads with or without lane marking and on highways.
|
| 18 |
+
|
| 19 |
+
Our objective is to provide drivers with a comfortable trip featuring automatic vehicle control . The above methods provide a uniform control for various scenarios, but drivers have an assortment of preference behaviors, and individuals may drive in different ways even if the scenario or situation is the same. For example, on the highway, one person might drive hard to arrive at a destination quickly while another might drive relatively slowly to arrive at a destination safely. Therefore, we want to provide autonomous driving adapted to each individual to improve ease of driving and to generate control targets that imitate individual behavior. To imitate individual behavior, we predict future vehicle states resulting from an individualfs decision.
|
| 20 |
+
|
| 21 |
+
There are many studies on the imitation of human behavior within the context of driving. Ma & Andreasson ´ (2006) proposed a vehicle interaction model that predicts future acceleration on the basis of current acceleration, velocity, relative velocity, and relative distance of the preceding vehicle. Moon & Choi (2011) proposed a method to predict human steering behavior. Their model considers path planning, feed-forward steering, and feedback steering. While these methods consider only acceleration or steering, Gindele et al. (2010) proposed a more complex model, the dynamic Bayesian network model, to estimate driver behavior and vehicle trajectory. This model considers vehicle model, trajectory, driver decision, and situation context. Wada et al. (2007) proposed a method to predict braking behavior. This method monitors the size of a preceding vehicle by means of front camera images to detect collision risk.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Graphical model of driving behavior.
|
| 25 |
+
|
| 26 |
+
These methods provide one output for one scene. However, we assume that one output might represent just one part of a driverfs behavior. We assume a driver will imagine several potential situations for one scene and have several potential actions to take associated with each situation. This means the driver is making decisions all the time. Therefore, we want to extract several of the driver’s candidate actions or intentions for the autonomous control of a vehicle while considering various potential situations.
|
| 27 |
+
|
| 28 |
+
In this paper, we propose a method to extract a driver’s potential intention by utilizing competitive learning (Ahalt et al. (1990), Shinozaki & Naruse (2013), Osoba & Kosko (2013)). Originally, competitive learning was used for unsupervised neural network algorithms and functioned as clustering. In such competitive learning, neural networks have several output layers and only one path that outputs the smallest loss to be trained . Consequently, neural networks predict the cluster with the most activated units .
|
| 29 |
+
|
| 30 |
+
Ahalt et al. (1990) compare several competitive learning algorithms. In this paper, competitive learning algorithms is dealt as a kind of vector quantization algorithms. Shinozaki & Naruse (2013) utilize competitive learning for pre-training of deep neural networks and they also use competitive learning as unsupervised learning. Osoba & Kosko (2013) consider supervised competitive learning. However, they use also competitive learning as a kind of clustering methods. Therefore, in our best knowledge, competitive learning is dealt as a kind of unsupervised learning algorithms or clustering algorithms.
|
| 31 |
+
|
| 32 |
+
We apply competitive learning to time series supervised learning, especially, regression task. And we train neural networks to output several patterns associated with a driver’s potential intentions. In this paper, we describe how to model the driving behavior with competitive learning architecture . Additionally, we show the experimental results of tests performed with an actual vehicle.
|
| 33 |
+
|
| 34 |
+
# 2 DRIVER BEHAVIOR MODEL
|
| 35 |
+
|
| 36 |
+
Here, we describe how to model driving behavior and how to implement the neural network architecture.
|
| 37 |
+
|
| 38 |
+
Our driving behavior model is a dynamic system that includes both a driver and a vehicle system. In this model, the driver observes the environment and then decides on a driving action, e.g., steering or pedal operation. The vehicle system then changes its state depending on the driving action and the state of the vehicle at a previous time. Finally, we observe the various vehicle states. For example, the environment observed by the driver is the same as that shown by the front camera and the vehicle states include travel speed, accelerations, gas pedal position, brake pedal position, engine speed, engine load, engine temperature, fuel level, fuel temperature, cooling water temperature, etc.
|
| 39 |
+
|
| 40 |
+
A graphical model of driving behavior is shown in Fig. 1. Here, $e$ stands for the environment observed by the driver, $d$ stands for the driving action decided by the driver, $s$ stands for vehicle states, and $x$ stands for observed vehicle states. Subscripts $t - 1$ and $t$ refer to time steps. Environment $e$ and parts of vehicle states $x$ are observed. Driving action $d$ and whole vehicle states $s$ are latent variables. We assume a front camera view for environment $e$ . Observed variables $x$ include travel speed, gas pedal position, engine speed, and engine load.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 2: Neural network architecture designed to imitate driving model.
|
| 44 |
+
|
| 45 |
+
To ensure comfortable driving, we estimate the driver’s intention by predicting vehicle states in $\mathbf { k }$ step future . The relations between each variable are shown in the following equations.
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { r c l } { { d _ { t } } } & { { = } } & { { f _ { e } ( e _ { t } ; \theta _ { e } ) } } \\ { { s _ { t } } } & { { = } } & { { f _ { s } ( s _ { t - 1 } ; \theta _ { s } ) + f _ { d } ( , d _ { t } ; \theta _ { d } ) } } \\ { { x _ { t } } } & { { = } } & { { f _ { x } ( s _ { t } ; \theta _ { x } ) } } \\ { { x _ { t + k } } } & { { = } } & { { f _ { x + k } ( s _ { t } ; \theta _ { x + k } ) } } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Additionally, we compensate for latent variable $s _ { t }$ by observable variable $x _ { t }$ . The compensated $s _ { t }$ are shown in Eq. 5:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
s _ { t } = f _ { s } ( s _ { t - 1 } ; \theta _ { s } ) + f _ { d } ( , d _ { t } ; \theta _ { d } ) + f _ { x } ^ { - 1 } ( x _ { t } ; \theta _ { x } ^ { - 1 }
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
We design the neural network architecture in accordance with the driving behavior model shown in Fig. 1. The designed architecture is shown in Fig. 2. First, we select convolutional neural network (CNN) layers to approximate driving action $f _ { e }$ , as the driver decides which action to take depending on the front view and CNN is the best layer to process images. The front camera images are resized to $2 5 6 \times 2 5 6$ with RGB channels. Second, we select a recurrent neural network (RNN) layer to approximate vehicle states $f _ { s }$ , as our driver model is a dynamic system (Graves (2013)). Finally, we select a fully connected layer for other layers $f _ { d } , f _ { x } ^ { - 1 } , f _ { x + k }$ because of its usability. This model predicts observed variables and we train the driver behavior model by loss function. We select squared error as loss function $L ( x _ { t + k } , \hat { x } _ { t + k } )$ and update parameters by backpropagation (Hecht-NielsenWerbos (1990)).
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
L ( x _ { t + k } , \hat { x } _ { t + k } ) = | x _ { t + k } - \hat { x } _ { t + k } | ^ { 2 }
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
The CNN consists of three layers. In the first layer, kernel size is $1 1 \times 1 1$ with 64 channels and stride 4 . In the second layer, kernel size is $5 \times 5$ with 128 channels. In the third layer, kernel size is $3 \times 3$ with 128 channels. After all CNN layers, we apply batch normalization, ReLU, and max pooling (Ioffe & Szegedy (2015)). The RNN layer has 1024 units. We use the ADAM algorithm for optimization (Kingma & Ba (2014)).
|
| 64 |
+
|
| 65 |
+
The architecture shown in Fig. 2 is a baseline architecture and cannot extract potential driver intentions. In the next section, we introduce a competitive learning architecture that can extract potential intentions and discuss how to train it.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 3: Competitive learning architecture.
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 4: Backpropagation in competitive learning architecture.
|
| 72 |
+
|
| 73 |
+
# 3 COMPETITIVE LEARNING FOR DRIVER BEHAVIOR MODEL
|
| 74 |
+
|
| 75 |
+
# 3.1 COMPETITIVE LEARNING ARCHITECTURE
|
| 76 |
+
|
| 77 |
+
The competitive learning architecture is shown in Fig. 3. It has $N _ { o }$ output layers. Additionally, we set up $N _ { o }$ RNN layers, as the driver’s potential intentions are separated depending on the driving actions . Therefore, a separated RNN will be affected by separated intentions. The i-th RNN i and the output layer generate i-th prediction $\hat { x } _ { t + k } ^ { i }$ at time $\mathbf { t } { + } \mathbf { k }$ . We calculate i-th loss using Eq. 7 and decide the loss for backpropagation using Eq. 9. Finally, we update the parameters depending on this loss for backpropagation.
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { c c l } { { l ^ { i } } } & { { = } } & { { L ( x _ { t + k } , \hat { x } _ { t + k } ^ { i } ) } } \\ { { L } } & { { = } } & { { [ l ^ { 1 } , . . . l ^ { i } , . . l ^ { N _ { o } } ] } } \\ { { } } & { { } } & { { } } \\ { { l _ { b p } ^ { i } } } & { { = } } & { { \left\{ \begin{array} { c } { { 0 i \ne \arg \operatorname* { m i n } ( L ) } } \\ { { l ^ { i } i = \arg \operatorname* { m i n } ( L ) } } \end{array} \right. } } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Backpropagation in the competitive learning architecture is shown in Fig. 4. In the competitive learning architecture, we train only the computation path that output minimum loss. In Fig. 4, the computation path to be trained is indicated by solid lines and the layer whose parameters are not updated is indicated by dashed lines. In this case, the i-th output layer has minimum loss and is trained. The other output layers (i.e., whose losses are bigger than i-th) are not trained and the losses are compensated as zero. Since each output layer is trained by different data, each prediction reflects different intentions. Therefore, competitive learning can extract several potential intentions.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 5: Pre-training for competitive learning architecture.
|
| 87 |
+
|
| 88 |
+
# 3.2 PRE-TRAINING FOR COMPETITIVE LEARNING
|
| 89 |
+
|
| 90 |
+
Here, we discuss the pre-training for competitive learning. In our experiments, competitive layers with simple initialization are difficult to train, and many experiments result in only one output layer being trained. Since only one computation path is trained at a time in competitive learning, how the trained path is decided depends on the initialization. Therefore, we need to ensure appropriate initialization for competitive layers. To this end , we adopt a pre-training technique for competitive learning (Erhan et al. (2010), Erhan et al.). Pre-training is an initialization technique for neural networks and is typically used for stacking neural networks. In this work, we apply pre-training to initialize the parallel competitive layer, as shown in Fig. 5. First, we train only one output layer by means of the ordinal loss function in Eq. 6. Then, we initialize competitive layers by copying pre-trained parameters. Finally, we train each output layer as fine-tuning.
|
| 91 |
+
|
| 92 |
+
# 4 EXPERIMENTAL RESULTS
|
| 93 |
+
|
| 94 |
+
In order to evaluate the proposed method, we record the front camera view using a smartphone and collect actual vehicle data using OBD2 (Birnbaum & Truglia (2000), International (2003)). The data on vehicle states are whitened by removing means and scaled variances. Front camera images and vehicle data are resampled to $2 \ \mathrm { H z }$ . Six steps (equivalent to three seconds in the future) are predicted. We collect 80 minutes of data and use 40 minutes to train the neural networks. We set three competitive layers and train 300 iterations for pre-training and 2000 iterations for fine-tuning. We train neural networks with TITAN Z and use the Chainer framework (Tokui et al. (2015)).
|
| 95 |
+
|
| 96 |
+
# 4.1 COMPARISON OF COMPETITIVE LEARNING ARCHITECTURE WITH BASELINE ARCHITECTURE
|
| 97 |
+
|
| 98 |
+
Before we show the competitive learning results, we present the results of the baseline architecture shown in Fig. 6 . These data are predictions of vehicle speed over ten minutes. The left figure is the prediction on training data and the right one is on test data. Red line indicates the measured speed and blue line indicates the prediction by baseline architecture. In the training data, the baseline architecture could predict accurately in the low speed band under $3 0 \mathrm { k m / h }$ . However, the prediction error became bigger in the middle-high speed band over $3 0 ~ \mathrm { k m / h }$ . In the higher speed band, the driverfs action had several variations even when the vehicle was operating in the same environment. This variation made prediction difficult. In the test data prediction, prediction error became bigger in not only the high speed band but also the very low speed band around $0 { \mathrm { k m } } / { \mathrm { h } }$ . Additionally, the timing of the acceleration or deceleration shifted later, too. This is because the baseline architecture cannot extract potential driving intentions.
|
| 99 |
+
|
| 100 |
+
The competitive learning results are shown in Fig. 7. This figure is written up the same way as Fig. 6, except the blue line refers to integrated predictions by the competitive learning architecture. These predictions are a combination of three outputs derived by selecting minimum loss. In the training data prediction, the competitive learning architecture predicted a value quite close to the measured vehicle speed before three seconds . In the test data prediction, the competitive learning architecture could also predict the speed accurately. Additionally, the timing shift of acceleration or deceleration became smaller. The loss summation in both the training and test data is listed in Table 1. Competitive learning architecture loss was about 1/25 smaller in the training data and about 1/3 smaller in the test data compared with the baseline architecture.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 6: Prediction of baseline architecture on training data (left) and test data (right).
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 7: Integrated prediction of competitive architecture on training data (left) and test data (right).
|
| 107 |
+
|
| 108 |
+
# 4.2 COMPETITIVE LEARNING PREDICTION ASSOCIATED WITH POTENTIAL INTENTIONS
|
| 109 |
+
|
| 110 |
+
Here, we show the driving intentions extracted using the competitive learning architecture. The intentions extracted from the training data are shown in Fig. 8. Four time series data are included: upper left is the integrated prediction, upper right is the first output layer’s prediction (indicated by green line), lower left is the second output prediction (blue line), and lower right is the third output prediction (purple line). The red lines are the measured vehicle speed. The upper left figure depicts the winning output prediction, where the minimum error prediction is output for each time and the line color refers to the winning output layer . For example, the purple line in the upper left figure is the prediction by the third output layer . We can see that each output layer is affected by other driving intentions. The first output layer accurately predicted the stop timing associated with the stop intention, the second output layer accurately predicted the acceleration or high speed band associated with a rapid intention, and the third output layer accurately predicted the deceleration timing associated with a careful intention. We also show the results of the test data in Fig. 9, which are written the same as the training data in Fig. 8. Trained intentions are also valid in test data because the first output was accurate at stop time, the second output was accurate at acceleration or the high speed band, and the third output was accurate at the time of deceleration. Therefore, extracting these potential intentions enables accurate prediction.
|
| 111 |
+
|
| 112 |
+
Table 1: Summation loss of each architecture
|
| 113 |
+
|
| 114 |
+
<table><tr><td>Architecture</td><td>Loss (training)</td><td>Loss (test)</td></tr><tr><td>Baseline</td><td>335.8</td><td>2603</td></tr><tr><td>Competitive learning</td><td>13.14</td><td>816.4</td></tr></table>
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 8: Driving intentions extracted by competitive learning architecture; training data.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 9: Driving intentions extracted by competitive learning architecture; test data.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 10: Competitive layer outputs without pre-training in training data.
|
| 124 |
+
|
| 125 |
+
Table 2: Summation loss without pre-training
|
| 126 |
+
|
| 127 |
+
<table><tr><td>Architecture</td><td>Loss (training)</td><td>Loss (test)</td></tr><tr><td>Baseline</td><td>335.8</td><td>2603</td></tr><tr><td>Competitive learning</td><td>13.14</td><td>816.4</td></tr><tr><td>Competitive learning without pre-training</td><td>164.0</td><td>870.9</td></tr></table>
|
| 128 |
+
|
| 129 |
+
# 4.3 EFFECT OF PRE-TRAINING
|
| 130 |
+
|
| 131 |
+
The competitive learning result without pre-training is shown in Fig. 10. We can train ”only one” output layer to predict driver intention even if we have three output layers. Potential intentions of the driver have similar trends. Therefore, we require the initialization of several of the same output layers . We can extract potential intentions by training each output layer using other data.
|
| 132 |
+
|
| 133 |
+
We show the summation loss in Table 2. Surprisingly, competitive learning without pre-training significantly improved its losses by about $1 / 2$ for training data and about 1/3 for test data. We consider the second and third output layers to play an important role, even though they cannot learn potential intentions. There is usually a lot of inadequate data to train, and these data disrupt the training of the model. However, in most cases we cannot distinguish useful data from disturbance data. In the competitive learning architecture, each output layer automatically selects data to train its computation path. This selection might distinguish useful data from disturbance data, and the first output layer can be trained using just the useful data, even though other output layers are trained using inadequate data. In this way, competitive learning can train the model such that it is robust against noisy data.
|
| 134 |
+
|
| 135 |
+
# 5 CONCLUSION
|
| 136 |
+
|
| 137 |
+
We proposed supervised competitive learning to imitate a driver’s potential intentions. Competitive learning was applied to supervised learning and the squared error was reduced to 1/25 that of a conventional method. We also demonstrated that competitive learning can distinguish valid data from disturbance data to train a model.
|
| 138 |
+
|
| 139 |
+
# REFERENCES
|
| 140 |
+
|
| 141 |
+
Stanley C Ahalt, Ashok K Krishnamurthy, Prakoon Chen, and Douglas E Melton. Competitive learning algorithms for vector quantization. Neural networks, 3(3):277–290, 1990.
|
| 142 |
+
|
| 143 |
+
Ralph Birnbaum and Jerry Truglia. Getting to Know OBD II. New York, 2000.
|
| 144 |
+
|
| 145 |
+
Mariusz Bojarski, Davide Del Testa, Daniel Dworakowski, Bernhard Firner, Beat Flepp, Prasoon Goyal, Lawrence D Jackel, Mathew Monfort, Urs Muller, Jiakai Zhang, et al. End to end learning for self-driving cars. arXiv preprint arXiv:1604.07316, 2016.
|
| 146 |
+
|
| 147 |
+
A. Kornhauser C. Chen, A. Seff and J. Xiao. Deepdriving: Learning affordance for direct perception in autonomous driving. In Proceedings of 15th IEEE International Conference on Computer Vision, 2015.
|
| 148 |
+
|
| 149 |
+
Dumitru Erhan, Pierre-Antoine Manzagol, Yoshua Bengio, Samy Bengio, and Pascal Vincent. The difficulty of training deep architectures and the effect of unsupervised pre-training.
|
| 150 |
+
|
| 151 |
+
Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? Journal of Machine Learning Research, 11(Feb):625–660, 2010.
|
| 152 |
+
|
| 153 |
+
Tobias Gindele, Sebastian Brechtel, and Rudiger Dillmann. A probabilistic model for estimating ¨ driver behaviors and vehicle trajectories in traffic environments. In Intelligent Transportation Systems (ITSC), 2010 13th International IEEE Conference on, pp. 1625–1631. IEEE, 2010.
|
| 154 |
+
|
| 155 |
+
Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
|
| 156 |
+
|
| 157 |
+
Robert Hecht-Nielsen. Theory of the backpropagation neural network. In Neural Networks, 1989. IJCNN., International Joint Conference on, pp. 593–605. IEEE.
|
| 158 |
+
|
| 159 |
+
SAE International. On-Board Diagnostics for Light and Medium Duty Vehicles Standards Manual. Pennsylvania, 2003.
|
| 160 |
+
|
| 161 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of The 32nd International Conference on Machine Learning, pp. 448–456, 2015.
|
| 162 |
+
|
| 163 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 164 |
+
|
| 165 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 166 |
+
|
| 167 |
+
Xiaoliang Ma and Ingmar Andreasson. Driver reaction time estimation from real car following data ´ and application in gm-type model evaluation. In Proceedings of the 85th TRB annual meeting, pp. 1–19, 2006.
|
| 168 |
+
|
| 169 |
+
Chulwoo Moon and Seibum B Choi. A driver model for vehicle lateral dynamics. International journal of vehicle design, 56(1-4):49–80, 2011.
|
| 170 |
+
|
| 171 |
+
Osonde Osoba and Bart Kosko. Noise-enhanced clustering and competitive learning algorithms. Neural Networks, 37:132–140, 2013.
|
| 172 |
+
|
| 173 |
+
Takashi Shinozaki and Yasushi Naruse. Competitive learning with feedforward supervisory signal for pre-trained multilayered networks. arXiv preprint arXiv:1312.5845, 2013.
|
| 174 |
+
|
| 175 |
+
Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton. Chainer: a nextgeneration open source framework for deep learning. In Proceedings of Workshop on Machine Learning Systems (LearningSys) in The Twenty-ninth Annual Conference on Neural Information Processing Systems (NIPS), 2015. URL http://learningsys.org/papers/LearningSys_2015_paper_33.pdf.
|
| 176 |
+
|
| 177 |
+
Takahiro Wada, Shun’ichi Doi, Keisuke Imai, Naohiko Tsuru, Kazuyoshi Isaji, and Hiroshi Kaneko. On driver’s braking behavior in car following. In SICE, 2007 Annual Conference, pp. 2396–2401. IEEE, 2007.
|
| 178 |
+
|
| 179 |
+
Paul J Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990.
|
md/train/SypU81Ole/SypU81Ole.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SAMPLING GENERATIVE NETWORKS
|
| 2 |
+
|
| 3 |
+
Tom White
|
| 4 |
+
School of Design
|
| 5 |
+
Victoria University of Wellington
|
| 6 |
+
Wellington, New Zealand
|
| 7 |
+
tom.white@vuw.ac.nz
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We introduce several techniques for sampling and visualizing the latent spaces of generative models. Replacing linear interpolation with spherical linear interpolation prevents diverging from a model’s prior distribution and produces sharper samples. J-Diagrams and MINE grids are introduced as visualizations of manifolds created by analogies and nearest neighbors. We demonstrate two new techniques for deriving attribute vectors: bias-corrected vectors with data replication and synthetic vectors with data augmentation. Binary classification using attribute vectors is presented as a technique supporting quantitative analysis of the latent space. Most techniques are intended to be independent of model type and examples are shown on both Variational Autoencoders and Generative Adversarial Networks.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Generative models are a popular approach to unsupervised machine learning. Generative neural network models are trained to produce data samples that resemble the training set. Because the number of model parameters is significantly smaller than the training data, the models are forced to discover efficient data representations. These models are sampled from a set of latent variables in a high dimensional space, here called a latent space. Latent space can be sampled to generate observable data values. Learned latent representations often also allow semantic operations with vector space arithmetic (Figure 1).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Schematic of the latent space of a generative model. In the general case, a generative model includes an encoder to map from the feature space (here images of faces) into a high dimensional latent space. Vector space arithmetic can be used in the latent space to perform semantic operations. The model also includes a decoder to map from the latent space back into the feature space, where the semantic operations can be observed. If the latent space transformation is the identity function we refer to the encoding and decoding as a reconstruction of the input through the model.
|
| 19 |
+
|
| 20 |
+
Generative models are often applied to datasets of images. Two popular generative models for image data are the Variational Autoencoder (VAE, Kingma & Welling, 2014) and the Generative Adversarial Network (GAN, Goodfellow et al., 2014). VAEs use the framework of probabilistic graphical models with an objective of maximizing a lower bound on the likelihood of the data. GANs instead formalize the training process as a competition between a generative network and a separate discriminative network. Though these two frameworks are very different, both construct high dimensional latent spaces that can be sampled to generate images resembling training set data. Moreover, these latent spaces are generally highly structured and can enable complex operations on the generated images by simple vector space arithmetic in the latent space (Larsen et al., 2016).
|
| 21 |
+
|
| 22 |
+
Generative models are beginning to find their way out of academia and into creative applications. In this paper we present techniques for improving the visual quality of generative models that are generally independent of the model itself. These include spherical linear interpolation, visualizing analogies with J-diagrams, and generating local manifolds with MINE grids. These techniques can be combined generate low dimensional embeddings of images close to the trained manifold. These can be used for visualization and creating realistic interpolations across latent space. Also by standardizing these operations independent of model type, the latent space of different generative models are more directly comparable with each other, exposing the strengths and weaknesses of various approaches.
|
| 23 |
+
|
| 24 |
+
Additionally, two new techniques for building latent space attribute vectors are introduced. On labeled datasets with correlated labels, data replication can be used to create bias-corrected vectors. Synthetic attributes vectors also can be derived via data augmentation on unlabeled data. Quantitative analysis of attribute vectors can be performed by using them as the basis for attribute binary classifiers.
|
| 25 |
+
|
| 26 |
+
# 2 SAMPLING TECHNIQUES
|
| 27 |
+
|
| 28 |
+
Generative models are often evaluated by examining samples from the latent space. Techniques frequently used are random sampling and linear interpolation. But often these can result in sampling the latent space from locations very far outside the manifold of probable locations.
|
| 29 |
+
|
| 30 |
+
Our work has followed two useful principles when sampling the latent space of a generative model. The first is to avoid sampling from locations that are highly unlikely given the prior of the model. This technique is very well established - including being used in the original VAE paper which adjusted sampling through the inverse CDF of the Gaussian to accommodate the Gaussian prior (Kingma & Welling, 2014). The second principle is to recognize that the dimensionality of the latent space is often artificially high and may contains dead zones that are not on the manifold learned during training. This has been demonstrated for VAE models (Makhzani et al., 2016) and implies that simply matching the model’s prior will not always be sufficient to yield samples that appear to have been drawn from the training set.
|
| 31 |
+
|
| 32 |
+
# 2.1 INTERPOLATION
|
| 33 |
+
|
| 34 |
+
Interpolation is used to traverse between two known locations in latent space. Research on generative models often uses interpolation as a way of demonstrating that a generative model has not simply memorized the training examples (eg: Radford et al., 2015, $\ S 6 . 1 \AA ,$ ). In creative applications interpolations can be used to provide smooth transitions between two decoded images.
|
| 35 |
+
|
| 36 |
+
Frequently linear interpolation is used, which is easily understood and implemented. But this is often inappropriate as the latent spaces of most generative models are high dimensional $( > 5 0$ dimensions) with a Gaussian or uniform prior. In such a space, linear interpolation traverses locations that are extremely unlikely given the prior. As a concrete example, consider a 100 dimensional space with the Gaussian prior $\scriptstyle \mu = 0$ , $\sigma { = } 1$ . Here all random vectors will generally a length very close to 10 (standard deviation $< 1$ ). However, linearly interpolating between any two will usually result in a "tent-pole" effect as the magnitude of the vector decreases from roughly 10 to 7 at the midpoint, which is over 4 standard deviations away from the expected length.
|
| 37 |
+
|
| 38 |
+
Our proposed solution is to use spherical linear interpolation slerp instead of linear interpolation. We use a formula introduced by (Shoemake 85) in the context of great arc inbetweening for rotation animations:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
S l e r p ( q _ { 1 } , q _ { 2 } ; \mu ) = \frac { \sin { ( 1 - \mu ) \theta } } { \sin { \theta } } q _ { 1 } + \frac { \sin { \mu \theta } } { \sin { \theta } } q _ { 2 }
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
This treats the interpolation as a great circle path on an n-dimensional hypersphere (with elevation changes). This technique has shown promising results on both VAE and GAN generative models and with both uniform and Gaussian priors (Figure 2).
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: DCGAN (Radford 15) interpolation pairs with identical endpoints and uniform prior. In each pair, the top series is linear interpolation and the bottom is spherical. Note the weak generations produced by linear interpolation at the center, which are not present in spherical interpolation.
|
| 48 |
+
|
| 49 |
+
# 2.2 ANALOGY
|
| 50 |
+
|
| 51 |
+
Analogy has been shown to capture regularities in continuous space models. In the latent space of some linguistic models “King – Man $^ +$ Woman” results in a vector very close to “Queen” (Mikolov et al., 2013). This technique has also been used in the context of deep generative models to solve visual analogies (Reed et al., 2015).
|
| 52 |
+
|
| 53 |
+
Analogies are usually written in the form:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
A : B : : C : ?
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Such a formation answers the question “What is the result of applying the transformation A:B to C?” In a vector space the solution generally proposed is to solve the analogy using vector math:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
( B - A ) = ( ? - C )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
? = C + B - A
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Note that an interesting property of this solution is an implied symmetry:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
A : C : : B : ?
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Because the same terms can be rearranged:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
( C - A ) = ( ? - B )
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
? = B + C - A
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Generative models that include an encoder for computing latent vectors given new samples allow for visual analogies. We have devised a visual representation for depicting analogies of visual generative networks called a “J-Diagram”. The J- Diagram uses interpolation across two dimensions two expose the manifold of the analogy. It also makes the symmetric nature of the analogy clear (Figure 3).
|
| 86 |
+
|
| 87 |
+
The J-Diagram also serves as a reference visualization across different model settings because it is deterministically generated from images which can be held constant. This makes it a useful tool for comparing results across epochs during training, after adjusting hyperparameters, or even across completely different model types (Figure 4).
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 3: J-Diagram. The three corner images are inputs to the system, with the top left being the “source” (A) and the other two being “analogy targets” (B and C). Adjacent to each is the reconstruction resulting from running the image through both the encoder and decoder of the model. The bottom right image shows the result of applying the analogy operation $( \mathbf { B } + \mathbf { C } ) - \mathbf { A }$ . All other images are interpolations using the slerp operator. (model: VAE from Lamb 16 on CelebA)
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 4: Same J-Diagram repeated with different model type. To facilitate comparisons (and demonstrate results are not cherry-picked) inputs selected are the first 3 images of the validation set. (model: GAN from Dumoulin 16 on CelebA)
|
| 94 |
+
|
| 95 |
+
# 2.3 MANIFOLD TRAVERSAL
|
| 96 |
+
|
| 97 |
+
Generative models can produce a latent space that is not tightly packed, and the dimensionality of the latent space is often set artificially high. As a result, the manifold of trained examples is can be a subset of the latent space after training, resulting in dead zones in the expected prior.
|
| 98 |
+
|
| 99 |
+
If the model includes an encoder, one simple way to stay on the manifold is by only using out of sample encodings (ie: any data not used in training) in the latent space. This is a useful diagnostic, but is overly restrictive in a creative application context since it prevents the model from suggesting new and novel samples from the model. However, we can recover this ability by also including the results of operations on these encoded samples that stay close to the manifold, such as interpolation, extrapolation, and analogy generation.
|
| 100 |
+
|
| 101 |
+
Ideally, there would be a mechanism to discover this manifold within the latent space. In generative models with an encoder and ample out-of-sample data, we can instead precompute locations on the manifold with sufficient density, and later query for nearby points in the latent space from this known set. This offers a navigation mechanism based on hopping to nearest neighbors across a large database of encoded samples. When combined with interpolation, we call this visualization a Manifold Interpolated Neighbor Embedding (MINE). A MINE grid is useful to visualize local patches of the latent space (Figure 5).
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
(b) Reconstructions are spread with interpolation to expose areas between them.
|
| 105 |
+
Figure 5: Example of local VAE manifold built using the $3 0 \mathrm { k }$ CelebA validation and test images as a dataset of out of sample features. The resulting MINE grid represents a small contiguous manifold of the larger latent space. (model: VAE from Lamb 16 on CelebA)
|
| 106 |
+
|
| 107 |
+
# 3 ATTRIBUTE VECTORS
|
| 108 |
+
|
| 109 |
+
Many generative models result in a latent space that is highly structured, even on purely unsupervised datasets (Radford et al., 2015). When combined with labeled data, attribute vectors can be computed using simple arithmetic. For example, a vector can be computed which represents the smile attribute, which by shorthand we call a smile vector. Following (Larsen et al., 2016), the smile vector can be computed by simply subtracting the mean vector for images without the smile attribute from the mean vector for images with the smile attribute. This smile vector can then be applied to in a positive or negative direction to manipulate this visual attribute on samples taken from latent space (Figure 6).
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 6: Traversals along the smile vector. (model: GAN from Dumoulin 16 on CelebA)
|
| 113 |
+
|
| 114 |
+
# 3.1 CORRELATED LABELS
|
| 115 |
+
|
| 116 |
+
The approach of building attribute vectors from means of labeled data has been noted to suffer from correlated labels (Larsen et al., 2016). While many correlations would be expected from ground truths (eg: heavy makeup and wearing lipstick) we discovered others that appear to be from sampling bias. For example, male and smiling attributes have unexpected negative correlations because women in the CelebA dataset are much more likely to be smiling than men. (Table 1).
|
| 117 |
+
|
| 118 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Male</td><td rowspan=1 colspan=1>Not Male</td><td rowspan=1 colspan=1>Total</td></tr><tr><td rowspan=1 colspan=1>Smiling</td><td rowspan=1 colspan=1>17%</td><td rowspan=1 colspan=1>31%</td><td rowspan=1 colspan=1>48%</td></tr><tr><td rowspan=1 colspan=1>Not Smiling</td><td rowspan=1 colspan=1>25%</td><td rowspan=1 colspan=1>27%</td><td rowspan=1 colspan=1>52%</td></tr><tr><td rowspan=1 colspan=1>Total</td><td rowspan=1 colspan=1>42%</td><td rowspan=1 colspan=1>58%</td><td rowspan=1 colspan=1></td></tr></table>
|
| 119 |
+
|
| 120 |
+
Table 1: Breakdown of CelebA smile versus male attributes. In the total population the smile attribute is almost balanced $4 8 \%$ smile). But separating the data further shows that those with the male attribute smile only $42 \%$ of the time while those without it smile $58 \%$ of the time.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 7: Initial attempts to build a smile vector suffered from sampling bias. The effect was that removing smiles from reconstructions (left) also added male attributes (center). By using replication to balance the data across both attributes before computing the attribute vectors, the gender bias was removed (right). (model: VAE from Lamb 16 on CelebA)
|
| 124 |
+
|
| 125 |
+
In an online service we setup to automatically add and remove smiles from images1, we discovered this gender bias was visually evident in the results. Our solution was to use replication on the training data such that the dataset was balanced across attributes. This was effective because ultimately the vectors are simply summed together when computing the attribute vector (Figure 7).
|
| 126 |
+
|
| 127 |
+
This balancing technique can also be applied to attributes correlated due to ground truths. Decoupling attributes allows individual effects to be applied separately. As an example, the two attributes smiling and mouth open are highly correlated in the CelebA training set (Table 2). This is not surprising, as physically most people photographed smiling would also have their mouth open. However by forcing these attributes to be balanced, we can construct two decoupled attribute vectors. This allows for more flexibility in applying each attribute separately to varying degrees (Figure 8).
|
| 128 |
+
|
| 129 |
+
Table 2: CelebA smile versus open mouth attributes shows a strong symmetric correlation (greater than 3 to 1).
|
| 130 |
+
|
| 131 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Open Mouth</td><td rowspan=1 colspan=1>Not Open Mouth</td><td rowspan=1 colspan=1>Total</td></tr><tr><td rowspan=1 colspan=1>Smiling</td><td rowspan=1 colspan=1>36%</td><td rowspan=1 colspan=1>12%</td><td rowspan=1 colspan=1>48%</td></tr><tr><td rowspan=1 colspan=1>Not Smiling</td><td rowspan=1 colspan=1>12%</td><td rowspan=1 colspan=1>40%</td><td rowspan=1 colspan=1>52%</td></tr><tr><td rowspan=1 colspan=1>Total</td><td rowspan=1 colspan=1>48%</td><td rowspan=1 colspan=1>52%</td><td rowspan=1 colspan=1></td></tr></table>
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 8: Decoupling attribute vectors for smiling (x-axis) and mouth open (y-axis) allows for more flexible latent space transformations. Input shown at left with reconstruction adjacent. (model: VAE from Lamb 16 on CelebA)
|
| 135 |
+
|
| 136 |
+
# 3.2 SYNTHETIC ATTRIBUTES
|
| 137 |
+
|
| 138 |
+
It has been noted that samples drawn from VAE based models is that they tend to be blurry (Goodfellow et al., 2014; Larsen et al., 2015). A possible solution to this would be to discover an attribute vector for “unblur”, and then apply this as a constant offset to latent vectors before decoding. CelebA includes a blur label for each image, and so a blur attribute vector was computed and then extrapolated in the negative direction. This was found to noticeably reduce blur, but also resulted in a number of unwanted artifacts such as increased image brightness.
|
| 139 |
+
|
| 140 |
+
We concluded this to be the result of human bias in labeling. Labelers appear more likely to label darker images as blurry, so this unblur vector was found to suffer from attribute correlation that also “lightened” the reconstruction. This bias could not be easily corrected because CelebA does not include a brightness label for rebalancing the data.
|
| 141 |
+
|
| 142 |
+
For the blurring attribute, an algorithmic solution is available. We take a large set of images from the training set and process them through a Gaussian blur filter (figure 9). Then we run both the original image set and the blurred image set through the encoder and subtract the means of each set to compute a new attribute vector for blur. We call this a synthetic attribute vector because this label is derived from algorithmic data augmentation of the training set. This technique removes the labeler bias, is straightforward to implement, and resulted in samples closely resembling the reconstructions with less noticeable blur (figure 10).
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 9: Zoomed detail from training images (top) and computed blurred images (bottom) were both encoded in order to determine a non-biased blur attribute vector.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 10: Zoomed detail of images from the validation set (top) are reconstructed (second row). Applying an offset in latent space based on the CelebA blur attribute (third row) does reduce noticeable blur from the reconstructions, but introduces visual artifacts including brightening due to attribute correlation. Applying an attribute vector instead computed from synthetic blur (bottom) yields images noticeably deblurred from the reconstructions and without unrelated artifacts.
|
| 149 |
+
|
| 150 |
+
# 3.3 QUANTITATIVE ANALYSIS WITH CLASSICICATION
|
| 151 |
+
|
| 152 |
+
The results of applying attribute vectors visually to images are often quite striking. But it would be useful to be able to evaluate the relative efficacy of various attribute vectors to each other or across different models and hyperparamaters. Attribute vectors have potential to be widely applicable outside of images in domain specific latent spaces, and this provides additional challenges for quantifying their performance. For example, recent work has shown the ability to use latent space model as a continuous representation of molecules (Gómez 16); though it is straightforward to generate vectors for attributes such as solubility in these spaces, the evaluation of these operations to existing molecules would appear to require specific domain knowledge.
|
| 153 |
+
|
| 154 |
+
We have found that very effective classifiers can be built in latent space using the dot product of an encoded vector with a computed attribute vector (figure 11A, 11B). We have named this technique for building classifiers on latent spaces AtDot, and models trained on unsupervised data have been shown to produce strong results on CelebA across most attributes (table 3). Importantly, these binary classifiers provide a quantitative basis to evaluate attribute vectors on a related surrogate task - their ability to be the basis for a simple linear classifier. This task is one of the most established paradigms in machine learning and provides a set of established tools such as ROC curves for offering new insights into the behavior of the attribute vectors across different hyperparameters or different models (figure 11C).
|
| 155 |
+
|
| 156 |
+
Table 3: Average Classification Accuracy on the CelebA dataset. Models for both VAE AtDot and GAN AtDot use unsupervised training with attribute vectors computed on the training set data after model training was completed. VAE AtDot from Lamb 16 with discriminative regularization disabled and GAN AtVec from Dumoulin 16. Other results are [1] Kumar 08, [2] Zhang 14, [3] Li 13, and [4] LeCun 94 as reported in Ehrlich 16.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Approach /Attribute</td><td>[1]</td><td>[2] W [2] L</td><td>[3] ANet</td><td>[4] LNet</td><td>[4] Full</td><td>VAE AtDot</td><td>GAN AtDot</td></tr><tr><td>5 0.C. Shadow</td><td>85</td><td>82 88</td><td>86</td><td>88</td><td>91</td><td>88</td><td>89</td></tr><tr><td>Arched Eyebrow</td><td>76</td><td>73 78</td><td>75</td><td>74</td><td>79</td><td>75</td><td>75</td></tr><tr><td>Attractive</td><td>78</td><td>77 81</td><td>79</td><td>77</td><td>81</td><td>71</td><td>69</td></tr><tr><td>Bags Under Eye</td><td>76</td><td>71 79</td><td>77</td><td>73</td><td>79</td><td>80</td><td>79</td></tr><tr><td>Bald</td><td>89</td><td>92 96</td><td>92</td><td>95</td><td>98</td><td>98</td><td>98</td></tr><tr><td>Bangs</td><td>88</td><td>89 92</td><td>94</td><td>92</td><td>95</td><td>90</td><td>90</td></tr><tr><td>Big Lips</td><td>64</td><td>61 67</td><td>63</td><td>66</td><td>68</td><td>85</td><td>76</td></tr><tr><td>Big Nose</td><td>74</td><td>70 75</td><td>74</td><td>75</td><td>78</td><td>77</td><td>77</td></tr><tr><td>Black Hair</td><td>70</td><td>74 85</td><td>77</td><td>84</td><td>88</td><td>83</td><td>81</td></tr><tr><td>Blond Hair</td><td>80</td><td>81 93</td><td>86</td><td>91</td><td>95</td><td>87</td><td>90</td></tr><tr><td>Blurry</td><td>81</td><td>77 86</td><td>83</td><td>80</td><td>84</td><td>95</td><td>95</td></tr><tr><td>Brown Hair</td><td>60</td><td>69 77</td><td>74</td><td>78</td><td>80</td><td>76</td><td>81</td></tr><tr><td>BushyEyebrow</td><td>80</td><td>76 86</td><td>80</td><td>85</td><td>90</td><td>87</td><td>86</td></tr><tr><td>Chubby</td><td>86</td><td>82 86</td><td>86</td><td>86</td><td>91</td><td>94</td><td>94</td></tr><tr><td>Double Chin</td><td>88</td><td>85 88</td><td>90</td><td>88</td><td>92</td><td>95</td><td>95</td></tr><tr><td>Eyeglasses</td><td>98</td><td>94 98</td><td>96</td><td>96</td><td>99</td><td>95</td><td>94</td></tr><tr><td>Goatee</td><td>93</td><td>86 93</td><td>92</td><td>92</td><td>95</td><td>93</td><td>94</td></tr><tr><td>Gray Hair</td><td>90</td><td>88 94</td><td>93</td><td>93</td><td>97</td><td>95</td><td>96</td></tr><tr><td>Heavy Makeup</td><td>85</td><td>84 90</td><td>87</td><td>85</td><td>90</td><td>76</td><td>75</td></tr><tr><td>High Cheekbone</td><td>84</td><td>80 86</td><td>85</td><td>84</td><td>87</td><td>81</td><td>68</td></tr><tr><td>Male</td><td>91</td><td>93 97</td><td>95</td><td>94</td><td>98</td><td>81</td><td>80</td></tr><tr><td>Mouth Open</td><td>87</td><td>82 93</td><td>85</td><td>86</td><td>92</td><td>78</td><td>67</td></tr><tr><td>Mustache</td><td>91</td><td>83 93</td><td>87</td><td>91</td><td>95</td><td>95</td><td>96</td></tr><tr><td>Narrow Eyes</td><td>82</td><td>79 84</td><td>83</td><td>77</td><td>81</td><td>93</td><td>89</td></tr><tr><td>No Beard</td><td>90</td><td>87 93</td><td>91</td><td>92</td><td>95</td><td>85</td><td>84</td></tr><tr><td>Oval Face</td><td>64</td><td>62 65</td><td>65</td><td>63</td><td>66</td><td>72</td><td>71</td></tr><tr><td>Pale Skin</td><td>83</td><td>84 91</td><td>89</td><td>87</td><td>91</td><td>96</td><td>96</td></tr><tr><td>Pointy Nose</td><td>68</td><td>65</td><td>71 67</td><td>70</td><td>72</td><td>72</td><td>72</td></tr><tr><td>Recede Hair</td><td>76</td><td>82</td><td>85 84</td><td>85</td><td>89</td><td>93</td><td>92</td></tr><tr><td>Rosy Cheeks</td><td>84</td><td>81</td><td>87 85</td><td>87</td><td>90</td><td>93</td><td>93</td></tr><tr><td>Sideburns</td><td>94</td><td>90</td><td>93 94</td><td>91</td><td>96</td><td>94</td><td>94</td></tr><tr><td>Smiling</td><td>89</td><td>89</td><td>92 92</td><td>88</td><td>92</td><td>87</td><td>68</td></tr><tr><td>Straight Hair</td><td>63</td><td>67</td><td>69 70</td><td>69</td><td>73</td><td>80</td><td>79</td></tr><tr><td>Wavy Hair</td><td>73</td><td>76</td><td>77 79</td><td>75</td><td>80</td><td>75</td><td>75</td></tr><tr><td>Earring</td><td>73</td><td>72</td><td>78 77</td><td>78</td><td>82</td><td>81</td><td>81</td></tr><tr><td>Hat</td><td>89</td><td>91</td><td>96 93</td><td>96</td><td>99</td><td>96</td><td>97</td></tr><tr><td>Lipstick</td><td>89</td><td>88</td><td>93 91</td><td>90</td><td>93</td><td>79</td><td>77</td></tr><tr><td>Necklace</td><td>68</td><td>67</td><td>67 70</td><td>68</td><td>71</td><td>88</td><td>88</td></tr><tr><td>Necktie</td><td>86</td><td>88</td><td>91 90</td><td>86</td><td>93</td><td>93</td><td>92</td></tr><tr><td>Young</td><td>80</td><td>77</td><td>84 81</td><td>83</td><td>87</td><td>78</td><td>81</td></tr><tr><td>Average</td><td>81</td><td>79 85</td><td>83</td><td>83</td><td>87</td><td>86</td><td>84</td></tr></table>
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 11: Example of using an attribute vector for classification. A smile vector is first constructed in latent space from labeled training data. By taking the dot product of this smile vector with the encoded representation of any face, a scalar smile score is generated (a). This score can be the basis for a binary classifier. The histogram shows the distribution of positive (green) and negative (red) scores on the CelebA validation set (b). The ROC curve for a smile vector based binary classifier is also shown (c).
|
| 162 |
+
|
| 163 |
+
# 4 FUTURE WORK
|
| 164 |
+
|
| 165 |
+
Software to support most techniques presented in this paper is included in a python software library that can be used with various generative models2. We hope to continue to improve the library so that the techniques are applicable across a broad range of generative models. Attribute vector based classifiers also offer a promising way to evaluate the suitability of attribute vectors in domains outside of images.
|
| 166 |
+
|
| 167 |
+
We are investigating constructing a specially constructed prior on the latent space such that interpolations could be linear. This would simplify many of the latent space operations and might enable new types of operations.
|
| 168 |
+
|
| 169 |
+
Given sufficient test data, the extent to which an encoded dataset deviates from the expected prior should be quantifiable. Developing such a metric would be useful in understanding the structure of the different latent spaces including probability that random samples fall outside of the expected manifold of encoded data.
|
| 170 |
+
|
| 171 |
+
# ACKNOWLEDGMENTS
|
| 172 |
+
|
| 173 |
+
I am thankful for the constructive feedback from readers including Ehud Ben-Reuven, Zachary Lipton, and Alex Champandard. I thank Victoria University of Wellington School of Design for supporting research on Creative Intelligence. I also thank the vibrant machine learning and creative coding communities on twitter for their support and encouragement.
|
| 174 |
+
|
| 175 |
+
# REFERENCES
|
| 176 |
+
|
| 177 |
+
Dumoulin, Vincent, Belghazi, Ishmael, Poole, Ben, Lamb, Alex, Arjovsky, Martin, Mastropietro, Olivier Courville, Aaron. Adversarially Learned Inference. https://arxiv.org/abs/1606.00704 2016 Ehrlich, Max, Shields, Timothy J., Almaev, Timur, Amer, Mohamed R. Facial Attributes Classification Using Multi-Task Representation Learning. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops. 2016.
|
| 178 |
+
Goodfellow, Ian, Pouget-Abadie, Jean, Mirza, Mehdi, Xu, Bing, Warde- Farley, David, Ozair, Sherjil, Courville, Aaron, and Bengio, Yoshua. Generative adversarial nets. In Ghahramani, Z., Welling, M., Cortes, C., Lawrence, N.D., and Weinberger, K.Q. (eds.), Advances in Neural Information Processing Systems 27, pp. 2672–2680. Curran Associates, Inc., 2014.
|
| 179 |
+
Gómez-Bombarelli, Rafael, Duvenaud, David, Miguel, Hernández-Lobato, José, Aguilera-Iparraguirre, Jorge, Hirzel, Timothy D., Adams, Ryan P., and Alán Aspuru-Guzik. Automatic chemical design using a data-driven continuous representation of molecules. https://arxiv.org/abs/1610.02415 2016 Kingma, Diederik P. and Welling, Max. Auto-encoding variational Bayes. In Proceedings of the International Conference on Learning Representations, 2014.
|
| 180 |
+
Kumar, N., Belhumeur, P., and Nayar, S. Facetracer: A search engine for large collections of images with faces. In ECCV, 2008.
|
| 181 |
+
Lamb, Alex, Dumoulin, Vincent, Courville, Aaron. Discriminative Regularization for Generative Models. http://arxiv.org/abs/1602.03220 2016
|
| 182 |
+
Larsen, Anders Boesen Lindbo, Sønderby, Søren Kaae, Larochelle, Hugo, Winther, Ole. Autoencoding beyond pixels using a learned similarity metric. https://arxiv.org/abs/1512.09300 2016
|
| 183 |
+
LeCun, Y. and Bengio., Y. Word-level training of a handwritten word recognizer based on convolutional neural networks. In ICPR, 1994.
|
| 184 |
+
Li, J., and Zhang, Y. Learning surf cascade for fast and accurate object detection. In CVPR, 2013.
|
| 185 |
+
Makhzani, Alireza, Shlens, Jonathon, Jaitly, Navdeep, Goodfellow, Ian, Brendan, Frey. Adversarial Autoencoders. http://arxiv.org/abs/1511.05644. 2016.
|
| 186 |
+
Mikolov, Tomas, Yih, Scott Wen-tau, Zweig, Geoffrey. Linguistic Regularities in Continuous Space Word Representations. NAACL-HLT, 2013.
|
| 187 |
+
Radford , Alec, Metz , Luke, Chintala, Soumith. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. Advances in Neural Information Processing Systems, 2015.
|
| 188 |
+
Reed, Scott E, Zhang, Yi, Zhang, Yuting, and Lee, Honglak. Deep visual analogy-making. In Cortes, C., Lawrence, N.D., Lee, D.D., Sugiyama, M., Garnett, R., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 28, pp. 1252–1260. Curran Associates, Inc., 2015
|
| 189 |
+
Shoemake, Ken. Animating rotation with quaternion curves. In ACM Siggraph, 19(3):245–254, 1985. Zhang, N., Paluri, M., Ranzato, M., Darrell, T., and Bourdev, L. Panda: Pose aligned networks for deep attribute modeling. In CVPR, 2014.
|
md/train/Syx6bz-Ab/Syx6bz-Ab.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SEQ2SQL: GENERATING STRUCTURED QUERIES FROM NATURAL LANGUAGE USING REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Relational databases store a significant amount of the worlds data. However, accessing this data currently requires users to understand a query language such as SQL. We propose Seq2SQL, a deep neural network for translating natural language questions to corresponding SQL queries. Our model uses rewards from inthe-loop query execution over the database to learn a policy to generate the query, which contains unordered parts that are less suitable for optimization via cross entropy loss. Moreover, Seq2SQL leverages the structure of SQL to prune the space of generated queries and significantly simplify the generation problem. In addition to the model, we release WikiSQL, a dataset of 80654 hand-annotated examples of questions and SQL queries distributed across 24241 tables from Wikipedia that is an order of magnitude larger than comparable datasets. By applying policybased reinforcement learning with a query execution environment to WikiSQL, $\mathrm { S e q } 2 \mathrm { S Q L }$ outperforms a state-of-the-art semantic parser, improving execution accuracy from $3 5 . 9 \%$ to $5 9 . 4 \%$ and logical form accuracy from $2 3 . 4 \%$ to $4 8 . 3 \%$ .
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Relational databases store a vast amount of today’s information and provide the foundation of applications such as medical records (Hillestad et al., 2005), financial markets (Beck et al., 2000), and customer relations management (Ngai et al., 2009). However, accessing relational databases requires an understanding of query languages such as SQL, which, while powerful, is difficult to master. Natural language interfaces (NLI), a research area at the intersection of natural language processing and human-computer interactions, seeks to provide means for humans to interact with computers through the use of natural language (Androutsopoulos et al., 1995). We investigate one particular aspect of NLI applied to relational databases: translating natural language questions to SQL queries.
|
| 12 |
+
|
| 13 |
+
Our main contributions in this work are two-fold. First, we introduce Seq2SQL, a deep neural network for translating natural language questions to corresponding SQL queries. Seq2SQL, shown in Figure 1, consists of three components that leverage the structure of SQL to prune the output space of generated queries. Moreover, it uses policy-based reinforcement learning (RL) to generate the conditions of the query, which are unsuitable for optimization using cross entropy loss due to their unordered nature. We train Seq2SQL using a mixed objective, combining cross entropy losses and RL rewards from in-the-loop query execution on a database. These characteristics allow Seq2SQL to achieve state-of-the-art results on query generation.
|
| 14 |
+
|
| 15 |
+
Next, we release WikiSQL, a corpus of 80654 hand-annotated instances of natural language questions, SQL queries, and SQL tables extracted from 24241 HTML tables from Wikipedia. WikiSQL is an order of magnitude larger than previous semantic parsing datasets that provide logical forms along with natural language utterances. We release the tables used in WikiSQL both in raw JSON format as well as in the form of a SQL database. Along with WikiSQL, we release a query execution engine for the database used for in-the-loop query execution to learn the policy. On WikiSQL, Seq2SQL outperforms a previously state-of-the-art semantic parsing model by Dong & Lapata (2016), which obtains $3 5 . 9 \%$ execution accuracy, as well as an augmented pointer network baseline, which obtains $5 3 . 3 \%$ execution accuracy. By leveraging the inherent structure of
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: $\mathrm { S e q } 2 \mathrm { S Q L }$ takes as input a question and the columns of a table. It generates the corresponding SQL query, which, during training, is executed against a database. The result of the execution is utilized as the reward to train the reinforcement learning algorithm.
|
| 19 |
+
|
| 20 |
+
<table><tr><td rowspan=1 colspan=6>Table:CFLDraft Question:</td></tr><tr><td rowspan=1 colspan=1>Pick #</td><td rowspan=1 colspan=1>CFL Team</td><td rowspan=1 colspan=1>Player</td><td rowspan=1 colspan=1>Position</td><td rowspan=1 colspan=1>College</td><td rowspan=1 colspan=1>How many CFL teamsare from York College?</td></tr><tr><td rowspan=1 colspan=1>27</td><td rowspan=1 colspan=1>Hamilton Tiger-Cats</td><td rowspan=1 colspan=1>Connor Healy</td><td rowspan=1 colspan=1>DB</td><td rowspan=1 colspan=1>Wilfrid Laurier</td><td rowspan=6 colspan=1>SQL:SELECT COUNT CFL Team FROMCFLDraft WHERE College = "York"Result:②</td></tr><tr><td rowspan=1 colspan=1>28</td><td rowspan=1 colspan=1>Calgary Stampeders</td><td rowspan=1 colspan=1>Anthony Forgone</td><td rowspan=1 colspan=1>OL</td><td rowspan=1 colspan=1>York</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>29</td><td rowspan=2 colspan=1>Ottawa Renegades</td><td rowspan=2 colspan=1>L.P. Ladouceur</td><td rowspan=2 colspan=1>DT</td><td rowspan=2 colspan=1>California</td></tr><tr><td rowspan=1 colspan=1>SELECT COUNT CFL Team FROMCFLDraft WHERE College = "York"</td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>Toronto Argonauts</td><td rowspan=1 colspan=1>Frank Hoffman</td><td rowspan=1 colspan=1>DL</td><td rowspan=1 colspan=1>York</td></tr><tr><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>..</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>…</td></tr></table>
|
| 21 |
+
|
| 22 |
+
Figure 2: An example in WikiSQL. The inputs consist of a table and a question. The outputs consist of a ground truth SQL query and the corresponding result from execution.
|
| 23 |
+
|
| 24 |
+
SQL queries and applying policy gradient methods using reward signals from live query execution, Seq2SQL achieves state-of-the-art performance on WikiSQL, obtaining $5 9 . 4 \%$ execution accuracy.
|
| 25 |
+
|
| 26 |
+
# 2 MODEL
|
| 27 |
+
|
| 28 |
+
The WikiSQL task is to generate a SQL query from a natural language question and table schema. Our baseline model is the attentional sequence to sequence neural semantic parser proposed by Dong & Lapata (2016) that achieves state-of-the-art performance on a host of semantic parsing datasets without using hand-engineered grammar. However, the output space of the softmax in their Seq2Seq model is unnecessarily large for this task. In particular, we can limit the output space of the generated sequence to the union of the table schema, question utterance, and SQL key words. The resulting model is similar to a pointer network (Vinyals et al., 2015) with augmented inputs. We first describe the augmented pointer network model, then address its limitations in our definition of Seq2SQL, particularly with respect to generating unordered query conditions.
|
| 29 |
+
|
| 30 |
+
# 2.1 AUGMENTED POINTER NETWORK
|
| 31 |
+
|
| 32 |
+
The augmented pointer network generates the SQL query token-by-token by selecting from an input sequence. In our case, the input sequence is the concatenation of the column names, required for the selection column and the condition columns of the query, the question, required for the conditions of the query, and the limited vocabulary of the SQL language such as SELECT, COUNT etc. In the example shown in Figure 2, the column name tokens consist of “Pick”, “#”, “CFL”, “Team” etc.; the question tokens consist of “How”, “many”, “CFL”, “teams” etc.; the SQL tokens consist of SELECT, WHERE, COUNT, MIN, MAX etc. With this augmented input sequence, the pointer network can produce the SQL query by selecting exclusively from the input.
|
| 33 |
+
|
| 34 |
+
Suppose we have a list of $N$ table columns and a question such as in Figure 2, and want to produce the corresponding SQL query. Let $\boldsymbol { x } _ { j } ^ { \mathrm { c } } = [ x _ { j , 1 } ^ { \mathrm { c } } , x _ { j , 2 } ^ { \mathrm { c } } , . . . x _ { j , T _ { j } } ^ { \mathrm { c } } ]$ denote the sequence of words in the name of the $j$ th column, where $\boldsymbol { x } _ { j , i } ^ { \mathrm { c } }$ represents the ith word in the $j$ th column and $T _ { j }$ represents the total number of words in the $j$ th column. Similarly, let $x ^ { \mathrm { q } }$ and $x ^ { \mathrm { s } }$ respectively denote the sequence of words in the question and the set of unique words in the SQL vocabulary.
|
| 35 |
+
|
| 36 |
+
We define the input sequence $x$ as the concatenation of all the column names, the question, and the SQL vocabulary:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
x = [ < \mathrm { c o l } > ; x _ { 1 } ^ { \mathrm { c } } ; x _ { 2 } ^ { \mathrm { c } } ; . . . ; x _ { N } ^ { \mathrm { c } } ; < \mathrm { s q l } > ; x ^ { \mathrm { s } } ; < \mathrm { q u e s t i o n } > ; x ^ { \mathrm { q } } ]
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $[ a ; b ]$ denotes the concatenation between the sequences $a$ and $b$ and we add sentinel tokens between neighbouring sequences to demarcate the boundaries.
|
| 43 |
+
|
| 44 |
+
The network first encodes $x$ using a two-layer, bidirectional Long Short-Term Memory network (Hochreiter & Schmidhuber, 1997). The input to the encoder are the embeddings corresponding to words in the input sequence. We denote the output of the encoder by $h ^ { \mathrm { e n c } }$ , where $h _ { t } ^ { \mathrm { e n c } }$ is the state of the encoder corresponding to the $t ^ { \mathrm { { t h } } }$ word in the input sequence. For brevity, we do not write out the LSTM equations, which are described by Hochreiter & Schmidhuber (1997). We then apply a pointer network similar to that proposed by Vinyals et al. (2015) to the input encodings $h ^ { \mathrm { e n c } }$ .
|
| 45 |
+
|
| 46 |
+
The decoder network uses a two layer, unidirectional LSTM. During each decoder step $s$ , the decoder LSTM takes as input $y _ { s - 1 }$ , the query token generated during the previous decoding step, and outputs the state $g _ { s }$ . Next, the decoder produces a scalar attention score $\alpha _ { s , t } ^ { \mathrm { p t r } }$ for each position $t$ of the input sequence:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\alpha _ { s , t } ^ { \mathrm { p t r } } = W ^ { \mathrm { p t r } } \mathrm { t a n h } \left( U ^ { \mathrm { p t r } } g _ { s } + V ^ { \mathrm { p t r } } h _ { t } \right)
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
We choose the input token with the highest score as the next token of the generated SQL query, $y _ { s } = \mathrm { a r g m a x } ( \alpha _ { s } ^ { \mathrm { p t r } } )$ .
|
| 53 |
+
|
| 54 |
+
# 2.2 SEQ2SQL
|
| 55 |
+
|
| 56 |
+
While the augmented pointer network can solve the SQL generation problem, it does not leverage the structure inherent in SQL. Typically, a SQL query such as that shown in Figure 3 consists of three components. The first component is the aggregation operator, in this case COUNT, which produces a summary of the rows selected by the query. Alternatively the query may request no summary statistics, in which case an aggregation operator is not provided. The second component is the SELECT column(s), in this case Engine, which identifies the column(s) that are to be included in the returned results. The third
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 3: The $\mathrm { S e q } 2 \mathrm { S Q L }$ model has three components, corresponding to the three parts of a SQL query (right). The input to the model are the question (top left) and the table column names (bottom left).
|
| 60 |
+
|
| 61 |
+
component is the WHERE clause of the query, in this case WHERE Driver $=$ Val Musetti, which contains conditions by which to filter the rows. Here, we keep rows in which the driver is “Val Musetti”.
|
| 62 |
+
|
| 63 |
+
Seq2SQL, as shown in Figure 3, has three parts that correspond to the aggregation operator, the SELECT column, and the WHERE clause. First, the network classifies an aggregation operation for the query, with the addition of a null operation that corresponds to no aggregation. Next, the network points to a column in the input table corresponding to the SELECT column. Finally, the network generates the conditions for the query using a pointer network. The first two components are supervised using cross entropy loss, whereas the third generation component is trained using policy gradient to address the unordered nature of query conditions (we explain this in the subsequent WHERE Clause section). Utilizing the structure of SQL allows $\mathrm { S e q } 2 \mathrm { S Q L }$ to further prune the output space of queries, which leads to higher performance than Seq2Seq and the augmented pointer network.
|
| 64 |
+
|
| 65 |
+
Aggregation Operation. The aggregation operation depends on the question. For the example shown in Figure 3, the correct operator is COUNT because the question asks for “How many”. To compute the aggregation operation, we first compute the scalar attention for each tth token in the input sequence. We normalize the vector of scores $\alpha _ { t } ^ { \mathrm { i n p } } = W ^ { \mathrm { i n p } } h _ { t } ^ { \mathrm { e n c } }$ , $\alpha ^ { \mathrm { i n p } } = [ \alpha _ { 1 } ^ { \mathrm { i n p } } , \alpha _ { 2 } ^ { \mathrm { i n p } } , \ldots ]$ produce a distribution over the input encodings, $\beta ^ { \mathrm { i n p } } = \mathrm { s o f t m a x } \left( \alpha ^ { \mathrm { i n p } } \right)$ . The input representation $\kappa ^ { \mathrm { a g g } }$ is the sum over the input encodings $h ^ { \mathrm { e n c } }$ weighted by the normalized scores $\beta ^ { \mathrm { i n p } }$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\kappa ^ { \mathrm { a g g } } = \sum _ { t } \beta _ { t } ^ { \mathrm { i n p } } h _ { t } ^ { \mathrm { e n c } }
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Let $\alpha ^ { \mathrm { a g g } }$ denote the scores over the aggregation operations such as COUNT, MIN, MAX, and the noaggregation operation NULL. We compute $\alpha ^ { \mathrm { a g g } }$ by applying a multi-layer perceptron to the input
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\alpha ^ { \mathrm { a g g } } = W ^ { \mathrm { a g g } } \operatorname { t a n h } \left( V ^ { \mathrm { a g g } } \kappa ^ { \mathrm { a g g } } + b ^ { \mathrm { a g g } } \right) + c ^ { \mathrm { a g g } }
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
We apply the softmax function to obtain the distribution over the set of possible aggregation operations $\beta ^ { \mathrm { a g g } } = \mathrm { s o f t m a x } \left( \alpha ^ { \mathrm { a g g } } \right)$ . We use cross entropy loss $L ^ { \mathrm { a g g } }$ for the aggregation operation.
|
| 78 |
+
|
| 79 |
+
SELECT Column. The selection column depends on the table columns as well as the question. Namely, for the example in Figure 3, “How many engine types” indicates that we need to retrieve the “Engine” column. SELECT column prediction is then a matching problem, solvable using a pointer: given the list of column representations and a question representation, we select the column that best matches the question.
|
| 80 |
+
|
| 81 |
+
In order to produce the representations for the columns, we first encode each column name with a LSTM. The representation of a particular column $j , e _ { j } ^ { \mathrm { c } }$ , is given by:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
h _ { j , t } ^ { \mathrm { c } } = \mathrm { L S T M } \left( \operatorname { e m b } \left( x _ { j , t } ^ { \mathrm { c } } \right) , h _ { j , t - 1 } ^ { \mathrm { c } } \right) \qquad e _ { j } ^ { \mathrm { c } } = h _ { j , T _ { j } } ^ { \mathrm { c } }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Here, $h _ { j , t } ^ { \mathrm { c } }$ denotes the tth encoder state of the $j$ th column. We take the last encoder state to be $e _ { j } ^ { \mathrm { c } }$ column $j$ ’s representation.
|
| 88 |
+
|
| 89 |
+
To construct a representation for the question, we compute another input representation $\kappa ^ { \mathrm { s e l } }$ using the same architecture as for $\kappa ^ { \mathrm { a g g } }$ (Equation 3) but with untied weights. Finally, we apply a multi-layer perceptron over the column representations, conditioned on the input representation, to compute the a score for each column $j$ :
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\alpha _ { j } ^ { \mathrm { s e l } } = W ^ { \mathrm { s e l } } \operatorname { t a n h } \left( V ^ { \mathrm { s e l } } \kappa ^ { \mathrm { s e l } } + V ^ { \mathrm { c } } e _ { j } ^ { \mathrm { c } } \right)
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
We normalize the scores with a softmax function to produce a distribution over the possible SELECT columns $\beta ^ { \mathrm { s e l } } =$ softmax $\left( \alpha ^ { \mathrm { { s e l } } } \right)$ . For the example shown in Figure 3, the distribution is over the columns “Entrant”, “Constructor”, “Chassis”, “Engine”, “No”, and the ground truth SELECT column “Driver”. We train the SELECT network using cross entropy loss $L ^ { \mathrm { { \bar { s e l } } } }$ .
|
| 96 |
+
|
| 97 |
+
WHERE Clause. We can train the WHERE clause using a pointer decoder similar to that described in Section 2.1. However, there is a limitation in using the cross entropy loss to optimize the network: the WHERE conditions of a query can be swapped and the query yield the same result. Suppose we have the question “which men are older than $1 8 ^ { \circ }$ and the queries SELECT name FROM insurance WHERE age $\mathrm { ~ ~ { ~ \geq ~ } ~ } { \mathrm { ~ \perp ~ 8 ~ } }$ AND gender $=$ "male" and SELECT name FROM insurance WHERE gender $=$ "male" AND age $\mathrm { ~ ~ { ~ \geq ~ } ~ } \mathbb { 1 } \mathrm { 8 }$ . Both queries obtain the correct execution result despite not having exact string match. If the former is provided as the ground truth, using cross entropy loss to supervise the generation would then wrongly penalize the latter. To address this problem, we apply reinforcement learning to learn a policy to directly optimize the expected correctness of the execution result (Equation 7).
|
| 98 |
+
|
| 99 |
+
Instead of teacher forcing at each step of query generation, we sample from the output distribution to obtain the next token. At the end of the generation procedure, we execute the generated SQL query against the database to obtain a reward. Let $y = \mathring [ y ^ { 1 } , y ^ { 2 } , . . . , y ^ { T } ]$ denote the sequence of generated tokens in the WHERE clause. Let $q \left( y \right)$ denote the query generated by the model and $q _ { g }$ denote the ground truth query corresponding to the question. We define the reward $R \left( q \left( y \right) , q _ { g } \right)$ as
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
R \left( q \left( y \right) , q _ { g } \right) = \left\{ \begin{array} { l l } { - 2 , } & { \mathrm { i f ~ } q \left( y \right) \mathrm { ~ i s ~ n o t ~ a ~ v a l i d ~ S Q L ~ q u e r y } } \\ { - 1 , } & { \mathrm { i f ~ } q \left( y \right) \mathrm { ~ i s ~ a ~ v a l i d ~ S Q L ~ q u e r y ~ a n d ~ e x e c u t e s ~ t o ~ a n ~ i n c o r r e c t ~ r e s u l t } } \\ { + 1 , } & { \mathrm { i f ~ } q \left( y \right) \mathrm { ~ i s ~ a ~ v a l i d ~ S Q L ~ q u e r y ~ a n d ~ e x e c u t e s ~ t o ~ t h e ~ c o r r e c t ~ r e s u l t } } \end{array} \right.
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
The loss, $L ^ { \mathrm { w h e } } = - \mathbb { E } _ { y } [ R \left( q \left( y \right) , q _ { g } \right) ]$ , is the negative expected reward over possible WHERE clauses.
|
| 106 |
+
We derive the policy gradient for $L ^ { \mathrm { w h e } }$ as shown by Sutton et al. (2000) and Schulman et al. (2015).
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r c l } { \nabla L _ { \Theta } ^ { \mathrm { w h e } } } & { = } & { - \nabla _ { \Theta } \left( \mathbb { E } _ { y \sim p _ { y } } \left[ R \left( q \left( \boldsymbol { y } \right) , q _ { g } \right) \right] \right) } \\ & { = } & { - \mathbb { E } _ { y \sim p _ { y } } \left[ R \left( q \left( \boldsymbol { y } \right) , q _ { g } \right) \nabla _ { \Theta } \sum _ { t } \left( \log p _ { y } \left( y _ { t } ; \Theta \right) \right) \right] } \\ & { \approx } & { - R \left( q \left( \boldsymbol { y } \right) , q _ { g } \right) \nabla _ { \Theta } \sum _ { t } \left( \log p _ { y } \left( y _ { t } ; \Theta \right) \right) } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Here, $p _ { y } ( y _ { t } )$ denotes the probability of choosing token $y _ { t }$ during time step $t$ . In equation 10, we approximate the expected gradient using a single Monte-Carlo sample $y$
|
| 113 |
+
|
| 114 |
+
Mixed Objective Function. We train the model using gradient descent to minimize the objective function $\dot { L } = L ^ { \mathrm { a g g } } + L ^ { \mathrm { s e l } } + L ^ { \mathrm { w h e } }$ . Consequently, the total gradient is the equally weighted sum of the gradients from the cross entropy loss in predicting the SELECT column, from the cross entropy loss in predicting the aggregation operation, and from policy learning.
|
| 115 |
+
|
| 116 |
+
# 3 WIKISQL
|
| 117 |
+
|
| 118 |
+
WikiSQL is a collection of questions, corresponding SQL queries, and SQL tables. A single example in WikiSQL, shown in Figure 2, contains a table, a SQL query, and the natural language question corresponding to the SQL query. Table 1 shows how WikiSQL compares to related datasets. Namely, WikiSQL is the largest hand-annotated semantic parsing dataset to date - it is an order of magnitude larger than other datasets that have logical forms, either in terms of the number of examples or the number of tables. The queries in WikiSQL span over a large number of tables and hence presents an
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: Distribution of questions in WikiSQL.
|
| 122 |
+
|
| 123 |
+
unique challenge: the model must be able to not only generalize to new queries, but to new table schema. Finally, WikiSQL contains realistic data extracted from the web. This is evident in the distributions of the number of columns, the lengths of questions, and the length of queries, respectively shown in Figure 5. Another indicator of the variety of questions in the dataset is the distribution of question types, shown in Figure 4.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 5: Distribution of table, question, query sizes in WikiSQL.
|
| 127 |
+
|
| 128 |
+
We collect WikiSQL by crowd-sourcing on Amazon Mechanical Turk in two phases. First, a worker paraphrases a generated question for a table. We form the generated question using a template, filled using a randomly generated SQL query. We ensure the validity and complexity of the tables by keeping only those that are legitimate database tables and sufficiently large in the number of rows and columns. Next, two other workers verify that the paraphrase has the same meaning as the generated question. We discard paraphrases that do not show enough variation, as measured by the character edit distance from the generated question, as well as those both workers deemed incorrect during verification. Section A of the Appendix contains more details on the collection of WikiSQL. We make available examples of the interface used during the paraphrase phase and during the verification phase in the supplementary materials. The dataset is available for download at [MASK].
|
| 129 |
+
|
| 130 |
+
The tables, their paraphrases, and SQL queries are randomly slotted into train, dev, and test splits, such that each table is present in exactly one split. In addition to the raw tables, queries, results, and natural utterances, we also release a corresponding SQL database and query execution engine.
|
| 131 |
+
|
| 132 |
+
# 3.1 EVALUATION
|
| 133 |
+
|
| 134 |
+
Let $N$ denote the total number of examples in the dataset, $N _ { \mathrm { e x } }$ the number of queries that, when executed, result in the correct result, and $N _ { \mathrm { l f } }$ the number of queries has exact string match with the ground truth query used to collect the paraphrase. We evaluate using the execution accuracy metric $\begin{array} { r l r } { \mathrm { A c c } _ { \mathrm { e x } } } & { { } = } & { \frac { N _ { \mathrm { e x } } } { N } } \end{array}$ . One downside of $\operatorname { A c c } _ { \mathrm { e x } }$ is that it is possible to construct a SQL query that does not correspond to the question but nevertheless obtains the same result. For example, the two queries SELECT COUNT(name)
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Dataset</td><td>Size</td><td>LF</td><td>Schema</td></tr><tr><td>WikiSQL</td><td>80654</td><td>yes</td><td>24241</td></tr><tr><td>Geoquery</td><td>880</td><td>yes</td><td>8</td></tr><tr><td>ATIS</td><td>5871</td><td>yes</td><td>141</td></tr><tr><td>Freebase917</td><td>917</td><td>yes</td><td>81*</td></tr><tr><td>Overnight</td><td>26098</td><td>yes</td><td>8</td></tr><tr><td>WebQuestions</td><td>5810</td><td>no</td><td>2420</td></tr><tr><td>WikiTableQuestions</td><td>22033</td><td>no</td><td>2108</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 1: Comparison between WikiSQL and existing datasets. The datasets are GeoQuery880 (Tang & Mooney, 2001), ATIS (Price, 1990), Free917 (Cai & Yates, 2013), Overnight (Wang et al., 2015), WebQuestions (Berant et al., 2013), and WikiTableQuestions (Pasupat & Liang, 2015). “Size” denotes the number of examples in the dataset. “LF” indicates whether it has annotated logical forms. “Schema” denotes the number of tables. ATIS is presented as a slot filling task. Each Freebase API page is counted as a separate domain.
|
| 139 |
+
|
| 140 |
+
WHERE $\mathrm { S S N } ~ = ~ 1 2 3$ and SELECT COUNT(SSN) WHERE $\mathrm { S S N } ~ = ~ 1 2 3$ produce the same result if no two people with different names share the SSN 123. Hence, we also use the logical form accuracy $\textstyle \operatorname { A c c } _ { \mathrm { l f } } = { \frac { N _ { \mathrm { l f } } } { N } }$ . However, as we showed in Section 2.2, $\operatorname { A c c } _ { \mathrm { l f } }$ incorrectly penalizes queries that achieve the correct result but do not have exact string match with the ground truth query. Due to these observations, we use both metrics to evaluate the models.
|
| 141 |
+
|
| 142 |
+
# 4 EXPERIMENTS
|
| 143 |
+
|
| 144 |
+
We tokenize the dataset using Stanford CoreNLP (Manning et al., 2014). We use the normalized tokens for training and revert into original gloss before outputting the query so that generated queries are executable on the database. We use fixed GloVe word embeddings (Pennington et al., 2014) and character n-gram embeddings (Hashimoto et al., 2016). Let $w _ { x } ^ { \mathrm { g } }$ denote the GloVe embedding and $w _ { x } ^ { \mathrm { c } }$ the character embedding for word $x$ . Here, $w _ { x } ^ { \mathrm { c } }$ is the mean of the embeddings of all the character ngrams in $x$ . For words that have neither word nor character embeddings, we assign the zero vector. All networks are run for a maximum of 300 epochs with early stopping on dev split execution accuracy. We train using ADAM (Kingma & Ba, 2014) and regularize using dropout (Srivastava et al., 2014). All recurrent layers have a hidden size of 200 units and are followed by a dropout of 0.3. We implement all models using PyTorch 1. To train Seq2SQL, we first train a version in which the WHERE clause is supervised via teacher forcing (i.e. the policy is not learned from scratch) and then continue training using reinforcement learning. In order to obtain the rewards described in Section 2.2, we use the query execution engine described in Section 3.
|
| 145 |
+
|
| 146 |
+
# 4.1 RESULT
|
| 147 |
+
|
| 148 |
+
We compare results against the attentional sequence to sequence neural semantic parser proposed by Dong & Lapata (2016). This model achieves state of the art results on a variety of semantic parsing datasets, outperforming a host of non-neural semantic parsers despite not using hand-engineered grammars. To make this baseline even more competitive on our new dataset, we augment their input with the table schema such that the model can generalize to new tables. We describe this baseline in detail in Section 2 of the Appendix. Table 2 compares the performance of the three models.
|
| 149 |
+
|
| 150 |
+
Table 2: Performance on WikiSQL. Both metrics are defined in Section 3.1. For $\mathrm { S e q } 2 \mathrm { S Q L }$ (no RL), the WHERE clause is supervised via teacher forcing as opposed to reinforcement learning.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Model</td><td>Dev AcClf</td><td>Dev AcCex</td><td>Test Accf</td><td>Test AcCex</td></tr><tr><td>Baseline (Dong & Lapata, 2016)</td><td>23.3%</td><td>37.0%</td><td>23.4%</td><td>35.9%</td></tr><tr><td>Aug Ptr Network</td><td>44.1%</td><td>53.8%</td><td>43.3%</td><td>53.3%</td></tr><tr><td>Seq2SQL (no RL)</td><td>48.2%</td><td>58.1%</td><td>47.4%</td><td>57.1%</td></tr><tr><td>Seq2SQL</td><td>49.5%</td><td>60.8%</td><td>48.3%</td><td> 59.4%</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Reducing the output space by utilizing the augmented pointer network improves upon the baseline by $1 7 . 4 \%$ . Leveraging the structure of SQL queries leads to another improvement of $3 . 8 \%$ , as is shown by the performance of Seq2SQL without RL compared to the augmented pointer network. Finally, training using reinforcement learning based on rewards from in-the-loop query executions on a database leads to another performance increase of $2 . 3 \%$ , as is shown by the performance of the full Seq2SQL model.
|
| 155 |
+
|
| 156 |
+
# 4.2 ANALYSIS
|
| 157 |
+
|
| 158 |
+
Limiting the output space via pointer network leads to more accurate conditions. Compared to the baseline, the augmented pointer network generates higher quality WHERE clause. For example, for “in how many districts was a successor seated on march 4, 1850?”, the baseline generates the condition successor seated $=$ seated march 4 whereas Seq2SQL generates successor seated $=$ seated march 4 1850. Similarly, for “what’s doug battaglia’s pick number?”, the baseline generates Player $=$ doug whereas Seq2SQL generates Player $=$ doug battaglia. The conditions tend to contain rare words (e.g. “ $\cdot 1 8 5 0 ^ { \cdot 9 } )$ , but the baseline is inclined to produce common words in the training corpus, such as “march” and “4” for date, or “doug” for name. The pointer is less affected since it selects exclusively from the input.
|
| 159 |
+
|
| 160 |
+
Incorporating structure reduces invalid queries. Seq2SQL without RL directly predicts selection and aggregation and reduces invalid SQL queries generated from $7 . 9 \%$ t o $4 . 8 \%$ . A large quantity of invalid queries result from column names – the generated
|
| 161 |
+
|
| 162 |
+
Table 3: Performance on the COUNT operator.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Model</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>Aug Ptr Network</td><td>66.3%</td><td>64.4%</td><td>65.4%</td></tr><tr><td>Seq2SQL</td><td>72.6%</td><td>66.2%</td><td>69.2%</td></tr></table>
|
| 165 |
+
|
| 166 |
+
query refers to selection columns that are not present in the table. This is particularly helpful when the column name contain many tokens, such as “Miles $\left( \mathrm { k m } \right) ^ { \ast }$ , which has 4 tokens. Introducing a classifier for the aggregation also reduces the error rate. Table 3 shows that adding the aggregation classifier improves the precision, recall, and F1 for predicting the COUNT operator. For more queries produced by the different models, please see Section 3 of the Appendix.
|
| 167 |
+
|
| 168 |
+
RL generates higher quality WHERE clause that are ordered differently than ground truth. Training with policy-based RL obtains correct results in which the order of conditions is differs from the ground truth query. For example, for “in what district was the democratic candidate first elected in 1992?”, the ground truth conditions are First elected $= \ 1 9 9 2$ AND Party $=$ Democratic whereas Seq2SQL generates Party $=$ Democratic AND First elected $= \ 1 9 9 2$ . When Seq2SQL is correct and Seq2SQL without RL is not, the latter tends to produce an incorrect WHERE clause. For example, for the rather complex question “what is the race name of the 12th round trenton, new jersey race where a.j. foyt had the pole position?”, Seq2SQL trained without RL generates WHERE rnd $\qquad = \quad \pm 2$ and track $\ u = \ a \cdot \dot { \ u } $ . foyt AND pole position $=$ a.j. foyt whereas Seq2SQL trained with RL correctly generates WHERE rnd $\qquad = \quad \pm 2$ AND pole position $\ u = \hat { \ u } \hat { \mathrm { ~ \bf ~ d ~ } } \cdot \dot { \mathrm { ~ \bf ~ J ~ } }$ . foyt.
|
| 169 |
+
|
| 170 |
+
# 5 RELATED WORK
|
| 171 |
+
|
| 172 |
+
Semantic Parsing. In semantic parsing for question answering (QA), natural language questions are parsed into logical forms that are then executed on a knowledge graph (Zelle & Mooney, 1996; Wong & Mooney, 2007; Zettlemoyer & Collins, 2005; 2007). Other works in semantic parsing focus on learning parsers without relying on annotated logical forms by leveraging conversational logs (Artzi & Zettlemoyer, 2011), demonstrations (Artzi & Zettlemoyer, 2013), distant supervision (Cai & Yates, 2013; Reddy et al., 2014), and question-answer pairs (Liang et al., 2011). Semantic parsing systems are typically constrained to a single schema and require hand-curated grammars to perform well2. Pasupat & Liang (2015) addresses the single-schema limitation by proposing the floating parser, which generalizes to unseen web tables on the WikiTableQuestions task. Our approach is similar in that it generalizes to new table schema. However, we do not require access to table content, conversion of table to an additional graph, hand-engineered features, nor handengineered grammar.
|
| 173 |
+
|
| 174 |
+
Semantic parsing datasets. Previous semantic parsing systems were designed to answer complex and compositional questions over closed-domain, fixed-schema datasets such as GeoQuery (Tang & Mooney, 2001) and ATIS (Price, 1990). Researchers also investigated QA over subsets of largescale knowledge graphs such as DBPedia (Starc & Mladenic, 2017) and Freebase (Cai & Yates, 2013; Berant et al., 2013). The dataset “Overnight” (Wang et al., 2015) uses a similar crowdsourcing process to build a dataset of natural language question, logical form pairs, but has only 8 domains. WikiTableQuestions (Pasupat & Liang, 2015) is a collection of question and answers, also over a large quantity of tables extracted from Wikipedia. However, it does not provide logical forms whereas WikiSQL does. WikiTableQuestions focuses on the task of QA over noisy web tables, whereas WikiSQL focuses on generating SQL queries for questions over relational database tables. We intend to build a natural language interface for databases, and do not use table content apart from evaluation.
|
| 175 |
+
|
| 176 |
+
Representation learning for sequence generation. Dong & Lapata (2016)’s attentional sequence to sequence neural semantic parser, which we use as the baseline, achieves state-of-the-art results on a variety of semantic parsing datasets despite not utilizing hand-engineered grammar. Unlike their model, Seq2SQL uses pointer based generation akin to Vinyals et al. (2015) to achieve higher performance, especially in generating queries with rare words and column names. Pointer models have also been successfully applied to tasks such as language modeling (Merity et al., 2017), summarization (Gu et al., 2016), combinatorial optimization (Bello et al., 2017), and question answering (Seo et al., 2017; Xiong et al., 2017). Another interesting neural semantic parsing model is the Neural Programmar by Neelakantan et al. (2017). Our approach is different than their work in that we do not require access to the table content during inference, which may be unavailable due to privacy concerns. We also do not hand-engineer model architecture for query execution and instead leverage existing database engines to perform efficient query execution. In contrast to both Dong & Lapata (2016) and Neelakantan et al. (2017), we train our model using policy-based RL, which helps Seq2SQL achieve state-of-the-art performance.
|
| 177 |
+
|
| 178 |
+
Natural language interface for databases. One of the prominent works in natural language interfaces is PRECISE (Popescu et al., 2003), which translates questions to SQL queries and identifies questions that it is not confident about. Giordani & Moschitti (2012) translate questions to SQL by first generating candidate queries from a grammar then ranking them using tree kernels. Both of these approaches rely on high quality grammar and are not suitable for tasks that require generalization to new schema. Iyer et al. (2017) also translate to SQL, but with a Seq2Seq model that is further improved with human feedback. Seq2SQL outperforms Seq2Seq and uses reinforcement learning instead of human feedback during training.
|
| 179 |
+
|
| 180 |
+
# 6 CONCLUSION
|
| 181 |
+
|
| 182 |
+
We proposed Seq2SQL, a deep neural network for translating questions to SQL queries. Our model leverages the structure of SQL queries to reduce the output space of the model. To train Seq2SQL, we applied in-the-loop query execution to learn a policy for generating the conditions of the SQL query, which is unordered and unsuitable for optimization via cross entropy loss. We also introduced WikiSQL, a dataset of questions and SQL queries that is an order of magnitude larger than comparable datasets. Finally, we showed that $\mathrm { S e q } 2 \mathrm { S Q L }$ outperforms a state-of-the-art semantic parser on WikiSQL, improving execution accuracy from $3 5 . 9 \%$ to $5 9 . 4 \%$ and logical form accuracy from $2 3 . 4 \%$ to $4 8 . 3 \%$ .
|
| 183 |
+
|
| 184 |
+
REFERENCES
|
| 185 |
+
I. Androutsopoulos, G.D. Ritchie, and P. Thanisch. Natural language interfaces to databases - an introduction. 1995.
|
| 186 |
+
Yoav Artzi and Luke S. Zettlemoyer. Bootstrapping semantic parsers from conversations. In EMNLP, 2011.
|
| 187 |
+
Yoav Artzi and Luke S. Zettlemoyer. Weakly supervised learning of semantic parsers for mapping instructions to actions. TACL, 1:49–62, 2013.
|
| 188 |
+
Thorsten Beck, Asli Demirguc¸-Kunt, and Ross Levine. A new database on the structure and devel- ¨ opment of the financial sector. The World Bank Economic Review, 14(3):597–605, 2000.
|
| 189 |
+
Irwan Bello, Hieu Pham, Quoc V. Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. ICLR, 2017.
|
| 190 |
+
Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on freebase from question-answer pairs. In EMNLP, 2013.
|
| 191 |
+
Chandra Bhagavatula, Thanapon Noraset, and Doug Downey. Methods for exploring and mining tables on wikipedia. In IDEA@KDD, 2013.
|
| 192 |
+
Qingqing Cai and Alexander Yates. Large-scale semantic parsing via schema matching and lexicon extension. In ACL, 2013.
|
| 193 |
+
Li Dong and Mirella Lapata. Language to logical form with neural attention. ACL, 2016.
|
| 194 |
+
Alessandra Giordani and Alessandro Moschitti. Translating questions to SQL queries with generative parsers discriminatively reranked. In COLING, 2012.
|
| 195 |
+
Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O. K. Li. Incorporating copying mechanism in sequence-to-sequence learning. ACL, 2016.
|
| 196 |
+
Kazuma Hashimoto, Caiming Xiong, Yoshimasa Tsuruoka, and Richard Socher. A Joint Many-Task Model: Growing a Neural Network for Multiple NLP Tasks. arXiv, cs.CL 1611.01587, 2016.
|
| 197 |
+
Richard Hillestad, James Bigelow, Anthony Bower, Federico Girosi, Robin Meili, Richard Scoville, and Roger Taylor. Can electronic medical record systems transform health care? potential health benefits, savings, and costs. Health affairs, 24(5):1103–1117, 2005.
|
| 198 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. Neural computation, 1997.
|
| 199 |
+
Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, Jayant Krishnamurthy, and Luke Zettlemoyer. Learning a neural semantic parser from user feedback. In ACL, 2017.
|
| 200 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv, abs/1412.6980, 2014.
|
| 201 |
+
Percy Liang, Michael I. Jordan, and Dan Klein. Learning dependency-based compositional semantics. Computational Linguistics, 39:389–446, 2011.
|
| 202 |
+
Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. The Stanford CoreNLP natural language processing toolkit. In Association for Computational Linguistics (ACL) System Demonstrations, pp. 55–60, 2014.
|
| 203 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. ICLR, 2017.
|
| 204 |
+
Arvind Neelakantan, Quoc V. Le, Mart´ın Abadi, Andrew McCallum, and Dario Amodei. Learning a natural language interface with neural programmer. In ICLR, 2017.
|
| 205 |
+
Eric WT Ngai, Li Xiu, and Dorothy CK Chau. Application of data mining techniques in customer relationship management: A literature review and classification. Expert systems with applications, 36(2):2592–2602, 2009.
|
| 206 |
+
|
| 207 |
+
Panupong Pasupat and Percy Liang. Compositional semantic parsing on semi-structured tables. In ACL, 2015.
|
| 208 |
+
|
| 209 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
|
| 210 |
+
|
| 211 |
+
Ana-Maria Popescu, Oren Etzioni, and Henry Kautz. Towards a theory of natural language interfaces to databases. In Proceedings of the 8th International Conference on Intelligent User Interfaces, pp. 149–157. ACM, 2003.
|
| 212 |
+
|
| 213 |
+
Patti J. Price. Evaluation of spoken language systems: The ATIS domain. 1990.
|
| 214 |
+
|
| 215 |
+
Siva Reddy, Mirella Lapata, and Mark Steedman. Large-scale semantic parsing without questionanswer pairs. TACL, 2:377–392, 2014.
|
| 216 |
+
|
| 217 |
+
John Schulman, Nicolas Heess, Theophane Weber, and Pieter Abbeel. Gradient estimation using stochastic computation graphs. In NIPS, 2015.
|
| 218 |
+
|
| 219 |
+
Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. ICLR, 2017.
|
| 220 |
+
|
| 221 |
+
Nitish Srivastava, Geoffrey E. Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014.
|
| 222 |
+
|
| 223 |
+
Janez Starc and Dunja Mladenic. Joint learning of ontology and semantic parser from text. Intelligent Data Analysis, 21:19–38, 2017.
|
| 224 |
+
|
| 225 |
+
Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000.
|
| 226 |
+
|
| 227 |
+
Lappoon R. Tang and Raymond J. Mooney. Using multiple clause constructors in inductive logic programming for semantic parsing. In ECML, 2001.
|
| 228 |
+
|
| 229 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In NIPS, 2015.
|
| 230 |
+
|
| 231 |
+
Yushi Wang, Jonathan Berant, and Percy Liang. Building a semantic parser overnight. In ACL, 2015.
|
| 232 |
+
|
| 233 |
+
Yuk Wah Wong and Raymond J. Mooney. Learning synchronous grammars for semantic parsing with lambda calculus. In ACL, 2007.
|
| 234 |
+
|
| 235 |
+
Caiming Xiong, Victor Zhong, and Richard Socher. Dynamic coattention networks for question answering. ICLR, 2017.
|
| 236 |
+
|
| 237 |
+
John M. Zelle and Raymond J. Mooney. Learning to parse database queries using inductive logic programming. In AAAI/IAAI, Vol. 2, 1996.
|
| 238 |
+
|
| 239 |
+
Luke S. Zettlemoyer and Michael Collins. Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. In Uncertainty in Artificial Intelligence, 2005.
|
| 240 |
+
|
| 241 |
+
Luke S. Zettlemoyer and Michael Collins. Online learning of relaxed ccg grammars for parsing to logical form. In EMNLP-CoNLL, 2007.
|
| 242 |
+
|
| 243 |
+
# A COLLECTION OF WIKISQL
|
| 244 |
+
|
| 245 |
+
WikiSQL is collected in a paraphrase phases as well as a verification phase. In the paraphrase phase, we use tables extracted from Wikipedia by Bhagavatula et al. (2013) and remove small tables according to the following criteria:
|
| 246 |
+
|
| 247 |
+
• the number of cells in each row is not the same • the content in a cell exceed 50 characters • a header cell is empty • the table has less than 5 rows or 5 columns • over $40 \%$ of the cells of a row contain identical content
|
| 248 |
+
|
| 249 |
+
We also remove the last row of a table because a large quantity of HTML tables tend to have summary statistics in the last row, and hence the last row does not adhere to the table schema defined by the header row.
|
| 250 |
+
|
| 251 |
+
For each of the table that passes the above criteria, we randomly generate 6 SQL queries according to the following rules:
|
| 252 |
+
|
| 253 |
+
• the query follows the format SELECT agg op agg col from table where cond1 col cond1 op cond1 AND cond2 col cond2 op cond2 ... • the aggregation operator agg op can be empty or COUNT. In the event that the aggregation column agg col is numeric, agg op can additionally be one of MAX and MIN • the condition operator cond op is $=$ . In the event that the corresponding condition column cond col is numeric, cond op can additionally be one of $>$ and $<$ • the condition cond can be any possible value present in the table under the corresponding cond col. In the event that cond col is numerical, cond can be any numerical value sampled from the range from the minimum value in the column to the maximum value in the column.
|
| 254 |
+
|
| 255 |
+
We only generate queries that produce a non-empty result set. To enforce succinct queries, we remove conditions from the generated queries if doing so does not change the execution result.
|
| 256 |
+
|
| 257 |
+
For each query, we generate a crude question using a template and obtain a human paraphrase via crowdsourcing on Amazon Mechanical Turk. In each Amazon Mechanical Turk HIT, a worker is shown the first 4 rows of the table as well as its generated questions and asked to paraphrase each question.
|
| 258 |
+
|
| 259 |
+
After obtaining natural language utterances from the paraphrase phase, we give each questionparaphrase pair to two other workers in the verification phase to verify that the paraphrase and the original question contain the same meaning.
|
| 260 |
+
|
| 261 |
+
We then filter the initial collection of paraphrases using the following criteria:
|
| 262 |
+
|
| 263 |
+
• the paraphrase must be deemed correct by at least one worker during the verification phrase • the paraphrase must be sufficiently different from the generated question, with a characterlevel edit distance greater than 10
|
| 264 |
+
|
| 265 |
+
# B ATTENTIONAL SEQ2SEQ NEURAL SEMANTIC PARSER BASELINE
|
| 266 |
+
|
| 267 |
+
We employ the attentional sequence to sequence model for the baseline. This model by Dong & Lapata (2016) achieves state of the art results on a variety of semantic parsing datasets despite not using hand-engineered grammar. We implement a variant using OpenNMT and a global attention encoder-decoder architecture (with input feeding) described by Luong et al.
|
| 268 |
+
|
| 269 |
+
We use the same two-layer, bidirectional, stacked LSTM encoder as described previously. The decoder is almost identical to that described by Equation 2 of the paper, with the sole difference coming from input feeding.
|
| 270 |
+
|
| 271 |
+
$$
|
| 272 |
+
g _ { s } = \mathrm { L S T M } \left( \left[ \operatorname { e m b } \left( y _ { s - 1 } \right) ; \kappa _ { s - 1 } ^ { \mathrm { d e c } } \right] , g _ { s - 1 } \right)
|
| 273 |
+
$$
|
| 274 |
+
|
| 275 |
+
where $\kappa _ { s } ^ { \mathrm { d e c } }$ is the attentional context over the input sequence during the sth decoding step, computed as
|
| 276 |
+
|
| 277 |
+
$$
|
| 278 |
+
\alpha _ { s , t } ^ { \mathrm { d e c } } = h _ { s } ^ { \mathrm { d e c } } \left( W ^ { \mathrm { d e c } } h _ { t } ^ { \mathrm { e n c } } \right) ^ { \intercal } \qquad \beta _ { s } ^ { \mathrm { d e c } } = \mathrm { s o f t m a x } \left( \alpha _ { s } ^ { \mathrm { d e c } } \right)
|
| 279 |
+
$$
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
\kappa _ { s } = \sum _ { t } \beta _ { s , t } h _ { t } ^ { \mathrm { e n c } }
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
To produce the output token during the sth decoder step, the concatenation of the decoder state and the attention context is given to a final linear layer to produce a distribution $\alpha ^ { \mathrm { d e c } }$ over words in the target vocabulary
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\alpha ^ { \mathrm { d e c } } = \mathrm { s o f t m a x } \left( U ^ { \mathrm { d e c } } [ h _ { s } ^ { \mathrm { d e c } } ; \kappa _ { s } ^ { \mathrm { d e c } } ] \right)
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
During training, teacher forcing is used. During inference, a beam size of 5 is used and generated unknown words are replaced by the input words with the highest attention weight.
|
| 292 |
+
|
| 293 |
+
# C PREDICTIONS BY SEQ2SQL
|
| 294 |
+
|
| 295 |
+
Table 4: Examples predictions by the models on the dev split. Q denotes the natural language question and G denotes the corresponding ground truth query. P, ${ \bf \vec { S } } ^ { \prime }$ , and S denote, respectively, the queries produced by the Augmented Pointer Network, Seq2SQL without reinforcement learning, Seq2SQL. We omit the FROM table part of the query for succinctness.
|
| 296 |
+
|
| 297 |
+
<table><tr><td>Q</td><td colspan="16">when connecticut & villanova are the regular season winner how many tournament venues (city)are there?</td></tr><tr><td></td><td colspan="11">SELECT COUNT tournament player (city) WHERE regular season winner city )= connecticut & villanova</td></tr><tr><td>P S</td><td></td><td colspan="3">COUNT tournament venue</td><td></td><td>(city)</td><td></td><td></td><td colspan="3"></td></tr><tr><td></td><td>SELECT COUNT</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>WHERE tournament winner = connecticut & villanova</td></tr><tr><td>S G</td><td>SELECT SELECT COUNT</td><td>tournament venue</td><td>tournament venue</td><td></td><td></td><td>(city) (city)</td><td></td><td>WHERE regular season winner</td><td></td><td>WHERE regular season winner = connecticut & villanova connecticut & villanova</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Q P</td><td colspan="8">what are the aggregate scores of those races where the first leg results are O-1?</td><td colspan="2"></td></tr><tr><td>S</td><td>SELECT aggregate WHERE 1st</td><td></td><td></td><td></td><td></td><td>=0-1</td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT</td><td>COUNT agg.</td><td></td><td></td><td></td><td></td><td>score WHERE 1st leg = 0-1</td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT agg. SELECT agg.</td><td>score WHERE</td><td>score WHERE 1st leg = 0-1</td><td>1st leg = 0-1</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td colspan="8"></td><td colspan="2"></td></tr><tr><td>Q P</td><td colspan="8">what is the race name of the l2th round trenton, new jersey race where a.j.foyt had the pole position?</td><td colspan="2"></td></tr><tr><td>S</td><td colspan="8">SELECT race name WHERE location = 12th AND round position = a.j.</td><td colspan="2">foyt,new jersey AND foyt AND pole position = a.j. foyt</td></tr><tr><td>S</td><td colspan="7">SELECT race name WHERE rnd = 12 AND track = a.j. f SELECT = 12 AND pole position = a.j.</td><td colspan="2">foyt</td></tr><tr><td>G</td><td colspan="7">race name rnd SELECT race name WHERE rnd = 12 :AND pole position = a.j.</td><td colspan="2">foyt</td></tr><tr><td>Q</td><td colspan="7"></td><td colspan="2"></td></tr><tr><td>P</td><td>what city is on 89.9?</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT city WHERE frequency = 89.9 SELECT city of license WHERE frequency = 89.9</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT city of license WHERE frequency</td><td></td><td></td><td></td><td></td><td></td><td>= 89.9</td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT city of license WHERE frequency</td><td></td><td></td><td></td><td></td><td></td><td>=89.9</td><td></td><td></td><td></td></tr><tr><td>Q</td><td>how many voters from the bronx voted for the socialist party?</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>P</td><td>SELECT MIN % party = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S' S</td><td>SELECT COUNT the bronx where the bronx = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT COUNT the bronx WHERE the bronx = socialist SELECT the bronx WHERE party = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td colspan="8">in what year did a plymouth vehicle win on february 9 ?</td><td colspan="2"></td></tr><tr><td>Q P</td><td colspan="8">SELECT MIN year (km) WHERE date = february 9 AND race time = plymouth 9</td><td colspan="2"></td></tr><tr><td>S</td><td>SELECT</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT</td><td>year (km)</td><td></td><td></td><td></td><td></td><td></td><td></td><td>year(km) WHERE date = plymouth 9 AND race time = february 9</td><td></td><td></td></tr><tr><td>G</td><td>SELECT year (km)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>WHERE date = plymouth 9 AND race time= february 9 WHERE manufacturer = plymouth AND date = february 9</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
md/train/TiwPYwg3IRf/TiwPYwg3IRf.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generalized Jensen-Shannon Divergence Loss for Learning with Noisy Labels
|
| 2 |
+
|
| 3 |
+
Erik Englesson KTH Stockholm, Sweden engless@kth.se
|
| 4 |
+
|
| 5 |
+
Hossein Azizpour KTH Stockholm, Sweden azizpour@kth.se
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Prior works have found it beneficial to combine provably noise-robust loss functions e.g., mean absolute error (MAE) with standard categorical loss function e.g. cross entropy (CE) to improve their learnability. Here, we propose to use Jensen-Shannon divergence as a noise-robust loss function and show that it interestingly interpolate between CE and MAE with a controllable mixing parameter. Furthermore, we make a crucial observation that CE exhibits lower consistency around noisy data points. Based on this observation, we adopt a generalized version of the JensenShannon divergence for multiple distributions to encourage consistency around data points. Using this loss function, we show state-of-the-art results on both synthetic (CIFAR), and real-world (e.g. WebVision) noise with varying noise rates.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Labeled datasets, even the systematically annotated ones, contain noisy labels [1]. Therefore, designing noise-robust learning algorithms are crucial for the real-world tasks. An important avenue to tackle noisy labels is to devise noise-robust loss functions [2, 3, 4, 5]. Similarly, in this work, we propose two new noise-robust loss functions based on two central observations as follows.
|
| 14 |
+
|
| 15 |
+
Observation I: Provably-robust loss functions can underfit the training data [2, 3, 4, 5].
|
| 16 |
+
Observation II: Standard networks show low consistency around noisy data points 1, see Figure 1.
|
| 17 |
+
|
| 18 |
+
We first propose to use Jensen-Shannon divergence (JS) as a loss function, which we crucially show interpolates between the noise-robust mean absolute error (MAE) and the cross entropy (CE) that better fits the data through faster convergence. Figure 2 illustrates the CE-MAE interpolation. Regarding Observation II, we adopt the generalized version of Jensen-Shannon divergence (GJS) to encourage predictions on perturbed inputs to be consistent, see Figure 3. Notably, Jensen-Shannon divergence has previously shown promise for test-time robustness to domain shift [6], here we further argue for its training-time robustness to label noise. The key contributions of this work2 are:
|
| 19 |
+
|
| 20 |
+
• We make a novel observation that a network predictions’ consistency is reduced for noisylabeled data when overfitting to noise, which motivates the use of consistency regularization. • We propose using Jensen-Shannon divergence (JS) and its multi-distribution generalization (GJS) as loss functions for learning with noisy labels. We relate JS to loss functions that are based on the noise-robustness theory of Ghosh et al. [2]. In particular, we prove that JS generalizes CE and MAE. Furthermore, we prove that GJS generalizes JS by incorporating consistency regularization in a single principled loss function. • We provide an extensive set of empirical evidences on several datasets, noise types and rates. They show state-of-the-art results and give in-depth studies of the proposed losses.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Evolution of a trained network’s consistency as it overfits to noise using CE loss. Here we plot the evolution of the validation accuracy (a) and network’s consistency (as measured by GJS) on clean (b) and noisy (c) examples of the training set of CIFAR-100 for varying symmetric noise rates when learning with the cross-entropy loss. The consistency of the learnt function and the accuracy closely correlate. This suggests that enforcing consistency may help avoid fitting to noise. Furthermore, the consistency is degraded more significantly for the noisy data points.
|
| 24 |
+
|
| 25 |
+
# 2 Generalized Jensen-Shannon Divergence
|
| 26 |
+
|
| 27 |
+
We propose two loss functions, the Jensen-Shannon divergence (JS) and its multi-distribution generalization (GJS). In this section, we first provide background and two observations that motivate our proposed loss functions. This is followed by definition of the losses, and then we show that JS generalizes CE and MAE similarly to other robust loss functions. Finally, we show how GJS generalizes JS to incorporate consistency regularization into a single principled loss function. We provide proofs of all theorems, propositions, and remarks in this section in Appendix C.
|
| 28 |
+
|
| 29 |
+
# 2.1 Background & Motivation
|
| 30 |
+
|
| 31 |
+
Supervised Classification. Assume a general function class3 $\mathcal { F }$ where each $f \in \mathcal F$ maps an input $\textbf { \em x } \in \mathrm { ~ \mathbb ~ X ~ }$ to the probability simplex $\Delta ^ { K - 1 }$ , i.e. to a categorical distribution over $K$ classes $\boldsymbol { y } \in \mathbb { Y } = \{ 1 , 2 , \dots , K \}$ . We seek $f ^ { * } \in { \mathcal { F } }$ that minimizes a risk $R _ { \mathcal { L } } ( f ) = \mathbb { E } _ { \mathcal { D } } [ \mathcal { L } ( e ^ { ( y ) } , f ( \pmb { x } ) ) ]$ , for some loss function $\mathcal { L }$ and joint distribution $\mathcal { D }$ over $\mathbb { X } \times \mathbb { Y }$ , where $e ^ { ( y ) }$ is a $K$ -vector with one at index and zero elsewhere. In practice, $\mathcal { D }$ is unknown and, instead, we use ${ \cal S } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ which are independently sampled from $\mathcal { D }$ to minimize an empirical risk $\begin{array} { r } { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { L } ( e ^ { ( y _ { i } ) } , f ( \pmb { x } _ { i } ) ) } \end{array}$ =1.
|
| 32 |
+
|
| 33 |
+
Learning with Noisy Labels. In this work, the goal is to learn from a noisy training distribution $\mathcal { D } _ { \eta }$ where the labels are changed, with probability $\eta$ , from their true distribution $\mathcal { D }$ . The noise is called instance-dependent if it depends on the input, asymmetric if it dependents on the true label, and symmetric if it is independent of both $_ { \textbf { \em x } }$ and $y$ . Let $f _ { \eta } ^ { * }$ be the optimizer of the noisy distribution risk $R _ { \mathcal { L } } ^ { \eta } ( f )$ . A loss function $\mathcal { L }$ is then called robust if $f _ { \eta } ^ { * }$ also minimizes $R _ { \mathcal { L } }$ . The MAE loss $( \mathcal L _ { M A E } ( e ^ { ( y ) } , f ( \pmb x ) ) : = \| e ^ { ( y ) } - f ( \pmb x ) \| _ { 1 } )$ is robust but not CE [2].
|
| 34 |
+
|
| 35 |
+
Issue of Underfitting. Several works propose such robust loss functions and demonstrate their efficacy in preventing noise fitting [2, 3, 4, 5]. However, all those works have observed slow convergence of such robust loss functions leading to underfitting. This can be contrasted with CE that has fast convergence but overfits to noise. Ghosh et al. [2] mentions slow convergence of MAE and GCE [3] extensively analyzes the undefitting thereof. SCE [4] reports similar problems for the reverse cross entropy and proposes a linear combination with CE. Finally, Ma et al. [5] observe the same problem and consider a combination of “active” and “passive” loss functions.
|
| 36 |
+
|
| 37 |
+
Consistency Regularization. This encourages a network to have consistent predictions for different perturbations of the same image, which has mainly been used for semi-supervised learning [7].
|
| 38 |
+
|
| 39 |
+
Motivation. In Figure 1, we show the validation accuracy and a measure of consistency during training with the CE loss for varying amounts of noise. First, we note that training with CE loss eventually overfits to noisy labels. Figure 1a, indicates that the higher the noise rate, the more accuracy drop when it starts to overfit to noise. Figure 1(b-c) shows the consistency of predictions for correct and noisy labeled examples of the training set, with the consistency measured as the ratio of examples that have the same class prediction for two perturbations of the same image, see
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 2: JS loss generalizes CE and MAE. The Jensen-Shannon loss $( \mathcal { L } _ { \mathrm { J S } } )$ for different values of the hyperparameter $\pi _ { 1 }$ . The JS loss interpolates between CE and MAE. For low values of $\pi _ { 1 }$ , ${ \mathcal { L } } _ { \mathrm { J S } }$ behaves like CE and for increasing values of $\pi _ { 1 }$ it behaves more like the noise robust MAE loss.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 3: GJS Dissection for $\mathbf { M } = \mathbf { K } = 3 \colon$ The decomposition of ${ \mathcal { L } } _ { \mathrm { G J S } }$ (left) into a JS term (middle) and a consistency term (right) from Proposition 2. Each point in the simplex correspond to a $\pmb { p } ^ { ( 3 ) } \in \Delta ^ { 2 }$ , where the color represents the value of the loss at that point. It can be seen that there are two ways to minimize ${ \mathcal { L } } _ { \mathrm { G J S } }$ , either by making the predictions similar to the label (middle) or similar to the other predictions (right) to increase consistency. To better highlight the variations of the losses, each loss has its own range of values.
|
| 46 |
+
|
| 47 |
+
Appendix B.6 for more details. A clear correlation is observed between the accuracy and consistency of the noisy examples. This suggests that maximizing consistency of predictions may improve the robustness to noise. Next, we define simple loss functions that (i) encourage consistency around data points and (ii) alleviate the “issue of underfitting” by interpolating between CE and MAE.
|
| 48 |
+
|
| 49 |
+
# 2.2 Definitions
|
| 50 |
+
|
| 51 |
+
$D _ { \mathbf { J } \mathbf { S } }$ . Let $\pmb { p } ^ { ( 1 ) } , \pmb { p } ^ { ( 2 ) } \in \Delta ^ { K - 1 }$ have corresponding weights $\pmb { \pi } = [ \pi _ { 1 } , \pi _ { 2 } ] ^ { T } \in \Delta$ . Then, the JensenShannon divergence between $ { \mathbf { \mathit { p } } } ^ { ( 1 ) }$ and $ { p ^ { ( 2 ) } }$ is
|
| 52 |
+
|
| 53 |
+
$D _ { 1 \mathrm { S } _ { \pi } } ( p ^ { ( 1 ) } , p ^ { ( 2 ) } ) : = H ( m ) - \pi _ { 1 } H ( p ^ { ( 1 ) } ) - \pi _ { 2 } H ( p ^ { ( 2 ) } ) = \pi _ { 1 } D _ { \mathrm { K L } } ( p ^ { ( 1 ) } | | m ) + \pi _ { 2 } D _ { \mathrm { K L } } ( p ^ { ( 2 ) } | | m )$ (1) with $H$ the Shannon entropy, and $\pmb { m } ~ = ~ \pi _ { 1 } \pmb { p } ^ { ( 1 ) } + \pi _ { 2 } \pmb { p } ^ { ( 2 ) }$ . Unlike Kullback–Leibler divergence $( D _ { \mathrm { K L } } ( \pmb { p } ^ { ( 1 ) } \| \pmb { p } ^ { ( 2 ) } ) )$ or cross entropy (CE), JS is symmetric, bounded, does not require absolute continuity, and has a crucial weighting mechanism $( \pi )$ , as we will see later.
|
| 54 |
+
|
| 55 |
+
$D _ { \mathbf { G J S } }$ . Similar to $D _ { \mathrm { K L } }$ , $D _ { \mathrm { J S } }$ satisfies $D _ { \mathrm { J S } _ { \pi } } ( { p } ^ { ( 1 ) } , { p } ^ { ( 2 ) } ) \geq 0$ , with equality iff $\pmb { p } ^ { ( 1 ) } = \pmb { p } ^ { ( 2 ) }$ . For $D _ { \mathrm { J S } }$ this is derived from Jensen’s inequality for the concave Shannon entropy. This property holds for finite number of distributions and motivates a generalization of $D _ { \mathrm { J S } }$ to multiple distributions [8]:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
D _ { \mathrm { G J S } _ { \pi } } ( p ^ { ( 1 ) } , \dots , p ^ { ( M ) } ) : = H { \Bigl ( } \sum _ { i = 1 } ^ { M } \pi _ { i } p ^ { ( i ) } { \Bigr ) } - \sum _ { i = 1 } ^ { M } \pi _ { i } H ( p ^ { ( i ) } ) = \sum _ { i = 1 } ^ { M } \pi _ { i } D _ { \mathrm { K L } } { \Bigl ( } p ^ { ( i ) } { \Bigr \| } \sum _ { j = 1 } ^ { M } \pi _ { j } p ^ { ( j ) } { \Bigr ) }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $M$ is the number of distributions, and $\pmb { \pi } = [ \pi _ { 1 } , \ldots , \pi _ { M } ] ^ { T } \in \Delta ^ { M - 1 }$
|
| 62 |
+
|
| 63 |
+
Loss functions. We aim to use $D _ { \mathrm { J S } }$ and $D _ { \mathrm { G J S } }$ divergences, to measure deviation of the predictive distribution(s), $f ( { \pmb x } )$ , from the target distribution, $e ^ { ( y ) }$ . Without loss of generality, hereafter, we dedicate $ { \mathbf { \mathit { p } } } ^ { ( 1 ) }$ to denote the target distribution. JS loss, therefore, can take the form of $D _ { \mathrm { J S } _ { \pi } } ( e ^ { ( y ) } , f ( { \pmb x } ) )$ . Generalized JS loss is a less straight-forward construction since $D _ { \mathrm { G J S } }$ can accommodate more predictive distributions. While various choices can be made for these distributions, in this work, we consider predictions associated with different random perturbations of a sample, denoted by $\scriptstyle A ( { \pmb x } )$ . This choice, as shown later, implies an interesting analogy to consistency regularization. The choice, also entails no distinction between the $M - 1$ predictive distributions. Therefore, we consider $\pi _ { 2 } = \cdot \cdot \cdot = \pi _ { M } = { \textstyle { \frac { 1 - \pi _ { 1 } } { M - 1 } } }$ in all our experiments. Finally, we scale the loss functions by a constant factor $Z = - ( 1 - \pi _ { 1 } ) \log ( 1 - \pi _ { 1 } )$ . As we will see later, the role of this scaling is merely to strengthen the already existing and desirable behaviors of these losses as $\pi _ { 1 }$ approaches zero and one. Formally, we have JS and GJS losses:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathcal { L } _ { \mathrm { J S } } ( y , f , x ) : = \frac { D _ { \mathrm { J S } _ { \pi } } ( e ^ { ( y ) } , f ( \tilde { x } ) ) } { Z } , \quad \mathcal { L } _ { \mathrm { G J S } } ( y , f , x ) : = \frac { D _ { \mathrm { G J S } _ { \pi } } ( e ^ { ( y ) } , f ( \tilde { x } ^ { ( 2 ) } ) , \dots , f ( \tilde { x } ^ { ( M ) } ) ) } { Z }
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
with $\tilde { \mathbf { x } } ^ { ( i ) } \sim \mathcal { A } ( \mathbf { x } )$ . Next, we study the connection between JS and losses which are based on the robustness theory of Ghosh et al. [2].
|
| 70 |
+
|
| 71 |
+
# 2.3 JS’s Connection to Robust Losses
|
| 72 |
+
|
| 73 |
+
Cross Entropy (CE) is the prevalent loss function for deep classifiers with remarkable successes. However, CE is prone to fitting noise [9]. On the other hand, Mean Absolute Error (MAE) is theoretically noise-robust [2]. Evidently, standard optimization algorithms struggle to minimize MAE, especially for more challenging datasets e.g. CIFAR-100 [3, 5]. Therefore, there have been several proposals that combine CE and MAE, such as Generalized CE (GCE) [3], Symmetric CE (SCE) [4], and Normalized CE (NCE+MAE) [5]. The rationale is for CE to help with the learning dynamics of MAE. Next, we show JS has CE and MAE as its asymptotes w.r.t. $\pi _ { 1 }$ .
|
| 74 |
+
|
| 75 |
+
Proposition 1. Let $\pmb { p } \in \Delta ^ { K - 1 }$ , then
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\operatorname* { l i m } _ { \pi _ { 1 } \to 0 } \mathcal L _ { \mathrm { J S } } ( e ^ { ( y ) } , p ) = H ( e ^ { ( y ) } , p ) , \qquad \operatorname* { l i m } _ { \pi _ { 1 } \to 1 } \mathcal L _ { \mathrm { J S } } ( e ^ { ( y ) } , p ) = \frac { 1 } { 2 } \| e ^ { ( y ) } - p \| _ { 1 }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $H ( e ^ { ( y ) } , p )$ is the cross entropy of $e ^ { ( y ) }$ relative to $\pmb { p }$
|
| 82 |
+
|
| 83 |
+
Figure 2 depicts how JS interpolates between CE and MAE for $\pi _ { 1 } \in ( 0 , 1 )$ . The proposition reveals an interesting connection to state-of-the-art robust loss functions, however, there are important differences. SCE is not bounded (so it cannot be used in Theorem 1), and GCE is not symmetric, while JS and MAE are both symmetric and bounded. In Appendix B.3, we perform a dissection to better understand how these properties affect learning with noisy labels. GCE is most similar to JS and is compared further in Appendix B.4.
|
| 84 |
+
|
| 85 |
+
A crucial difference to these other losses is that JS naturally extends to multiple predictive distributions (GJS). Next, we show how GJS generalizes JS by incorporating consistency regularization.
|
| 86 |
+
|
| 87 |
+
# 2.4 GJS’s Connection to Consistency Regularization
|
| 88 |
+
|
| 89 |
+
In Figure 1, it was shown how the consistency of the noisy labeled examples was reduced when the network overfitted to noise. The following proposition shows how GJS naturally encourages consistency in a single principled loss function.
|
| 90 |
+
|
| 91 |
+
Proposition 2. Let $\pmb { p } ^ { ( 2 ) } , \ldots , \pmb { p } ^ { ( M ) } \in \Delta ^ { K - 1 }$ with $M \geq 3$ and $\begin{array} { r } { \bar { p } _ { > 1 } = \frac { \sum _ { j = 2 } ^ { M } \pi _ { j } { p ^ { ( j ) } } } { 1 - \pi _ { 1 } } } \end{array}$ , then
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathscr { L } _ { \mathrm { G J S } } ( e ^ { ( y ) } , \pmb { p } ^ { ( 2 ) } , \dots , \pmb { p } ^ { ( M ) } ) = \mathscr { L } _ { \mathrm { J S } _ { \pi ^ { \prime } } } ( e ^ { ( y ) } , \bar { \pmb { p } } _ { > 1 } ) + ( 1 - \pi _ { 1 } ) \mathscr { L } _ { \mathrm { G J S } _ { \pi ^ { \prime \prime } } } ( \pmb { p } ^ { ( 2 ) } , \dots , \pmb { p } ^ { ( M ) } )
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where π0 = [π1, 1 − π1]T and π00 = [π2,...,πM ]T .
|
| 98 |
+
|
| 99 |
+
Importantly, Proposition 2 shows that GJS can be decomposed into two terms: 1) a JS term between the label and the mean prediction $\bar { p } _ { > 1 }$ , and 2) a GJS term, but without the label. Figure 3 illustrates the effect of this decomposition. The first term, similarly to the standard JS loss, encourages the predictions’ mean to be closer to the label (Figure 3 middle). However, the second term encourages all predictions to be similar, that is, consistency regularization (Figure 3 right).
|
| 100 |
+
|
| 101 |
+
# 2.5 Noise Robustness
|
| 102 |
+
|
| 103 |
+
Here, the robustness properties of JS and GJS are analyzed in terms of lower $( B _ { L } )$ and upper bounds $( B _ { U } )$ for the following theorem, which generalizes the results by Zhang et al. [3] to any bounded loss function, even with multiple predictive distributions.
|
| 104 |
+
|
| 105 |
+
Theorem 1. Undsatisfied for a loss symmetric noise with , then $\begin{array} { r } { \eta < \frac { K - 1 } { K } } \end{array}$ , $\begin{array} { r } { \{ B _ { L } \leq \sum _ { i = 1 } ^ { K } \mathcal { L } ( e ^ { ( i ) } , { \pmb x } , f ) \leq B _ { U } , \forall { \pmb x } , f } \end{array}$ $\mathcal { L }$
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
0 \leq R _ { \mathcal { L } } ^ { \eta } ( f ^ { * } ) - R _ { \mathcal { L } } ^ { \eta } ( f _ { \eta } ^ { * } ) \leq \eta \frac { B _ { U } - B _ { L } } { K - 1 } , \quad a n d \quad - \frac { \eta ( B _ { U } - B _ { L } ) } { K - 1 - \eta K } \leq R _ { \mathcal { L } } ( f ^ { * } ) - R _ { \mathcal { L } } ( f _ { \eta } ^ { * } ) \leq 0 ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
A tighter bound $B _ { U } - B _ { L }$ , implies a smaller worst case risk difference of the optimal classifiers (robust when $B _ { U } = B _ { L }$ ). Importantly, while $\mathcal { L } ( e ^ { ( i ) } , \pmb { x } , f ) = \mathcal { L } ( e ^ { ( i ) } , f ( \pmb { x } ) )$ usually, this subtle distinction is useful for losses with multiple predictive distributions, see Equation 3. In Theorem 2 in Appendix C.3, we further prove the robustness of the proposed losses to asymmetric noise.
|
| 112 |
+
|
| 113 |
+
For losses with multiple predictive distributions, the bounds in Theorem 1 and 2 must hold for any $_ { \textbf { \em x } }$ and $f$ , i.e., for any combination of $M - 1$ categorical distributions on $K$ classes. Proposition 3 provides such bounds for GJS.
|
| 114 |
+
|
| 115 |
+
Proposition 3. GJS loss with $M \leq K + 1$ satisfies $\begin{array} { r } { B _ { L } \le \sum _ { k = 1 } ^ { K } \mathcal { L } _ { \mathrm { G J S } } ( e ^ { ( k ) } , \pmb { p } ^ { ( 2 ) } , \dots , \pmb { p } ^ { ( M ) } ) \le B _ { U } } \end{array}$ for all $\pmb { p } ^ { ( 2 ) } , \ldots , \pmb { p } ^ { ( M ) } \in \Delta ^ { K - 1 }$ , with the following bounds
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
B _ { L } = \sum _ { k = 1 } ^ { K } \mathcal { L } _ { \mathrm { G J S } } ( e ^ { ( k ) } , { \pmb u } , \ldots , { \pmb u } ) , \quad B _ { U } = \sum _ { k = 1 } ^ { K } \mathcal { L } _ { \mathrm { G J S } } ( e ^ { ( k ) } , e ^ { ( 1 ) } , \ldots , e ^ { ( M - 1 ) } )
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $\pmb { u } \in \Delta ^ { K - 1 }$ is the uniform distribution.
|
| 122 |
+
|
| 123 |
+
Note the bounds for the JS loss is a special case of Proposition 3 for $M = 2$
|
| 124 |
+
|
| 125 |
+
Remark 1. ${ \mathcal { L } } _ { \mathrm { J S } }$ and ${ \mathcal { L } } _ { \mathrm { G J S } }$ are robust $B _ { L } = B _ { U , }$ ) in the limit of $\pi _ { 1 } 1$
|
| 126 |
+
|
| 127 |
+
Remark 1 is intuitive from Section 2.3 which showed that ${ \mathcal { L } } _ { \mathrm { J S } }$ is equivalent to the robust MAE in this limit and that the consistency term in Proposition 2 vanishes.
|
| 128 |
+
|
| 129 |
+
In Proposition 3, the lower bound $( B _ { L } )$ is the same for JS and GJS. However, the upper bound $( B _ { U } )$ increases for more distributions, which makes JS have a tighter bound than GJS in Theorem 1 and 2. In Proposition 4, we show that JS and GJS have the same bound for the risk difference, given an assumption based on Figure 1 that the optimal classifier on clean data $( f ^ { * } )$ is at least as consistent as the optimal classifier on noisy data $( f _ { \eta } ^ { * } )$ .
|
| 130 |
+
|
| 131 |
+
${ \mathcal { L } } _ { \mathrm { J S } }$ ${ \mathcal { L } } _ { \mathrm { G J S } }$ ounds , where $^ { l }$ i f is $\mathbb { E } _ { \mathbf { x } } [ \mathcal { L } _ { \mathrm { G J S } _ { \pi ^ { \prime \prime } } } ^ { f ^ { * } } ( \pmb { p } ^ { ( 2 ) } , \dots , \pmb { p } ^ { ( M ) } ) ] \le \mathbb { E } _ { \mathbf { x } } [ \mathcal { L } _ { \mathrm { G J S } _ { \pi ^ { \prime \prime } } } ^ { f _ { \eta } ^ { * } } ( \pmb { p } ^ { ( 2 ) } , \dots , \pmb { p } ^ { ( M ) } ) ]$ $\mathcal { L } _ { \mathrm { G J S } _ { \pi ^ { \prime \prime } } } ^ { f } ( \pmb { p } ^ { ( 2 ) } , \dots , \pmb { p } ^ { ( M ) } )$ the consistency term from Proposition 2.
|
| 132 |
+
|
| 133 |
+
# 3 Related Works
|
| 134 |
+
|
| 135 |
+
Interleaved in the previous sections, we covered most-related works to us, i.e. the avenue of identification or construction of theoretically-motivated robust loss functions [2, 3, 4, 5]. These works, similar to this paper, follow the theoretical construction of Ghosh et al. [2]. Furthermore, Liu&Guo [10] use “peer prediction” to propose a new family of robust loss functions. Different to these works, here, we propose loss functions based on $D _ { \mathrm { J S } }$ which holds various desirable properties of those prior works while exhibiting novel ties to consistency regularization; a recent important regularization technique.
|
| 136 |
+
|
| 137 |
+
Next, we briefly cover other lines of work. A more thorough version can be found in Appendix D.
|
| 138 |
+
|
| 139 |
+
A direction, that similar to us does not alter training, reweights a loss function by confusion matrix [11, 12, 13, 14, 15]. Assuming a class-conditional noise model, loss correction is theoretically motivated and perfectly orthogonal to noise-robust losses.
|
| 140 |
+
|
| 141 |
+
Consistency regularization is a recent technique that imposes smoothness in the learnt function for semi-supervised learning [7] and recently for noisy data [16]. These works use different complex pipelines for such regularization. GJS encourages consistency in a simple way that exhibits other desirable properties for learning with noisy labels. Importantly, Jensen-Shannon-based consistency loss functions have been used to improve test-time robustness to image corruptions [6] and adversarial examples [17], which further verifies the general usefulness of GJS. In this work, we study such loss functions for a different goal: training-time label-noise robustness. In this context, our thorough analytical and empirical results are, to the best of our knowledge, novel.
|
| 142 |
+
|
| 143 |
+
Recently, loss functions with information-theoretic motivations have been proposed [18, 19]. JS, with an apparent information-theoretic interpretation, has a strong connection to those. Especially, the latter is a close concurrent work studying JS and other divergences from the family of f-divergences [20]. However, in this work, we consider a generalization to more than two distributions and study the role of $\pi _ { 1 }$ , which they treat as a constant $\begin{array} { r } { \check { \boldsymbol { \pi } } _ { 1 } = \frac { 1 } { 2 } \boldsymbol { \cdot } } \end{array}$ ). These differences lead to improved performance and novel theoretical results, e.g., Proposition 1 and 2. Lastly, another generalization of JS was recently presented by Nielsen [21], where the arithmetic mean is generalized to abstract means.
|
| 144 |
+
|
| 145 |
+
# 4 Experiments
|
| 146 |
+
|
| 147 |
+
This section, first, empirically investigates the effectiveness of the proposed losses for learning with noisy labels on synthetic (Section 4.1) and real-world noise (Section 4.2). This is followed by several experiments and ablation studies (Section 4.3) to shed light on the properties of JS and GJS through empirical substantiation of the theories and claims provided in Section 2. All these additional experiments are done on the more challenging CIFAR-100 dataset.
|
| 148 |
+
|
| 149 |
+
Table 1: Synthetic Noise Benchmark on CIFAR. We reimplement other noise-robust loss functions into the same learning setup and ResNet-34, including label smoothing (LS), Bootstrap (BS), Symmetric CE (SCE), Generalized CE (GCE), and Normalized CE $( \mathrm { N C E + R C E } )$ ). We used same hyperparameter optimization budget and mechanism for all the prior works and ours. Mean test accuracy and standard deviation are reported from five runs and the statistically-significant top performers are boldfaced. The thorough analysis is evident from the higher performance of CE in our setup compared to prior works. GJS achieves state-of-the-art results for different noise rates, types, and datasets. Generally, GJS’s efficacy is more evident for the more challenging CIFAR-100 dataset.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Dataset</td><td>Method</td><td>No Noise</td><td colspan="4">Symmetric Noise Rate</td><td colspan="2">Asymmetric Noise Rate</td></tr><tr><td></td><td></td><td>0%</td><td>20%</td><td>40%</td><td>60%</td><td>80%</td><td>20%</td><td>40%</td></tr><tr><td></td><td>CE</td><td>95.77 ± 0.11</td><td>91.63 ±0.27</td><td>87.74 ±0.46</td><td>81.99 ± 0.56</td><td>66.51 ± 1.49</td><td>92.77 ± 0.24</td><td>87.12 ± 1.21</td></tr><tr><td></td><td>BS</td><td>94.58± 0.25</td><td>91.68 ±0.32</td><td>89.23 ±0.16</td><td>82.65 ± 0.57</td><td>16.97 ± 6.36</td><td>93.06±0.25</td><td>88.87 ± 1.06</td></tr><tr><td></td><td>LS</td><td>95.64 ± 0.12</td><td>93.51 ± 0.20</td><td>89.90 ±0.20</td><td>83.96±0.58</td><td>67.35 ± 2.71</td><td>92.94 ± 0.17</td><td>88.10 ±0.50</td></tr><tr><td>CIFAR-10</td><td>SCE</td><td>95.75 ± 0.16</td><td>94.29 ± 0.14</td><td>92.72 ±0.25</td><td>89.26± 0.37</td><td>80.68 ± 0.42</td><td>93.48± 0.31</td><td>84.98±0.76</td></tr><tr><td></td><td>GCE</td><td>95.75 ± 0.14</td><td>94.24 ± 0.18</td><td>92.82 ± 0.11</td><td>89.37 ±0.27</td><td>79.19 ± 2.04</td><td>92.83 ±0.36</td><td>87.00 ±0.99</td></tr><tr><td></td><td>NCE+RCE</td><td>95.36±0.09</td><td>94.27 ± 0.18</td><td>92.03 ±0.31</td><td>87.30 ± 0.35</td><td>77.89 ± 0.61</td><td>93.87 ± 0.03</td><td>86.83 ±0.84</td></tr><tr><td></td><td>JS</td><td>95.89 ±0.10</td><td>94.52 ± 0.21</td><td>93.01 ±0.22</td><td>89.64 ±0.15</td><td>76.06 ±0.85</td><td>92.18 ± 0.31</td><td>87.99 ± 0.55</td></tr><tr><td></td><td>GJS</td><td>95.91 ± 0.09</td><td>95.33 ± 0.18</td><td>93.57 ± 0.16</td><td>91.64 ± 0.22</td><td>79.11 ± 0.31</td><td>93.94±0.25</td><td>89.65± 0.37</td></tr><tr><td></td><td>CE</td><td>77.60 ± 0.17</td><td>65.74 ± 0.22</td><td>55.77 ± 0.83</td><td>44.42 ± 0.84</td><td>10.74 ± 4.08</td><td>66.85±0.32</td><td>49.45 ± 0.37</td></tr><tr><td></td><td>BS</td><td>77.65± 0.29</td><td>72.92 ± 0.50</td><td>68.52 ± 0.54</td><td>53.80 ± 1.76</td><td>13.83 ± 4.41</td><td>73.79 ± 0.43</td><td>64.67 ± 0.69</td></tr><tr><td></td><td>LS</td><td>78.60 ±0.04</td><td>74.88 ± 0.15</td><td>68.41 ± 0.20</td><td>54.58 ± 0.47</td><td>26.98 ± 1.07</td><td>73.17 ± 0.46</td><td>57.20±0.85</td></tr><tr><td>CIFAR-100</td><td>SCE</td><td>78.29±0.24</td><td>74.21 ± 0.37</td><td>68.23 ±0.29</td><td>59.28 ± 0.58</td><td>26.80 ± 1.11</td><td>70.86 ± 0.44</td><td>51.12 ± 0.37</td></tr><tr><td></td><td>GCE</td><td>77.65 ± 0.17</td><td>75.02 ± 0.24</td><td>71.54 ± 0.39</td><td>65.21 ± 0.16</td><td>49.68 ±0.84</td><td>72.13 ±0.39</td><td>51.50 ± 0.71</td></tr><tr><td></td><td>NCE+RCE</td><td>74.66 ± 0.21</td><td>72.39± 0.24</td><td>68.79 ±0.29</td><td>62.18 ± 0.35</td><td>31.63 ± 3.59</td><td>71.35 ± 0.16</td><td>57.80±0.52</td></tr><tr><td></td><td>JS</td><td>77.95± 0.39</td><td>75.41 ± 0.28</td><td>71.12 ± 0.30</td><td>64.36 ±0.34</td><td>45.05 ± 0.93</td><td>71.70 ± 0.36</td><td>49.36±0.25</td></tr><tr><td></td><td>GJS</td><td>79.27 ±0.29</td><td>78.05±0.25</td><td>75.71±0.25</td><td>70.15 ±0.30</td><td>44.49 ± 0.53</td><td>74.60 ± 0.47</td><td>63.70 ±0.22</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Experimental Setup. We use ResNet 34 and 50 for experiments on CIFAR and WebVision datasets respectively and optimize them using SGD with momentum. The complete details of the training setup can be found in Appendix A. Most importantly, we take three main measures to ensure a fair and reliable comparison throughout the experiments: 1) we reimplement all the loss functions we compare with in a single shared learning setup, 2) we use the same hyperparameter optimization budget and mechanism for all the prior works and ours, and 3) we train and evaluate five networks for individual results, where in each run the synthetic noise, network initialization, and data-order are differently randomized. The thorough analysis is evident from the higher performance of CE in our setup compared to prior works. Where possible, we report mean and standard deviation and denote the statistically-significant top performers with student t-test.
|
| 154 |
+
|
| 155 |
+
# 4.1 Synthetic Noise Benchmarks: CIFAR
|
| 156 |
+
|
| 157 |
+
Here, we evaluate the proposed loss functions on the CIFAR datasets with two types of synthetic noise: symmetric and asymmetric. For symmetric noise, the labels are, with probability $\eta$ , resampled from a uniform distribution over all labels. For asymmetric noise, we follow the standard setup of Patrini et al. [22]. For CIFAR-10, the labels are modified, with probability $\eta$ , as follows: truck automobile, $b i r d $ airplane, $c a t d o g$ , and $d e e r \to h o r s e$ . For CIFAR-100, labels are, with probability $\eta$ , cycled to the next sub-class of the same “super-class”, e.g. the labels of super-class “vehicles $1 ^ { \circ }$ are modified as follows: bicycle $ b u s m o t o r c y c l e p i c k u p t r u c k t r a i n b i c y c l e$ .
|
| 158 |
+
|
| 159 |
+
We compare with other noise-robust loss functions such as label smoothing (LS) [23], Bootstrap (BS) [24], Symmetric Cross-Entropy (SCE) [4], Generalized Cross-Entropy (GCE) [3], and the $\mathrm { N C E + R C E }$ loss of Ma et al. [5]. Here, we do not compare to methods that propose a full pipeline since, first, a conclusive comparison would require re-implementation and individual evaluation of several components and second, robust loss functions can be considered orthogonal to them.
|
| 160 |
+
|
| 161 |
+
Results. Table 1 shows the results for symmetric and asymmetric noise on CIFAR-10 and CIFAR100. GJS performs similarly or better than other methods for different noise rates, noise types, and data sets. Generally, GJS’s efficacy is more evident for the more challenging CIFAR-100 dataset. For example, on $60 \%$ uniform noise on CIFAR-100, the difference between GJS and the second best (GCE) is 4.94 percentage points, while our results on $80 \%$ noise is lower than GCE. We attribute this to the high sensitivity of the results to the hyperparameter settings in such a high-noise rate which are also generally unrealistic (WebVision has $\sim 2 0 \%$ ). The performance of JS is consistently similar to the top performance of the prior works across different noise rates, types and datasets. In Section 4.3, we substantiate the importance of the consistency term, identified in Proposition 2, when going from JS to GJS that helps with the learning dynamics and reduce the susceptibility to noise. In Appendix B.1, we provide results for GJS on instance-dependent synthetic noise [25]. Next, we test the proposed losses on a naturally-noisy dataset to see their efficacy in a real-world scenario.
|
| 162 |
+
|
| 163 |
+
Table 2: Real-world Noise Benchmark on WebVision. Mean test accuracy and standard deviation from five runs are reported for the validation sets of (mini) WebVision and ILSVRC12. GJS with two networks correspond to the mean prediction of two independently trained GJS networks with different seeds for data augmentation and weight initialization. Here, GJS uses $Z = 1$ . Results marked with $\dagger$ are from Zheltonozhskii et al. [26].
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Architecture</td><td rowspan="2">Augmentation Networks</td><td rowspan="2"></td><td colspan="2">WebVision</td><td colspan="2">ILSVRC12</td></tr><tr><td>Top1</td><td>Top5</td><td>Top1</td><td>Top 5</td></tr><tr><td>ELR+ [27]†</td><td>Inception-ResNet-V2</td><td>Mixup</td><td>2</td><td>77.78</td><td>91.68</td><td>70.29</td><td>89.76</td></tr><tr><td>DivideMix [16]t]</td><td>Inception-ResNet-V2</td><td>Mixup</td><td>2</td><td>77.32</td><td>91.64</td><td>75.20</td><td>90.84</td></tr><tr><td>DivideMix [16]t</td><td>ResNet-50</td><td>Mixup</td><td>2</td><td>76.32 ± 0.36</td><td>90.65 ± 0.16</td><td>74.42 ± 0.29</td><td>91.21±0.12</td></tr><tr><td>CE</td><td>ResNet-50</td><td>ColorJitter</td><td>1</td><td>70.69 ± 0.66</td><td>88.64 ± 0.17</td><td>67.32 ± 0.57</td><td>88.00 ±0.49</td></tr><tr><td>JS</td><td>ResNet-50</td><td>ColorJitter</td><td>1</td><td>74.56± 0.32</td><td>91.09 ±0.08</td><td>70.36 ± 0.12</td><td>90.60 ±0.09</td></tr><tr><td>GJS</td><td>ResNet-50</td><td>ColorJitter</td><td>1</td><td>77.99 ± 0.35</td><td>90.62 ±0.28</td><td>74.33 ± 0.46</td><td>90.33±0.20</td></tr><tr><td>GJS</td><td>ResNet-50</td><td>ColorJitter</td><td>2</td><td>79.28±0.24</td><td>91.22 ± 0.30</td><td>75.50 ± 0.17</td><td>91.27±0.26</td></tr></table>
|
| 166 |
+
|
| 167 |
+
# 4.2 Real-World Noise Benchmark: WebVision
|
| 168 |
+
|
| 169 |
+
WebVision v1 is a large-scale image dataset collected by crawling Flickr and Google, which resulted in an estimated $20 \%$ of noisy labels [28]. There are 2.4 million images of the same thousand classes as ILSVRC12. Here, we use a smaller version called mini WebVision [29] consisting of the first 50 classes of the Google subset. We compare CE, JS, and GJS on WebVision following the same rigorous procedure as for the synthetic noise. However, upon request by the reviewers, we also compare with the reported results of some state-of-the-art elaborate techniques. This comparison deviates from our otherwise systematic analysis.
|
| 170 |
+
|
| 171 |
+
Results. Table 2, as the common practice, reports the performances on the validation sets of WebVision and ILSVRC12 (first 50 classes). Both JS and GJS exhibit large margins with standard CE, especially for top-1 accuracy. Top-5 accuracy, due to its admissibility of wrong top predictions, can obscure the susceptibility to noise-fitting and thus indicates smaller but still significant improvements.
|
| 172 |
+
|
| 173 |
+
The two state-of-the-art methods on this dataset were DivideMix [16] and $\mathrm { E L R + }$ [27]. Compared to our setup, both these methods use a stronger network (Inception-ResNet-V2 vs ResNet-50), stronger augmentations (Mixup vs color jittering) and co-train two networks. Furthermore, $\mathrm { E L R + }$ uses an exponential moving average of weights and DivideMix treats clean and noisy labeled examples differently after separating them using Gaussian mixture models. Despite these differences, GJS performs as good or better in terms of top-1 accuracy on WebVision and significantly outperforms $\mathrm { E L R + }$ on ILSVRC12 (70.29 vs 74.33). The importance of these differences becomes apparent as 1) the top-1 accuracy for DivideMix degrades when using ResNet-50, and 2) the performance of GJS improves by adding one of their components, i.e. the use of two networks. We train an ensemble of two independent networks with the GJS loss and average their predictions (last row of Table 2). This simple extension, which requires no change in the training code, gives significant improvements. To the best of our knowledge, this is the highest reported top-1 accuracy on WebVision and ILSVRC12 when no pre-training is used.
|
| 174 |
+
|
| 175 |
+
In Appendix B.2, we show state-of-the-art results when using GJS on two other real-world noisy datasets: ANIMAL-10N [30] and Food-101N [31].
|
| 176 |
+
|
| 177 |
+
So far, the experiments demonstrated the robustness of the proposed loss function (regarding Proposition 3) via the significant improvement of the final accuracy on noisy datasets. While this was central and informative, it is also important to investigate whether this improvement comes from the theoretical properties that were argued for JS and GJS. In what follows, we devise several such experiments, in an effort to substantiate the theoretical claims and conjectures.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 4: Effect of $\pi _ { 1 }$ . Validation accuracy of JS and GJS during training with symmetric noise on CIFAR100. From Proposition 1, JS behaves like CE and MAE for low and high values of $\pi _ { 1 }$ , respectively. The signs of noise-fitting for $\pi _ { 1 } = 0 . 1$ on $60 \%$ noise (b), and slow learning of $\pi _ { 1 } = 0 . 9$ (a-b), show this in practice. The GJS loss does not exhibit overfitting for low values of $\pi _ { 1 }$ and learns quickly for large values of $\pi _ { 1 }$ (c-d).
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 5: Effect of M. Validation accuracy for increasing number of distributions $( M )$ and different symmetric noise rates on CIFAR-100 with $\pi _ { 1 } = { \frac { 1 } { 2 } } \quad$ . For all noise rates, using three instead of two distributions results in a higher accuracy. Going beyond three distributions is only helpful for lower noise rates. For simplicity we use $M = 3$ (corresponding to two augmentations) for all of our experiments.
|
| 184 |
+
|
| 185 |
+
# 4.3 Towards a Better Understanding of the Jensen-Shannon-based Loss Functions
|
| 186 |
+
|
| 187 |
+
Here, we study the behavior of the losses for different distribution weights $\pi _ { 1 }$ , number of distributions $M$ , and epochs. We also provide insights on why GJS performs better than JS.
|
| 188 |
+
|
| 189 |
+
How does $\pi _ { 1 }$ control the trade-off of robustness and learnability? In Figure 4, we plot the validation accuracy during training for both JS and GJS at different values of $\pi _ { 1 }$ and noise rates $\eta$ From Proposition 1, we expect JS to behave as CE for low values of $\pi _ { 1 }$ and as MAE for larger values of $\pi _ { 1 }$ . Figure 4 (a-b) confirms this. Specifically, $\pi _ { 1 } = 0 . 1$ learns quickly and performs well for low noise but overfits for $\eta = 0 . 6$ (characteristic of non-robust CE), on the other hand, $\pi _ { 1 } = 0 . 9$ learns slowly but is robust to high noise rates (characteristic of noise-robust MAE).
|
| 190 |
+
|
| 191 |
+
In Figure 4 (c-d), we observe three qualitative improvements of GJS over JS: 1) no signs of overfitting to noise for large noise rates with low values of $\pi _ { 1 }$ , 2) better learning dynamics for large values of $\pi _ { 1 }$ that otherwise learns slowly, and 3) converges to a higher validation accuracy.
|
| 192 |
+
|
| 193 |
+
How many distributions to use? Figure 5 depicts validation accuracy for varying number of distributions $M$ . For all noise rates, we observe a performance increase going from $M = 2$ to $M = 3$ However, the performance of $M > 3$ depends on the noise rate. For lower noise rates, having more than three distributions can improve the performance. For higher noise rates e.g. $6 0 \%$ , having $M > 3$ degrades the performance. We hypothesise this is due to: 1) at high noise rates, there are only a few correctly labeled examples that can help guide the learning, and 2) going from $M = 2$ to $M = 3$ adds a consistency term, while $M > 3$ increases the importance of the consistency term in Proposition 2. Therefore, for a large enough M, the loss will find it easier to keep the consistency term low (keep predictions close to uniform as at the initialization), instead of generalizing based on the few clean examples. For simplicity, we have used $M = 3$ for all experiments with GJS.
|
| 194 |
+
|
| 195 |
+
Is the improvements of GJS over JS due to mean prediction or consistency? Proposition 2 decomposed GJS into a JS term with a mean prediction $( { \bar { p } } _ { > 1 } )$ and a consistency term operating on all distributions but the target. In Table 3, we compare the performance of JS and GJS to GJS without the consistency term, i.e., $\mathcal { L } _ { \mathrm { J S } _ { \pi ^ { \prime } } } ( e ^ { ( y ) } , \bar { p } _ { > 1 } )$ . The results suggest that the improvement of GJS over JS can be attributed to the consistency term.
|
| 196 |
+
|
| 197 |
+
Figure 4 (a-b) showed that JS improves the learning dynamics of MAE by blending it with CE, controlled by $\pi _ { 1 }$ . Similarly, we see here that the consistency term also improves the learning dynamics (underfitting and convergence speed) of MAE. Interestingly, Figure 4 (c-d), shows the higher values of $\pi _ { 1 }$ (closer to MAE) work best for GJS, hinting that, the consistency term improves the learning dynamics of MAE so much so that the role of CE becomes less important.
|
| 198 |
+
|
| 199 |
+
Table 3: Effect of Consistency. Validation accuracy for JS, GJS w/o the consistency term in Proposition 2, and GJS for $4 0 \%$ noise on the CIFAR-100 dataset. Using the mean of two predictions in the JS loss does not improve performance. On the other hand, adding the consistency term significantly helps.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Method</td><td>Accuracy</td></tr><tr><td>LJs(e(),p(2))</td><td>71.0</td></tr><tr><td>LJsπ,(e(),p>1)</td><td>68.7</td></tr><tr><td>LGJs(e(y),p(2),p(3))</td><td>74.3</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Table 4: Effect of GJS. Validation accuracy when using different loss functions for clean and noisy examples of the CIFAR-100 training set with $40 \%$ symmetric noise. Noisy examples benefit significantly more from GJS than clean examples (74.1 vs 72.9).
|
| 204 |
+
|
| 205 |
+
<table><tr><td colspan="2">Method</td><td colspan="3">T1</td></tr><tr><td>Clean</td><td>Noisy</td><td>0.1</td><td>0.5</td><td>0.9</td></tr><tr><td>JS</td><td>JS</td><td>70.0</td><td>71.5</td><td>55.3</td></tr><tr><td>GJS</td><td>JS</td><td>72.6</td><td>72.9</td><td>70.2</td></tr><tr><td>JS</td><td>GJS</td><td>71.0</td><td>74.1</td><td>68.0</td></tr><tr><td>GJS</td><td>GJS</td><td>71.3</td><td>74.7</td><td>73.8</td></tr></table>
|
| 206 |
+
|
| 207 |
+
Is GJS mostly helping the clean or noisy examples? To better understand the improvements of GJS over JS, we perform an ablation with different losses for clean and noisy examples, see Table 4. We observe that using GJS instead of JS improves performance in all cases. Importantly, using GJS only for the noisy examples performs significantly better than only using it for the clean examples (74.1 vs 72.9). The best result is achieved when using GJS for both clean and noisy examples but still close to the noisy-only case (74.7 vs 74.1).
|
| 208 |
+
|
| 209 |
+
How is different choices of perturbations affecting GJS? In this work, we use stochastic augmentations for $\mathcal { A }$ , see Appendix A.1 for details. Table 5 reports validation results on $40 \%$ symmetric and asymmetric noise on CIFAR-100 for varying types of augmentation. We observe that all methods improve their performance with stronger augmentation and that GJS achieves the best results in all cases. Also, note that we use weak augmentation for all naturally-noisy datasets (WebVision, ANIMAL-10N, and Food-101N) and still get state-of-the-art results.
|
| 210 |
+
|
| 211 |
+
How fast is the convergence? We found that some baselines (especially the robust $\mathrm { N C E + R C E }$ had slow convergence. Therefore, we used 400 epochs for all methods to make sure all had time to converge properly. Table 6 shows results on $40 \%$ symmetric and asymmetric noise on CIFAR-100 when the number of epochs has been reduced by half.
|
| 212 |
+
|
| 213 |
+
Is training with the proposed losses leading to more consistent networks? Our motivation for investigating losses based on Jensen-Shannon divergence was partly due to the observation in Figure 1 that consistency and accuracy correlate when learning with CE loss. In Figure 6, we compare CE, JS, and GJS losses in terms of validation accuracy and consistency during training on CIFAR-100 with $40 \%$ symmetric noise. We find that the networks trained with JS and GJS losses are more consistent and has higher accuracy. In Appendix B.7, we report the consistency of the networks in Table 1.
|
| 214 |
+
|
| 215 |
+
Summary of experiments in the appendix. Due to space limitations, we report several important experiments in the appendix. We evaluate the effectiveness of GJS on 1) instance-dependent synthetic noise (Section B.1), and 2) real-world noisy datasets ANIMAL-10N and Food-101N (Section B.2). We also investigate the importance of 1) losses being symmetric and bounded for learning with noisy labels (Section B.3), and 2) a clean vs noisy validation set for hyperparameter selection and the effect of a single set of parameters for all noise rates (Section B.5).
|
| 216 |
+
|
| 217 |
+
Table 5: Effect of Augmentation Strategy. Validation accuracy for training w/o CutOut(-CO) or w/o RandAug(-RA) or w/o both(weak) on $40 \%$ symmetric and asymmetric noise on CIFAR-100. All methods improves by stronger augmentations. GJS performs best for all types of augmentations.
|
| 218 |
+
|
| 219 |
+
<table><tr><td rowspan="3">Method</td><td colspan="4">Symmetric</td><td colspan="4">Asymmetric</td></tr><tr><td>Full</td><td>-CO</td><td>-RA</td><td>Weak Full</td><td></td><td>-C0</td><td>-RA</td><td>Weak</td></tr><tr><td>GCE</td><td>70.8</td><td>64.2</td><td>64.1</td><td>58.0</td><td>51.7</td><td>44.9</td><td>46.6</td><td>42.9</td></tr><tr><td>NCE+RCE</td><td>68.5</td><td>66.6</td><td>68.3</td><td>61.7</td><td>57.5</td><td>52.1</td><td>49.5</td><td>44.4</td></tr><tr><td>GJS</td><td>74.8</td><td>71.3</td><td>70.6</td><td>66.5</td><td>62.6</td><td>56.8</td><td>52.2</td><td>44.9</td></tr></table>
|
| 220 |
+
|
| 221 |
+
Table 6: Effect of Number of Epochs. Validation accuracy for training with 200 and 400 epochs for $40 \%$ symmetric and asymmetric noise on CIFAR-100. GJS still outperforms the baselines and $\mathrm { N C E + R C E }$ ’s performance is reduced heavily by the decrease in epochs.
|
| 222 |
+
|
| 223 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Symmetric</td><td colspan="2">Asymmetric</td></tr><tr><td>200</td><td>400</td><td>200</td><td>400</td></tr><tr><td>GCE</td><td>70.3</td><td>70.8</td><td>39.1</td><td>51.7</td></tr><tr><td>NCE+RCE</td><td>60.0</td><td>68.5</td><td>35.0</td><td>57.5</td></tr><tr><td>GJS</td><td>72.9</td><td>74.8</td><td>43.2</td><td>62.6</td></tr></table>
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 6: Evolution of a trained network’s consistency for the CE, JS, and GJS losses. We plot the evolution of the validation accuracy (a) and network’s consistency on clean (b) and noisy (c) examples of the training set of CIFAR-100 when learning with $40 \%$ symmetric noise. All losses use the same learning rate and weight decay and both JS and GJS use $\pi _ { 1 } = 0 . 5$ . The consistency of the learnt function and the accuracy closely correlate. The accuracy and consistency of JS and GJS improve during training, while both degrade when learning with CE loss.
|
| 227 |
+
|
| 228 |
+
# 5 Limitations & Future Directions
|
| 229 |
+
|
| 230 |
+
We empirically showed that the consistency of the network around noisy data degrades as it fits noise and accordingly proposed a loss based on generalized Jensen-Shannon divergence (GJS). While we empirically verified the significant role of consistency regularization in robustness to noise, we only theoretically showed the robustness $B _ { L } = B _ { U , }$ ) of GJS at its limit $\pi _ { 1 } 1 $ ) where the consistency term gradually vanishes. Therefore, the main limitation is the lack of a theoretical proof of the robustness of the consistency term in Proposition 2. This is, in general, an important but understudied area, also for the literature of self- or semi-supervised learning and thus is of utmost importance for future works.
|
| 231 |
+
|
| 232 |
+
Secondly, we had an important observation that GJS with $M > 3$ might not perform well under high noise rates. While we have some initial conjectures, this phenomenon deserves a systematic analysis both empirically and theoretically.
|
| 233 |
+
|
| 234 |
+
Finally, a minor practical limitation is the added computations for GJS forward passes, however this applies to training time only and in all our experiments, we only use one extra prediction ( $M = 3$ ).
|
| 235 |
+
|
| 236 |
+
# 6 Final Remarks
|
| 237 |
+
|
| 238 |
+
We first made two central observations that (i) robust loss functions have an underfitting issue and (ii) consistency of noise-fitting networks is significantly lower around noisy data points. Correspondingly, we proposed two loss functions, JS and GJS, based on Jensen-Shannon divergence that (i) interpolates between noise-robust MAE and fast-converging CE, and (ii) encourages consistency around training data points. This simple proposal led to state-of-the-art performance on both synthetic and real-world noise datasets even when compared to the more elaborate pipelines such as DivideMix or $\mathrm { E L R + }$ . Furthermore, we discussed their robustness within the theoretical construction of Ghosh et al. [2]. By drawing further connections to other seminal loss functions such as CE, MAE, GCE, and consistency regularization, we uncovered other desirable or informative properties. We further empirically studied different aspects of the losses that corroborate various theoretical properties.
|
| 239 |
+
|
| 240 |
+
Overall, we believe the paper provides informative theoretical and empirical evidence for the usefulness of two simple and novel JS divergence-based loss functions for learning under noisy data that achieve state-of-the-art results. At the same time, it opens interesting future directions.
|
| 241 |
+
|
| 242 |
+
Ethical Considerations. Considerable resources are needed to create labeled data sets due to the burden of manual labeling process. Thus, the creators of large annotated datasets are mostly limited to well-funded companies and academic institutions. In that sense, developing robust methods against label noise enables less affluent organizations or individuals to benefit from labeled datasets since imperfect or automatic labeling can be used instead. On the other hand, proliferation of such harvested datasets can increase privacy concerns arising from redistribution and malicious use.
|
| 243 |
+
|
| 244 |
+
Acknowledgement. This work was partially supported by the Wallenberg AI, Autonomous Systems and Software Program (WASP) funded by the Knut and Alice Wallenberg Foundation.
|
| 245 |
+
|
| 246 |
+
References
|
| 247 |
+
[1] Lucas Beyer, Olivier J Hénaff, Alexander Kolesnikov, Xiaohua Zhai, and Aäron van den Oord. Are we done with imagenet? arXiv preprint arXiv:2006.07159, 2020.
|
| 248 |
+
[2] Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, pages 1919–1925, 2017.
|
| 249 |
+
[3] Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in neural information processing systems, pages 8778–8788, 2018.
|
| 250 |
+
[4] Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In Proceedings of the IEEE International Conference on Computer Vision, pages 322–330, 2019.
|
| 251 |
+
[5] Xingjun Ma, Hanxun Huang, Yisen Wang, Simone Romano, Sarah Erfani, and James Bailey. Normalized loss functions for deep learning with noisy labels, 2020.
|
| 252 |
+
[6] Dan Hendrycks, Norman Mu, Ekin D. Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. Augmix: A simple data processing method to improve robustness and uncertainty. In International Conference on Learning Representation, 2020.
|
| 253 |
+
[7] Avital Oliver, Augustus Odena, Colin Raffel, Ekin D Cubuk, and Ian J Goodfellow. Realistic evaluation of deep semi-supervised learning algorithms. arXiv preprint arXiv:1804.09170, 2018.
|
| 254 |
+
[8] Jianhua Lin. Divergence measures based on the shannon entropy. IEEE Transactions on Information theory, 37(1):145–151, 1991.
|
| 255 |
+
[9] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization, 2017.
|
| 256 |
+
[10] Yang Liu and Hongyi Guo. Peer loss functions: Learning from noisy labels without knowing noise rates. In Hal Daumé III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 6226–6236. PMLR, 13–18 Jul 2020.
|
| 257 |
+
[11] Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. In Advances in neural information processing systems, pages 1196–1204, 2013.
|
| 258 |
+
[12] Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. In Proceedings of the international conference on learning representation, 2015.
|
| 259 |
+
[13] Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1944–1952, 2017.
|
| 260 |
+
[14] Bo Han, Jiangchao Yao, Gang Niu, Mingyuan Zhou, Ivor Tsang, Ya Zhang, and Masashi Sugiyama. Masking: A new perspective of noisy supervision. In Advances in Neural Information Processing Systems, pages 5836–5846, 2018.
|
| 261 |
+
[15] Xiaobo Xia, Tongliang Liu, Nannan Wang, Bo Han, Chen Gong, Gang Niu, and Masashi Sugiyama. Are anchor points really indispensable in label-noise learning? In Advances in Neural Information Processing Systems, pages 6838–6849, 2019.
|
| 262 |
+
[16] Junnan Li, Richard Socher, and Steven CH Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. In International Conference on Learning Representation, 2020.
|
| 263 |
+
[17] Jihoon Tack, Sihyun Yu, Jongheon Jeong, Minseon Kim, Sung Ju Hwang, and Jinwoo Shin. Consistency regularization for adversarial robustness, 2021.
|
| 264 |
+
[18] Yilun Xu, Peng Cao, Yuqing Kong, and Yizhou Wang. L_dmi: A novel information-theoretic loss function for training deep nets robust to label noise. In Advances in Neural Information Processing Systems, pages 6225–6236, 2019.
|
| 265 |
+
[19] Jiaheng Wei and Yang Liu. When optimizing f-divergence is robust with label noise. In International Conference on Learning Representation, 2021.
|
| 266 |
+
[20] I. CSISZAR. Information-type measures of difference of probability distributions and indirect observation. Studia Scientiarum Mathematicarum Hungarica, 2:229–318, 1967.
|
| 267 |
+
[21] Frank Nielsen. On the jensen–shannon symmetrization of distances relying on abstract means. Entropy, 21(5), 2019.
|
| 268 |
+
[22] Giorgio Patrini, Alessandro Rozza, Aditya Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: a loss correction approach, 2017.
|
| 269 |
+
[23] Michal Lukasik, Srinadh Bhojanapalli, Aditya Krishna Menon, and Sanjiv Kumar. Does label smoothing mitigate label noise? In International Conference on Machine Learning, 2020.
|
| 270 |
+
[24] Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014.
|
| 271 |
+
[25] Yikai Zhang, Songzhu Zheng, Pengxiang Wu, Mayank Goswami, and Chao Chen. Learning with feature-dependent label noise: A progressive approach, 2021.
|
| 272 |
+
[26] Evgenii Zheltonozhskii, Chaim Baskin, Avi Mendelson, Alex M. Bronstein, and Or Litany. Contrast to divide: Self-supervised pre-training for learning with noisy labels, 2021.
|
| 273 |
+
[27] Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Earlylearning regularization prevents memorization of noisy labels, 2020.
|
| 274 |
+
[28] Wen Li, Limin Wang, Wei Li, Eirikur Agustsson, and Luc Van Gool. Webvision database: Visual learning and understanding from web data, 2017.
|
| 275 |
+
[29] Lu Jiang, Zhenyuan Zhou, Thomas Leung, Jia Li, and Fei-Fei Li. Mentornet: Learning data-driven curriculum for very deep neural networks on corrupted labels. In ICML, 2018.
|
| 276 |
+
[30] Hwanjun Song, Minseok Kim, and Jae-Gil Lee. SELFIE: Refurbishing unclean samples for robust deep learning. In ICML, 2019.
|
| 277 |
+
[31] Kuang-Huei Lee, Xiaodong He, Lei Zhang, and Linjun Yang. Cleannet: Transfer learning for scalable image classifier training with label noise. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 278 |
+
[32] Ekin D. Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V. Le. Randaugment: Practical automated data augmentation with a reduced search space, 2019.
|
| 279 |
+
[33] Terrance DeVries and Graham W. Taylor. Improved regularization of convolutional neural networks with cutout, 2017.
|
| 280 |
+
[34] Junnan Li, Yongkang Wong, Qi Zhao, and Mohan Kankanhalli. Learning to learn from noisy labeled data, 2019.
|
| 281 |
+
[35] Duc Tam Nguyen, Chaithanya Kumar Mummadi, Thi Phuong Nhung Ngo, Thi Hoai Phuong Nguyen, Laura Beggel, and Thomas Brox. Self: Learning to filter noisy labels with selfensembling. In International Conference on Learning Representation, 2019.
|
| 282 |
+
[36] Curtis G Northcutt, Tailin Wu, and Isaac L Chuang. Learning with confident examples: Rank pruning for robust classification with noisy labels. arXiv preprint arXiv:1705.01936, 2017.
|
| 283 |
+
[37] Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5552–5560, 2018.
|
| 284 |
+
[38] Arash Vahdat. Toward robustness against label noise in training deep discriminative neural networks. In Advances in Neural Information Processing Systems, pages 5596–5605, 2017.
|
| 285 |
+
[39] Ahmet Iscen, Giorgos Tolias, Yannis Avrithis, Ondrej Chum, and Cordelia Schmid. Graph convolutional networks for learning with few clean and many noisy labels. In Proceedings of the European Conference on Computer Vision, 2020.
|
| 286 |
+
[40] Paul Hongsuck Seo, Geeho Kim, and Bohyung Han. Combinatorial inference against label noise. In Advances in Neural Information Processing Systems, pages 1173–1183, 2019.
|
| 287 |
+
[41] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
|
| 288 |
+
[42] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 41(8):1979–1993, 2018.
|
| 289 |
+
[43] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin A Raffel. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems, pages 5049–5059, 2019.
|
| 290 |
+
[44] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in neural information processing systems, pages 1195–1204, 2017.
|
| 291 |
+
|
| 292 |
+
# Checklist
|
| 293 |
+
|
| 294 |
+
1. For all authors...
|
| 295 |
+
|
| 296 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 297 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 6.
|
| 298 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 6.
|
| 299 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 300 |
+
|
| 301 |
+
2. If you are including theoretical results...
|
| 302 |
+
|
| 303 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] See Section C in the Appendix.
|
| 304 |
+
|
| 305 |
+
3. If you ran experiments...
|
| 306 |
+
|
| 307 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See footnote on the first page.
|
| 308 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section A in the Appendix.
|
| 309 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See main experiments in Table 1 & 2.
|
| 310 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section A.
|
| 311 |
+
|
| 312 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 313 |
+
|
| 314 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 315 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 316 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
|
| 317 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 318 |
+
|
| 319 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 320 |
+
|
| 321 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 322 |
+
|
| 323 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 324 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 325 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/Wua2zjxJdYo/Wua2zjxJdYo.md
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Learning to Generate Realistic Noisy Images via Pixel-level Noise-aware Adversarial Training
|
| 2 |
+
|
| 3 |
+
Yuanhao Cai 1,2, Xiaowan $\mathbf { H } \mathbf { u } ^ { \mathrm { ~ 1 , 2 ~ } }$ , Haoqian Wang $^ { 1 , 2 , * }$ , Yulun Zhang 3, Hanspeter Pfister 4, Donglai Wei 5
|
| 4 |
+
|
| 5 |
+
1 Shenzhen International Graduate School, Tsinghua University, 2 Shenzhen Institute of Future Media Technology, 3 ETH Zürich, 4 Harvard University, 5 Boston College
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Existing deep learning real denoising methods require a large amount of noisyclean image pairs for supervision. Nonetheless, capturing a real noisy-clean dataset is an unacceptable expensive and cumbersome procedure. To alleviate this problem, this work investigates how to generate realistic noisy images. Firstly, we formulate a simple yet reasonable noise model that treats each real noisy pixel as a random variable. This model splits the noisy image generation problem into two subproblems: image domain alignment and noise domain alignment. Subsequently, we propose a novel framework, namely Pixel-level Noise-aware Generative Adversarial Network (PNGAN). PNGAN employs a pre-trained real denoiser to map the fake and real noisy images into a nearly noise-free solution space to perform image domain alignment. Simultaneously, PNGAN establishes a pixel-level adversarial training to conduct noise domain alignment. Additionally, for better noise fitting, we present an efficient architecture Simple Multi-scale Network (SMNet) as the generator. Qualitative validation shows that noise generated by PNGAN is highly similar to real noise in terms of intensity and distribution. Quantitative experiments demonstrate that a series of denoisers trained with the generated noisy images achieve state-of-the-art (SOTA) results on four real denoising benchmarks.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Image denoising is an important yet challenging problem in low-level vision. It aims to restore a clean image from its noisy counterpart. Traditional approaches concentrate on designing a rational maximum a posteriori (MAP) model, containing regularization and fidelity terms, from a Bayesian perspective [1]. Some image priors like low-rankness [2, 3, 4], sparsity [5], and non-local similarity [6, 7] are exploited to customize a better rational MAP model. However, these hand-crafted methods are inferior in representing capacity. With the development of deep learning, image denoising has witnessed significant progress. Deep convolutional neural network (CNN) applies a powerful learning model to eliminate noise and has achieved promising performance [8, 9, 10, 11, 12, 13, 14]. These deep CNN denoisers rely on a large-scale dataset of real-world noisy-clean image pairs. Nonetheless, collecting even small datasets is extremely tedious and labor-intensive. The process of acquiring real-world noisy-clean image pairs is to take hundreds of noisy images of the same scene and average them to get the clean image. To get more image pairs, researchers try to synthesize noisy images.
|
| 14 |
+
|
| 15 |
+
In particular, there are two common settings for synthesizing noisy images. As shown in Fig. 1 (a1), setting1 directly adds the additive white Gaussian noise (AWGN) with the clean RGB image. For a long time, single image denoising [15, 16, 17, 18, 19, 10] is performed with setting1. Nevertheless, fundamentally different from AWGN, real camera noise is generally more sophisticated and signaldependent[20, 21]. The noise produced by photon sensing is further affected by the in-camera signal processing (ISP) pipeline (e.g., Gama correction, compression, and demosaicing). Models trained with setting1 are easily over-fitted to AWGN and fail in real noise removal. Setting2 is based on ISP-modeling CNN [22] and Poisson-Gaussian [21, 23] noise model that modeling photon sensing with Poisson and remaining stationary disturbances with Gaussian has been adopted in RAW denoising. As shown in Fig. 1 (a2), setting2 adds a Poisson-Gaussian noise with the clean RAW image and then passes the result through a pre-trained RAW2RGB CNN to obtain the RGB noisy counterpart. Notably, when the clean RAW image is unavailable, a pre-trained RGB2RAW CNN is utilized to transform the clean RGB image to its RAW counterpart [22]. However, setting2 has the following drawbacks: (i) The noise is assumed to obey a hand-crafted probability distribution. However, because of the randomness and complexity of real camera noise, it’s difficult to customize a hand-crafted probability distribution to model all the characteristics of real noise. (ii) The ISP pipeline is very sophisticated and hard to be completely modeled. The RAW2RGB branch only learns the mapping from the clean RAW domain to the clean RGB space. However, the mapping from the Poisson-Gaussian noisy RAW domain to the real noisy RGB space can not be ensured. (iii) The ISP pipelines of different devices vary significantly, which results in the poor generality and robustness of ISP modeling CNNs. Thus, whether noisy images are synthesized with setting1 or 2, there still remains a discrepancy between synthetic and real noisy datasets. We notice that GAN utilizes the internal information of the input image and external information from other images when modeling image priors. Hence, we propose to use GAN to adaptively learn the real noise distribution.
|
| 16 |
+
|
| 17 |
+
GAN is firstly introduced in [24] and has been proven successful in image synthesis [25, 26, 27] and translation [26, 27]. Subsequently, GAN is applied to image restoration and enhancement, e.g., super resolution [28, 29, 30], style transfer [27, 31], enlighten [32, 33], deraining [34], dehazing [35], image inpainting [36, 37], image editing [38, 39], and mobile photo enhancement [40, 41]. Although GAN is widely applied in low-level vision tasks, few works are dedicated to investigating the realistic noise generation problem [42]. Chen et al. [43] propose a simple GAN that takes Gaussian noise as input to generate noisy patches. However, as in general, this GAN is image-level, i.e., it treats images as samples and attempts to approximate the probability distribution of real-world noisy images. This image-level GAN neglects that each pixel of a real noisy image is a random variable and the real noise is spatio-chromatically correlated, thus results in coarse learning of the real noise distribution.
|
| 18 |
+
|
| 19 |
+
To alleviate the above problems, this work focuses on learning how to generate realistic noisy images so as to augment the training data for real denoisers. To begin with, we propose a simple yet reasonable noise model that treats each pixel of a real noisy image as a random variable. This noise model splits the noise generation problem into two sub-problems: image domain alignment and noise domain alignment. Subsequently, to tackle these two sub-problems, we propose a novel Pixel-level Noise-aware Generative Adversarial Network (PNGAN). During the training procedure of PNGAN, we employ a pre-trained real denoiser to map the generated and real noisy images into a nearly noise-free solution space to perform image domain alignment. Simultaneously, PNGAN establishes a pixel-level adversarial training that encourages the generator to adaptively simulate the real noise distribution so as to conduct the noise domain alignment. In addition, for better real noise fitting, we present a lightweight yet efficient CNN architecture, Simple Multi-scale Network (SMNet) as the generator. SMNet repeatedly aggregates multi-scale features to capture rich auto-correlation, which provides more sufficient spatial representations for noise simulating. Different from general image-level GAN, our discriminator is pixel-level. The discriminator outputs a score map. Each position on the score map indicates how realistic the corresponding noisy pixel is. With this pixellevel noise-aware adversarial training, the generator is encouraged to create solutions that are highly similar to real noisy images and thus difficult to be distinguished.
|
| 20 |
+
|
| 21 |
+
In conclusion, our contributions can be summarized into four points:
|
| 22 |
+
|
| 23 |
+
(1) We formulate a simple yet reasonable noise model. This model treats each noisy pixel as a random variable and then splits the noisy image generation into two parts: image and noise domain alignment.
|
| 24 |
+
|
| 25 |
+
(2) We propose a novel framework, PNGAN. It establishes an effective pixel-level adversarial training to encourage the generator to favor solutions that reside on the manifold of real noisy images.
|
| 26 |
+
|
| 27 |
+
(3) We customize an efficient CNN architecture, SMNet learning rich multi-scale auto-correlation for better noise fitting. SMNet serves as the generator in PNGAN costing only 0.8M parameters.
|
| 28 |
+
|
| 29 |
+
(4) Qualitative validation shows that noise generated by PNGAN is highly similar to real noise in terms of intensity and distribution. Quantitative experiments demonstrate that a series of denoisers finetuned with the generated noisy images achieve SOTA results on four real denoising benchmarks.
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
Figure 1: The pipeline of using PNGAN to perform data augmentation. It is divided into: (a) synthesizing phase, (b) training phase, and (c) finetuning phase. Please refer to the text (Sec. 2) for more detailed descriptions.
|
| 33 |
+
|
| 34 |
+
# 2 Proposed Method
|
| 35 |
+
|
| 36 |
+
As shown in Fig. 1, the pipeline of using PNGAN to perform data augmentation consists of three phases. (a) is the synthesizing phase. (a1) and (a2) are two common synthetic settings. In this phase, we produce the synthetic noisy image from its clean RGB or RAW counterpart. (b) is the training phase of PNGAN. The generator $G$ adopts the synthetic image as input. Which synthetic setting is selected is controlled by the switch. By using a pre-trained real denoiser $D _ { d }$ , PNGAN establishes a pixel-level noise-aware adversarial training between the generator $G$ and discriminator $D$ so as to simultaneously conduct image and noise domain alignment. $D _ { d }$ is set as RIDNet [44] in this work. (c) is the finetuning phase. Firstly, in (c1), the generator creates extended fake noisy-clean image pairs. Secondly, in (c2), the fake and real data are jointly utilized to finetune a series of real denoisers.
|
| 37 |
+
|
| 38 |
+
# 2.1 Pixel-level Noise Modelling
|
| 39 |
+
|
| 40 |
+
Real camera noise is sophisticated and signal-dependent. Specifically, in the real camera system, the RAW noise produced by photon sensing comes from multiple sources (e.g., short noise, thermal noise, and dark current noise) and is further affected by the ISP pipeline. Besides, illumination changes and camera movement inevitably lead to spatial pixel misalignment and color or brightness deviation. Hence, hand-designed noise models based on mathematical assumptions are difficult to accurately and completely describe the properties of real noise. Different from previous methods, we don’t base our noise model on any mathematical assumptions. Instead, we use CNN to implicitly simulate the characteristics of real noise. We begin by noting that when taking multiple noisy images of the same scene, the noise intensity of the same pixel varies a lot. Simultaneously, affected by the ISP pipeline, the real noise is spatio-chromatically correlated. Thus, the correlation between different pixels of the same real noisy image should be considered. In light of these facts, we treat each pixel of a real noisy image as a random variable and formulate a simple yet reasonable noise model:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\mathbf { I } _ { r n } [ i ] = \hat { \mathbf { I } } _ { c l e a n } [ i ] + \mathbf { N } [ i ] , \quad D _ { d } ( \mathbf { I } _ { r n } ) [ i ] = \hat { \mathbf { I } } _ { c l e a n } [ i ] , \quad 1 \leq i \leq H \times W ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\hat { \mathbf { I } } _ { c l e a n } \in \mathbb { R } ^ { H \times W \times 3 }$ is the predicted clean counterpart of ${ \mathbf I } _ { r n }$ , it’s denoised by $D _ { d }$ . Each $\mathbf { N } [ i ]$ is a random noise variable with unknown probability distribution. Therefore, each $\mathbf { I } _ { \mathit { r n } } [ i ]$ can also be viewed as a distribution-unknown random variable. Now we aim to design a framework to generate a fake noisy image $\mathbf { I } _ { f n } \in \mathbb { R } ^ { H \times W \times 3 }$ such that the probability distribution of $\mathbf { I } _ { f n } [ i ]$ and $\mathbf { I } _ { \mathit { r n } } [ i ]$ is as close as possible. Please note that the mapping learned by $D _ { d }$ is precisely from ${ \mathbf I } _ { r n }$ to $\hat { \mathbf { I } } _ { c l e a n }$ . If the constant in Eq. (1) is set as the clean image $\mathbf { I } _ { c l e a n } \in \mathbb { R } ^ { \bar { H } \times W \times 3 }$ , the subsequent domain alignment will introduce unnecessary errors and eventually lead to inaccurate results.
|
| 47 |
+
|
| 48 |
+
# 2.2 Pixel-level Noise-aware Adversarial Training
|
| 49 |
+
|
| 50 |
+
Our goal is to generate realistic noisy images. According to the noise model in Eq. (1), we split this problem into two sub-problems: (i) Image domain alignment aims to align $\hat { \mathbf { I } } _ { c l e a n } [ i ]$ . (ii) Noise domain alignment targets at modeling the distribution of $\mathbf { N } [ i ]$ . To handle the sub-problems, PNGAN establishes a novel pixel-level noise-aware adversarial training between $G$ and $D$ in Fig. 1 (b).
|
| 51 |
+
|
| 52 |
+
Image Domain Alignment. A very naive strategy to construct both image and noise domain alignment is to directly minimize the distance of $\mathbf { I } _ { f n }$ and ${ \mathbf I } _ { r n }$ . However, due to the intrinsic randomness, complexity, and irregularity of real noise, directly deploying $\mathcal { L } _ { 1 }$ loss between $\mathbf { I } _ { f n }$ and ${ \mathbf I } _ { r n }$ is unreasonable and drastically damages the quality of $\mathbf { I } _ { f n }$ . Besides, as analyzed in Sec. 2.1, each pixel of ${ \mathbf I } _ { r n }$ is a distribution-unknown random variable. This indicates that such a naive strategy challenges the training and may easily cause the non-convergence issue. Therefore, the noise interference should be eliminated while constructing the image domain alignment. To this end, we feed $\mathbf { I } _ { f n }$ and ${ \mathbf I } _ { r n }$ into $D _ { d }$ to obtain their denoised versions and then perform $\mathcal { L } _ { 1 }$ loss between $\mathbf { I } _ { f n }$ and ${ \mathbf I } _ { r n }$ :
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathcal { L } _ { 1 } = \sum _ { i = 1 } ^ { H \times W } \left| \left| D _ { d } ( \mathbf { I } _ { f n } ) [ i ] - D _ { d } ( \mathbf { I } _ { r n } ) [ i ] \right| \right| _ { 1 } = \sum _ { i = 1 } ^ { H \times W } \left| \left| D _ { d } ( \mathbf { I } _ { f n } ) [ i ] - \hat { \mathbf { I } } _ { c l e a n } [ i ] \right| \right| _ { 1 } .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
By using $D _ { d }$ , we can transfer ${ \mathbf I } _ { r n }$ and $\mathbf { I } _ { f n }$ into a nearly noise-free solution space. The value of $\hat { \mathbf { I } } _ { c l e a n }$ is relatively stable. Therefore, minimizing $\mathcal { L } _ { 1 }$ can encourage $G$ to favor solutions that after being denoised by $D _ { d }$ converge to $\hat { \mathbf { I } } _ { c l e a n }$ . In this way, the image domain alignment is constructed.
|
| 59 |
+
|
| 60 |
+
Noise Domain Alignment. Becasue of the complexity and variability of real noise, it’s hard to completely seperate $\mathbf { N } [ i ]$ from $\mathbf { I } _ { \mathit { r n } } [ i ]$ in Eq (1). Fortunately, we note that on the basis of constructing the image domain alignment of $\hat { \mathbf { I } } _ { c l e a n } [ i ]$ , the noise domain alignment of $\mathbf { N } [ i ]$ is equivalent to the distribution estimation of $\mathbf { I } _ { \mathit { r n } } [ \bar { i } ]$ . Additionally, as the real noise is signaldependent, the alignment between $\mathbf { I } _ { f n } [ i ]$ and $\mathbf { I } _ { \mathit { r n } } [ i ]$ is more beneficial to capture the correlation between noise and scene. We denote the
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 2: Architecture of discriminator.
|
| 64 |
+
|
| 65 |
+
distribution of $\mathbf { I } _ { \mathit { r n } } [ i ]$ as $P _ { d a t a } ( x _ { i } )$ , some real noisy pixel samples of $\mathbf { I } _ { \mathit { r n } } [ i ]$ as $\{ x _ { i } ^ { 1 } , x _ { i } ^ { 2 } , . . . , x _ { i } ^ { m } \}$ such that $x _ { i } ^ { k } \sim P _ { d a t a } ( x _ { i } )$ , and the distribution of $\mathbf { I } _ { f n } [ i ]$ as $P _ { G } ( x _ { i } ; \theta _ { G } )$ . Here $\theta _ { G }$ is the parameter of $G$ . Then we formulate the noise domain aligment into a maximum likelihood estimation problem:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\theta _ { G } ^ { * } = a r g \operatorname * { m a x } _ { \theta _ { G } } \sum _ { i = 1 } ^ { H \times W } \sum _ { k = 1 } ^ { m } \log P _ { G } ( x _ { i } ^ { k } ; \theta _ { G } ) = a r g m a x \operatorname { \mathbb { E } } _ { i } \left[ \mathbb { E } _ { x _ { i } ^ { k } } \left[ \log P _ { G } ( x _ { i } ^ { k } ; \theta _ { G } ) \right] \right] ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\mathbb { E }$ means taking the average value. To approach this upper bound as close as possible, we present $D$ and establish the pixel-level adversarial traininig between $G$ and $D$ . The architecture of $D$ is shown in Fig. 2. $D$ consists of 4 convolutional $( c o n v )$ layers and utilizes LeakyReLU activation $( \alpha = 0 . 2$ ). General discriminator treats a image as a sample and outputs a score indicating how realistic the image is. Instead, $D$ is a pixel-level classifier. $D$ adopts the fake and real noisy images as input in a mini-batch and outputs a score map $\mathbf { P } \in \mathbb { R } ^ { H \times W }$ for each image. Specifically, the information of $\mathbf { P } [ i ] \in [ 0 , 1 ]$ is the probability value indicating how realistic $P _ { G } ( x _ { i } ; \theta _ { G } )$ is. $G$ aims to generate more realistic $\mathbf { I } _ { f n } [ i ]$ to fool $D$ while $D$ targets at distinguishing $\mathbf { I } _ { f n } [ i ]$ from $\mathbf { I } _ { \mathit { r n } } [ i ]$ . According to Eq .(3), we formulate the adversarial training between $G$ and $D$ as a min-max problem:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\operatorname* { m i n } _ { \theta _ { G } } \operatorname* { m } _ { \theta _ { D } } \mathbb { E } _ { i } \left[ \mathbb { E } _ { \mathbf { I } _ { r n } } \left[ \mathrm { l o g } ( D ( \mathbf { I } _ { r n } ; \theta _ { D } ) [ i ] ) \right] \right] + \mathbb { E } _ { i } \left[ \mathbb { E } _ { \mathbf { I } _ { f n } } \left[ \mathrm { l o g } ( 1 - D ( \mathbf { I } _ { f n } ; \theta _ { D } ) [ i ] ) \right] \right] ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\mathbb { E } _ { \mathbf { I } _ { r n } }$ and $\mathbb { E } _ { \mathbf { I } _ { f n } }$ respectively represent the operation of taking the average for all fake and real data in the mini-batch. As analyzed in [45], to make GANs analogous to divergence minimization and produce sensible predictions based on the a priori knowledge that half of the samples in the mini-batch are fake, we utilize the recently proposed relativistic discriminator [45] as follow:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r l } & { D ( \mathbf { I } _ { r n } ; \theta _ { D } ) = \sigma ( C _ { D } ( \mathbf { I } _ { r n } ) ) , \quad D _ { R a } ( \mathbf { I } _ { r n } , \mathbf { I } _ { f n } ) = \sigma ( C _ { D } ( \mathbf { I } _ { r n } ) - \mathbb { E } _ { \mathbf { I } _ { f n } } ( C _ { D } ( \mathbf { I } _ { f n } ) ) ) , } \\ & { D ( \mathbf { I } _ { f n } ; \theta _ { D } ) = \sigma ( C _ { D } ( \mathbf { I } _ { f n } ) ) , \quad D _ { R a } ( \mathbf { I } _ { f n } , \mathbf { I } _ { r n } ) = \sigma ( C _ { D } ( \mathbf { I } _ { f n } ) - \mathbb { E } _ { \mathbf { I } _ { r n } } ( C _ { D } ( \mathbf { I } _ { r n } ) ) ) , } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $D _ { R a }$ denotes the relativistic discriminator, $\sigma$ means the Sigmoid activation, and $C _ { D }$ represents the non-transformed discriminator output. $D _ { R a }$ estimates the probability that real data is more realistic than fake data and also directs the generator to create a fake image that is more realistic than real images. The loss functions of $D$ and $G$ are then defined in a symmetrical form:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r l } & { \mathcal { L } _ { D } = - \mathbb { E } _ { i } [ \mathbb { E } _ { { \mathbf { I } } _ { r n } } \big [ \mathrm { l o g } ( D _ { R a } ( { \mathbf { I } } _ { r n } , { \mathbf { I } } _ { f n } ) [ i ] ) \big ] + \mathbb { E } _ { { \mathbf { I } } _ { f n } } \big [ \mathrm { l o g } ( 1 - D _ { R a } ( { \mathbf { I } } _ { f n } , { \mathbf { I } } _ { r n } ) [ i ] ) \big ] \big ] , } \\ & { \mathcal { L } _ { G } = - \mathbb { E } _ { i } [ \mathbb { E } _ { { \mathbf { I } } _ { r n } } \big [ \mathrm { l o g } ( 1 - D _ { R a } ( { \mathbf { I } } _ { r n } , { \mathbf { I } } _ { f n } ) [ i ] ) \big ] + \mathbb { E } _ { { \mathbf { I } } _ { f n } } \big [ \mathrm { l o g } ( D _ { R a } ( { \mathbf { I } } _ { f n } , { \mathbf { I } } _ { r n } ) [ i ] ) \big ] ] . } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 3: Details of the generator. (a) is the architecture of SMNet. (b) depicts the components of SRG. (c) shows the details of MAB. MAB is equipped with FCA, which is illustrated in (d).
|
| 91 |
+
|
| 92 |
+
During the training procedure, we fix $D$ to train $G$ and fix $G$ to train $D$ iteratively. Minimizing $\mathcal { L } _ { G }$ and $\mathcal { L } _ { D }$ alternately allows us to train a generative model $G$ with the goal of fooling the pixel-level discriminator $D$ that is trained to distinguish fake noisy images from real noisy images. This pixellevel noise-aware adversarial training scheme encourages $G$ to favor perceptually natural solutions that reside on the manifold of real noisy images so as to construct the noise domain alignment.
|
| 93 |
+
|
| 94 |
+
# 2.3 Noisy Image Generating
|
| 95 |
+
|
| 96 |
+
In Sec. 2.1, we denote the probability distribution of $\mathbf { I } _ { f n } [ i ]$ as $P _ { G } ( x _ { i } ; \theta _ { G } )$ . Now we customize a light-weight yet efficient CNN architecture, SMNet as $G$ to generate $P _ { G } ( x _ { i } ; \theta _ { G } )$ . In this section, we firstly introduce the input setting of $G$ and subsequently detail the architecture of SMNet.
|
| 97 |
+
|
| 98 |
+
Input Setting. We aim to generate a realistic noisy image from its clean counterpart. A naive setting is to directly adopt the clean image as the input to generate the noisy image. However, this naive setting is not in line with the fact. When we repeatedly feed the same clean image to a pre-trained $G$ , $G$ outputs completely the same noisy images. In contrast, when taking multiple pictures in the real world, the real noisy images vary a lot in the intensity of each pixel. This is caused by many factors (e.g., photon sensing noise, ISP pipelines, and illumination conditions). Hence, the naive input setting containing no distribution is unreasonable. We review that the general GANs sample from an initial random distribution (usually Gaussian) to generate a fake image. Hence, the input of $G$ should contain a random distribution so as to generate multiple noisy images of the same scene. We note that the two common synthetic settings meet this condition. Therefore, we utilize the two common settings to produce the synthetic image and then adopt the synthetic image as the input of $G$ Subsequently, we propose a light-weight yet efficient architecture, SMNet for better real noise fitting.
|
| 99 |
+
|
| 100 |
+
SMNet Architecture. The architecture of SMNet is shown in Fig. 3 (a). SMNet involves $t$ Simple Residual Groups (SRG) and each SRG contains $n$ Multi-scale Attention Blocks (MAB). The synthetic input $\mathbf { I } _ { s y n } \in \dot { \mathbb { R } } ^ { H \times W \times 3 }$ continuously undergoes a conv layer $f _ { 1 }$ , $t$ SRGs, and a conv layer $f _ { 2 }$ , then adds with a long identity mapping for efficient residual learning to eventually generate the fake noisy counterpart $\mathbf { I } _ { f n } \in \mathbb { R } ^ { H \times W \times \dot { 3 } }$ . This process can be formulated as:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathbf { I } _ { f n } = \mathbf { I } _ { s y n } + f _ { 2 } ( S _ { t } ( \mathbf { F } _ { S _ { t } } ) ) , ~ \mathbf { F } _ { S _ { j + 1 } } = S _ { j } ( \mathbf { F } _ { S _ { j } } ) , ~ \mathbf { F } _ { S _ { 1 } } = f _ { 1 } ( \mathbf { I } _ { f n } ) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $S _ { j }$ denotes the $j _ { t h }$ SRG, $1 \leq j \leq t - 1$ . The components of SRG are depicted in Fig. 3 (b). We define the input feature of the $j _ { t h }$ SRG as $\mathbf { F } _ { S _ { j } } \in \mathbb { R } ^ { H \times W \times C }$ and its channel as $C$ . $\mathbf { F } _ { S _ { j } }$ continuously undergoes a conv layer, $n$ MABs, and a conv layer to add with an identity mapping:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathbf { F } _ { S _ { j + 1 } } = \mathbf { F } _ { S _ { j } } + M _ { n } ^ { j } ( \mathbf { F } _ { M _ { n } ^ { j } } ) , ~ \mathbf { F } _ { M _ { k + 1 } ^ { j } } = M _ { k } ^ { j } ( \mathbf { F } _ { M _ { k } ^ { j } } ) , ~ \mathbf { F } _ { M _ { 1 } ^ { j } } = \mathbf { F } _ { S _ { j } } ,
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $M _ { k } ^ { j }$ denotes the $k _ { t h }$ MAB of the $j _ { t h }$ SRG, $1 \leq k \leq n - 1$ . MAB is the basic building block and the most significant component of SMNet. The details of MAB are depicted in Fig. 3 (c). We customize MAB with the following motivations: (i) Multi-scale feature fusion can increase the receptive field and multi-resolution contextual information can cover rich auto-correlation, which provides more sufficient spatial representations for noise fitting. (ii) The noise level decreases as the scale increases and nonlinear sampling operations can increase the richness of the mapping in the potential space of real noise. Therefore, we exploit parallel multi-resolution branch aggregation from top to bottom and bottom to top to facilitate the learning of complex real noise. (iii) Specifically, during the feature downsampling, general downsample operation damages the image information, resulting in pixel discontinuity and jagged artifact. To alleviate these issues, we exploit ShiftInvariant Downsample [46] that copes with the discontinuity by using continuous pooling and filtering operation, preserving rich cross-correlation information between original and downsampled images. (iv) To efficiently capture continuous channel correlation and avoid information loss, we use the 1D channel attention module, Fast Channel Attention (FCA) instead of the general 2D convolution attention module. The input feature, $\mathbf { F } _ { M _ { k } ^ { j } } \in \mathbb { R } ^ { H \times W \times C }$ is fed into three parallel multi-scale paths:
|
| 113 |
+
|
| 114 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">SIDD[47]</td><td colspan="2">DND [48]</td><td rowspan="2">Methods</td><td colspan="2">PolyU [40]</td><td colspan="2">Nam [49]</td></tr><tr><td>PSNR↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>DnCNN-B[10]</td><td>23.66</td><td>0.583</td><td>32.43</td><td>0.790</td><td>RDN[12]</td><td>37.94</td><td>0.946</td><td>38.16</td><td>0.956</td></tr><tr><td>CBDNet [50]</td><td>33.28</td><td>0.868</td><td>38.06</td><td>0.942</td><td>FFDNet+ [19]</td><td>38.17</td><td>0.951</td><td>38.81</td><td>0.957</td></tr><tr><td>RIDNet [44]</td><td>38.71</td><td>0.914</td><td>39.26</td><td>0.953</td><td>TWSC [51]</td><td>38.68</td><td>0.958</td><td>38.96</td><td>0.962</td></tr><tr><td>AINDNet [52]</td><td>39.15</td><td>0.955</td><td>39.53</td><td>0.956</td><td>CBDNet [50]</td><td>38.74</td><td>0.961</td><td>39.08</td><td>0.969</td></tr><tr><td>VDN[53]</td><td>39.23</td><td>0.955</td><td>39.38</td><td>0.952</td><td>RIDNet [44]</td><td>38.86</td><td>0.962</td><td>39.20</td><td>0.973</td></tr><tr><td>CycleISP [22]</td><td>39.52</td><td>0.957</td><td>39.56</td><td>0.956</td><td>VDN [53]</td><td>39.04</td><td>0.965</td><td>39.68</td><td>0.976</td></tr><tr><td>MPRNet [54]</td><td>39.71</td><td>0.958</td><td>39.80</td><td>0.954</td><td>MPRNet [54]</td><td>39.07</td><td>0.969</td><td>39.41</td><td>0.974</td></tr><tr><td>MIRNet [55]</td><td>39.72</td><td>0.959</td><td>39.88</td><td>0.956</td><td>MIRNet [55]</td><td>39.18</td><td>0.973</td><td>39.57</td><td>0.979</td></tr><tr><td>RIDNet*(Ours)</td><td>39.25</td><td>0.956</td><td>39.55</td><td>0.955</td><td>RIDNet*(Ours)</td><td>39.54</td><td>0.971</td><td>39.69</td><td>0.975</td></tr><tr><td>MPRNet*(Ours)</td><td>40.06</td><td>0.960</td><td>40.18</td><td>0.961</td><td>MPRNet*(Ours)</td><td>40.48</td><td>0.982</td><td>40.72</td><td>0.984</td></tr><tr><td>MIRNet*(Ours)</td><td>40.07</td><td>0.960</td><td>40.25</td><td>0.962</td><td>MIRNet*(Ours)</td><td>40.55</td><td>0.983</td><td>40.78</td><td>0.986</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Table 1: Comparison on four benchmarks. \* denotes denoisers finetuned with images generated by PNGAN.
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbf { F } _ { M _ { k } ^ { j } } ^ { 1 } = F C A ( \mathbf { F } _ { M _ { k } ^ { j } } ) , \mathbf { F } _ { M _ { k } ^ { j } } ^ { 2 } = f _ { u p } ^ { 2 } ( F C A ( f _ { s i d } ^ { 2 } ( \mathbf { F } _ { M _ { k } ^ { j } } ) ) ) , \mathbf { F } _ { M _ { k } ^ { j } } ^ { 4 } = f _ { u p } ^ { 4 } ( F C A ( f _ { s i d } ^ { 4 } ( \mathbf { F } _ { M _ { k } ^ { j } } ) ) ) ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $F C A$ denotes Fast Channel Attention. $f _ { u p } ^ { 2 }$ denotes a conv layer after bilinear interpolation upsampling, 2 is the scale factor. $f _ { u p } ^ { 4 }$ is similarly defined. $f _ { s i d } ^ { 2 }$ means Shift-Invariant Downsample [46], 2 is also the scale factor. $f _ { s i d } ^ { 4 }$ is similarly defined. Subsequently, the output feature is derived by:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
M _ { k } ^ { j } ( { \bf F } _ { M _ { k } ^ { j } } ) = { \bf F } _ { M _ { k } ^ { j } } + f ( [ { \bf F } _ { M _ { k } ^ { j } } ^ { 1 } , { \bf F } _ { M _ { k } ^ { j } } ^ { 2 } , { \bf F } _ { M _ { k } ^ { j } } ^ { 4 } ] ) ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $f$ represents the last conv layer, $[ \cdot , \cdot , \cdot ]$ denotes the concatenating operation. The architecture of FCA is shown in Fig. 3 (d). We define the input feature as $\mathbf { F } _ { d }$ , then FCA can be formulated as:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
F C A ( \mathbf { F } _ { d } ) = \mathbf { F } _ { d } \cdot \big ( 1 + \sigma \big ( f _ { 1 D C } ( G A P ( \mathbf { F } _ { d } ) ) \big ) \big ) ,
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $\sigma$ represents the Sigmoid activation function, $G A P$ means global average pooling along the spatial wise, $f _ { 1 D C }$ denotes 1-Dimension Convolution. In this work, we set $t = 3$ , $n = 2$ , and $C = 6 4$ .
|
| 135 |
+
|
| 136 |
+
# 2.4 Overall Training Objective
|
| 137 |
+
|
| 138 |
+
In addition to the aforementioned losses, we employ a perceptual loss function that assesses a solution with respect to perceptually relevant characteristics (e.g., the structural contents and detailed textures):
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\begin{array} { r } { \mathcal { L } _ { p } = \left| \left| V G G ( \mathbf { I } _ { f d } ) - V G G ( \mathbf { I } _ { r d } ) \right| \right| _ { 2 } ^ { 2 } , \mathbf { I } _ { f d } = D _ { d } ( \mathbf { I } _ { f n } ) , \mathbf { I } _ { r d } = D _ { d } ( \mathbf { I } _ { r n } ) , } \end{array}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where $V G G$ denotes the last feature map of VGG16 [56]. Eventually, the training objective is:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\mathcal { L } = \mathcal { L } _ { 1 } + \lambda _ { p } \cdot \mathcal { L } _ { p } + \lambda _ { R a } \cdot ( \mathcal { L } _ { D } + \mathcal { L } _ { G } ) ,
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
where $\lambda _ { p }$ and $\lambda _ { R a }$ are two hyper-parameters controlling the importance balance. The proposed PNGAN framework is end-to-end trained by minimizing $\mathcal { L }$ . Note that the parameters in $D _ { d }$ and VGG16 are fixed. Each mini-batch training procedure is divided into two steps: (i) Fix $D$ and train $G$ . (ii) Fix $G$ and train $D$ . This pixel-level adversarial training scheme promotes $D$ the ability to distinguish fake noisy images from real noisy images and allows $G$ to learn to create the solutions that are highly similar to real camera noisy images and thus difficult to be classified by $D$ .
|
| 151 |
+
|
| 152 |
+
# 3 Experiment
|
| 153 |
+
|
| 154 |
+
# 3.1 Experiment Setup
|
| 155 |
+
|
| 156 |
+
Datasets. We first use SIDD [47] train set to train $D _ { d }$ . Then we fix $D _ { d }$ to train $G$ on the same set. Subsequently, $G$ uses clean images from DIV2K [57], Flickr2K [58], BSD68 [59], Kodak24 [60], and Urban100 [61] to generate realistic noisy-clean image pairs. We use the generated data and SIDD train set jointly to finetune real denoisers and evaluate them on four real denoising benchmarks: SIDD [47], DND [48], PolyU [40], and Nam [49]. The images in SIDD [47] are collected using five smartphone cameras in 10 static scenes. There are 320 image pairs for training and 1,280 image patch pairs for validation. DND [48] composes 50 noisy-clean image pairs captured by 4 consumer
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 4: Domain discrepancy comparisons. We use the metric, Maximum Mean Discrepancy (MMD) to measure the domain discrepancy between synthetic and real noisy datasets, PNGAN generating and real noisy datasets. Under both setting1 and 2, the discrepancy decreases significantly when PNGAN is applied.
|
| 160 |
+
|
| 161 |
+
<table><tr><td rowspan="2">Methods</td><td rowspan="2"></td><td colspan="4">SIDD [47]</td><td rowspan="2">S1</td><td colspan="4">DF2K[57,58]</td></tr><tr><td>S1 +PNGAN</td><td>S2</td><td>S2+PNGAN</td><td>Real</td><td></td><td>S1 + PNGAN</td><td>S2</td><td>S2+PNGAN</td></tr><tr><td>RIDNet</td><td>22.55</td><td>37.92 (+15.37)</td><td>36.13</td><td>38.71 (+2.58)</td><td>38.69</td><td>22.55</td><td>32.10</td><td>(+9.55)</td><td>33.98</td><td>38.14 (+4.16)</td></tr><tr><td>MPRNet</td><td>22.86</td><td>38.52 (+15.66)</td><td>36.52</td><td>39.53 (+3.01)</td><td>39.45</td><td>22.85</td><td>32.82</td><td>(+9.97)</td><td>34.19</td><td>38.61 (+4.42)</td></tr><tr><td>MIRNet</td><td>22.83</td><td>38.76 (+15.93)</td><td>36.55</td><td>39.57 (+3.02)</td><td>39.58</td><td>23.08</td><td>32.34</td><td>(+9.26)</td><td>34.26</td><td>38.72 (+4.46)</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Table 2: Training denoisers with different data from scratch. PSNR is reported. $^ { \mathrm { ~ S 1 , 2 = } }$ synthetic setting1,2.
|
| 164 |
+
|
| 165 |
+
cameras. 1,000 patches at size $5 1 2 \times 5 1 2$ are cropped from the collected images. PolyU [40] consists of 40 real camera noisy images. Nam [49] is composed of real noisy images of 11 static scenes.
|
| 166 |
+
|
| 167 |
+
Implementation Details. We set the hyper-parameter $\lambda _ { p } = 6 \times 1 0 ^ { - 3 }$ , $\lambda _ { R a } = 8 \times 1 0 ^ { - 4 }$ . For synthetic setting1, we set the noise intensity, $\sigma _ { n } = 5 0$ . For synthetic setting2, we directly exploit CycleISP to generate the synthetic noisy input. All the sub-modules $( D _ { d } , G$ , and $D$ ) are trained with the Adam [62] optimizer $\beta _ { 1 } = 0 . 9$ and $\beta _ { 1 } = 0 . 9 9 9 9 )$ for $7 \times 1 0 ^ { 5 }$ iterations. The initial learning rate is set to $2 \times 1 \bar { 0 } ^ { - 4 }$ . The cosine annealing strategy [63] is employed to steadily decrease the learning rate from the initial value to $1 0 ^ { - 6 }$ during the training procedure. Patches at size $1 2 8 \times 1 2 8$ cropped from training images are fed into the models. The batch size is set as 8. The horizontal and vertical flips are performed for data augmentation. All the models are trained on RTX8000 GPUs. In the finetuning phase, the learning rate is set to $1 \times 1 0 ^ { - 6 }$ , other settings remain unchanged.
|
| 168 |
+
|
| 169 |
+
# 3.2 Quantitative Results
|
| 170 |
+
|
| 171 |
+
Domain Discrepancy Validation. We use the widely applied metric, Maximum Mean Discrepancy (MMD) [64] to measure the domain discrepancy between synthetic and real-world noisy images, PNGAN generating, and real noisy images on four real noisy benchmarks. For DND, we derive a pseudo clean version by denoising the real noisy counterparts with a pre-trained MIRNet [55]. Then we use the pseudo clean version to synthesize noisy images. The results are depicted as a histogram in Fig. 4. For setting1, the domain discrepancy decreases by $74 \%$ , $7 5 \%$ , $44 \%$ , and $43 \%$ on SIDD, DND, PolyU, and Nam when PNGAN is exploited. For setting2, the discrepancy decreases by $64 \%$ , $67 \%$ , $46 \%$ , and $44 \%$ . These results demonstrate that PNGAN can narrow the discrepancy between synthetic and real noisy datasets. Please refer to the supplementary for detailed calculation process.
|
| 172 |
+
|
| 173 |
+
Comparison with SOTA Methods. We use the generated noisy-clean image pairs (setting2) to finetune a series of denoisers. We compare our models with SOTA algorithms on four real denoising datasets: SIDD, DND, PolyU, and Nam. The results are reported in Tab. 1. \* denotes denoisers finetuned with image pairs generated by PNGAN. We have the following observations: (i) Our denoisers outperform SOTA methods by a large margin. Specifically, MPRNet\* and MIRNet\* exceed the recent best method MIRNet by 0.34 and $0 . 3 5 \mathrm { d B }$ on SIDD, 0.30 and 0.37 dB on DND. RIDNet\*, MPRNet\*, and MIRNet\* surpass the best performers by 0.36, 1.30, and 1.37 dB on PolyU and 0.01, 1.04, and 1.10 dB on Nam. (ii) Compared with the counterparts that are not finetuned, our models achieve a significant promotion. In particular, RIDNet\* is 0.54, 0.29, 0.68, and $0 . 4 9 \mathrm { d B }$ higher than RIDNet on SIDD, DND, PolyU, and Nam. MPRNet\* achieves 0.35, 0.38, 1.41, and 1.31 dB gain than MPRNet on SIDD, DND, PolyU, and Nam. MIRNet\* is improved by 0.35, 0.37, 1.37, and 1.21 dB. This evidence clearly suggests the high similarity between PNGAN generating and real noisy images. Denoisers adapted with our fake image pairs generalize better across different benchmarks.
|
| 174 |
+
|
| 175 |
+
Train from Scratch. For more strong comparisons, we use the fake noisy images generated from clean SIDD train and DF2K (DIV2K+Flicker2K) respectively to train denoisers from scratch. The PSNR results evaluated on SIDD test are listed in Tab. 2. All models are trained with the same experiment schedule except the training data. It can be observed: (i) On SIDD train, when PNGAN is applied to setting1, denoisers are promoted by $\sim 1 5 . 6 5$ dB and only $\sim 0 . 8 4$ dB lower than those
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
|
| 179 |
+
Figure 5: Visual comparisons of noisy images on SIDD, DND, PolyU, and Nam. Please zoom in.
|
| 180 |
+
|
| 181 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="4">PNGAN Component</td><td colspan="6">Generator Architecture</td></tr><tr><td>Baseline1</td><td>+Dd</td><td>+D</td><td></td><td>+Lp</td><td>Baseline2</td><td>+ Multi-scale</td><td></td><td>+ SID</td><td>+FCA</td></tr><tr><td>RIDNet</td><td>14.54</td><td>35.37 (+20.83)</td><td>37.49</td><td>(+2.12) 37.92</td><td>(+0.43)</td><td>35.62</td><td>37.01</td><td>(+1.39)</td><td>37.23 (+0.22)</td><td>37.92 (+0.69)</td></tr><tr><td>MPRNet</td><td>14.25</td><td>36.26 (+22.01)</td><td>38.27</td><td>(+2.01) 38.52</td><td>(+0.25)</td><td>36.28</td><td>37.47</td><td>(+1.19)</td><td>37.86 (+0.39)</td><td>38.52 (+0.66)</td></tr><tr><td>MIRNet</td><td>13.57</td><td>36.15 (+22.58)</td><td>38.28</td><td>(+2.13) 38.76</td><td>(+0.48)</td><td>36.39</td><td>37.66</td><td>(+1.27)</td><td>37.89 (+0.23)</td><td>38.76 (+0.87)</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Table 3: Ablation study of PNGAN component and the noise generator architecture. PSNR is reported.
|
| 184 |
+
|
| 185 |
+
trained with real data (SIDD train set). While applying PNGAN to setting2 (CycleISP), denoisers are improved by $\sim 2 . 8 7$ dB. Surprisingly, in this case, denoisers achieve almost the same performance as those trained with real data. The relative error is $0 . 2 \%$ . (ii) To validate the generality of PNGAN, we also adopt synthetic DF2K noisy-clean image pairs to train denoisers. As shown in the right part of Tab. 2, when PNGAN is applied to setting1, denoisers are promoted by $\sim 9 . 5 9$ dB. While applying PNGAN to setting2, denoisers are improved by $\sim 4 . 3 5 ~ \mathrm { d B }$ and only $\sim 0 . 7 5$ dB lower than those trained with SIDD real train set. These results convincingly demonstrate: (i) The generated noise is highly similar to the real noise especially when PNGAN is applied to synthetic setting2. (ii) PNGAN can significantly narrow the domain discrepancy between synthetic and real-world noise.
|
| 186 |
+
|
| 187 |
+
# 3.3 Qualitative Results
|
| 188 |
+
|
| 189 |
+
Visual Examinations of Noisy Images. To intuitively evaluate the generated noisy images, we provide visual comparisons of noisy images on the four real noisy datasets, as shown in Fig. 5. Note that the clean image of DND is pseudo, denoised from its noisy version by a MIRNet. The left part depicts noisy images from SIDD, DND, PolyU, and Nam (top to down). The right part exhibits the patches cropped by the yellow bboxes, from left to right: clean, synthetic setting1, setting2 (CycleISP), PNGAN generating, and real noisy images. As can be seen from the zoom-in patches: (i) Noisy images synthesized by setting1 is signal-independent. The distribution and intensity remain unchanged across diverse scenes, indicating the characteristics of AWGN fundamentally differ from those of the real noise. (ii) Noisy images generated by PNGAN are closer to the real noise than those synthesized by setting2 visually. Noise synthesized by setting2 shows randomness that is obviously inconsistent with the real noise in terms of intensity and distribution. While PNGAN can model spatio-chromatically correlated and non-Gaussian noise more accurately. (iii) Even if passing through the same camera pipeline, different shooting conditions lead to the diversity of real noise. It’s unreasonable for the noise synthesized by CycleISP to show nearly uniform fitting to different input images. In contrast, PNGAN can adaptively simulate more sophisticated and photo-realistic models. This adaptability allows PNGAN to show robust performance across different real noisy datasets.
|
| 190 |
+
|
| 191 |
+
Visual Comparison of Denoised Images. We compare the visual results of denoisers before and after being finetuned (denoted with \*) with the generated data in Fig. 4. We observe that models finetuned with the generated data are more effective in real noise removal. Furthermore, they are capable of preserving the structural content, textural details, and spatial smoothness of the homogeneous regions. In contrast, original models either yield over-smooth images sacrificing fine textural details and structural content or introduce redundant blotchy texture and chroma artifacts.
|
| 192 |
+
|
| 193 |
+
# 3.4 Ablation Study
|
| 194 |
+
|
| 195 |
+
Break-down Ablations. We perform break-down ablations to evaluate the effects of PNGAN components and SMNet architecture. We select setting1 to synthesize the noisy input from SIDD train set. Then we use the generated data only to train the denoisers from scratch and evaluate them on SIDD test. The PSNR results are reported in Tab. 3. (i) Firstly, $G$ is set as SMNet to validate the effects of PNGAN components. We start from Baseline1, no discriminator is used and the $\mathcal { L } _ { 1 }$ loss is
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 6: Visual results of denoisers before and after being finetuned with fake data. Please zoom in.
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 7: Parameter analysis of $\lambda _ { p }$ , $\lambda _ { R a }$ , and $\sigma _ { n }$
|
| 202 |
+
|
| 203 |
+
<table><tr><td rowspan="3">q</td><td colspan="2">SIDD [47]</td><td colspan="2">PolyU[40]</td><td colspan="2">Nam [49]</td><td colspan="2">Total</td></tr><tr><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td><td>PSNR</td><td>SSIM</td></tr><tr><td>None</td><td>38.71</td><td>0.914</td><td>38.86</td><td>0.962</td><td>39.20</td><td>0.973</td><td>38.76</td><td>0.929</td></tr><tr><td>0</td><td>39.32</td><td>0.957</td><td>38.01</td><td>0.949</td><td>38.34</td><td>0.958</td><td>38.92</td><td>0.955</td></tr><tr><td>20%</td><td>39.29</td><td>0.957</td><td>38.45</td><td>0.959</td><td>38.87</td><td>0.970</td><td>39.03</td><td>0.958</td></tr><tr><td>40%</td><td>39.28</td><td>0.956</td><td>39.02</td><td>0.966</td><td>39.26</td><td>0.973</td><td>39.20</td><td>0.959</td></tr><tr><td>60%</td><td>39.26</td><td>0.956</td><td>39.54</td><td>0.971</td><td>39.69</td><td>0.975</td><td>39.35</td><td>0.961</td></tr><tr><td>80%</td><td>39.23</td><td>0.955</td><td>39.56</td><td>0.972</td><td>39.72</td><td>0.976</td><td>39.33</td><td>0.960</td></tr><tr><td>100%</td><td>39.21</td><td>0.955</td><td>39.57</td><td>0.972</td><td>39.73</td><td>0.976</td><td>39.33</td><td>0.960</td></tr></table>
|
| 204 |
+
|
| 205 |
+
Table 4: Analysis of the finetuning data ratio $q$
|
| 206 |
+
|
| 207 |
+
directly performed between $\mathbf { I } _ { f n }$ and ${ \mathbf I } _ { r n }$ in Eq. (2). Denoisers trained with the generated data collapse dramatically, implying the naive strategy mentioned in Sec. 2.2 is unfeasible. When $D _ { d }$ is applied, the denoisers are promoted by 21.81 dB on average. In addition, the PSNR and SSIM between the denoised counterparts of generated and real noisy images are $3 9 . 1 4 ~ \mathrm { d B }$ and 0.928 on average respectively. This evidence indicates that $D _ { d }$ successfully conducts the image domain alignment as mentioned in Sec. 2.2. Subsequently, we use an image-level $D$ with stride conv layers to classify whether the whole generated image is real. Nonetheless, the performance of denoisers remains almost unchanged. After deploying $D$ , the models are improved by ${ \sim } 2 . 0 9$ dB, suggesting that the pixel-level noise model is more in line with real noise scenes and benefits generating more realistic noisy images. When ${ \mathcal { L } } _ { p }$ is used, the denoisers gain a slight improvement by about 0.39 dB, indicating ${ \mathcal { L } } _ { p }$ facilitates yielding more vivid results. (ii) Secondly, we only change the architecture of $G$ to study the effects of its components. We start from Baseline2 that doesn’t exploit multi-scale feature fusion, SID, and FCA. When we add two different scale branches and use bilinear interpolation to downsample and upsample, denoisers trained with the generated images are promoted by about $1 . 2 8 \ : \mathrm { d B }$ . After applying SID and FCA, the denoisers further gain 0.28 and $0 . 7 4 \mathrm { d B }$ improvement on average. These results convincingly demonstrate the superiority of the proposed SMNet in real-world noise fitting.
|
| 208 |
+
|
| 209 |
+
Parameter Analysis. We adopt RIDNet as the baseline to perform parameter analysis. We firstly validate the effects of $\lambda _ { p }$ , $\lambda _ { R a }$ in Eq. (13), and the noise intensity of setting1, i.e., $\sigma _ { n }$ . We change the parameters, train $G$ , use $G$ to generate realistic noisy images from clean images of SIDD train set, train RIDNet with the generated data, and evaluate its performance on SIDD test set. When analyzing one parameter, we fix the others at their optimal values. The PSNR results are shown in Fig. 7. The optimal setting is $\lambda _ { p } = 6 \times 1 0 ^ { - 3 }$ , $\lambda _ { R a } = 8 \times 1 0 ^ { - 4 }$ , and $\sigma _ { n } = 4 0$ or 50. Secondly, we evaluate the effect of the ratio of finetuning data. We denote the ratio of extended training data (setting2) to SIDD real noisy training data as $q$ . We change the value of $q$ , finetuned the original RIDNet, and test on three real denoising datasets: SIDD, PolyU, and Nam. The results are listed in Tab. 4. When $q = 0$ , all the finetuning data comes from SIDD train set, RIDNet achieves the best performance on SIDD. However, its performance on PolyU and Nam degrades drastically due to the domain discrepancy between different real noisy datasets. We gradually increase the value of $q$ to study its effects. The average performance on the three datasets yields the maximum when $q = 6 0 \%$ .
|
| 210 |
+
|
| 211 |
+
# 4 Conclusion
|
| 212 |
+
|
| 213 |
+
Too much research focuses on designing a CNN architecture for real noise removal. In contrast, this work investigates how to generate more realistic noisy images so as to boom the denoising performance. We first formulate a noise model that treats each noisy pixel as a random variable. Then we propose a novel framework PNGAN to perform the image and noise domain alignment. For better noise fitting, we customize an efficient architecture, SMNet as the generator. Experiments show that noise generated by PNGAN is highly similar to real noise in terms of intensity and distribution. Denoisers finetuned with the generated data outperform SOTA methods on real denoising datasets.
|
| 214 |
+
|
| 215 |
+
# Acknowledgement
|
| 216 |
+
|
| 217 |
+
This work is jointly supported by the NSFC fund (61831014), in part by the Shenzhen Science and Technology Project under Grant (ZDYBH201900000002, JCYJ20180508152042002, CJGJZD20200617102601004).
|
| 218 |
+
|
| 219 |
+
# References
|
| 220 |
+
|
| 221 |
+
[1] PP, ng, [2] S. Gu, L. Zhang, W. Zuo, and X. Feng, “Weighted nuclear norm minimization with application to image denoising,” in CVPR, 2014. 1 [3] F. Zhu, G. Chen, and P.-A. Heng, “From noise modeling to blind image denoising,” in CVPR, 2016. 1 [4] J. Xu, L. Zhang, and D. Zhang, “A trilateral weighted sparse coding scheme for real-world image denoising,” in ECCV, 2018. 1 [5] M. Aharon, M. Elad, and A. Bruckstein, “K-svd: An algorithm for designing overcomplete dictionaries for sparse representation,” TSP, 2006. 1 [6] A. Buades, B. Coll, and J. . Morel, “A non-local algorithm for image denoising,” in CVPR, 2005. 1 [7] M. Maggioni, V. Katkovnik, K. Egiazarian, and A. Foi, “Nonlocal transform-domain filter for volumetric data denoising and reconstruction,” TIP, 2013. 1 [8] H. C. Burger, C. J. Schuler, and S. Harmeling, “Image denoising: Can plain neural networks compete with bm3d?,” in CVPR, 2012. 1 [9] S. Lefkimmiatis, “Non-local color image denoising with convolutional neural networks,” in CVPR, 2017. 1
|
| 222 |
+
[10] K. Zhang, W. Zuo, Y. Chen, D. Meng, and L. Zhang, “Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising,” TIP, 2017. 1, 6
|
| 223 |
+
[11] K. Zhang, W. Zuo, S. Gu, and L. Zhang, “Learning deep cnn denoiser prior for image restoration,” in CVPR, 2017. 1
|
| 224 |
+
[12] Y. Zhang, Y. Tian, Y. Kong, B. Zhong, and Y. Fu, “Residual dense network for image restoration,” TPAMI, 2020. 1, 6
|
| 225 |
+
[13] Y. Cai, Z. Wang, Z. Luo, B. Yin, A. Du, H. Wang, X. Zhou, E. Zhou, X. Zhang, and J. Sun, “Learning delicate local representations for multi-person pose estimation,” in ECCV, 2020. 1
|
| 226 |
+
[14] Z. Luo, Z. Wang, Y. Cai, G. Wang, L. Wang, Y. Huang, E. Zhou, T. Tan, and J. Sun, “Efficient human pose estimation by learning deeply aggregated representations,” in ICME, 2021. 1
|
| 227 |
+
[15] Y. Chen, W. Yu, and T. Pock, “On learning optimized reaction diffusion processes for effective image restoration,” in CVPR, 2015. 1
|
| 228 |
+
[16] K. Dabov, A. Foi, V. Katkovnik, and K. Egiazarian, “Image denoising by sparse 3-d transformdomain collaborative filtering,” TIP, 2007. 1
|
| 229 |
+
[17] X. Hu, Y. Cai, Z. Liu, H. Wang, and Y. Zhang, “Multi-scale selective feedback network with dual loss for real image denoising,” in IJCAI, 2021. 1
|
| 230 |
+
[18] h. Xiaowan, M. Ruijun, L. Zhihong, C. Yuanhao, Z. Xiaole, Z. Yulun, and W. Haoqian, “Pseudo 3d auto-correlation network for real image denoising,” in CVPR, 2021. 1
|
| 231 |
+
[19] K. Zhang, W. Zuo, and L. Zhang, “Ffdnet: Toward a fast and flexible solution for cnn-based image denoising,” TIP, 2018. 1, 6
|
| 232 |
+
[20] K. Ma, Z. Duanmu, Q. Wu, Z. Wang, H. Yong, H. Li, and L. Zhang., “Waterloo exploration database: New challenges for image quality assessment models,” TIP, 2014. 1
|
| 233 |
+
[21] A. Foi, M. Trimeche, V. Katkovnik, and K. O. Egiazarian, “Practical poissonian-gaussian noise modeling and fitting for single-image raw-data,” TIP, 2008. 1, 2
|
| 234 |
+
[22] S. W. Zamir, A. Arora, S. Khan, M. Hayat, F. S. Khan, M.-H. Yang, and L. Shao, “Cycleisp: Real image restoration via improved data synthesis,” in CVPR, 2020. 2, 6
|
| 235 |
+
[23] Y. Hwang, J.-S. Kim, and I.-S. Kweon, “Difference-based image noise modeling using skellam distribution,” TPAMI, 2012. 2
|
| 236 |
+
[24] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” in NeurIPS, 2014. 2
|
| 237 |
+
[25] X. Gong, S. Chang, Y. Jiang, and Z. Wang, “Autogan: Neural architecture search for generative adversarial networks,” in ICCV, 2019. 2
|
| 238 |
+
[26] P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros, “Image-to-image translation with conditional adversarial networks,” in CVPR, 2017. 2
|
| 239 |
+
[27] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros, “Unpaired image-to-image translation using cycle-consistent adversarial networkss,” in ICCV, 2017. 2
|
| 240 |
+
[28] C. Ledig, L. Theis, F. Huszar, J. Caballero, A. Cunningham, A. Acosta, A. Aitken, A. Tejani, J. Totz, Z. Wang, and W. Shi, “Photo-realistic single image super-resolution using a generative adversarial network,” in CVPR, 2017. 2
|
| 241 |
+
[29] X. Wang, K. Yu, S. Wu, J. Gu, Y. Liu, C. Dong, Y. Qiao, and C. C. Loy, “Esrgan: Enhanced super-resolution generative adversarial networks,” in ECCVW, 2018. 2
|
| 242 |
+
[30] X. Hu, H. Wang, Y. Cai, X. Zhao, and Y. Zhang, “Pyramid orthogonal attention network based on dual self-similarity for accurate mr image super-resolution,” in ICME, 2021. 2
|
| 243 |
+
[31] C. Li and M. Wand, “Combining markov random fields and convolutional neural networks for image synthesis,” in CVPR, 2016. 2
|
| 244 |
+
[32] Y. Jiang, X. Gong, D. Liu, Y. Cheng, C. Fang, X. Shen, J. Yang, P. Zhou, and Z. Wang, “Enlightengan: Deep light enhancement without paired supervision,” TIP, 2021. 2
|
| 245 |
+
[33] W. Yang, S. Wang, Y. Fang, Y. Wang, and J. Liu, “From fidelity to perceptual quality: A semi-supervised approach for low-light image enhancement,” in CVPR, 2020. 2
|
| 246 |
+
[34] R. Qian, R. T. Tan, W. Yang, J. Su, and J. Liu, “Attentive generative adversarial network for raindrop removal from a single image,” in CVPR, 2018. 2
|
| 247 |
+
[35] R. Li, J. Pan, Z. Li, and J. Tang, “Single image dehazing via conditional generative adversarial network,” in CVPR, 2018. 2
|
| 248 |
+
[36] C. Zheng, T.-J. Cham, and J. Cai, “Pluralistic image completion,” in CVPR, 2019. 2
|
| 249 |
+
[37] J. Yu, Z. Lin, J. Yang, X. Shen, X. Lu, and T. S. Huang, “Generative image inpainting with contextual attention,” in CVPR, 2018. 2
|
| 250 |
+
[38] S. Yang, Z. Wang, Z. Wang, N. Xu, J. Liu, and Z. Guo, “Controllable artistic text style transfer via shape-matching gan,” in ICCV, 2019. 2
|
| 251 |
+
[39] S. Yang, Z. Wang, J. Liu, and Z. Guo, “Deep plastic surgery: Robust and controllable image editing with human-drawn sketches,” in ECCV, 2020. 2
|
| 252 |
+
[40] Y. Yuan, S. Liu, J. Zhang, Y. Zhang, C. Dong, and L. Lin, “Unsupervised image super-resolution using cycle-in-cycle generative adversarial networks,” in CVPRW, 2018. 2, 6, 7, 9
|
| 253 |
+
[41] Y.-S. Chen, Y.-C. Wang, M.-H. Kao, and Y.-Y. Chuang, “Deep photo enhancer: Unpaired learning for image enhancement from photographs with gans,” in CVPR, 2018. 2
|
| 254 |
+
[42] Z. Yue, Q. Zhao, L. Zhang, and D. Meng, “Dual adversarial network: Toward real-world noise removal and noise generation,” in ECCV, 2020. 2
|
| 255 |
+
[43] J. Chen, J. Chen, H. Chao, and M. Yang, “Image blind denoising with generative adversarial network based noise modeling,” in CVPR, 2018. 2
|
| 256 |
+
[44] S. Anwar and N. Barnes, “Real image denoising with feature attention,” in ICCV, 2019. 3, 6
|
| 257 |
+
[45] A. Jolicoeur-Martineau, “The relativistic discriminator: a key element missing from standard gan,” in ICLR, 2019. 4
|
| 258 |
+
[46] R. Zhang, “Making convolutional networks shift-invariant again,” in ICML, 2019. 5, 6
|
| 259 |
+
[47] A. Abdelhamed, S. Lin, and M. S. Brown, “A high-quality denoising dataset for smartphone cameras,” in CVPR, 2018. 6, 7, 9
|
| 260 |
+
[48] T. Plotz and S. Roth, “Benchmarking denoising algorithms with real photographs,” in CVPR, 2017. 6
|
| 261 |
+
[49] S. Nam, Y. Hwang, Y. Matsushita, and S. J. Kim, “A holistic approach to cross-channel image noise modeling and its application to image denoising,” in CVPR, 2016. 6, 7, 9
|
| 262 |
+
[50] S. Guo, Z. Yan, K. Zhang, W. Zuo, and L. Zhang, “Toward convolutional blind denoising of real photographs,” in CVPR, 2019. 6
|
| 263 |
+
[51] J. Xu, L. Zhang, and D. Zhang, “A trilateral weighted sparse coding scheme for real-world image denoising,” in ECCV, 2018. 6
|
| 264 |
+
[52] Y. Kim, J. W. Soh, G. Y. Park, and N. I. Cho, “Transfer learning from synthetic to real-noise denoising with adaptive instance normalization,” in CVPR, 2020. 6
|
| 265 |
+
[53] Z. Yue, H. Yong, Q. Zhao, D. Meng, and L. Zhang, “Variational denoising network: Toward blind noise modeling and removal,” in NeurIPS, 2019. 6
|
| 266 |
+
[54] S. W. Zamir, A. Arora, S. Khan, M. Hayat, F. S. Khan, M.-H. Yang, and L. Shao, “Multi-stage progressive image restoration,” in CVPR, 2021. 6
|
| 267 |
+
[55] S. W. Zamir, A. Arora, S. Khan, M. Hayat, F. S. Khan, M.-H. Yang, and L. Shao, “Learning enriched features for real image restoration and enhancement,” in ECCV, 2020. 6, 7
|
| 268 |
+
[56] A. Z. Karen Simonyan, “Very deep convolutional networks for large-scale image recognition,” in ICLR, 2015. 6
|
| 269 |
+
[57] R. Timofte, E. Agustsson, L. Van Gool, M.-H. Yang, and L. Zhang, “Ntire 2017 challenge on single image super-resolution: Methods and results,” in CVPRW, 2017. 6, 7
|
| 270 |
+
[58] B. Lim, S. Son, H. Kim, S. Nah, and K. Mu Lee, “Enhanced deep residual networks for single image super-resolution,” in CVPRW, 2017. 6, 7
|
| 271 |
+
[59] S. Roth and M. J. Black, “Fields of experts: A framework for learning image priors,” in CVPR, 2015. 6
|
| 272 |
+
[60] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, and e. a. Michael Bernstein, “Imagenet large scale visual recognition challenge,” in IJCV, 2015. 6
|
| 273 |
+
[61] J.-B. Huang, A. Singh, and N. Ahuja, “Single image super-resolution from transformed selfexemplars,” in CVPR, 2015. 6
|
| 274 |
+
[62] D. P. Kingma and J. L. Ba, “Adam: A method for stochastic optimization,” in ICLR, 2015. 7
|
| 275 |
+
[63] I. Loshchilov and F. Hutter, “Sgdr: Stochastic gradient descent with warm restarts,” in ICLR, 2017. 7
|
| 276 |
+
[64] A. Gretton, K. M. Borgwardt, M. J. Rasch, B. Schölkopf, and A. Smola, “A kernel two-sample test,” in JMLR, 2012. 7
|
md/train/_WnAQKse_uK/_WnAQKse_uK.md
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ViTAE: Vision Transformer Advanced by Exploring Intrinsic Inductive Bias
|
| 2 |
+
|
| 3 |
+
Yufei Xu1∗ Qiming Zhang1∗ Jing Zhang1 Dacheng Tao2,1
|
| 4 |
+
|
| 5 |
+
1The University of Sydney, Australia, 2JD Explore Academy, China
|
| 6 |
+
|
| 7 |
+
{yuxu7116,qzha2506}@uni.sydney.edu.au, jing.zhang1@sydney.edu.au, dacheng.tao@gmail.com
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Transformers have shown great potential in various computer vision tasks owing to their strong capability in modeling long-range dependency using the self-attention mechanism. Nevertheless, vision transformers treat an image as 1D sequence of visual tokens, lacking an intrinsic inductive bias (IB) in modeling local visual structures and dealing with scale variance. Alternatively, they require large-scale training data and longer training schedules to learn the IB implicitly. In this paper, we propose a new Vision Transformer Advanced by Exploring intrinsic IB from convolutions, i.e., ViTAE. Technically, ViTAE has several spatial pyramid reduction modules to downsample and embed the input image into tokens with rich multi-scale context by using multiple convolutions with different dilation rates. In this way, it acquires an intrinsic scale invariance IB and is able to learn robust feature representation for objects at various scales. Moreover, in each transformer layer, ViTAE has a convolution block in parallel to the multi-head selfattention module, whose features are fused and fed into the feed-forward network. Consequently, it has the intrinsic locality IB and is able to learn local features and global dependencies collaboratively. Experiments on ImageNet as well as downstream tasks prove the superiority of ViTAE over the baseline transformer and concurrent works. Source code and pretrained models will be available at code.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Transformers [79, 17, 40, 14, 46, 61] have shown a domination trend in NLP studies owing to their strong ability in modeling long-range dependencies by the self-attention mechanism [67, 81, 51]. Such success and good properties of transformers has inspired following many works that apply them in various computer vision tasks [19, 100, 97, 80, 7]. Among them, ViT [19] is the pioneering pure transformer model that embeds images into a sequence of visual tokens and models the global dependencies among them with stacked transformer blocks. Although it achieves promising performance on image classification, it requires large-scale training data and a longer training schedule. One important reason is that ViT
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Comparison of data and training efficiency of T2T-ViT-7 and ViTAE-T on ImageNet.
|
| 19 |
+
|
| 20 |
+
lacks intrinsic inductive bias (IB) in modeling local visual structures (e.g., edges and corners) and dealing with objects at various scales like convolutions. Alternatively, ViT has to learn such IB implicitly from large-scale data.
|
| 21 |
+
|
| 22 |
+
Unlike vision transformers, Convolution Neural Networks (CNNs) naturally equip with the intrinsic IBs of scale-invariance and locality and still serve as prevalent backbones in vision tasks [26, 70, 62, 8, 96]. The success of CNNs inspires us to explore intrinsic IBs in vision transformers. We start by analyzing the above two IBs of CNNs, i.e., locality and scale-invariance. Convolution that computes local correlation among neighbor pixels is good at extracting local features such as edges and corners. Consequently, CNNs can provide plentiful low-level features at the shallow layers [94], which are then aggregated into high-level features progressively by a bulk of sequential convolutions [32, 68, 71]. Moreover, CNNs have a hierarchy structure to extract multi-scale features at different layers [68, 38, 26]. Besides, intra-layer convolutions can also learn features at different scales by varying their kernel sizes and dilation rates [25, 70, 8, 45, 96]. Consequently, scale-invariant feature representation can be obtained via intra- or inter-layer feature fusion. Nevertheless, CNNs are not well suited to model long-range dependencies2, which is the key advantage of transformers. An interesting question comes up: Can we improve vision transformers by leveraging the good properties of CNNs? Recently, DeiT [76] explores the idea of distilling knowledge from CNNs to transformers to facilitate training and improve the performance. However, it requires an off-the-shelf CNN model as the teacher and consumes extra training cost.
|
| 23 |
+
|
| 24 |
+
Different from DeiT, we explicitly introduce intrinsic IBs into vision transformers by re-designing the network structures in this paper. Current vision transformers always obtain tokens with singlescale context [19, 93, 80, 86, 47, 69, 77] and learn to adapt to objects at different scales from data. For example, T2T-ViT [93] improves ViT by delicately generating tokens in a soft split manner. Specifically, it uses a series of Tokens-to-Token transformation layers to aggregate single-scale neighboring contextual information and progressively structurizes the image to tokens. Motivated by the success of CNNs in dealing with scale variance, we explore a similar design in transformers, i.e., intra-layer convolutions with different receptive fields [70, 91], to embed multi-scale context into tokens. Such a design allows tokens to carry useful features of objects at various scales, thereby naturally having the intrinsic scale-invariance IB and explicitly facilitating transformers to learn scale-invariant features more efficiently from data. On the other hand, low-level local features are fundamental elements to generate high-level discriminative features. Although transformers can also learn such features at shallow layers from data, they are not skilled as convolutions by design. Recently, [89, 43, 21] stack convolutions and attention layers sequentially and demonstrate that locality is a reasonable compensation of global dependency. However, this serial structure ignores the global context during locality modeling (and vice versa). To avoid such a dilemma, we follow the “divide-and-conquer” idea and propose to model locality and long-range dependencies in parallel and then fuse the features to account for both. In this way, we empower transformers to learn local and long-range features within each block more effectively.
|
| 25 |
+
|
| 26 |
+
Technically, we propose a new Vision Transformers Advanced by Exploring Intrinsic Inductive Bias $( V i T A E )$ , which is a combination of two types of basic cells, i.e., reduction cell (RC) and normal cell (NC). RCs are used to downsample and embed the input images into tokens with rich multi-scale context while NCs aim to jointly model locality and global dependencies in the token sequence. Moreover, these two types of cells share a simple basic structure, i.e., paralleled attention module and convolutional layers followed by a feed-forward network (FFN). It is noteworthy that RC has an extra pyramid reduction module with atrous convolutions of different dilation rates to embed multi-scale context into tokens. Following the setting in [93], we stack three reduction cells to reduce the spatial resolution by $1 / 1 6$ and a series of NCs to learn discriminative features from data. ViTAE outperforms representative vision transformers in terms of data efficiency and training efficiency (see Figure 1), as well as classification accuracy and generalization on downstream tasks.
|
| 27 |
+
|
| 28 |
+
Our contributions are threefold. First, we explore two types of intrinsic IB in transformers, i.e., scale invariance and locality, and demonstrate the effectiveness of this idea in improving the feature learning ability of transformers. Second, we design a new transformer architecture named ViTAE based on two new reduction and normal cells to intrinsically incorporate the above two IBs. The proposed ViTAE embeds multi-scale context into tokens and learns both local and long-range features effectively. Third, ViTAE outperforms representative vision transformers regarding classification accuracy, data efficiency, training efficiency, and generalization on downstream tasks. ViTAE achieves $7 5 . 3 \%$ and $8 2 . 0 \%$ top-1 accuracy on ImageNet with 4.8M and 23.6M parameters, respectively.
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
# 2.1 CNNs with intrinsic IB
|
| 33 |
+
|
| 34 |
+
CNNs have led to a series of breakthroughs in image classification [38, 94, 26, 95, 87] and downstream computer vision tasks. The convolution operations in CNNs extract local features from the neighbor pixels within the receptive field determined by the kernel size [42]. Following the intuition that local pixels are more likely to be correlated in images [41], CNNs have the intrinsic IB in modeling locality. In addition to the locality, another critical topic in visual tasks is scale-invariance, where multi-scale features are needed to represent the objects at different scales effectively [49, 90]. For example, to effectively learn features of large objects, a large receptive field is needed by either using large convolution kernels [90, 91] or a series of convolution layers in deeper architectures [26, 32, 68, 71]. To construct multi-scale feature representation, the classical idea is using image pyramid [8, 1, 55, 4, 39, 16], where features are hand-crafted or learned from a pyramid of images at different resolutions respectively [44, 8, 52, 63, 35, 3]. Accordingly, features from the small scale image mainly encode the large objects while features from the large scale image respond more to small objects. In addition to the above inter-layer fusion way, another way is to aggregate multi-scale context by using multiple convolutions with different receptive fields within a single layer, i.e., intra-layer fusion [96, 71, 70, 70, 72]. Either inter-layer fusion or intra-layer fusion empower CNNs an intrinsic IB in modeling scale-invariance. This paper introduces such an IB to vision transformers by following the intra-layer fusion idea and utilizing multiple convolutions with different dilation rates in the reduction cells to encode multi-scale context into each visual token.
|
| 35 |
+
|
| 36 |
+
# 2.2 Vision transformers with learned IB
|
| 37 |
+
|
| 38 |
+
ViT [19] is the pioneering work that applies a pure transformer to vision tasks and achieves promising results. However, since ViT lacks intrinsic inductive bias in modeling local visual structures, it indeed learns the IB from amounts of data implicitly. Following works along this direction are to simplify the model structures with fewer intrinsic IBs and directly learn them from large scale data [50, 74, 75, 22, 18, 20, 27] which have achieved promising results and been studied actively. Another direction is to leverage the intrinsic IB from CNNs to facilitate the training of vision transformers, e.g., using less training data or shorter training schedules. For example, DeiT [76] proposes to distill knowledge from CNNs to transformers during training. However, it requires an off-the-shelf CNN model as a teacher, introducing extra computation cost during training. Recently, some works try to introduce the intrinsic IB of CNNs into vision transformers explicitly [23, 58, 21, 43, 15, 89, 83, 92, 6, 47, 11]. For example, [43, 21, 83] stack convolutions and attention layers sequentially, resulting in a serial structure and modeling the locality and global dependency accordingly. [80, 28] design sequential stage-wise structures while [47, 33] apply attention within local windows. However, these serial structure may ignore the global context during locality modeling (and vice versa). [88] establishes connection across different scales at the cost of heavy computation. Instead, we follow the “divide-and-conquer” idea and propose to model locality and global dependencies simultaneously via a parallel structure within each transformer layer. Conformer [58], the most relevant concurrent work to us, employs a unit to explore inter-block interactions between parallel convolution and transformer blocks. In contrast, in ViTAE, the convolution and attention modules are designed to be complementary to each other within the transformer block. In addition, Conformer is not designed to have inherent scale invariance IB.
|
| 39 |
+
|
| 40 |
+
# 3 Methodology
|
| 41 |
+
|
| 42 |
+
# 3.1 Revisit vision transformer
|
| 43 |
+
|
| 44 |
+
We first give a brief review of vision transformer in this part. To adapt transformers to vision tasks, ViT [19] first splits an image $x \in R ^ { H \times W \times C }$ into tokens with a reduction ratio of $p$ (i.e., $x _ { t } \in R ^ { ( ( H \times W ) / p ^ { 2 } ) \times D } )$ , where $H , W$ and $C$ denote the height, width, and channel dimensions of the input image, $D = C p ^ { 2 }$ denotes the token dimension. Then, an extra class token is concatenated to the visual tokens before adding position embeddings in an element-wise manner. The resulting tokens are fed into the following transformer layers. Each transformer layer is composed of two parts, i.e., a multi-head self-attention module (MHSA) and a feed forward network (FFN).
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: The structure of the proposed ViTAE. It is constructed by stacking three RCs and several NCs. Both types of cells share a simple basic structure, i.e., an MHSA module and a parallel convolutional module followed by an FFN. In particular, RC has an extra pyramid reduction module using atrous convolutions with different dilation rates to embed multi-scale context into tokens.
|
| 48 |
+
|
| 49 |
+
MHSA Multi-head self-attention extends single-head self-attention (SHSA) by using different projection matrices for each head. Specifically, the input tokens $x _ { t }$ are first projected to queries $( Q )$ , keys $( K )$ and values $( V )$ using projection matrices, i.e., $Q , K , V = x _ { t } W _ { Q } , x _ { t } Q _ { K } , x _ { t } Q _ { V }$ , where $W _ { Q / K / V } \in R ^ { D \times D }$ denotes the projection matrix for query, key, and value, respectively. Then, the self-attention operation is calculated as:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
A t t e n t i o n ( Q , K , V ) = s o f t m a x ( \frac { Q K ^ { T } } { \sqrt { D } } ) V .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
This SHSA module is repeated for $h$ times to formulate the MHSA module, where $h$ is the number of heads. The output features of the $h$ heads are concatenated along the channel dimension and formulate the output of the MHSA module.
|
| 56 |
+
|
| 57 |
+
FFN FFN is placed on top of the MHSA module and applied to each token identically and separately. It consists of two linear transformations with an activation function in between. Besides, a layer normalization [2] and a shortcut are added before and aside from the MHSA and FFN, respectively.
|
| 58 |
+
|
| 59 |
+
# 3.2 Overview architecture of ViTAE
|
| 60 |
+
|
| 61 |
+
ViTAE aims to introduce the intrinsic IB in CNNs to vision transformers. As shown in Figure 2, ViTAE is composed of two types of cells, i.e., RCs and NCs. RCs are responsible for embedding multi-scale context and local information into tokens, and NCs are used to further model the locality and long-range dependencies in the tokens. Taken an image $x \in R ^ { H \times W \times C }$ as input, three RCs are used to gradually downsample $x$ by $4 \times , 2 \times$ , and $2 \times$ , respectively. Thereby, the output tokens of the RCs are of size $[ H / 1 6 , W / 1 6 , D ]$ where $D$ is the token dimension (64 in our experiments). The output tokens of RCs are then flattened as $R ^ { H W / 2 5 6 \times D }$ , concatenated with the class token, and added by the sinusoid position encoding. Next, the tokens are fed into the following NCs, which keep the length of the tokens. Finally, the prediction probability is obtained using a linear classification layer on the class token from the last NC.
|
| 62 |
+
|
| 63 |
+
# 3.3 Reduction cell
|
| 64 |
+
|
| 65 |
+
Instead of directly splitting and flatten images into visual tokens based on a linear image patch embedding layer, we devise the reduction cell to embed multi-scale context and local information into visual tokens, which introduces the intrinsic scale-invariance and locality IBs from convolutions. Technically, RC has two parallel branches responsible for modeling locality and long-range dependency, respectively, followed by an FFN for feature transformation. We denote the input feature of the $i _ { t h } \ : \mathrm { R C }$ as $f _ { i } \in \dot { R } ^ { H _ { i } \times W _ { i } \times D _ { i } }$ . The input of the first RC is the image $x$ . In the global dependencies branch, $f _ { i }$ is firstly fed into a Pyramid Reduction Module (PRM) to extract multi-scale context, i.e.,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
f _ { i } ^ { m s } \triangleq P R M _ { i } ( f _ { i } ) = C a t ( [ C o n v _ { i j } ( f _ { i } ; s _ { i j } , r _ { i } ) | s _ { i j } \in S _ { i } , r _ { i } \in { \mathcal { R } } ] ) ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $C o n v _ { i j } ( \cdot )$ indicates the $j$ th convolutional layer in the PRM $( P R M _ { i } ( \cdot ) )$ . It uses a dilation rate $s _ { i j }$ from the predefined dilation rate set $S _ { i }$ corresponding to the ith RC. Note that we use stride convolution to reduce the spatial dimension of features by a ratio $r _ { i }$ from the predefined reduction ratio set $\mathcal { R }$ . The conv features are concatenated along the channel dimension, i.e., $f _ { i } ^ { m s } \in$ $R ^ { ( W _ { i } / p ) \times ( H _ { i } / p ) \times ( | S _ { i } | D ) }$ , where $| { S _ { i } } |$ denotes the number of dilation rates in $S _ { i }$ . $f _ { i } ^ { m s }$ is then processed by an MHSA module to model long-range dependencies, i.e.,
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
f _ { i } ^ { g } = M H S A _ { i } ( I m g 2 S e q ( f _ { i } ^ { m s } ) ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $I m g 2 S e q ( \cdot )$ is a simple reshape operation to flatten the feature map to a 1D sequence. In this way, $f _ { i } ^ { g }$ embeds the multi-scale context in each token. In addition, we use a Parallel Convolutional Module (PCM) to embed local context within the tokens, which are fused with $f _ { i } ^ { g }$ as follows:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
f _ { i } ^ { l g } = f _ { i } ^ { g } + { \cal P } { \cal C } M _ { i } ( f _ { i } ) .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Here, $P C M _ { i } ( \cdot )$ represents the PCM, which is composed of three stacked convolution layers and an $I m g 2 S e q ( \cdot )$ operation. It is noteworthy that the parallel convolution branch has the same spatial downsampling ratio as the PRM by using stride convolutions. In this way, the token features can carry both local and multi-scale context, implying that RC acquires the locality IB and scale-invariance IB by design. The fused tokens are then processed by the FFN, reshaped back to feature maps, and fed into the following RC or NC, i.e.,
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
f _ { i + 1 } = S e q 2 I m g ( F F N _ { i } ( f _ { i } ^ { l g } ) + f _ { i } ^ { l g } ) ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where the $S e q 2 I m g ( \cdot )$ is a simple reshape operation to reshape a token sequence back to feature maps. $F F N _ { i } ( \cdot )$ represents the FFN in the ith RC. In our ViTAE, three RCs are stacked sequentially to gradually reduce the input image’s spatial dimension by $4 \times , 2 \times$ , and $2 \times$ , respectively. The feature maps generated by the last RC are of a size of $[ H / 1 6 , W / 1 6 , D ]$ , which are then flattened into visual tokens and fed into the following NCs.
|
| 90 |
+
|
| 91 |
+
# 3.4 Normal cell
|
| 92 |
+
|
| 93 |
+
As shown in the bottom right part of Figure 2, NCs share a similar structure with the reduction cell except for the absence of the PRM. Due to the relatively small $( \frac { 1 } { 1 6 } \times )$ spatial size of feature maps after RCs, it is unnecessary to use PRM in NCs. Given $f _ { 3 }$ from the third RC, we first concatenate it with the class token $t _ { c l s }$ , and then add it to the positional encodings to get the input tokens $t$ for the following NCs. Here we ignore the subscript for clarity since all NCs have an identical architecture but different learnable weights. $t _ { c l s }$ is randomly initialized at the start of training and fixed during the inference. Similar to the RC, the tokens are fed into the MHSA module, i.e., $t _ { g } = M H S A ( t )$ . Meanwhile, they are reshaped to 2D feature maps and fed into the PCM, i.e., $t _ { l } = \bar { I } m g 2 S e q ( P C M ( S e q 2 I m g ( t ) ) )$ . Note that the class token is discarded in PCM because it has no spatial connections with other visual tokens. To further reduce the parameters in NCs, we use group convolutions in PCM. The features from MHSA and PCM are then fused via element-wise sum, i.e., $t _ { l g } = t _ { g } + t _ { l }$ . Finally, $t _ { l g }$ are fed into the FFN to get the output features of NC, i.e., $t _ { n c } = F F N ( t _ { l g } ) \overline { { + } } t _ { l g }$ . Similar to ViT [19], we apply layer normalization to the class token generated by the last NC and feed it to the classification head to get the final classification result.
|
| 94 |
+
|
| 95 |
+
# 3.5 Model details
|
| 96 |
+
|
| 97 |
+
We use two variants of ViTAE in our experiments for a fair comparison of other models with similar model sizes. The details of them are summarized in Table 1. In the first RC, the default convolution kernel size is $7 \times 7$ with a
|
| 98 |
+
|
| 99 |
+
Table 1: Model details of two variants of ViTAE.
|
| 100 |
+
|
| 101 |
+
<table><tr><td>Model</td><td>Reduction Cell Dilation</td><td>Cells</td><td>Normal Cell Heads Embed Cells</td><td></td><td>Params Macs (M)</td><td>(G)</td></tr><tr><td>ViTAE-T</td><td>[1,2,3,4] √</td><td>3</td><td>4 256</td><td>7</td><td>4.8</td><td>1.5</td></tr><tr><td>ViTAE-S</td><td>[1,2,3,4] √</td><td>3</td><td>6</td><td>384 14</td><td>23.6</td><td>5.6</td></tr></table>
|
| 102 |
+
|
| 103 |
+
stride of 4 and dilation rates of $\mathcal { S } _ { 1 } = [ 1 , 2 , 3 , 4 ]$ . In the following two RCs, the convolution kernel size is $3 \times 3$ with a stride of 2 and dilation rates of $S _ { 2 } = [ 1 , 2 , 3 ]$ and $S _ { 3 } = [ 1 , 2 ]$ , respectively. Since the spatial dimension of tokens decreases, there is no need to use large kernels and dilation rates. PCM in both RCs and NCs comprises three convolutional layers with a kernel size of $3 \times 3$ .
|
| 104 |
+
|
| 105 |
+
# 4 Experiments
|
| 106 |
+
|
| 107 |
+
# 4.1 Implementation details
|
| 108 |
+
|
| 109 |
+
We train and test the proposed ViTAE model on the standard ImageNet [38] dataset, which contains about 1.3 million images and covers 1k classes. Unless explicitly stated, the image size during training is set to $2 2 4 \times 2 2 4$ . We use the AdamW [48] optimizer with the cosine learning rate scheduler and uses the data augmentation strategy exactly the same as T2T [93] for a fair comparison, regarding the training strategies and the size of models. We use a batch size of 512 for training all our models and set the initial learning rate to be 5e-4. The results of our models can be found in Table 2, where all the models are trained for 300 epochs on 8 V100 GPUs. The models are built on PyTorch [57] and TIMM [82].
|
| 110 |
+
|
| 111 |
+
# 4.2 Comparison with the state-of-the-art
|
| 112 |
+
|
| 113 |
+
We compare our ViTAE with both CNN models and vision transformers with similar model sizes in Table 2. Both Top-1/5 accuracy and real Top-1 accuracy on the ImageNet validation set are reported. We categorize the methods into CNN models, vision transformers with learned IB, and vision transformers with introduced intrinsic IB. Compared with CNN models, our ViTAE-T achieves a $7 5 . 3 \%$ Top-1 accuracy, which is better than ResNet-18 with more parameters. The real Top-1 accuracy of the ViTAE model is $8 2 . 9 \%$ , which is comparable to ResNet-50 that has four more times of parameters than ours. Similarly, our ViTAE-S achieves $8 2 . 0 \%$ Top-1 accuracy with half of the parameters of ResNet-101 and ResNet-152, showing the superiority of learning both local and longrange features from specific structures with corresponding intrinsic IBs by design. Similar phenomena can also be observed when comparing ViTAE-T with MobileNetV1 [31] and MobileNetV2 [65], where ViTAE obtains better performance with fewer parameters. When compared with larger models which are searched according to NAS [73], our ViTAE-S achieves a similar performance when using $3 8 4 \times 3 8 4$ images as input, which further shows the potential of vision transformers with intrinsic IB.
|
| 114 |
+
|
| 115 |
+
In addition, among the transformers with learned IB, ViT is the first pure transformer model for visual recognition. DeiT shares the same structure with ViT but uses different data augmentation and training strategies to facilitate the learning of transformers. DeiT⚗ denotes using an off-the-shelf CNN model as the teacher model to train DeiT, which introduces the intrinsic IB from CNN to transformer implicitly in a knowledge distillation manner, showing better performance than the vanilla ViT on the ImageNet dataset. It is exciting to see that our ViTAE-T with fewer parameters even outperforms the distilled model DeiT⚗, demonstrating the efficacy of introducing intrinsic IBs in transformers by design. Besides, compared with other transformers with explicit intrinsic IB, our ViTAE with fewer parameters also achieves comparable or better performance. For instance, ViTAE-T achieves comparable performance with LocalVit-T but has 1M fewer parameters, demonstrating the superiority of the proposed RCs and NCs in introducing intrinsic IBs.
|
| 116 |
+
|
| 117 |
+
# 4.3 Ablation study
|
| 118 |
+
|
| 119 |
+
We use T2T-ViT [93] as our baseline model in the following ablation study of our ViTAE. As shown in Table 3, we investigate the hyper-parameter settings in RCs and NCs by isolating them separately. All the models are trained for 100 epochs on ImageNet and follow the same training setting and data augmentation strategy as described in Section 4.1.
|
| 120 |
+
|
| 121 |
+
Table 2: Comparison of ViTAE and SOTA methods on the ImageNet validation set.
|
| 122 |
+
|
| 123 |
+
<table><tr><td rowspan="2">Type Model</td><td rowspan="2">Params (M)</td><td rowspan="2">MACs (G)</td><td rowspan="2">Input Size</td><td colspan="3">ImageNet Real</td></tr><tr><td>Top-1</td><td>Top-5</td><td>Top-1</td></tr><tr><td rowspan="9">CNN</td><td>ResNet-18 [26]</td><td>11.7</td><td>3.6</td><td>224</td><td>70.3</td><td>86.7</td><td>77.3</td></tr><tr><td>ResNet-50 [26]</td><td>25.6</td><td>7.6</td><td>224</td><td>76.7</td><td>93.3</td><td>82.5</td></tr><tr><td>ResNet-101 [26]</td><td>44.5</td><td>15.2</td><td>224</td><td>78.3</td><td>94.1</td><td>83.7</td></tr><tr><td>ResNet-152 [26]</td><td>60.2</td><td>22.6</td><td>224</td><td>78.9</td><td>94.4</td><td>84.1</td></tr><tr><td>EfficientNet-B0 [73]</td><td>5.3</td><td>0.8</td><td>224</td><td>77.1</td><td>93.3</td><td>83.5</td></tr><tr><td>EfficientNet-B4 [73]</td><td>19.3</td><td>8.4</td><td>380</td><td>82.9</td><td>96.4</td><td>88.0</td></tr><tr><td>MobileNetV1 [31]</td><td>4.3</td><td>0.6</td><td>224</td><td>72.3</td><td>1</td><td>-</td></tr><tr><td>MobileNetV2(1.4) [65]</td><td>6.9</td><td>0.6</td><td>224</td><td>74.7</td><td>-</td><td>-</td></tr><tr><td>RegNetY-600M[62]</td><td>6.1</td><td>1.2</td><td>224</td><td>75.5</td><td>-</td><td>-</td></tr><tr><td>RegNetY-4GF[62] RegNetY-8GF[62]</td><td>20.6 39.2</td><td>8.0 16.0</td><td>224</td><td>80.0</td><td>1</td><td>86.4</td></tr><tr><td></td><td></td><td></td><td></td><td>224</td><td>81.7</td><td>1</td><td>87.4</td></tr><tr><td rowspan="14"></td><td>DeiT-T[76]</td><td>5.7</td><td>2.6</td><td>224</td><td>72.2</td><td>91.1</td><td>80.6</td></tr><tr><td>DeiT-T [76]</td><td>5.7</td><td>2.6</td><td>224</td><td>74.5</td><td>91.9</td><td>82.1</td></tr><tr><td>LocalViT-T[43]</td><td>5.9</td><td>2.6</td><td>224</td><td>74.8</td><td>92.6</td><td></td></tr><tr><td>LocalViT-T2T[43]</td><td>4.3</td><td>2.4</td><td>224</td><td>72.5</td><td>-</td><td>1 1</td></tr><tr><td>ConT-Ti [89]</td><td>5.8</td><td>1.6</td><td>224</td><td>74.9</td><td>-</td><td>-</td></tr><tr><td>PiT-Ti [29]</td><td>4.9</td><td>1.4</td><td>224</td><td>73.0</td><td>-</td><td>1</td></tr><tr><td>T2T-ViT-7 [93]</td><td>4.3</td><td>1.2</td><td>224</td><td>71.7</td><td>90.9</td><td>79.7</td></tr><tr><td>ViTAE-T</td><td>4.8</td><td>1.5</td><td>224</td><td>75.3</td><td>92.7</td><td>82.9</td></tr><tr><td>ViTAE-T ↑ 384</td><td>4.8</td><td>5.7</td><td>384</td><td>77.2</td><td>93.8</td><td>84.4</td></tr><tr><td>CeiT-T [92]</td><td>6.4</td><td>2.4</td><td>224</td><td>76.4</td><td>93.4</td><td>83.6</td></tr><tr><td>ConViT-Ti[15]</td><td>6.0</td><td>2.0</td><td>224</td><td>73.1</td><td>1</td><td>1</td></tr><tr><td>Cross ViT-Ti [6]</td><td>6.9</td><td>3.2</td><td>224</td><td>73.4</td><td>1</td><td>1</td></tr><tr><td>ViTAE-6M</td><td>6.5</td><td>2.0</td><td>224</td><td>77.9</td><td>94.1</td><td>84.9</td></tr><tr><td>PVT-T[80] LocalViT-PVT [43]</td><td>13.2</td><td>3.8</td><td>224</td><td>75.1</td><td>1</td><td></td></tr><tr><td rowspan="8">PiT-XS [29] ConT-M [89] ViTAE-13M DeiT-S [76]</td><td>13.5</td><td>9.6</td><td>224</td><td></td><td>94.2</td><td>-</td></tr><tr><td>ConViT-Ti+ [15] 10.0</td><td>4.0</td><td>224</td><td>78.2 76.7</td><td></td><td>1</td></tr><tr><td></td><td>2.8</td><td></td><td>78.1</td><td>1</td><td>-</td></tr><tr><td>10.6 19.2</td><td>6.2</td><td>224 224</td><td>80.2</td><td>-</td><td>1</td></tr><tr><td>13.2</td><td>3.4</td><td>224</td><td>81.0</td><td>- 95.4</td><td>- 86.8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>22.1 DeiT-S [76] 22.1</td><td>9.8 9.8</td><td>224 224</td><td>79.9 81.2</td><td>95.0 95.4</td><td>85.7 86.8</td></tr><tr><td>PVT-S[80]</td><td>7.6</td><td>224</td><td>79.8</td><td>-</td><td></td></tr><tr><td></td><td>24.5 23.5</td><td>5.2</td><td></td><td>81.3</td><td></td><td>1</td></tr><tr><td>Conformer-Ti [58] Swin-T[47]</td><td></td><td></td><td>224</td><td></td><td>-</td><td></td></tr><tr><td>CeiT-S [92]</td><td>29.0</td><td>9.0</td><td>224</td><td>81.3</td><td>-</td><td>1</td></tr><tr><td>CvT-13 [83]</td><td>24.2 20.0</td><td>9.0</td><td>224</td><td>82.0 81.6</td><td>95.9</td><td>87.3 86.7</td></tr><tr><td>ConViT-S[15]</td><td>27.0</td><td>9.0 10.8</td><td>224 224</td><td>81.3</td><td>1 1</td><td>1</td></tr><tr><td>Cross ViT-S [6]</td><td>26.7</td><td>11.2</td><td>224</td><td>81.0</td><td>1</td><td>1</td></tr><tr><td>PiT-S [29]</td><td>23.5</td><td>4.8</td><td>224</td><td>80.9</td><td></td><td></td></tr><tr><td>TNT-S [23]</td><td></td><td></td><td></td><td></td><td>-</td><td>1</td></tr><tr><td>Twins-PCPVT-S[10]</td><td>23.8</td><td>10.4</td><td>224</td><td>81.3</td><td>95.6</td><td>-</td></tr><tr><td></td><td>24.1</td><td>7.4</td><td>224</td><td>81.2</td><td>-</td><td>-</td></tr><tr><td>Twins-SVT-S [10]</td><td>24.0</td><td>5.6</td><td>224</td><td>81.7</td><td>-</td><td>1</td></tr><tr><td>T2T-ViT-14 [93]</td><td>21.5</td><td>5.2</td><td>224</td><td>81.5</td><td>95.7</td><td>86.8</td></tr><tr><td>ViTAE-S</td><td>23.6</td><td>5.6</td><td>224</td><td>82.0</td><td>95.9</td><td>87.0</td></tr><tr><td>ViTAE-S ↑ 384</td><td>23.6</td><td>20.2</td><td>384</td><td>83.0</td><td>96.2</td><td>87.5</td></tr></table>
|
| 124 |
+
|
| 125 |
+
We use $\checkmark$ and $\times$ to denote whether or not the corresponding module is enabled during the experiments. If all columns under the RC and NC are marked $\times$ as shown in the first row, the model becomes the standard T2T-ViT model. “Pre” indicates the output features of PCM and MHSA are fused before FFN while “Post” indicates a late fusion strategy correspondingly. “BN” indicates whether PCM uses BN after the convolutional layer or not. $\mathit { \Omega } ^ { 6 } \times 3 \mathit { \Omega } ^ { 5 }$ in the first column denotes that the dilation rate set is the same in the three RCs. “ $[ 1 , 2 , 3 , 4 ]$ $\downarrow ^ { \circ }$ denotes using lower dilation rates in deeper RCs, i.e., $\mathcal { S } _ { 1 } = [ 1 , 2 , 3 , 4 ]$ , $S _ { 2 } = [ 1 , 2 , 3 ]$ , $S _ { 3 } = [ 1 , 2 ]$ .
|
| 126 |
+
|
| 127 |
+
As can be seen, using a pre-fusion strategy and BN achieves the best $6 9 . 9 \%$ Top-1 accuracy among other settings. It is noteworthy that all the variants of NC outperform the vanilla T2T-ViT, implying the effectiveness of PCM, which introduces the intrinsic locality IB in transformers. It can also be observed that BN plays an important role in improving the model’s performance as it can help to alleviate the scale deviation between convolution’s and attention’s features. For the RC, we first investigate the impact of using different dilation rates in the PRM, as shown in the first column. As can be seen, using larger dilation rates (e.g., 4 or 5) does not deliver better performance. We suspect that larger dilation rates may lead to plain features in the deeper RCs due to the smaller resolution of feature maps. To
|
| 128 |
+
|
| 129 |
+
Table 3: Ablation Study of RCs and NCs in our ViTAE. “Pre” indicates the output features of PCM and MHSA are fused before FFN while “Post” indicates a late fusion strategy correspondingly. “BN” indicates whether PCM uses BN or not. “ $[ 1 , 2 , 3 , 4 ]$ $\downarrow ^ { \circ }$ denotes using smaller dilation rates in deeper RCs, i.e., $\mathcal { S } _ { 1 } = [ 1 , 2 , 3 , 4 ]$ , $\mathsf { \bar { S } } _ { 2 } = [ 1 , 2 , 3 ]$ , $ { S _ { 3 } } = [ 1 , 2 ]$ .
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Reduction Cell</td><td></td><td>Normal Cell</td><td rowspan="2">Top-1</td></tr><tr><td>Dilation (S1 ~ S3) PCM</td><td>Pre</td><td>BN Post</td></tr><tr><td>× ×</td><td>×</td><td>× ×</td><td>68.7</td></tr><tr><td>× ×</td><td>√</td><td>× ×</td><td>69.1</td></tr><tr><td>× ×</td><td>×</td><td>√ ×</td><td>69.0</td></tr><tr><td>× ×</td><td>×</td><td>√ √</td><td>68.8</td></tr><tr><td>× ×</td><td>√</td><td>× √</td><td>69.9</td></tr><tr><td>[1,2]×3</td><td>× ×</td><td>×</td><td>× 69.5</td></tr><tr><td>[1,2,3]×3 ×</td><td>×</td><td>× ×</td><td>69.9</td></tr><tr><td>[1,2,3,4] × 3 ×</td><td>×</td><td>× ×</td><td>69.2</td></tr><tr><td>[1,2,3,4,5] × 3 ×</td><td>×</td><td>× ×</td><td>68.9</td></tr><tr><td>[1,2,3,4]↓ ×</td><td>×</td><td>× ×</td><td>69.8</td></tr><tr><td>[1,2,3,4]↓ √</td><td>×</td><td>× ×</td><td>71.7</td></tr><tr><td>[1,2,3,4]↓ √</td><td>√</td><td>× √</td><td>72.6</td></tr></table>
|
| 132 |
+
|
| 133 |
+
validate the hypothesis, we use smaller dilation rates in deeper RCs as denoted by $[ 1 , 2 , 3 , 4 ] \downarrow$ . As can be seen, it achieves comparable performance as $[ 1 , 2 , 3 ] \times$ . However, compared with $[ 1 , 2 , 3 , 4 ] \downarrow$ , $[ 1 , 2 , 3 ] \times$ increases the amount of parameters from 4.35M to $4 . 6 \mathsf { M }$ . Therefore, we select $[ 1 , 2 , 3 , 4 ] \downarrow$ as the default setting. In addition, after using PCM in the RC, it introduces the intrinsic locality IB, and the performance increases to $7 1 . 7 \%$ Top-1 accuracy. Finally, the combination of RCs and NCs achieves the best accuracy at $7 2 . 6 \%$ , demonstrating the complementarity between our RCs and NCs.
|
| 134 |
+
|
| 135 |
+
# 4.4 Data efficiency and training efficiency
|
| 136 |
+
|
| 137 |
+
To validate the effectiveness of the introduced intrinsic IBs in improving data efficiency and training efficiency, we compare our ViTAE with T2T-ViT at different training settings: (a) training them using $20 \%$ , $60 \%$ , and $100 \%$ ImageNet training set for equivalent 100 epochs on the full ImageNet training set, e.g., we employ 5 times epochs when using $20 \%$ data for training compared with using $100 \%$ data; and (b) training them using the full ImageNet training set for 100, 200, and 300 epochs respectively. The results are shown in Figure 1. As can be seen, ViTAE consistently outperforms the T2T-ViT baseline by a large margin in terms of both data efficiency and training efficiency. For example, ViTAE using only $20 \%$ training data achieves comparable performance with T2T-ViT using all data. When $60 \%$ training data are used, ViTAE significantly outperforms T2T-ViT using all data by about an absolute $3 \%$ accuracy. It is also noteworthy that ViTAE trained for only 100 epochs has outperformed T2T-ViT trained for 300 epochs. After training ViTAE for 300 epochs, its performance is significantly boosted to $7 5 . 3 \%$ Top-1 accuracy. With the proposed RCs and NCs, the transformer layers in our ViTAE only need to focus on modeling long-range dependencies, leaving the locality and multi-scale context modeling to its convolution counterparts, i.e., PCM and PRM. Such a “divide-and-conquer” strategy facilitates the training of vision transformers, making it possible to learn more efficiently with less training data and fewer training epochs.
|
| 138 |
+
|
| 139 |
+
To further validate the data efficiency of ViTAE model, we train the ViTAE model from scratch on the smaller datasets, i.e., Cifar10 and Cifar100. The results are summarized in Table 4. It can be viewed that with only $1 / 7$ number of epochs, the ViTAE-T model achieves better classification performance on Cifar10 dataset, with far fewer parameters (4.8M v.s. 86M), which further confirms ViTAE model’s data efficiency.
|
| 140 |
+
|
| 141 |
+
Table 4: Results of training from scratch on Cifar10/100.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>Model</td><td>Params (M)</td><td>Top-1 Acc</td><td>Epochs</td><td>Dataset</td></tr><tr><td>DeiT-B</td><td>86.0</td><td>97.5</td><td>7000</td><td>Cifar10</td></tr><tr><td>ViTAE-T</td><td>4.8</td><td>97.7</td><td>1000</td><td>Cifar10</td></tr><tr><td>ViTAE-T</td><td>4.8</td><td>85.0</td><td>1000</td><td>Cifar100</td></tr></table>
|
| 144 |
+
|
| 145 |
+
# 4.5 Generalization on downstream tasks
|
| 146 |
+
|
| 147 |
+
Table 5: Generalization of ViTAE and SOTA methods on different downstream tasks.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Model</td><td>Params (M)</td><td>Cifar10</td><td>Cifar100</td><td>iNat19</td><td>Cars</td><td>Flowers</td><td>Pets</td></tr><tr><td>Grafit ResNet-50 [78]</td><td>25.6</td><td>-</td><td>=</td><td>75.9</td><td>92.5</td><td>98.2</td><td>-</td></tr><tr><td>EfficientNet-B5 [73]</td><td>30</td><td>98.1</td><td>91.1</td><td>-</td><td>-</td><td>98.5</td><td>-</td></tr><tr><td>ViT-B/16 [19]</td><td>86.5</td><td>98.1</td><td>87.1</td><td>-</td><td>1</td><td>89.5</td><td>93.8</td></tr><tr><td>ViT-L/16 [19]</td><td>304.3</td><td>97.9</td><td>86.4</td><td>-</td><td>-</td><td>89.7</td><td>93.6</td></tr><tr><td>DeiT-B [76]</td><td>86.6</td><td>99.1</td><td>90.8</td><td>77.7</td><td>92.1</td><td>98.4</td><td>-</td></tr><tr><td>T2T-ViT-14 [93]</td><td>21.5</td><td>98.3</td><td>88.4</td><td>-</td><td>-</td><td>-</td><td>1</td></tr><tr><td>ViTAE-T</td><td>4.8</td><td>97.3</td><td>86.0</td><td>73.3</td><td>89.5</td><td>97.5</td><td>92.6</td></tr><tr><td>ViTAE-S</td><td>23.6</td><td>98.8</td><td>90.8</td><td>76.0</td><td>91.4</td><td>97.8</td><td>94.2</td></tr></table>
|
| 150 |
+
|
| 151 |
+
We further investigate the generalization of the proposed ViTAE models on downstream tasks by finetuning them on the training sets of several fine-grained classification tasks3, including Flowers [53], Cars [36], Pets [56], and iNaturalist19. We also fine-tune the proposed ViTAE models on Cifar10 [37] and Cifar100 [37]. The results are shown in Table 5. It can be seen that ViTAE achieves SOTA performance on most of the datasets using comparable or fewer parameters. These results demonstrate that the good generalization ability of our ViTAE.
|
| 152 |
+
|
| 153 |
+
# 4.6 Visual inspection of ViTAE
|
| 154 |
+
|
| 155 |
+
To further analyze the property of our ViTAE, we first calculate the average attention distance of each layer in ViTAE-T and the baseline T2T-ViT-7 on the ImageNet test set, respectively. The results are shown in Figure 3. It can be observed that with the usage of PCM, which focuses on modeling locality, the transformer layers in the proposed NCs can better focus on modeling long-range dependencies, especially in shallow layers. In the deep layers, the average attention distances of ViTAE-T and T2T-ViT-7 are almost the same since modeling long-range dependencies is much more important.
|
| 156 |
+
|
| 157 |
+
These results confirm the effectiveness of the adopted “divide-and-conquer” idea in the proposed ViTAE, i.e., introducing the intrinsic locality IB from convolutions into vision transformers makes it possible that transformer layers only need to be responsible to long-range dependencies, since locality can be well modeled by convolutions in PCM.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: The average per-layer attention distance of T2T-ViT-7 and our ViTAE-T.
|
| 161 |
+
|
| 162 |
+
Besides, we apply Grad-CAM [66] on the MHSA’s output in the last NC to qualitatively inspect ViTAE. The visualization results are provided in Figure 4. Compared with the baseline T2T-ViT, our ViTAE covers the single or multiple targets in the images more precisely and attends less to the background. Moreover, ViTAE can better handle the scale variance issue as shown in Figure 4(b). Namely, it can precisely cover the birds no matter they are in small, middle, or large size. Such observations demonstrate that introducing the intrinsic IBs of locality and scale-invariance from convolutions to transformers helps ViTAE learn more discriminate features than the pure transformers.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 4: Visual inspection of T2T-ViT and ViTAE using Grad-CAM [66]. (a) Images containing multiple or single objects and the heatmaps. (b) Images containing the same class of objects at different scales and the heatmaps (Best viewed in color).
|
| 166 |
+
|
| 167 |
+
# 5 Limitation and discussion
|
| 168 |
+
|
| 169 |
+
In this paper, we explore two types of IBs and incorporate them into transformers through the proposed reduction and normal cells. With the collaboration of these two cells, our ViTAE model achieves impressive performance on the ImageNet with fast convergence and high data efficiency. Nevertheless, due to computational resource constraints, we have not scaled the ViTAE model and train it on largesize dataset, e.g., ImageNet-21K [38] and JFT-300M [30]. Although it remains unclear by now, we are optimistic about its scale property from the following preliminary evidence. As illustrated in Figure 2, our ViTAE model can be viewed as an intra-cell ensemble of complementary transformer layers and convolution layers owing to the skip connection and parallel structure. According to the attention distance analysis shown in Figure 3, the ensemble nature enables the transformer layers and convolution layers to focus on what they are good at, i.e., modeling long-range dependencies and locality. Therefore, ViTAE is very likely to learn better feature representation from large-scale data. Besides, we only study two typical IBs in this paper. More kinds of IBs such as constituting viewpoint invariance [64] can be explored in the future study.
|
| 170 |
+
|
| 171 |
+
# 6 Conclusion
|
| 172 |
+
|
| 173 |
+
In this paper, we re-design the transformer block by proposing two basic cells (reduction cells and normal cells) to incorporate two types of intrinsic inductive bias (IB) into transformers, i.e., locality and scale-invariance, resulting in a simple yet effective vision transformer architecture named ViTAE. Extensive experiments show that ViTAE outperforms representative vision transformers in various respects including classification accuracy, data efficiency, training efficiency, and generalization ability on downstream tasks. We plan to scale ViTAE to the large or huge model size and train it on large-size datasets in the future study. In addition, other kinds of IBs will also be investigated. We hope that this study will provide valuable insights to the following studies of introducing intrinsic IB into vision transformers and understanding the impact of intrinsic and learned IBs.
|
| 174 |
+
|
| 175 |
+
Acknowledgement Dr. Jing Zhang is supported by the ARC project FL-170100117.
|
| 176 |
+
|
| 177 |
+
# References
|
| 178 |
+
|
| 179 |
+
processing. RCA engineer, 29(6):33–41, 1984. [2] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 180 |
+
[3] H. Bay, T. Tuytelaars, and L. Van Gool. Surf: Speeded up robust features. In European conference on computer vision, pages 404–417. Springer, 2006. [4] P. J. Burt and E. H. Adelson. The laplacian pyramid as a compact image code. In Readings in computer vision, pages 671–679. Elsevier, 1987.
|
| 181 |
+
[5] Z. Cai and N. Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6154–6162, 2018. [6] C.-F. Chen, Q. Fan, and R. Panda. Crossvit: Cross-attention multi-scale vision transformer for image classification. arXiv preprint arXiv:2103.14899, 2021. [7] H. Chen, Y. Wang, T. Guo, C. Xu, Y. Deng, Z. Liu, S. Ma, C. Xu, C. Xu, and W. Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020. [8] L.-C. Chen, G. Papandreou, F. Schroff, and H. Adam. Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587, 2017.
|
| 182 |
+
[9] X. Chen, S. Xie, and K. He. An empirical study of training self-supervised vision transformers. arXiv preprint arXiv:2104.02057, 2021.
|
| 183 |
+
[10] X. Chu, Z. Tian, Y. Wang, B. Zhang, H. Ren, X. Wei, H. Xia, and C. Shen. Twins: Revisiting spatial attention design in vision transformers. arXiv preprint arXiv:2104.13840, 2021.
|
| 184 |
+
[11] X. Chu, Z. Tian, B. Zhang, X. Wang, X. Wei, H. Xia, and C. Shen. Conditional positional encodings for vision transformers. arXiv preprint arXiv:2102.10882, 2021.
|
| 185 |
+
[12] M. Contributors. MMSegmentation: Openmmlab semantic segmentation toolbox and benchmark. https: //github.com/open-mmlab/mmsegmentation, 2020.
|
| 186 |
+
[13] M. Contributors. Openmmlab pose estimation toolbox and benchmark. https://github.com/ open-mmlab/mmpose, 2020.
|
| 187 |
+
[14] Z. Dai, Z. Yang, Y. Yang, J. Carbonell, Q. V. Le, and R. Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
|
| 188 |
+
[15] S. d’Ascoli, H. Touvron, M. Leavitt, A. Morcos, G. Biroli, and L. Sagun. Convit: Improving vision transformers with soft convolutional inductive biases. arXiv preprint arXiv:2103.10697, 2021.
|
| 189 |
+
[16] H. Demirel and G. Anbarjafari. Image resolution enhancement by using discrete and stationary wavelet decomposition. IEEE transactions on image processing, 20(5):1458–1460, 2010.
|
| 190 |
+
[17] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 191 |
+
[18] X. Ding, X. Zhang, J. Han, and G. Ding. Repmlp: Re-parameterizing convolutions into fully-connected layers for image recognition. arXiv preprint arXiv:2105.01883, 2021.
|
| 192 |
+
[19] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 193 |
+
[20] A. El-Nouby, H. Touvron, M. Caron, P. Bojanowski, M. Douze, A. Joulin, I. Laptev, N. Neverova, G. Synnaeve, J. Verbeek, et al. Xcit: Cross-covariance image transformers. arXiv preprint arXiv:2106.09681, 2021.
|
| 194 |
+
[21] B. Graham, A. El-Nouby, H. Touvron, P. Stock, A. Joulin, H. Jégou, and M. Douze. Levit: a vision transformer in convnet’s clothing for faster inference. arXiv preprint arXiv:2104.01136, 2021.
|
| 195 |
+
[22] M.-H. Guo, Z.-N. Liu, T.-J. Mu, and S.-M. Hu. Beyond self-attention: External attention using two linear layers for visual tasks. arXiv preprint arXiv:2105.02358, 2021.
|
| 196 |
+
[23] K. Han, A. Xiao, E. Wu, J. Guo, C. Xu, and Y. Wang. Transformer in transformer. arXiv preprint arXiv:2103.00112, 2021.
|
| 197 |
+
[24] K. He, G. Gkioxari, P. Dollár, and R. Girshick. Mask r-cnn. In Proceedings of the IEEE international conference on computer vision, pages 2961–2969, 2017.
|
| 198 |
+
[25] K. He, X. Zhang, S. Ren, and J. Sun. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE transactions on pattern analysis and machine intelligence, 37(9):1904–1916, 2015.
|
| 199 |
+
[26] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 200 |
+
[27] L. He, Y. Dong, Y. Wang, D. Tao, and Z. Lin. Gauge equivariant transformer. In Thirty-Fifth Conference on Neural Information Processing Systems, 2021.
|
| 201 |
+
[28] B. Heo, S. Yun, D. Han, S. Chun, J. Choe, and S. J. Oh. Rethinking spatial dimensions of vision transformers. In International Conference on Computer Vision (ICCV), 2021.
|
| 202 |
+
[29] B. Heo, S. Yun, D. Han, S. Chun, J. Choe, and S. J. Oh. Rethinking spatial dimensions of vision transformers. arXiv preprint arXiv:2103.16302, 2021.
|
| 203 |
+
[30] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015.
|
| 204 |
+
[31] A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 205 |
+
[32] G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700–4708, vision transformer. arXiv preprint arXiv:2106.03650, 2021.
|
| 206 |
+
[34] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pages 448–456. PMLR, 2015.
|
| 207 |
+
[35] Y. Ke and R. Sukthankar. Pca-sift: A more distinctive representation for local image descriptors. In Proceedings of the IEEE conference on computer vision and pattern recognition, volume 2, pages II–II. IEEE, 2004.
|
| 208 |
+
[36] J. Krause, M. Stark, J. Deng, and L. Fei-Fei. 3d object representations for fine-grained categorization. In 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13), Sydney, Australia, 2013.
|
| 209 |
+
[37] A. Krizhevsky, G. Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 210 |
+
[38] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
|
| 211 |
+
[39] W.-S. Lai, J.-B. Huang, N. Ahuja, and M.-H. Yang. Deep laplacian pyramid networks for fast and accurate super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 624–632, 2017.
|
| 212 |
+
[40] Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut. Albert: A lite bert for self-supervised learning of language representations. arXiv preprint arXiv:1909.11942, 2019.
|
| 213 |
+
[41] Y. LeCun, Y. Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
|
| 214 |
+
[42] Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. nature, 521(7553):436–444, 2015.
|
| 215 |
+
[43] Y. Li, K. Zhang, J. Cao, R. Timofte, and L. Van Gool. Localvit: Bringing locality to vision transformers. arXiv preprint arXiv:2104.05707, 2021.
|
| 216 |
+
[44] G. Lin, C. Shen, A. Van Den Hengel, and I. Reid. Efficient piecewise training of deep structured models for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3194–3203, 2016.
|
| 217 |
+
[45] T.-Y. Lin, P. Dollár, R. Girshick, K. He, B. Hariharan, and S. Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2117–2125, 2017.
|
| 218 |
+
[46] Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
|
| 219 |
+
[47] Z. Liu, Y. Lin, Y. Cao, H. Hu, Y. Wei, Z. Zhang, S. Lin, and B. Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
|
| 220 |
+
[48] I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2018.
|
| 221 |
+
[49] W. Luo, Y. Li, R. Urtasun, and R. S. Zemel. Understanding the effective receptive field in deep convolutional neural networks. In Proceedings of the 30th International Conference on Neural Information Processing Systems, volume 29, pages 4898–4906, 2016.
|
| 222 |
+
[50] L. Melas-Kyriazi. Do you even need attention? a stack of feed-forward layers does surprisingly well on imagenet. arXiv: Computer Vision and Pattern Recognition, 2021.
|
| 223 |
+
[51] H. Nam, J.-W. Ha, and J. Kim. Dual attention networks for multimodal reasoning and matching. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 299–307, 2017.
|
| 224 |
+
[52] P. C. Ng and S. Henikoff. Sift: Predicting amino acid changes that affect protein function. Nucleic acids research, 31(13):3812–3814, 2003.
|
| 225 |
+
[53] M.-E. Nilsback and A. Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics and Image Processing, Dec 2008.
|
| 226 |
+
[54] S. W. Oh, J.-Y. Lee, N. Xu, and S. J. Kim. Video object segmentation using space-time memory networks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9226–9235, 2019.
|
| 227 |
+
[55] H. Olkkonen and P. Pesola. Gaussian pyramid wavelet transform for multiresolution analysis of images. Graphical Models and Image Processing, 58(4):394–398, 1996.
|
| 228 |
+
[56] O. M. Parkhi, A. Vedaldi, A. Zisserman, and C. V. Jawahar. Cats and dogs. In IEEE Conference on Computer Vision and Pattern Recognition, 2012.
|
| 229 |
+
[57] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, volume 32, pages 8026–8037, 2019.
|
| 230 |
+
[58] Z. Peng, W. Huang, S. Gu, L. Xie, Y. Wang, J. Jiao, and Q. Ye. Conformer: Local features coupling global representations for visual recognition. arXiv preprint arXiv:2105.03889, 2021.
|
| 231 |
+
[59] F. Perazzi, J. Pont-Tuset, B. McWilliams, L. Van Gool, M. Gross, and A. Sorkine-Hornung. A benchmark dataset and evaluation methodology for video object segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 724–732, 2016.
|
| 232 |
+
[60] J. Pont-Tuset, F. Perazzi, S. Caelles, P. Arbeláez, A. Sorkine-Hornung, and L. Van Gool. The 2017 davis challenge on video object segmentation. arXiv preprint arXiv:1704.00675, 2017.
|
| 233 |
+
[61] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 234 |
+
[62] I. Radosavovic, R. P. Kosaraju, R. Girshick, K. He, and P. Dollár. Designing network design spaces. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 10428–10436, 2020.
|
| 235 |
+
[63] E. Rublee, V. Rabaud, K. Konolige, and G. Bradski. Orb: An efficient alternative to sift or surf. In Proceedings of the IEEE international conference on computer vision, pages 2564–2571. Ieee, 2011.
|
| 236 |
+
[64] S. Sabour, N. Frosst, and G. E. Hinton. Dynamic routing between capsules. arXiv preprint arXiv:1710.09829, 2017.
|
| 237 |
+
[65] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510–4520, 2018.
|
| 238 |
+
[66] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision, pages 618–626, 2017.
|
| 239 |
+
[67] P. Shaw, J. Uszkoreit, and A. Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018.
|
| 240 |
+
[68] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 241 |
+
[69] A. Srinivas, T.-Y. Lin, N. Parmar, J. Shlens, P. Abbeel, and A. Vaswani. Bottleneck transformers for visual recognition. arXiv preprint arXiv:2101.11605, 2021.
|
| 242 |
+
[70] C. Szegedy, S. Ioffe, V. Vanhoucke, and A. Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017.
|
| 243 |
+
[71] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1–9, 2015.
|
| 244 |
+
[72] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818–2826, 2016.
|
| 245 |
+
[73] M. Tan and Q. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105–6114. PMLR, 2019.
|
| 246 |
+
[74] I. Tolstikhin, N. Houlsby, A. Kolesnikov, L. Beyer, X. Zhai, T. Unterthiner, J. Yung, D. Keysers, J. Uszkoreit, M. Lucic, and A. Dosovitskiy. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint arXiv:2105.01601, 2021.
|
| 247 |
+
[75] H. Touvron, P. Bojanowski, M. Caron, M. Cord, A. El-Nouby, E. Grave, A. Joulin, G. Synnaeve, J. Verbeek, and H. Jégou. Resmlp: Feedforward networks for image classification with data-efficient training. arXiv preprint arXiv:2105.03404, 2021.
|
| 248 |
+
[76] H. Touvron, M. Cord, M. Douze, F. Massa, A. Sablayrolles, and H. Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
|
| 249 |
+
[77] H. Touvron, M. Cord, A. Sablayrolles, G. Synnaeve, and H. Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021.
|
| 250 |
+
[78] H. Touvron, A. Sablayrolles, M. Douze, M. Cord, and H. Jégou. Grafit: Learning fine-grained image representations with coarse labels. arXiv preprint arXiv:2011.12982, 2020.
|
| 251 |
+
[79] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, volume 30, pages 5998–6008, 2017.
|
| 252 |
+
[80] W. Wang, E. Xie, X. Li, D.-P. Fan, K. Song, D. Liang, T. Lu, P. Luo, and L. Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122, 2021.
|
| 253 |
+
[81] X. Wang, R. Girshick, A. Gupta, and K. He. Non-local neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
|
| 254 |
+
[82] R. Wightman. Pytorch image models. https://github.com/rwightman/pytorch-image-models, 2019.
|
| 255 |
+
[83] H. Wu, B. Xiao, N. Codella, M. Liu, X. Dai, L. Yuan, and L. Zhang. Cvt: Introducing convolutions to vision transformers. arXiv preprint arXiv:2103.15808, 2021.
|
| 256 |
+
[84] B. Xiao, H. Wu, and Y. Wei. Simple baselines for human pose estimation and tracking. In Proceedings of the European Conference on Computer Vision (ECCV), September 2018.
|
| 257 |
+
[85] T. Xiao, Y. Liu, B. Zhou, Y. Jiang, and J. Sun. Unified perceptual parsing for scene understanding. In Proceedings of the European Conference on Computer Vision (ECCV), pages 418–434, 2018.
|
| 258 |
+
[86] J. Xie, R. Zeng, Q. Wang, Z. Zhou, and P. Li. So-vit: Mind visual tokens for vision transformer. arXiv preprint arXiv:2104.10935, 2021.
|
| 259 |
+
[87] S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492–1500, 2017.
|
| 260 |
+
[88] W. Xu, Y. Xu, T. Chang, and Z. Tu. Co-scale conv-attentional image transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 9981–9990, October 2021.
|
| 261 |
+
[89] H. Yan, Z. Li, W. Li, C. Wang, M. Wu, and C. Zhang. Contnet: Why not use convolution and transformer at the same time? arXiv preprint arXiv:2104.13497, 2021.
|
| 262 |
+
[90] F. Yu and V. Koltun. Multi-scale context aggregation by dilated convolutions. In ICLR 2016 : International Conference on Learning Representations 2016, 2016.
|
| 263 |
+
[91] F. Yu, V. Koltun, and T. Funkhouser. Dilated residual networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 472–480, 2017.
|
| 264 |
+
[92] K. Yuan, S. Guo, Z. Liu, A. Zhou, F. Yu, and W. Wu. Incorporating convolution designs into visual transformers. arXiv preprint arXiv:2103.11816, 2021.
|
| 265 |
+
[93] L. Yuan, Y. Chen, T. Wang, W. Yu, Y. Shi, Z. Jiang, F. E. Tay, J. Feng, and S. Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
|
| 266 |
+
[94] M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818–833. Springer, 2014.
|
| 267 |
+
[95] X. Zhang, X. Zhou, M. Lin, and J. Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6848–6856, 2018.
|
| 268 |
+
[96] H. Zhao, J. Shi, X. Qi, X. Wang, and J. Jia. Pyramid scene parsing network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2881–2890, 2017.
|
| 269 |
+
[97] S. Zheng, J. Lu, H. Zhao, X. Zhu, Z. Luo, Y. Wang, Y. Fu, J. Feng, T. Xiang, P. H. S. Torr, and L. Zhang. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. arXiv preprint arXiv:2012.15840, 2020.
|
| 270 |
+
[98] B. Zhou, H. Zhao, X. Puig, S. Fidler, A. Barriuso, and A. Torralba. Scene parsing through ade20k dataset. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 633–641, 2017.
|
| 271 |
+
[99] B. Zhou, H. Zhao, X. Puig, T. Xiao, S. Fidler, A. Barriuso, and A. Torralba. Semantic understanding of scenes through the ade20k dataset. International Journal of Computer Vision, 127(3):302–321, 2019.
|
| 272 |
+
[100] X. Zhu, W. Su, L. Lu, B. Li, X. Wang, and J. Dai. Deformable detr: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2021.
|
md/train/aExAsh1UHZo/aExAsh1UHZo.md
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Gradient Starvation: A Learning Proclivity in Neural Networks
|
| 2 |
+
|
| 3 |
+
Mohammad Pezeshki1,2 Sékou-Oumar Kaba1,3 Yoshua Bengio1,2 Aaron Courville1,2 Doina Precup1,3,4 Guillaume Lajoie1,2
|
| 4 |
+
1Mila 2Université de Montréal 3McGill University 4Google DeepMind
|
| 5 |
+
corresponding authors:{pezeshki, guillaume.lajoie}@mila.quebec
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We identify and formalize a fundamental gradient descent phenomenon leading to a learning proclivity in over-parameterized neural networks. Gradient Starvation arises when cross-entropy loss is minimized by capturing only a subset of features relevant for the task, despite the presence of other predictive features that fail to be discovered. This work provides a theoretical explanation for the emergence of such feature imbalances in neural networks. Using tools from Dynamical Systems theory, we identify simple properties of learning dynamics during gradient descent that lead to this imbalance, and prove that such a situation can be expected given certain statistical structure in training data. Based on our proposed formalism, we develop guarantees for a novel but simple regularization method aimed at decoupling feature learning dynamics, improving accuracy and robustness in cases hindered by gradient starvation. We illustrate our findings with simple and realworld out-of-distribution (OOD) generalization experiments.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
In 1904, a horse named Hans attracted worldwide attention due to the belief that it was capable of doing arithmetic calculations [81]. Its trainer would ask Hans a question, and Hans would reply by tapping on the ground with its hoof. However, it was later revealed that the horse was only noticing subtle but distinctive signals in its trainer’s unconscious behavior, unbeknown to him, and not actually performing arithmetic. An analogous phenomenon has been noticed when training neural networks [e.g. 85, 109, 54, 39, 17, 14, 37, 51, 107, 76, 48, 19, 61, 77]. In many cases, state-of-the-art neural networks appear to focus on low-level superficial correlations, rather than more abstract and robustly informative features of interest [16, 88, 40, 68, 30].
|
| 14 |
+
|
| 15 |
+
The rationale behind this phenomenon is well known by practitioners: given strongly-correlated and fast-to-learn features in training data, gradient descent is biased towards learning them first. However, the precise conditions leading to such learning dynamics, and how one might intervene to control this feature imbalance are not entirely understood. Recent work aims at identifying the reasons behind this phenomenon [97, 70, 22, 73, 51, 76, 100, 92, 83, 105, 42, 79, 4], while complementary work quantifies resulting shortcomings, including poor generalization to out-of-distribution (OOD) test data, reliance upon spurious correlations, and lack of robustness [30, 68, 77, 41, 63, 64, 9]. However most established work focuses on squared-error loss and its particularities, where results do not readily generalize to other objective forms. This is especially problematic since for several classification applications, cross-entropy is the loss function of choice, yielding very distinct learning dynamics. In this paper, we argue that Gradient Starvation, first coined in [26], is a leading cause for this feature imbalance in neural networks trained with cross-entropy, and propose a simple approach to mitigate it.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Diagram illustrating the effect of gradient starvation in a simple 2-D classification task. (a) Data is not linearly separable and the learned decision boundary is curved. (b) Data is linearly separable by a small margin $\Delta = \mathrm { 0 . 1 }$ ). This small margin allows the network to discriminate confidently only along the horizontal axis and ignore the vertical axis. (c) Data is linearly separable as in (b). However, with the proposed Spectral decoupling (SD), a curved decision boundary with a large margin is learned. (d) Diagram shows the evolution of two of the features (Eq. 4) of the dynamics in three cases shown as dotted, dashed and solid lines. Analysis: (dotted) vs (dashed): Linear separability of the data results in an increase in $z _ { 1 }$ and a decrease (starvation) of $z _ { 2 }$ . (dashed) vs (solid): SD suppresses $z _ { 1 }$ and hence allows $z _ { 2 }$ to grow. Decision boundaries are averaged over ten runs. More experiments with common regularization methods are provided in App. B.
|
| 19 |
+
|
| 20 |
+
Here we summarize our contributions:
|
| 21 |
+
|
| 22 |
+
We provide a theoretical framework to study the learning dynamics of linearized neural networks trained with cross-entropy loss in a dual space. Using perturbation analysis, we formalize Gradient Starvation (GS) in view of the coupling between the dynamics of orthogonal directions in the feature space (Thm. 2). We leverage our theory to introduce Spectral Decoupling (SD) (Eq. 17) and prove this simple regularizer helps to decouple learning dynamics, mitigating GS. We support our findings with extensive empirical results on a variety of classification and adversarial attack tasks. All code and experiment details available at GitHub repository.
|
| 23 |
+
|
| 24 |
+
In the rest of the paper, we first present a simple example to outline the consequences of GS. We then present our theoretical results before outlining a number of numerical experiments. We close with a review of related work followed by a discussion.
|
| 25 |
+
|
| 26 |
+
# 2 Gradient Starvation: A simple example
|
| 27 |
+
|
| 28 |
+
Consider a 2-D classification task with a training set consisting of two classes, as shown in Figure 1. A two-layer ReLU network with 500 hidden units is trained with cross-entropy loss for two different arrangements of the training points. The difference between the two arrangements is that, in one setting, the data is not linearly separable, but a slight shift makes it linearly separable in the other setting. This small shift allows the network to achieve a negligible loss by only learning to discriminate along the horizontal axis, ignoring the other. This contrasts with the other case, where both features contribute to the learned classification boundary, which arguably matches the data structure better. We observe that training longer or using different regularizers, including weight decay [58], dropout [95], batch normalization [49], as well as changing the optimization algorithm to Adam [56] or changing the network architecture or the coordinate system, do not encourage the network to learn a curved decision boundary. (See App. B for more details.)
|
| 29 |
+
|
| 30 |
+
We argue that this occurs because cross-entropy loss leads to gradients “starved” of information from vertical features. Simply put, when one feature is learned faster than the others, the gradient contribution of examples containing that feature is diminished (i.e., they are correctly processed based on that feature alone). This results in a lack of sufficient gradient signal, and hence prevents any remaining features from being learned. This simple mechanism has potential consequences, which we outline below.
|
| 31 |
+
|
| 32 |
+
# 2.1 Consequences of Gradient Starvation
|
| 33 |
+
|
| 34 |
+
Lack of robustness. In the example above, even in the right plot, the training loss is nearly zero, and the network is very confident in its predictions. However, the decision boundary is located very close to the data points. This could lead to adversarial vulnerability as well as lack of robustness when generalizing to out-of-distribution data.
|
| 35 |
+
|
| 36 |
+
Excessive invariance. GS could also result in neural networks that are invariant to task-relevant changes in the input. In the example above, it is possible to obtain a data point with low probability under the data distribution, but that would still be classified with high confidence.
|
| 37 |
+
|
| 38 |
+
Implicit regularization. One might argue that according to Occam’s razor, a simpler decision boundary should generalize better. In fact, if both training and test sets share the same dominant feature (in this example, the feature along the horizontal axis), GS naturally prevents the learning of less dominant features that could otherwise result in overfitting. Therefore, depending on our assumptions on the training and test distributions, GS could also act as an implicit regularizer. We provide further discussion on the implicit regularization aspect of GS in Section 5.
|
| 39 |
+
|
| 40 |
+
# 3 Theoretical Results
|
| 41 |
+
|
| 42 |
+
In this section, we study the learning dynamics of neural networks trained with cross-entropy loss. Particularly, we seek to decompose the learning dynamics along orthogonal directions in the feature space of neural networks, to provide a formal definition of GS, and to derive a simple regularization method to mitigate it. For analytical tractability, we make three key assumptions: (1) we study deep networks in the Neural Tangent Kernel (NTK) regime, (2) we treat a binary classification task, (3) we decompose the interaction between two features. In Section 4, we demonstrate our results hold beyond these simplifying assumptions, for a wide range of practical settings. All derivation details can be found in $\mathbf { S M C }$ .
|
| 43 |
+
|
| 44 |
+
# 3.1 Problem Setup and Gradient Starvation Definition
|
| 45 |
+
|
| 46 |
+
Let ${ \mathcal { D } } = \{ { \bf X } , { \bf y } \}$ denote a training set containing $n$ datapoints with $d$ dimensions, where, $\mathbf { X } =$ $[ \mathbf { x } _ { 1 } , . . . , \mathbf { x } _ { n } ] \in \mathbb { R } ^ { n \times d }$ and their corresponding class label $\mathbf { y } \in \{ - 1 , + 1 \} ^ { n }$ . Also let $\hat { \mathbf { y } } ( \mathbf { X } ) : = f ^ { ( L ) } ( \mathbf { X } ) :$ $\mathbb { R } ^ { n \times d } \to \mathbb { R } ^ { n }$ represent the logits of an $\mathrm { L }$ -layer fully-connected neural network where each hidden layer $h ^ { ( l ) } ( x ) \in \mathbf { \bar { \mathbb { R } } } ^ { d _ { l } }$ is defined as follows,
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { \boldsymbol { f } ^ { ( l ) } ( \mathbf { x } _ { i } ) = \mathbf { W } ^ { ( l ) } h ^ { ( l - 1 ) } ( \mathbf { x } _ { i } ) } \\ { h ^ { ( l ) } ( \mathbf { x } _ { i } ) = \sqrt { \frac { \gamma } { d _ { l } } } \boldsymbol { \xi } ( \boldsymbol { f } ^ { ( l ) } ( \mathbf { x } _ { i } ) ) } \end{array} \right. , l \in \{ 0 , 1 , . . . , L \} , } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
in which $\mathbf { W } ^ { ( l ) } \in \mathbb { R } ^ { d _ { l } \times d _ { l - 1 } }$ is a weight matrix drawn from $\mathcal { N } ( 0 , \bf { I } )$ and $\gamma$ is a scaling factor to ensure that norm of each $\boldsymbol { h } ^ { ( l - 1 ) }$ is preserved at initialization (See [28] for a formal treatment). The function $\xi ( . )$ is also an element-wise non-linear activation function.
|
| 53 |
+
|
| 54 |
+
Let $\pmb \theta = \mathrm { c o n c a t } \big ( \cup _ { l = 1 } ^ { L } \mathrm { v e c } ( \mathbf W ^ { ( l ) } ) \big ) \in \mathbb { R } ^ { m }$ be the concatenation of all vectorized weight matrices with $m$ as the total number of parameters. In the NTK regime [52], in the limit of infinite width, the output of the neural network can be approximated as a linear function of its parameters governed by the neural tangent random feature (NTRF) matrix [23],
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\Phi \left( \mathbf { X } , \theta \right) = \frac { \partial \hat { \mathbf { y } } \left( \mathbf { X } , \theta \right) } { \partial \theta } \in \mathbb { R } ^ { n \times m } .
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
In the wide-width regime, the NTRF changes very little during training [62], and the output of the neural network can be approximated by a first order Taylor expansion around the initialization parameters $\pmb { \theta } _ { 0 }$ . Setting $\Phi _ { 0 } \equiv \Phi \left( \mathbf { X } , \pmb { \theta } _ { 0 } \right)$ and then, without loss of generality, centering parameters and the output coordinates to their value at the initialization ${ \bf \delta _ { \theta } }$ and $\hat { \mathbf { y } } _ { 0 , }$ ), we get
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\hat { \mathbf { y } } \left( \mathbf { X } , \pmb { \theta } \right) = \Phi _ { 0 } \pmb { \theta } .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Dominant directions in the feature space as well as the parameter space are given by principal components of the NTRF matrix $\Phi _ { 0 }$ , which are the same as those of the NTK Gram matrix [106]. We therefore introduce the following definition.
|
| 67 |
+
|
| 68 |
+
Definition 1 (Features and Responses). Consider the singular value decomposition (SVD) of the matrix $\mathbf { Y } \Phi _ { 0 } = \mathbf { U } \mathbf { S } \mathbf { V } ^ { T }$ , where $\mathbf { Y } = d i a g \left( \mathbf { y } \right)$ . The jth feature is given by $( \mathbf { \dot { V } } ^ { T } ) _ { j . }$ .. The strength of jth feature is represented by $s _ { j } = ( \mathbf { S } ) _ { j j }$ . Also, $( \mathbf { U } ) _ { \cdot j }$ contains the weights of this feature in all examples. A neural network’s response to a feature $j$ is given by $z _ { j }$ where,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathbf { z } : = \mathbf { U } ^ { T } \mathbf { Y } \hat { \mathbf { y } } = \mathbf { S } \mathbf { V } ^ { T } \pmb { \theta } .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
In Eq. 4, the response to feature $j$ is the sum of the responses to every example in $( \mathbf { Y } \hat { \mathbf { y } } )$ multiplied by the weight of the feature in that example $( \mathbf { U } ^ { T } )$ . For example, if all elements of $( \mathbf { U } ) _ { \cdot j }$ are positive, it indicates a perfect correlation between this feature and class labels. We are now equipped to formally define GS.
|
| 75 |
+
|
| 76 |
+
Definition 2 (Gradient Starvation). Recall the the model prescribed by Eq. 3. Let $z _ { j } ^ { \ast }$ denote the model’s response to feature $j$ at training optimum $\pmb { \theta } ^ { * 1 }$ . Feature $i$ starves the gradient for feature $j$ $i f d z _ { j } ^ { * } / d ( s _ { i } ^ { 2 } ) < 0$ .
|
| 77 |
+
|
| 78 |
+
This definition of GS implies that an increase in the strength of feature $i$ has a detrimental effect on the learning of feature $j$ . We now derive conditions for which learning dynamics of system 3 suffer from GS.
|
| 79 |
+
|
| 80 |
+
# 3.2 Training Dynamics
|
| 81 |
+
|
| 82 |
+
We consider the widely used ridge-regularized cross-entropy loss function,
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathcal { L } \left( \pmb { \theta } \right) = \mathbf { 1 } \cdot \log \left[ 1 + \exp \left( - \mathbf { Y } \hat { \mathbf { y } } \right) \right] + \frac { \lambda } { 2 } \| \pmb { \theta } \| ^ { 2 } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where 1 is a vector of size $n$ with all its elements equal to 1. This vector form simply represents a summation over all the elements of the vector it is multiplied to. $\lambda \in [ 0 , \infty )$ denotes the weight decay coefficient.
|
| 89 |
+
|
| 90 |
+
Direct minimization of this loss function using the gradient descent obeys coupled dynamics and is difficult to treat directly [26]. To overcome this problem, we call on a variational approach that leverages the Legendre transformation of the loss function. This allows tractable dynamics that can directly incorporate rates of learning in different feature directions. Following [50], we note the following inequality,
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r } { \log \left[ 1 + \exp \left( - \mathbf { Y } \hat { \mathbf { y } } \right) \right] \geq H ( \alpha ) - \alpha \odot \mathbf { Y } \hat { \mathbf { y } } , } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $H ( \pmb { \alpha } ) = - \left[ \pmb { \alpha } \log \pmb { \alpha } + ( 1 - \pmb { \alpha } ) \log \left( 1 - \pmb { \alpha } \right) \right]$ is Shannon’s binary entropy function, $\alpha \in$ $( 0 , 1 ) ^ { n }$ is a variational parameter defined for each training example, and $\odot$ denotes the element-wise vector product. Crucially, the equality holds when the maximum of r.h.s. w.r.t $_ \alpha$ is achieved at $\begin{array} { r } { \pmb { \alpha } ^ { * } = \frac { \bar { { \partial \mathcal { L } } } } { \partial ( \mathbf { Y } \hat { \mathbf { y } } ) ^ { T } } } \end{array}$ , which leads to the following optimization problem,
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\operatorname* { m i n } _ { \pmb { \theta } } \mathcal { L } \left( \pmb { \theta } \right) = \operatorname* { m i n } _ { \pmb { \theta } } \operatorname* { m a x } _ { \pmb { \alpha } } \left( \mathbf { 1 } \cdot H ( \pmb { \alpha } ) - \pmb { \alpha } \mathbf { Y } \hat { \mathbf { y } } + \frac { \lambda } { 2 } \| \pmb { \theta } \| ^ { 2 } \right) ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where the order of min and max can be swapped (see Lemma 3 of [50]). Since the neural network’s output is approximated by a linear function of $\pmb \theta$ , the minimization can be performed analytically with an critical value $\pmb { \theta } _ { . } ^ { \ast T } = \triangleq \frac { 1 } { \lambda } \pmb { \alpha } \mathbf { Y } \pmb { \Phi } _ { 0 }$ , given by a weighted sum of the training examples. This results in the following maximization problem on the dual variable, i.e., $\operatorname* { m i n } _ { \theta } { \mathcal { L } } \left( \theta \right)$ is equivalent to,
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\operatorname* { m i n } _ { \pmb { \theta } } \mathcal { L } \left( \pmb { \theta } \right) = \operatorname* { m a x } _ { \pmb { \alpha } } \left( \mathbf { 1 } \cdot H ( \pmb { \alpha } ) - \frac { 1 } { 2 \lambda } \pmb { \alpha } \mathbf { Y } \pmb { \Phi } _ { 0 } \pmb { \Phi } _ { 0 } ^ { T } \mathbf { Y } ^ { T } \pmb { \alpha } ^ { T } \right) .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
By applying continuous-time gradient ascent on this optimization problem, we derive an autonomous differential equation for the evolution of $_ { \pmb { \alpha } }$ , which can be written in terms of features (see Definition 1),
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\dot { \pmb { \alpha } } = \eta \left( - \log \pmb { \alpha } + \log \left( \mathbf { 1 } - \pmb { \alpha } \right) - \frac { 1 } { \lambda } \pmb { \alpha } \mathbf { U } \mathbf { S } ^ { 2 } \mathbf { U } ^ { T } \right) ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where $\eta$ is the learning rate (see $\mathrm { S M } \mathrm { C } . 1$ for more details). For this dynamical system, we see that the logarithm term acts as barriers that keep $\alpha _ { i } \in ( 0 , 1 )$ . The other term depends on the matrix $\mathbf { U S ^ { 2 } U } ^ { T }$ , which is positive definite, and thus pushes the system towards the origin and therefore drives learning.
|
| 115 |
+
|
| 116 |
+
When $\lambda \ll s _ { k } ^ { 2 }$ , where $k$ is an index over the singular values, the linear term dominates Eq. 9, and the fixed point is drawn closer towards the origin. Approximating dynamics with a first order Taylor expansion around the origin of the second term in Eq. 9, we get
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\dot { \boldsymbol { \alpha } } \approx \eta \left( - \log \boldsymbol { \alpha } - \frac { 1 } { \lambda } \boldsymbol { \alpha } \mathbf { U } \left( \mathbf { S } ^ { 2 } + \lambda \mathbf { I } \right) \mathbf { U } ^ { T } \right) ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
with stability given by the following theorem with proof in $\mathbf { S M C }$ .
|
| 123 |
+
|
| 124 |
+
Theorem 1. Any fixed points of the system in Eq. 10 is attractive in the domain $\alpha _ { i } \in ( 0 , 1 )$ .
|
| 125 |
+
|
| 126 |
+
At the fixed point $\ b { \alpha } ^ { * }$ , corresponding to the optimum of Eq. 8, the feature response of the neural network is given by,
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mathbf { z } ^ { \ast } = \frac { 1 } { \lambda } \mathbf { S } ^ { 2 } \mathbf { U } ^ { T } \pmb { \alpha } ^ { \ast T } .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
See App. A for further discussions on the distinction between "feature space" and "parameter space". Below, we study how the strength of one feature could impact the response of the network to another feature which leads to GS.
|
| 133 |
+
|
| 134 |
+
# 3.3 Gradient Starvation Regime
|
| 135 |
+
|
| 136 |
+
In general, we do not expect to find an analytical solution for the dynamics of the coupled non-linear dynamical system of Eq. 10. However, there are at least two cases where a decoupled form for the dynamics allows to find an exact solution. We first introduce these cases and then study their perturbation to outline general lessons.
|
| 137 |
+
|
| 138 |
+
1. If the matrix of singular values $\mathbf { S } ^ { 2 }$ is proportional to the identity: This is the case where all the features have the same strength $s ^ { 2 }$ . The fixed points are then given by,
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\alpha _ { i } ^ { * } = \frac { \lambda \mathcal { W } ( \lambda ^ { - 1 } s ^ { 2 } + 1 ) } { s ^ { 2 } + \lambda } , \qquad z _ { j } ^ { * } = \frac { s ^ { 2 } \mathcal { W } ( \lambda ^ { - 1 } s ^ { 2 } + 1 ) } { s ^ { 2 } + \lambda } \sum _ { i } u _ { i j } ,
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where $\mathcal { W }$ is the Lambert W function.
|
| 145 |
+
|
| 146 |
+
2. If the matrix $\mathbf { U }$ is a permutation matrix: This is the case in which each feature is associated with a single example only. The fixed points are then given by,
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\alpha _ { i } ^ { * } = \frac { \lambda \mathcal { W } ( \lambda ^ { - 1 } s _ { i } ^ { 2 } + 1 ) } { s _ { i } ^ { 2 } + \lambda } , \ ~ \ z _ { j } ^ { * } = \frac { s _ { i } ^ { 2 } \mathcal { W } ( \lambda ^ { - 1 } s _ { i } ^ { 2 } + 1 ) } { s _ { i } ^ { 2 } + \lambda } .
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
To study a minimal case of starvation, we consider a variation of case 2 with the following assumption which implies that each feature is not associated with a single example anymore.
|
| 153 |
+
|
| 154 |
+
Lemma 1. Assume $\mathbf { U }$ is a perturbed identity matrix (a special case of a permutation matrix) in which the off-diagonal elements are proportional to a small parameter $\delta > 0$ . Then, the fixed point of the dynamical system in Eq. 10 can be approximated by,
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\begin{array} { r } { { \pmb \alpha } ^ { * } = ( 1 - \log \left( { \pmb \alpha } _ { 0 } ^ { * } \right) ) \left[ { \pmb A } + d i a g \left( { \pmb \alpha } _ { 0 } ^ { * } ^ { - 1 } \right) \right] ^ { - 1 } , } \end{array}
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
where $\mathbf { A } = \lambda ^ { - 1 } \mathbf { U } ( \mathbf { S } ^ { 2 } + \lambda \mathbf { I } ) \mathbf { U } ^ { T }$ and $\alpha _ { 0 } ^ { * }$ is the fixed point of the uncoupled system with $\delta = 0$
|
| 161 |
+
|
| 162 |
+
For sake of ease of derivations, we consider the two dimensional case where,
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\mathbf { U } = \left( \begin{array} { c c } { \sqrt { 1 - \delta ^ { 2 } } } & { - \delta } \\ { \delta } & { \sqrt { 1 - \delta ^ { 2 } } } \end{array} \right) ,
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
which is equivalent to a $U$ matrix with two blocks of features with no intra-block coupling and $\delta$ amount of inter-block coupling.
|
| 169 |
+
|
| 170 |
+
Theorem 2 (Gradient Starvation Regime). Consider a neural network in the linear regime, trained under cross-entropy loss for a binary classification task. With definition $^ { l }$ , assuming coupling between features 1 and 2 as in Eq. 15 and $s _ { 1 } ^ { 2 } > s _ { 2 } ^ { 2 }$ , we have,
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\frac { \mathrm { d } z _ { 2 } ^ { * } } { \mathrm { d } s _ { 1 } ^ { 2 } } < 0 ,
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
which implies GS.
|
| 177 |
+
|
| 178 |
+
While Thm. 2 outlines conditions for GS in two dimensional feature space, we note that the same rationale naturally extends to higher dimensions, where GS is defined pairwise over feature directions. For a classification task, Thm. 2 indicates that gradient starvation occurs when the data admits different feature strengths, and coupled learning dynamics. GS is thus naturally expected with cross-entropy loss. Its detrimental effects however (as outlined in Sect. 2) arise in settings with large discrepancies between feature strengths, along with network connectivity that couples these features’ directions. This phenomenon readily extends to multi-class settings, and we validate this case with experiments in Sect. 4. Next, we introduce a simple regularizer that encourages feature decoupling, thus mitigating GS by insulating strong features from weaker ones.
|
| 179 |
+
|
| 180 |
+
# 3.4 Spectral Decoupling
|
| 181 |
+
|
| 182 |
+
By tracing back the equations of the previous section, one may realize that the term $U ^ { T } S ^ { 2 } U$ in Eq. 9 is not diagonal in the general case, and consequently introduces coupling between $\alpha _ { i }$ ’s and hence, between the features $z _ { i }$ ’s. We would like to discourage solutions that couple features in this way. To that end, we introduce a simple regularizer: Spectral Decoupling (SD). SD replaces the general L2 weight decay term in Eq. 5 with an L2 penalty exclusively on the network’s logits, yielding
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
\mathcal { L } \left( \pmb { \theta } \right) = \mathbf { 1 } \cdot \log \left[ 1 + \exp \left( - \mathbf { Y } \hat { \mathbf { y } } \right) \right] + \frac { \lambda } { 2 } \| \hat { \mathbf { y } } \| ^ { 2 } .
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
Repeating the same analysis steps taken above, but with SD instead of general L2 penalty, the critical value for $\pmb { \theta } ^ { * }$ becomes $\begin{array} { r } { \pmb { \theta } ^ { \ast } = \frac { 1 } { \lambda } \pmb { \alpha } \pmb { Y } \pmb { \Phi } _ { 0 } V \mathbf { S } ^ { - 2 } V ^ { T } } \end{array}$ . This new expression for $\pmb { \theta } ^ { * }$ results in the following modification of Eq. 9,
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\dot { \alpha } = \eta \left( \log \frac { \mathbf { 1 } - \alpha } { \alpha } - \frac { 1 } { \lambda } \alpha \mathbf { U } \mathbf { S } ^ { 2 } \mathbf { S } ^ { - 2 } \mathbf { U } ^ { T } \right) = \eta \left( \log \frac { \mathbf { 1 } - \alpha } { \alpha } - \frac { 1 } { \lambda } \alpha \right) ,
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
where as earlier, log and division are taken element-wise on the coordinates of $_ { \pmb { \alpha } }$
|
| 195 |
+
|
| 196 |
+
Note that in contrast to Eq. 9 the matrix multiplication involving $U$ and $S$ in Eq. 18 cancels out, leaving $\alpha _ { i }$ independent of other $\alpha _ { j \neq i }$ ’s. We point out this is true for any initial coupling, without simplifying assumptions. Thus, a simple penalty on output weights promotes decoupled dynamics across the dual parameter $\alpha _ { i }$ ’s, which track learning dynamics of feature responses (see Eq. 7). Together with Thm. 2, Eq. 18 suggests SD should mitigate GS and promote balanced learning dynamics across features. We now verify this in numerical experiments. For further intuition, we provide a simple experiment, summarized in Fig. 5, where directly visualizes the primal vs. the dual dynamics as well as the effect of the proposed spectral decoupling method.
|
| 197 |
+
|
| 198 |
+
# 4 Experiments
|
| 199 |
+
|
| 200 |
+
The experiments presented here are designed to outline the presence of GS and its consequences, as well as the efficacy of our proposed regularization method to alleviate them. Consequently, we highlight that achieving state-of-the-art results is not the objective. For more details including the scheme for hyper-parameter tuning, see App. B.
|
| 201 |
+
|
| 202 |
+
# 4.1 Two-Moon classification and the margin
|
| 203 |
+
|
| 204 |
+
Recall the simple 2-D classification task between red and blue data points in Fig. 1. Fig. 1 (c) demonstrates the learned decision boundary when SD is used. SD leads to learning a curved decision boundary with a larger margin in the input space. See App. B for additional details and experiments.
|
| 205 |
+
|
| 206 |
+
# 4.2 CIFAR classification and adversarial robustness
|
| 207 |
+
|
| 208 |
+
To study the classification margin in deeper networks, we conduct a classification experiment on CIFAR-10, CIFAR-100, and CIFAR-2 (cats vs dogs of CIFAR-10) [57] using a convolutional network with ReLU non-linearity. Unlike linear models, the margin to a non-linear decision boundary cannot be computed analytically. Therefore, following the approach in [72], we use "the norm of inputdisturbance required to cross the decision boundary" as a proxy for the margin. The disturbance on the input is computed by projected gradient descent (PGD) [84], a well-known adversarial attack.
|
| 209 |
+
|
| 210 |
+
Table 1: Table compares adversarial robustness of ERM (vanilla cross-entropy) vs SD with a CNN trained on CIFAR-2, 10, and 100 (setup of [72]). SD consistently achieves a better OOD performance.
|
| 211 |
+
|
| 212 |
+
<table><tr><td>Dataset</td><td>Method</td><td>Train*</td><td>Test IID</td><td>Test OOD†</td></tr><tr><td rowspan="2">Cifar-2</td><td>w/o SD</td><td></td><td>100.0% ±0.0 95.2%±0.12</td><td>42.3% ±3.0</td></tr><tr><td></td><td></td><td>w/ SD(a=0.01)100.0%±0.0 95.3%±0.17</td><td>69.7% ± 2.9</td></tr><tr><td rowspan="2">Cifar-10</td><td>w/o SD</td><td>99.9% ± 0.01</td><td>92.8%±0.15</td><td>30.1% ± 2.1</td></tr><tr><td></td><td></td><td>w/ SD(=0.01)99.9%±0.01 92.9% ±0.16</td><td>67.7% ± 1.5</td></tr><tr><td rowspan="2">Cifar-100</td><td>w/o SD</td><td></td><td>99.7% ± 0.01 69.2% ±0.29</td><td>14.3% ± 2.0</td></tr><tr><td></td><td></td><td>w/SD(a=0.05)99.7%±0.0270.5%±0.26</td><td>24.9% ± 1.9</td></tr></table>
|
| 213 |
+
|
| 214 |
+
† Accuracy (± std) for 10 runs.
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 2: The plot shows the cumulative distribution function (CDF) of the margin for the CIFAR-2 binary classification. SD appears to improve the margin considerably.
|
| 218 |
+
|
| 219 |
+
Table 1 includes the results for IID (original test set) and OOD (perturbed test set by $\epsilon _ { \mathrm { P G D } } = 0 . 0 5 )$ . Fig. 2 shows the percentange of mis-classifications as the norm of disturbance is increased for the Cifar-2 dataset. This plot can be interpreted as the cumulative distribution function (CDF) of the margin and hence a lower curve reads as a more robust network with a larger margin. This experiment suggests that when trained with vanilla cross-entropy, even slight disturbances in the input deteriorates the network’s classification accuracy. That is while spectral decoupling (SD) improves the margin considerably. Importantly, this improvement in robustness does not seem to compromise the noise-free test performance. It should also be highlighted that SD does not explicitly aim at maximizing the margin and the observed improvement is in fact a by-product of decoupled learning of latent features. See Section 5 for a discussion on why cross-entropy results in a poor margin while being considered a max-margin classifier in the literature [94].
|
| 220 |
+
|
| 221 |
+
# 4.3 Colored MNIST with color bias
|
| 222 |
+
|
| 223 |
+
We conduct experiments on the Colored MNIST Dataset, proposed in [9]. The task is to predict binary labels $y = - 1$ for digits 0 to 4 and $y = + 1$ for digits 5 to 9. A color channel (red, green) is artificially added to each example to deliberately impose a spurious correlation between the color and the label. The task has three environments:
|
| 224 |
+
|
| 225 |
+
• Training env. 1: Color is correlated with the labels with 0.9 probability. • Training env. 2: Color is correlated with the labels with 0.8 probability. • Testing env.: Color is correlated with the labels with 0.1 probability (0.9 reversely corre
|
| 226 |
+
|
| 227 |
+
Because of the opposite correlation between the color and the label in the test set, only learning to classify based on color would be disastrous at testing. For this reason, Empirical Risk Minimization (ERM) performs very poorly on the test set $( 2 3 . 7 \%$ accuracy) as shown in Tab. 2.
|
| 228 |
+
|
| 229 |
+
<table><tr><td>Method</td><td>Train Accuracy</td><td>Test Accuracy</td></tr><tr><td>ERM(Vanilla Cross-Entropy)</td><td>91.1 % (±0.4)</td><td>23.7 % (±0.8)</td></tr><tr><td>REx[59]</td><td>71.5 % (±1.0)</td><td>68.7% (±0.9)</td></tr><tr><td>IRM[9]</td><td>70.5% (±0.6)</td><td>67.1 % (±1.4)</td></tr><tr><td>SD (this work)</td><td>70.0 % (±0.9)</td><td>68.4% (±1.2)</td></tr><tr><td>Oracle - (grayscale images)</td><td>73.5 % (±0.2)</td><td>73.0 % (±0.4)</td></tr><tr><td>RandomGuess</td><td>50%</td><td>50%</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Table 2: Test accuracy on test examples of the Colored MNIST after training for 1k epochs. The standard deviation over 10 runs is reported in parenthesis. ERM stands for the empirical risk minimization. Oracle is an ERM trained on grayscale images. Note that due to $25 \%$ label noise, a hypothetical optimum achieves $75 \%$ accuracy (the upper bound).
|
| 232 |
+
|
| 233 |
+
Invariant Risk Minimization (IRM) [9] on the other hand, performs well on the test set with $( 6 7 . 1 \%$ accuracy). However, IRM requires access to multiple (two in this case) separate training environments with varying amount of spurious correlations. IRM uses the variance between environments as a signal for learning to be “invariant” to spurious correlations. Risk Extrapolation (REx) [59] is a related training method that encourages learning invariant representations. Similar to IRM, it requires access to multiple training environments in order to quantify the concept of “invariance”.
|
| 234 |
+
|
| 235 |
+
SD achieves an accuracy of $6 8 . 4 \%$ . Its performance is remarkable because unlike IRM and REx, SD does not require access to multiple environments and yet performs well when trained on a single environment (in this case the aggregation of both of the training environments).
|
| 236 |
+
|
| 237 |
+
A natural question that arises is “How does SD learn to ignore the color feature without having access to multiple environments?” The short answer is that it does not! In fact, we argue that SD learns the color feature but it also learns other predictive features, i.e., the digit shape features. At test time, the predictions resulting from the shape features prevail over the color feature. To validate this hypothesis, we study a trained model with each of these methods (ERM, IRM, SD) on four variants of the test environment: 1) grayscale-digits: No color channel is provided and the network should rely on shape features only. 2) colored-digits: Both color and digit are provided however the color is negatively correlated (opposite of the training set) with the label. 3) grayscaleblank: All images are grayscale and blank and hence do not provide any information. 4) colored-blank: Digit features are removed and only the color feature is kept, also with reverse label compared to training. Fig. 3 summarizes the results. For more discussions see SM B.
|
| 238 |
+
|
| 239 |
+
As a final remark, we should highlight that, by design, this task assumes access to the test environment for hyperparameter tuning for all the reported methods. This is not a valid assumption in general, and hence the results should be only interpreted as a probe that shows that SD could provide an important level of control over what features are learned.
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Figure 3: Diagram comparing ERM, SD, and IRM on four different test environments on which we evaluate a pre-trained model. Top and bottom rows show the accuracy and the entropy (inverse of confidence), respectively. Analysis: Compare three values of $\mathfrak { C } \sharp \sharp \sharp \sharp \sharp \cdot$ , 9.4 % , and $4 9 . 6 \%$ : Both ERM and SD have learned the color feature but since it is inversely correlated with the label, when only the color feature is provided, as expected both ERM and SD performs poorly. Now compare $\textcircled { 1 } \textcircled { 1 }$ and $0 . 4 1$ : Although both ERM and SD have learned the color feature, ERM is much more confident on its predictions (zero entropy). As a consequence, when digit features are provided along with the color feature (colored-digit environment), ERM still performs poorly $( \overbrace { 2 3 . 9 \mathrm { ~ \% ~ } } )$ but SD achieves significantly better results $( 6 7 . 2 \% )$ ). IRM ignores the color feature altogether but it requires access to multiple training environments.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure 4: CelebA: blond vs dark hair classification. The HairColor and the Gender are spuriously correlated which leads to poor OOD performance with ERM, however SD significantly improves performance. ERM’s worst group accuracy is significantly lower than SD.
|
| 246 |
+
|
| 247 |
+
Table 3: CelebA: blond vs dark hair classification with spurious correlation. We report test performance over ten runs. SD significantly improves upon ERM. ∗Group DRO [89] requires explicit information about the spurious correlation. LfF [71] requires simultaneous training of two networks.
|
| 248 |
+
|
| 249 |
+
<table><tr><td>Method</td><td>Average Acc.</td><td>Worst Group Acc.</td></tr><tr><td>ERM</td><td>94.61 % (±0.67)</td><td>40.35 % (±1.68)</td></tr><tr><td>SD (this work)</td><td>91.64 % (±0.61)</td><td>83.24 % (±2.01)</td></tr><tr><td>LfF</td><td>N/A</td><td>81.24 % (±1.38)</td></tr><tr><td>Group DRO*</td><td>91.76 % (±0.28)</td><td>87.78 % (±0.96)</td></tr></table>
|
| 250 |
+
|
| 251 |
+
# 4.4 CelebA with gender bias
|
| 252 |
+
|
| 253 |
+
The CelebA dataset [65] contains $1 6 2 \mathrm { k }$ celebrity faces with binary attributes associated with each image. Following the setup of [89], the task is to classify images with respect to their hair color into two classes of blond or dark hair. However, the Gender $\in$ {Male, Female} is spuriously correlated with the $\mathtt { H a i r C o l o r } \in \{ \mathtt { B l o n d } , \mathtt { D a r k } \}$ in the training data. The rarest group which is blond males represents only $0 . 8 5 \%$ of the training data (1387 out of $1 6 2 \mathrm { k }$ examples). We train a ResNet-50 model [38] on this task. Tab. 3 summarizes the results and compares the performance of several methods. A model with vanilla cross-entropy (ERM) appears to generalize well on average but fails to generalize to the rarest group (blond males) which can be considered as “weakly" out-of-distribution (OOD). Our proposed SD improves the performance more than twofold. It should be highlighted that for this task, we use a variant of SD in which, $\frac { \lambda } { 2 } | | \hat { y } - \gamma | | _ { 2 } ^ { 2 }$ is added to the original cross-entropy loss. The hyper-parameters $\lambda$ and $\gamma$ are tuned separately for each class (a total of four hyper-parameters). This variant of SD does provably decouple the dynamics too but appears to perform better than the original SD in Eq. 17 in this task.
|
| 254 |
+
|
| 255 |
+
Other proposed methods presented in Tab. 3 also show significant improvements on the performance of the worst group accuracy. The recently proposed “Learning from failure” (LfF) [71] achieves comparable results to SD, but it requires simultaneous training of two networks. Group DRO [89] is another successful method for this task. However, unlike SD, Group DRO requires explicit information about the spuriously correlated attributes. In most practical tasks, information about the spurious correlations is not provided and, dependence on the spurious correlation goes unrecognized.2
|
| 256 |
+
|
| 257 |
+
# 5 Related Work and Discussion
|
| 258 |
+
|
| 259 |
+
Here, we discuss the related work. Due to space constraints, further discussions are in App. A.
|
| 260 |
+
|
| 261 |
+
On learning dynamics and Loss Choice. Several works including [90, 91, 1, 60] investigate the dynamics of deep linear networks trained with squared-error loss. Different decompositions of the learning process for neural networks have been used: [83, 104, 87, 105] study the learning in the Fourier domain and show that low-frequency functions are learned earlier than high-frequency ones. [90, 2, 32] provide closed-form equations for the dynamics of linear networks in terms of the principal components of the input covariance matrix. More recently, with the introduction of neural tangent kernel (NTK) [52, 62], a new line of research is to study the convergence properties of gradient descent [e.g. 8, 69, 25, 29, 7, 44, 33, 110, 11, 99]. Among them, [12, 106, 18, 22] decompose the learning process along the principal components of the NTK. The message in these works is that the training process can be decomposed into independent learning dynamics along the orthogonal directions.
|
| 262 |
+
|
| 263 |
+
Most of the studies mentioned above focus on the particular squared-error loss. For a linearized network, the squared-error loss results in linear learning dynamics, which often admit an analytical solution. However, the de-facto loss function for many of the practical applications of neural networks is the cross-entropy. Using the cross-entropy as the loss function leads to significantly more complicated and non-linear dynamics, even for a linear neural network. In this work, our focus was the cross-entropy loss.
|
| 264 |
+
|
| 265 |
+
On reliance upon spurious correlations and robustness. In the context of robustness in neural networks, state-of-the-art neural networks appear to naturally focus on low-level superficial correlations rather than more abstract and robustly informative features of interest (e.g. [30]). As we argue in this work, Gradient Starvation is likely an important factor contributing to this phenomenon and can result in adversarial vulnerability. There is a rich research literature on adversarial attacks and neural networks’ vulnerability [96, 34, 48, 67, 5, 47]. Interestingly, [73], [72] and [51] draw a similar conclusion and argue that “an insufficiency of the cross-entropy loss” causes excessive invariances to predictive features. Perhaps [92] is the closest to our work in which authors study the simplicity bias (SB) in stochastic gradient descent. They demonstrate that neural networks exhibit extreme bias that could lead to adversarial vulnerability.
|
| 266 |
+
|
| 267 |
+
On implicit bias. Despite being highly-overparameterized, modern neural networks seem to generalize very well [108]. Modern neural networks generalize surprisingly well in numerous machine tasks. This is despite the fact that neural networks typically contain orders of magnitude more parameters than the number of examples in a training set and have sufficient capacity to fit a totally randomized dataset perfectly [108]. The widespread explanation is that the gradient descent has a form of implicit bias towards learning simpler functions that generalize better according to Occam’s razor. Our exposition of GS reinforces this explanation. In essence, when training and test data points are drawn from the same distribution, the top salient features are predictive in both sets. We conjecture that in such a scenario, by not learning the less salient features, GS naturally protects the network from overfitting.
|
| 268 |
+
|
| 269 |
+
The same phenomenon is referred to as implicit bias, implicit regularization, simplicity bias and spectral bias in several works [83, 75, 36, 74, 70, 53, 94, 10, 13, 35, 82, 66].
|
| 270 |
+
|
| 271 |
+
As an active line of research, numerous studies have provided different explanations for this phenomenon. For example, [70] justifies the implicit bias of neural networks by showing that stochastic gradient descent learns simpler functions first. [15, 78] suggests that a form of implicit regularization is induced by an alignment between NTK’s principal components and only a few task-relevant directions. Several other works such as [20, 35, 94, 25] recognize the convergence of gradient descent to maximum-margin solution as the essential factor for the generalizability of neural networks. It should be stressed that these work refer to the margin in the hidden space and not in the input space as pointed out in [55]. Indeed, as observed in our experiments, the maximum-margin classifier in the hidden space can be achieved at the expense of a small margin in the input space.
|
| 272 |
+
|
| 273 |
+
On Gradient Starvation and no free lunch theorem. The no free lunch theorem [93, 102] states that “learning is impossible without making assumptions about training and test distributions”. Perhaps, the most commonly used assumption of machine learning is the i.i.d. assumption [98], which assumes that training and test data are identically distributed. However, in general, this assumption might not hold, and in many practical applications, there are predictive features in the training set that do not generalize to the test set. A natural question that arises is how to favor generalizable features over spurious features? The most common approaches include data augmentation, controlling the inductive biases, using regularizations, and more recently training using multiple environments.
|
| 274 |
+
|
| 275 |
+
Here, we would like to elaborate on an interesting thought experiment of [79]: Suppose a neural network is provided with a chess book containing examples of chess games with the best movements indicated by a red arrow. The network can take two approaches: 1) learn how to play chess, or 2) learn just the red arrows. Either of these solutions results in zero training loss on the games in the book while only the former is generalizable to new games. With no external knowledge, the network typically learns the simpler solution.
|
| 276 |
+
|
| 277 |
+
Recent work aims to leverage the invariance principle across several environments to improve robust learning. This is akin to present several chess books to a network, each with markings indicating the best moves for different sets of games. In several studies [9, 59, 79, 3], methods are developed to aggregate information from multiple training environments in a way that favors the generalizable / domain-agnostic / invariant solution. We argue that even with having access to only one training environment, there is useful information in the training set that fails to be discovered due to Gradient Starvation. The information on how to actually play chess is already available in any of the chess books. Still, as soon as the network learns the red arrows, the network has no incentive for further learning. Therefore, learning the red arrows is not an issue per se, but not learning to play chess is.
|
| 278 |
+
|
| 279 |
+
Gradient Starvation: friend or foe? Here, we would like to remind the reader that GS can have both adverse and beneficial consequences. If the learned features are sufficient to generalize to the test data, gradient starvation can be viewed as an implicit regularizer. Otherwise, Gradient Starvation could have an unfavorable effect, which we observe empirically when some predictive features fail to be learned. A better understanding and control of Gradient Starvation and its impact on generalization offers promising avenues to address this issue with minimal assumptions. Indeed, our Spectral Decoupling method requires an assumption about feature imbalance but not to pinpoint them exactly, relying on modulated learning dynamics to achieve balance.
|
| 280 |
+
|
| 281 |
+
GS social impact Modern neural networks are being deployed extensively in numerous machine learning tasks. Our models are used in critical applications such as autonomous driving, medical prediction, and even justice system where human lives are at stake. However, neural networks appear to base their predictions on superficial biases in the dataset. Unfortunately, biases in datasets could be neglected and pose negative impacts on our society. In fact, our Celeb-A experiment is an example of the existence of such a bias in the data. As shown in the paper, the gender-specific bias could lead to a superficial high performance and is indeed very hard to detect. Our analysis, although mostly on the theory side, could pave the path for researchers to build machine learning systems that are robust to biases and helps towards fairness in our predictions.
|
| 282 |
+
|
| 283 |
+
# 6 Conclusion
|
| 284 |
+
|
| 285 |
+
In this paper, we formalized Gradient Starvation (GS) as a phenomenon that emerges when training with cross-entropy loss in neural networks. By analyzing the dynamical system corresponding to the learning process in a dual space, we showed that GS could slow down the learning of certain features, even if they are present in the training set. We derived spectral decoupling (SD) regularization as a possible remedy to GS.
|
| 286 |
+
|
| 287 |
+
# Acknowledgments and Disclosure of Funding
|
| 288 |
+
|
| 289 |
+
The authors are grateful to Samsung Electronics Co., Ldt., CIFAR, and IVADO for their funding and Calcul Québec and Compute Canada for providing us with the computing resources. We would further like to acknowledge the significance of discussions and supports from Reyhane Askari Hemmat and Faruk Ahmed. MP would like to thank Aristide Baratin, Kostiantyn Lapchevskyi, Seyed Mohammad Mehdi Ahmadpanah, Milad Aghajohari, Kartik Ahuja, Shagun Sodhani, and Emmanuel Bengio for their invaluable help.
|
| 290 |
+
|
| 291 |
+
# References
|
| 292 |
+
|
| 293 |
+
[1] Madhu S Advani and Andrew M Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv preprint arXiv:1710.03667, 2017.
|
| 294 |
+
[2] Madhu S Advani, Andrew M Saxe, and Haim Sompolinsky. High-dimensional dynamics of generalization error in neural networks. Neural Networks, 2020.
|
| 295 |
+
[3] Kartik Ahuja, Karthikeyan Shanmugam, and Amit Dhurandhar. Linear regression games: Convergence guarantees to approximate out-of-distribution solutions. arXiv preprint arXiv:2010.15234, 2020. [4] Kartik Ahuja, Karthikeyan Shanmugam, Kush Varshney, and Amit Dhurandhar. Invariant risk minimization games. arXiv preprint arXiv:2002.04692, 2020.
|
| 296 |
+
[5] Naveed Akhtar and Ajmal Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. IEEE Access, 6:14410–14430, 2018.
|
| 297 |
+
[6] Adelin Albert and John A Anderson. On the existence of maximum likelihood estimates in logistic regression models. Biometrika, 71(1):1–10, 1984.
|
| 298 |
+
[7] 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, pages 6158–6169, 2019.
|
| 299 |
+
[8] Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via over-parameterization. In International Conference on Machine Learning, pages 242–252. PMLR, 2019.
|
| 300 |
+
[9] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019.
|
| 301 |
+
[10] Sanjeev Arora, Nadav Cohen, Wei Hu, and Yuping Luo. Implicit regularization in deep matrix factorization. In Advances in Neural Information Processing Systems, pages 7413–7424, 2019.
|
| 302 |
+
[11] 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, pages 8141–8150, 2019.
|
| 303 |
+
[12] Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. arXiv preprint arXiv:1901.08584, 2019.
|
| 304 |
+
[13] Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. arXiv preprint arXiv:1706.05394, 2017.
|
| 305 |
+
[14] Nicholas Baker, Hongjing Lu, Gennady Erlikhman, and Philip J Kellman. Deep convolutional networks do not classify based on global object shape. PLoS computational biology, 14(12):e1006613, 2018.
|
| 306 |
+
[15] Aristide Baratin, Thomas George, César Laurent, R Devon Hjelm, Guillaume Lajoie, Pascal Vincent, and Simon Lacoste-Julien. Implicit regularization in deep learning: A view from function space. arXiv preprint arXiv:2008.00938, 2020.
|
| 307 |
+
[16] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision (ECCV), pages 456–473, 2018.
|
| 308 |
+
[17] Yonatan Belinkov and Yonatan Bisk. Synthetic and natural noise both break neural machine translation. arXiv preprint arXiv:1711.02173, 2017.
|
| 309 |
+
[18] Alberto Bietti and Julien Mairal. On the inductive bias of neural tangent kernels. In Advances in Neural Information Processing Systems, pages 12893–12904, 2019.
|
| 310 |
+
[19] Wieland Brendel and Matthias Bethge. Approximating cnns with bag-of-local-features models works surprisingly well on imagenet. arXiv preprint arXiv:1904.00760, 2019.
|
| 311 |
+
[20] Alon Brutzkus, Amir Globerson, Eran Malach, and Shai Shalev-Shwartz. Sgd learns overparameterized networks that provably generalize on linearly separable data. arXiv preprint arXiv:1710.10174, 2017.
|
| 312 |
+
[21] Christopher JC Burges and David J Crisp. Uniqueness of the svm solution. Advances in neural information processing systems, 12:223–229, 2000.
|
| 313 |
+
[22] Yuan Cao, Zhiying Fang, Yue Wu, Ding-Xuan Zhou, and Quanquan Gu. Towards understanding the spectral bias of deep learning. arXiv preprint arXiv:1912.01198, 2019.
|
| 314 |
+
[23] Yuan Cao and Quanquan Gu. Generalization bounds of stochastic gradient descent for wide and deep neural networks. In Advances in Neural Information Processing Systems, pages 10836–10846, 2019.
|
| 315 |
+
[24] Zixiang Chen, Yuan Cao, Quanquan Gu, and Tong Zhang. A generalized neural tangent kernel analysis for two-layer neural networks. arXiv preprint arXiv:2002.04026, 2020.
|
| 316 |
+
[25] Lenaic Chizat and Francis Bach. A note on lazy training in supervised differentiable programming. arXiv preprint arXiv:1812.07956, 1, 2018.
|
| 317 |
+
[26] Remi Tachet des Combes, Mohammad Pezeshki, Samira Shabanian, Aaron Courville, and Yoshua Bengio. On the learning dynamics of deep neural networks. arXiv preprint arXiv:1809.06848, 2018.
|
| 318 |
+
[27] Thomas M Cover. Geometrical and statistical properties of systems of linear inequalities with applications in pattern recognition. IEEE transactions on electronic computers, 0(3):326–334, 1965.
|
| 319 |
+
[28] Simon S Du, Wei Hu, and Jason D Lee. Algorithmic regularization in learning deep homogeneous models: Layers are automatically balanced. In Advances in Neural Information Processing Systems, pages 384–395, 2018.
|
| 320 |
+
[29] Simon S Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. arXiv preprint arXiv:1810.02054, 2018.
|
| 321 |
+
[30] Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A Wichmann. Shortcut learning in deep neural networks. arXiv preprint arXiv:2004.07780, 2020.
|
| 322 |
+
[31] Thomas George. Nngeometry: Easy and fast fisher information matrices and neural tangent kernels in pytorch. 0, 2020.
|
| 323 |
+
[32] Gauthier Gidel, Francis Bach, and Simon Lacoste-Julien. Implicit regularization of discrete gradient dynamics in linear neural networks. In Advances in Neural Information Processing Systems, pages 3202–3211, 2019.
|
| 324 |
+
[33] Sebastian Goldt, Madhu Advani, Andrew M Saxe, Florent Krzakala, and Lenka Zdeborová. Dynamics of stochastic gradient descent for two-layer neural networks in the teacher-student setup. In Advances in Neural Information Processing Systems, pages 6981–6991, 2019.
|
| 325 |
+
[34] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 326 |
+
[35] Suriya Gunasekar, Jason D Lee, Daniel Soudry, and Nati Srebro. Implicit bias of gradient descent on linear convolutional networks. In Advances in Neural Information Processing Systems, pages 9461–9471, 2018.
|
| 327 |
+
[36] Suriya Gunasekar, Blake E Woodworth, Srinadh Bhojanapalli, Behnam Neyshabur, and Nati Srebro. Implicit regularization in matrix factorization. In Advances in Neural Information Processing Systems, pages 6151–6159, 2017.
|
| 328 |
+
[37] Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel R Bowman, and Noah A Smith. Annotation artifacts in natural language inference data. arXiv preprint arXiv:1803.02324, 2018.
|
| 329 |
+
[38] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 330 |
+
[39] Christina Heinze-Deml and Nicolai Meinshausen. Conditional variance penalties and domain shift robustness. arXiv preprint arXiv:1710.11469, 2017.
|
| 331 |
+
[40] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019.
|
| 332 |
+
[41] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-ofdistribution examples in neural networks. arXiv preprint arXiv:1610.02136, 2016.
|
| 333 |
+
[42] Katherine L Hermann and Andrew K Lampinen. What shapes feature representations? exploring datasets, architectures, and training. arXiv preprint arXiv:2006.12433, 2020.
|
| 334 |
+
[43] Cho-Jui Hsieh, Kai-Wei Chang, Chih-Jen Lin, S Sathiya Keerthi, and Sellamanickam Sundararajan. A dual coordinate descent method for large-scale linear svm. In Proceedings of the 25th international conference on Machine learning, pages 408–415, 2008.
|
| 335 |
+
[44] Jiaoyang Huang and Horng-Tzer Yau. Dynamics of deep neural networks and neural tangent hierarchy. arXiv preprint arXiv:1909.08156, 2019.
|
| 336 |
+
[45] Kaixuan Huang, Yuqing Wang, Molei Tao, and Tuo Zhao. Why do deep residual networks generalize better than deep feedforward networks?—a neural tangent kernel perspective. Advances in Neural Information Processing Systems, 33, 2020.
|
| 337 |
+
[46] Like Hui and Mikhail Belkin. Evaluation of neural architectures trained with square loss vs cross-entropy in classification tasks. arXiv preprint arXiv:2006.07322, 2020.
|
| 338 |
+
[47] Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. arXiv preprint arXiv:1804.08598, 2018.
|
| 339 |
+
[48] Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In Advances in Neural Information Processing Systems, pages 125–136, 2019.
|
| 340 |
+
[49] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 341 |
+
[50] Tommi S Jaakkola and David Haussler. Probabilistic kernel regression models. In AISTATS, 1999.
|
| 342 |
+
[51] Jörn-Henrik Jacobsen, Jens Behrmann, Richard Zemel, and Matthias Bethge. Excessive invariance causes adversarial vulnerability. arXiv preprint arXiv:1811.00401, 2018.
|
| 343 |
+
[52] Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, pages 8571–8580, 2018.
|
| 344 |
+
[53] Ziwei Ji and Matus Telgarsky. The implicit bias of gradient descent on nonseparable data. In Conference on Learning Theory, pages 1772–1798, 2019.
|
| 345 |
+
[54] Jason Jo and Yoshua Bengio. Measuring the tendency of cnns to learn surface statistical regularities. arXiv preprint arXiv:1711.11561, 2017.
|
| 346 |
+
[55] Alexia Jolicoeur-Martineau and Ioannis Mitliagkas. Connections between support vector machines, wasserstein distance and gradient-penalty gans. arXiv preprint arXiv:1910.06922, 2019.
|
| 347 |
+
[56] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 348 |
+
[57] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 0, 2009.
|
| 349 |
+
[58] Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pages 950–957, 1992.
|
| 350 |
+
[59] David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). arXiv preprint arXiv:2003.00688, 2020.
|
| 351 |
+
[60] Andrew K Lampinen and Surya Ganguli. An analytic theory of generalization dynamics and transfer learning in deep linear networks. arXiv preprint arXiv:1809.10374, 2018.
|
| 352 |
+
[61] Sebastian Lapuschkin, Stephan Wäldchen, Alexander Binder, Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Unmasking clever hans predictors and assessing what machines really learn. Nature communications, 10(1):1–8, 2019.
|
| 353 |
+
[62] Jaehoon Lee, Lechao Xiao, Samuel Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Advances in neural information processing systems, pages 8570–8581, 2019.
|
| 354 |
+
[63] Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems, pages 7167–7177, 2018.
|
| 355 |
+
[64] Shiyu Liang, Yixuan Li, and Rayadurgam Srikant. Enhancing the reliability of out-ofdistribution image detection in neural networks. arXiv preprint arXiv:1706.02690, 2017.
|
| 356 |
+
[65] Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
|
| 357 |
+
[66] Cong Ma, Kaizheng Wang, Yuejie Chi, and Yuxin Chen. Implicit regularization in nonconvex statistical estimation: Gradient descent converges linearly for phase retrieval and matrix completion. In International Conference on Machine Learning, pages 3345–3354. PMLR, 2018.
|
| 358 |
+
[67] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 359 |
+
[68] R Thomas McCoy, Ellie Pavlick, and Tal Linzen. Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference. arXiv preprint arXiv:1902.01007, 2019.
|
| 360 |
+
[69] Song Mei and Andrea Montanari. The generalization error of random features regression: Precise asymptotics and double descent curve. arXiv preprint arXiv:1908.05355, 2019.
|
| 361 |
+
[70] Preetum Nakkiran, Gal Kaplun, Dimitris Kalimeris, Tristan Yang, Benjamin L Edelman, Fred Zhang, and Boaz Barak. Sgd on neural networks learns functions of increasing complexity. arXiv preprint arXiv:1905.11604, 2019.
|
| 362 |
+
[71] Junhyun Nam, Hyuntak Cha, Sungsoo Ahn, Jaeho Lee, and Jinwoo Shin. Learning from failure: Training debiased classifier from biased classifier. arXiv preprint arXiv:2007.02561, 2020.
|
| 363 |
+
[72] Kamil Nar, Orhan Ocal, S Shankar Sastry, and Kannan Ramchandran. Cross-entropy loss and low-rank features have responsibility for adversarial examples. arXiv preprint arXiv:1901.08360, 2019.
|
| 364 |
+
[73] Kamil Nar and S Shankar Sastry. Persistency of excitation for robustness of neural networks. arXiv preprint arXiv:1911.01043, 2019.
|
| 365 |
+
[74] Behnam Neyshabur, Ryota Tomioka, Ruslan Salakhutdinov, and Nathan Srebro. Geometry of optimization and implicit regularization in deep learning. arXiv preprint arXiv:1705.03071, 2017.
|
| 366 |
+
[75] Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. arXiv preprint arXiv:1412.6614, 2014.
|
| 367 |
+
[76] Timothy Niven and Hung-Yu Kao. Probing neural network comprehension of natural language arguments. arXiv preprint arXiv:1907.07355, 2019.
|
| 368 |
+
[77] Luke Oakden-Rayner, Jared Dunnmon, Gustavo Carneiro, and Christopher Ré. Hidden stratification causes clinically meaningful failures in machine learning for medical imaging. In Proceedings of the ACM Conference on Health, Inference, and Learning, pages 151–159, 2020.
|
| 369 |
+
[78] Samet Oymak, Zalan Fabian, Mingchen Li, and Mahdi Soltanolkotabi. Generalization guarantees for neural networks via harnessing the low-rank structure of the jacobian. arXiv preprint arXiv:1906.05392, 2019.
|
| 370 |
+
[79] Giambattista Parascandolo, Alexander Neitz, Antonio Orvieto, Luigi Gresele, and Bernhard Schölkopf. Learning explanations that are hard to vary. arXiv preprint arXiv:2009.00329, 2020.
|
| 371 |
+
[80] 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. openreview id=BJJsrmfCZ, 2017.
|
| 372 |
+
[81] Oskar Pfungst. Clever Hans:(the horse of Mr. Von Osten.) a contribution to experimental animal and human psychology. Holt, Rinehart and Winston, 1911.
|
| 373 |
+
[82] Tomaso Poggio, Kenji Kawaguchi, Qianli Liao, Brando Miranda, Lorenzo Rosasco, Xavier Boix, Jack Hidary, and Hrushikesh Mhaskar. Theory of deep learning iii: explaining the non-overfitting puzzle. arXiv preprint arXiv:1801.00173, 2017.
|
| 374 |
+
[83] Nasim Rahaman, Aristide Baratin, Devansh Arpit, Felix Draxler, Min Lin, Fred Hamprecht, Yoshua Bengio, and Aaron Courville. On the spectral bias of neural networks. In International Conference on Machine Learning, pages 5301–5310. PMLR, 2019.
|
| 375 |
+
[84] Jonas Rauber, Wieland Brendel, and Matthias Bethge. Foolbox: A python toolbox to benchmark the robustness of machine learning models. arXiv preprint arXiv:1707.04131, 2017.
|
| 376 |
+
[85] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. " why should i trust you?" explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pages 1135–1144, 2016.
|
| 377 |
+
[86] Michael Roberts. Machine learning for covid-19 diagnosis: Promising, but still too flawed, Mar 2021.
|
| 378 |
+
[87] Basri Ronen, David Jacobs, Yoni Kasten, and Shira Kritchman. The convergence rate of neural networks for learned functions of different frequencies. In Advances in Neural Information Processing Systems, pages 4761–4771, 2019.
|
| 379 |
+
[88] Amir Rosenfeld, Richard Zemel, and John K Tsotsos. The elephant in the room. arXiv preprint arXiv:1808.03305, 2018.
|
| 380 |
+
[89] Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731, 2019.
|
| 381 |
+
|
| 382 |
+
[90] Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013.
|
| 383 |
+
|
| 384 |
+
[91] Andrew M Saxe, James L McClelland, and Surya Ganguli. A mathematical theory of semantic development in deep neural networks. Proceedings of the National Academy of Sciences, 116(23):11537–11546, 2019.
|
| 385 |
+
|
| 386 |
+
[92] Harshay Shah, Kaustav Tamuly, Aditi Raghunathan, Prateek Jain, and Praneeth Netrapalli. The pitfalls of simplicity bias in neural networks. arXiv preprint arXiv:2006.07710, 2020.
|
| 387 |
+
|
| 388 |
+
[93] Shai Shalev-Shwartz and Shai Ben-David. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014.
|
| 389 |
+
|
| 390 |
+
[94] Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19(1):2822–2878, 2018.
|
| 391 |
+
|
| 392 |
+
[95] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014.
|
| 393 |
+
|
| 394 |
+
[96] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 395 |
+
|
| 396 |
+
[97] Guillermo Valle-Pérez, Chico Q Camargo, and Ard A Louis. Deep learning generalizes because the parameter-function map is biased towards simple functions. arXiv preprint arXiv:1805.08522, 2018.
|
| 397 |
+
|
| 398 |
+
[98] Vladimir Vapnik and Vlamimir Vapnik. Statistical learning theory wiley. New York, 1:624, 1998.
|
| 399 |
+
|
| 400 |
+
[99] Santosh Vempala and John Wilmes. Gradient descent for one-hidden-layer neural networks: Polynomial convergence and sq lower bounds. In Conference on Learning Theory, pages 3115–3117, 2019.
|
| 401 |
+
|
| 402 |
+
[100] Haohan Wang, Zexue He, Zachary C Lipton, and Eric P Xing. Learning robust representations by projecting superficial statistics out. arXiv preprint arXiv:1903.06256, 2019.
|
| 403 |
+
|
| 404 |
+
[101] Sifan Wang, Xinling Yu, and Paris Perdikaris. When and why pinns fail to train: A neural tangent kernel perspective. Journal of Computational Physics, page 110768, 2021.
|
| 405 |
+
|
| 406 |
+
[102] David H Wolpert. The lack of a priori distinctions between learning algorithms. Neural computation, 8(7):1341–1390, 1996.
|
| 407 |
+
|
| 408 |
+
[103] Xin Xu and Eibe Frank. Logistic regression and boosting for labeled bags of instances. In Pacific-Asia conference on knowledge discovery and data mining, pages 272–281. Springer, 2004.
|
| 409 |
+
|
| 410 |
+
[104] Zhi-Qin John Xu, Yaoyu Zhang, Tao Luo, Yanyang Xiao, and Zheng Ma. Frequency principle: Fourier analysis sheds light on deep neural networks. arXiv preprint arXiv:1901.06523, 2019.
|
| 411 |
+
|
| 412 |
+
[105] Zhi-Qin John Xu, Yaoyu Zhang, and Yanyang Xiao. Training behavior of deep neural network in frequency domain. In International Conference on Neural Information Processing, pages 264–274. Springer, 2019.
|
| 413 |
+
|
| 414 |
+
[106] Greg Yang and Hadi Salman. A fine-grained spectral perspective on neural networks. arXiv preprint arXiv:1907.10599, 2019.
|
| 415 |
+
|
| 416 |
+
[107] John R Zech, Marcus A Badgeley, Manway Liu, Anthony B Costa, Joseph J Titano, and Eric K Oermann. Confounding variables can degrade generalization performance of radiological deep learning models. arXiv preprint arXiv:1807.00431, 2018.
|
| 417 |
+
|
| 418 |
+
[108] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 419 |
+
|
| 420 |
+
[109] Jieyu Zhao, Tianlu Wang, Mark Yatskar, Vicente Ordonez, and Kai-Wei Chang. Men also like shopping: Reducing gender bias amplification using corpus-level constraints. arXiv preprint arXiv:1707.09457, 2017.
|
| 421 |
+
|
| 422 |
+
[110] Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Gradient descent optimizes overparameterized deep relu networks. Machine Learning, 109(3):467–492, 2020.
|
md/train/af_hng9tuNj/af_hng9tuNj.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GEOMOL: Torsional Geometric Generation of Molecular 3D Conformer Ensembles
|
| 2 |
+
|
| 3 |
+
Octavian-Eugen Ganea ⇤, ‡
|
| 4 |
+
|
| 5 |
+
Lagnajit Pattanaik \*, †
|
| 6 |
+
|
| 7 |
+
Connor W. Coley Regina Barzilay ‡ Klavs F. Jensen †
|
| 8 |
+
|
| 9 |
+
William H. Green †
|
| 10 |
+
|
| 11 |
+
Tommi S. Jaakkola ‡
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Prediction of a molecule’s 3D conformer ensemble from the molecular graph holds a key role in areas of cheminformatics and drug discovery. Existing generative models have several drawbacks including lack of modeling important molecular geometry elements (e.g., torsion angles), separate optimization stages prone to error accumulation, and the need for structure fine-tuning based on approximate classical force-fields or computationally expensive methods. We propose GEOMOL — an end-to-end, non-autoregressive, and SE(3)-invariant machine learning approach to generate distributions of low-energy molecular 3D conformers. Leveraging the power of message passing neural networks (MPNNs) to capture local and global graph information, we predict local atomic 3D structures and torsion angles, avoiding unnecessary over-parameterization of the geometric degrees of freedom (e.g., one angle per non-terminal bond). Such local predictions suffice both for both the training loss computation and for the full deterministic conformer assembly (at test time). We devise a non-adversarial optimal transport based loss function to promote diverse conformer generation. GEOMOL predominantly outperforms popular open-source, commercial, or state-of-the-art machine learning (ML) models, while achieving significant speed-ups. We expect such differentiable 3D structure generators to significantly impact molecular modeling and related applications. 4
|
| 16 |
+
|
| 17 |
+
# 1 Overview
|
| 18 |
+
|
| 19 |
+
Problem & importance. We tackle the problem of molecular conformer generation (MCG), i.e., predicting the ensemble of low-energy 3D conformations of a small molecule solely based on the molecular graph (fig. 1). A single conformation is represented by the list of 3D coordinates for each atom in the respective molecule. In this work, we assume that the low-energy states are implicitly defined by the given dataset, i.e., our training data consist of molecular graphs and corresponding sets of energetically favorable 3D conformations. Low-energy structures are the most stable configurations and, thus, expected to be observed most often experimentally.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: We generate a representative set of low-energy 3D conformers from the input molecular graph. This example molecule has both rigid (rings) and flexible parts. Conformers are shown aligned and juxtaposed.
|
| 23 |
+
|
| 24 |
+
Dealing with molecules in their natural 3D structure is of great importance in areas such as cheminformatics or computational drug discovery because conformations determine biological, chemical, and physical properties [Guimaraes et al., 2012, Schütt et al., 2018, Klicpera et al., 2019, Axelrod and Gomez-Bombarelli, 2020b, Schütt et al., 2021, Liu et al., 2021] such as charge distribution, potential energy, docking poses [McGann, 2011], shape similarity [Kumar and Zhang, 2018], pharmacophore searching [Schwab, $\overline { { 2 0 1 0 } }$ , or descriptors for 3/4D QSAR [Verma et al., 2010]. For instance, in drug design it is crucial to understand how a molecule binds to a specific target protein; this process heavily depends on the 3D structures of the two components, both in terms of geometric (shape matching) and chemical (hydrophobic/hydrophilic) interactions [Gainza et al., 2020, Sverrisson et al., 2020].
|
| 25 |
+
|
| 26 |
+
Motivation & challenges of existing methods. The main challenge in MCG comes from the enormous size of the 3D structure space consisting of bond lengths, bond angles, and torsion angles. It is known that the molecular graph imposes specific constraints on possible 3D conformations, e.g., bond length ranges depend on the respective bond types, while tetrahedral centers dictate local spatial arrangement. However, the space of possible conformations grows exponentially with the graph size and number of rotatable bonds, thus hindering exhaustive brute force exploration even for relatively small molecules. Additionally, the number of plausibly-stable low-energy states is unknown a priori and can vary between one and several thousand conformations for a single molecule [Chan et al., $\boxed { 2 0 2 1 }$ . Nevertheless, various facets of the curse of dimensionality have been favorably tackled by ML models in different contexts, and our goal is to build on the recent ML efforts for MCG [Mansimov et al., 2019, Simm and Hernandez-Lobato, 2020, Lemm et al., 2021, Xu et al., 2021]
|
| 27 |
+
|
| 28 |
+
Molecular conformations can be determined experimentally, but existing techniques are very expensive. As a consequence, predictive computational models have been developed over the past few decades, traditionally being categorized as either stochastic or systematic (rule-based) methods $\lVert \mathbf { H a w k i n s } \rVert \mathbf { 2 0 1 7 } \rVert$ . Stochastic approaches have traditionally been based on molecular dynamics (MD) or Markov chain Monte Carlo (MCMC) techniques, potentially combined with genetic algorithms (GAs). They can do extensive explorations of the energy landscape and accurately sample equilibrium structures, but quickly become prohibitively slow for larger molecules [Shim and MacKerell Jr, 2011, Ballard et al., 2015, De Vivo et al., 2016, Hawkins, 2017], e.g., they require several CPU minutes for a single drug-like molecule. Moreover, stochastic methods have difficulties sampling diverse and representative conformers, prioritizing quantity over quality. On the other hand, rule-based systematic methods achieve state-of-the-art in commercial software [Friedrich et al., $\mathbb { Z 0 1 7 }$ with OMEGA [Hawkins et al., 2010, Hawkins and Nicholls, 2012] being a popular example. They usually process a single drug-like molecule under a second. They address the aforementioned challenges of stochastic methods by relying on carefully curated torsion templates (torsion rules), rule-based generators, and knowledge bases of rigid 3D fragments, which are assembled together and combined with subsequent stability score ranking. However, torsion angles are mostly varied independently (based on their fragments), without explicitly capturing their global interactions, which results in difficulties for larger and more flexible molecules. Furthermore, the curated fragments and rules are inadequate for more challenging inputs (e.g., transition states or open-shell molecules).
|
| 29 |
+
|
| 30 |
+
Both types of methods can be combined with Distance Geometry (DG) techniques to generate the initial 3D conformation. First, the 3D atom distance matrix is generated based on a set of distance constraints or from a specialized model. Subsequently, the corresponding 3D atom coordinates are learned to approximately match these predicted distances [Havel et al., 1983b,a, Crippen et al., 1988, Havel, 1998, Lagorce et al., 2009, Riniker and Landrum, 2015]. Indeed, modern stochastic algorithms are entirely based on DG methods [Riniker and Landrum, 2015]. The inductive bias of rotational and translational invariance is guaranteed for DG, thus being appealing for ML models [Simm and Hernandez-Lobato, 2020, Xu et al., 2021, Pattanaik et al., 2020b]. However, several drawbacks weaken this important direction: i) the distance matrix is overparameterized compared to the actual number of degrees of freedom, ii) it is difficult to enforce 3D Euclidean distance constraints as well as geometric graph constraints (e.g., on torsion angles or rings [Riniker and Landrum, $\boxed { 2 0 1 5 } ] )$ ; iii) important aspects of molecular geometry are not explicitly modeled, e.g., torsion angles of rotatable bonds or tetrahedral centers; iv) expensive force-field energy fine-tuning of the generated conformers is vital for a reasonable quality [Xu et al., 2021, Simm and Hernandez-Lobato, $\check { 2 0 } 2 0 \|$ ; iv) the resulting multi-stage pipeline is prone to error accumulation as opposed to an end-to-end model.
|
| 31 |
+
|
| 32 |
+
Previous methods often rely on a force field (FF) energy function minimization to fine-tune the conformers. These are hand-designed energy models which use parameters estimated from experiment and/or computed from quantum mechanics (e.g., Universal Force Field [Rappé et al., 1992], Merck Molecular Force Field [Halgren, 1996]). However, FFs are crude approximations of the true molecular potential energy surface [Kanal et al., 2018], limited in the interactions they can capture in biomolecules due to their strong assumptions [Barman et al., 2015]. In addition, FF energy optimization is relatively slow and increases error accumulation in a multi-pipeline method.
|
| 33 |
+
|
| 34 |
+
Relation to protein folding. There has been impressive recent progress on modeling protein folding dynamics [Ingraham et al., 2018, AlQuraishi, 2019, Noé et al., 2019, Senior et al., 2020], where crystallized 3D structures are predicted solely from the amino-acid sequence using ML methods. However, molecules pose unique challenges, being highly branched graphs containing cycles, different types of bonds, and chirality information. This makes protein folding approaches not readily transferable to general molecular data.
|
| 35 |
+
|
| 36 |
+
Our key contributions & model in a nutshell. In this work, we investigate the question:
|
| 37 |
+
|
| 38 |
+
Can we design a fast and generalizable deep learning model to predict high-quality, representative, and diverse 3D conformational ensembles from input molecular graphs?
|
| 39 |
+
|
| 40 |
+
To tackle this question, we propose GEOMOL (shown in fig. 2), exhibiting the following merits:
|
| 41 |
+
|
| 42 |
+
• It is end-to-end trainable, non-autoregressive, and does not rely on DG techniques (thus avoiding aforementioned drawbacks). More precisely, it outputs a minimal set of geometric quantities (i.e., angles and distances) sufficient for full deterministic reconstruction of the 3D conformer.
|
| 43 |
+
|
| 44 |
+
• It models conformers in an SE(3)-invariant (translation/rotation) manner by design. This desirable inductive bias was previously either achieved using multi-step DG methods [Simm and HernandezLobato, 2020] or not captured at all [Mansimov et al., 2019].
|
| 45 |
+
|
| 46 |
+
• It explicitly models and predicts essential molecular geometry elements: torsion angles and local 3D structures (bond distances and bond angles adjacent to each atom). Together with the input molecular graph, these are used for k-hop distance computation at train time and full deterministic conformation assembly at test time. Crucially, we do not over-parameterize these predictions, i.e., a single torsion angle is computed per each non-terminal bond, irrespective of the number and permutation of the neighboring atoms at each end-point of the respective bond.
|
| 47 |
+
|
| 48 |
+
• The above geometric elements (torsion angles, local structures) are SE(3)-invariant (by definition or usage) and we jointly predict them using MPNNs $\lVert \mathbf { G i l m e r \ e t \ a l . } \rVert \mathbf { 2 0 1 7 } \rVert$ and self-attention networks. Thus, unlike [Mansimov et al., $\boxed { 2 0 1 9 }$ , we are not affected by MPNNs’ pitfalls that obstruct direct predictions of 3D atom coordinates from node embeddings, e.g., symmetric or locally isomorphic nodes would always have identical MPNN embeddings [Xu et al., 2019, Garg et al., 2020] and, as a consequence, would be inappropriately assigned identical 3D coordinates.
|
| 49 |
+
|
| 50 |
+
• To promote diverse conformer ensembles with good coverage, we devise a tailored generative loss that does not use slow or difficult-to-optimize adversarial training techniques. Using optimal transport, GEOMOL finds the best matching between generated and ground truth conformers based on their pairwise log-likelihood loss, requiring only minimization.
|
| 51 |
+
|
| 52 |
+
• It explicitly and deterministically distinguishes reflected structures (enantiomers) by solving tetrahedral stereocenters using oriented volumes and local chiral descriptors, bypassing the need for iterative optimization usually done in DG approaches.
|
| 53 |
+
|
| 54 |
+
• Empirically, we conduct experiments on two benchmarks: GEOM-QM9 (smaller molecules relevant to gas-phase chemistry) and GEOM-DRUGS (drug-like molecules) [Axelrod and GomezBombarelli, 2020a]. Our method often outperforms previous ML and two popular open-source or commercial methods in different metrics. Moreover, we show competitive quality even without the frequently-used computationally-demanding fine-tuning FF strategies.
|
| 55 |
+
|
| 56 |
+
• GEOMOL processes drug-like molecules in seconds or less, being orders of magnitude faster than popular baselines (e.g., ETKDG/RDKit[Riniker and Landrum, 2015]), without sacrificing quality.
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 2: Overview of the GEOMOL model, which is SE(3)-invariant by design. Given a molecular graph, we first compute MPNNs atom embeddings. Next, we predict the local 3D structures (LS) of each non-terminal atom in a permutation invariant way, explicitly solving chirality. Third, for each bond connecting non-terminal vertices, we assemble the two LS by predicting a single torsion angle, avoiding overparameterization. Finally, the full conformer is assembled (only) at test time.
|
| 60 |
+
|
| 61 |
+
# 2 Method
|
| 62 |
+
|
| 63 |
+
Problem setup $\pmb { \& }$ notations. Our input is any molecular graph $G = ( V , E )$ with node and edge features, $\mathbf { x } _ { v } \in \mathbb { R } ^ { f } , \forall v \in V$ and $\mathbf { e } _ { u , v } \in \mathbb { R } ^ { f ^ { \prime } } , \forall ( u , v ) \in E$ representing atom types, formal charges, bond types, etc. For each molecular graph $\mathbf { G }$ , we have a variable-size set of low-energy ground truth 3D conformers $\{ \mathcal { C } _ { l } ^ { * } \} _ { l }$ that we predict with a model $\{ { \mathcal { C } } _ { k } \} _ { k } \ { \overset { \underset { \mathrm { d e f } } { } } { = } } \ \zeta ( G )$ . A conformer is a map $\mathcal { C } : V \to \mathbb { R } ^ { 3 }$ from graph nodes to 3D coordinates, but a simplified notation is $\mathbf { c } _ { v } \in \mathbb { R } ^ { 3 }$ for $v \in V$ . We use additional notations: $d ( X , Y ) = \| \mathbf { c } _ { X } - \mathbf { c } _ { Y } \|$ is the 3D distance between X and Y; $\angle X Y Z$ is the counter-clockwise (CCW) angle $\angle \mathbf { c } _ { X } \mathbf { c } _ { Y } \mathbf { c } _ { Z }$ ; $\angle ( X Y Z , X Y T )$ is the CCW dihedral angle of the 2D planes $\mathbf { c } _ { X } \mathbf { c } _ { Y } \mathbf { c } _ { Z }$ and $\mathbf { c } _ { X } \mathbf { c } _ { Y } \mathbf { c } _ { T }$ (formula is in appendix $\checkmark$ . We use the corresponding $\mathbf { c } _ { v } ^ { * } , d ^ { * } ( X , Y ) , \angle ^ { * } X Y Z , \angle ^ { * } ( X Y Z , X Y T )$ when manipulating a ground truth conformer.
|
| 64 |
+
|
| 65 |
+
Any conformer is defined up to a SE(3) transformation, i.e., any translation or rotation applied to the set $\{ \mathbf { c } _ { v } \} _ { v \in V }$ . A classic conformer distance function that satisfies this constraint is root-mean-square deviation of atomic positions (RMSD), computed by the Kabsch alignment algorithm [Kabsch, 1976].
|
| 66 |
+
|
| 67 |
+
# 2.1 GEOMOL high-level overview
|
| 68 |
+
|
| 69 |
+
Our approach, shown in fig. $\mathbb { Z } ,$ comprises three steps. First, we predict the local 3D structure of each non-terminal atom, which we deem local structure (LS), by combining self-attention layers and MPNNs with deterministic corrections for tetrahedral centers. Bond distances and bond angles are computed from the predicted LS. Next, we assemble all neighboring pairs of LSs by predicting the torsion angles and aligning them. Importantly, since LSs are fixed, it suffices to only predict a single value for the dihedral angle of each bond. Towards this goal, we develop a canonical representation of torsion angles via a local coordinate system defined SE(3)-equivariantly w.r.t. the full structure, which allows us to predict exactly the number of degrees of freedom. Finally, at test time, we assemble all predicted pairs of neighboring LSs to construct the full conformer, applying deterministic ring corrections. In order to generate diverse conformers, we append random Gaussian noise vectors to each initial node feature vector and use an optimal transport-based loss function for training.
|
| 70 |
+
|
| 71 |
+
# 2.2 Message passing neural networks (MPNNs)
|
| 72 |
+
|
| 73 |
+
Given an input graph $\mathbf { G }$ , an MPNN [Gilmer et al., 2017, Battaglia et al., 2018, Yang et al., 2019] computes node embeddings $\mathbf { h } _ { v } \in \mathbb { R } ^ { d } , \overline { { \forall v \in V } }$ using $\overline { T }$ layers of iterative message passing:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathbf { h } _ { u } ^ { ( t + 1 ) } = \psi \left( \mathbf { h } _ { u } ^ { ( t ) } , \sum _ { v \in \mathcal { N } _ { u } } \phi ( \mathbf { h } _ { v } ^ { ( t ) } , \mathbf { h } _ { u } ^ { ( t ) } , \mathbf { e } _ { u , v } ) \right) , \quad \mathrm { w h e r e ~ } \mathbf { h } _ { v } ^ { ( 0 ) } \overset { \mathrm { d e f } } { = } c o n c a t [ \mathbf { x } _ { v } , \mathbf { z } _ { v } ] , \mathbf { z } _ { v } \sim \mathcal { N } ( \mathbf { 0 } , s \mathbf { I } _ { d } )
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
for each $t \in [ 0 \dots T - 1 ]$ , where $\mathcal { N } _ { u } = \{ v \in V | ( u , v ) \in E \}$ , while $\psi$ and $\phi$ are generic functions, e.g., implemented using multilayer perceptrons (MLP) or attention [Velickovi ˇ c et al.,´ $\boxed { 2 0 1 7 }$ . Final node embeddings are obtained by the embedding of the last layer: $\mathbf { h } _ { v } \overline { { \stackrel { \mathrm { d e f } } { = } \mathbf { h } _ { v } ^ { ( T ) } , \forall v \in V } }$ . Finally, we
|
| 80 |
+
|
| 81 |
+
also compute a molecular embedding: $\begin{array} { r } { \mathbf { h } _ { m o l } \overset { \mathrm { d e f } } { = } M L P ( \sum _ { v \in V } \mathbf { h } _ { v } ) } \end{array}$ . We leave comparison with other 2 MPNN variants for future work, e.g., Kipf and Welling [2017], Velickovi ˇ c et al. [2017], Hamilton ´ et al. [2017], Xu et al. [2019].
|
| 82 |
+
|
| 83 |
+
# 2.3 Local structure (1-hop) prediction model
|
| 84 |
+
|
| 85 |
+
Following notations in fig. $^ { 3 , }$ , for each non-terminal graph vertex $X \in V$ having $n$ graph neighbors $\mathcal { N } _ { X } = \{ T _ { i } \} _ { i \in [ 1 \ldots n ] }$ , we predict its local $3 D$ structure (LS), i.e., the relative 3D positions of all $T _ { i }$ , when $\mathbf { X }$ is centered in the origin. The generic model is a function $f ( \mathbf { h } _ { T _ { 1 } } , \dots , \mathbf { h } _ { T _ { n } } ; \mathbf { h } _ { X } ) =$ $( \mathbf { p } _ { 1 } , \ldots , \mathbf { p } _ { n } ) \in \mathbb { R } ^ { 3 \times n }$ that, additionally, should satisfy permutation equivariance w.r.t. $T _ { i }$ ’s, namely, the 3D position of each neighbor $T _ { i }$ should not change regardless of the ordering of the $X$ ’s neighbors:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
f ( \mathbf { h } _ { T _ { \pi ( 1 ) } } , \ldots , \mathbf { h } _ { T _ { \pi ( n ) } } ; \mathbf { h } _ { X } ) = ( \mathbf { p } _ { \pi ( 1 ) } , \ldots , \mathbf { p } _ { \pi ( n ) } ) , \forall \pi \in S _ { n }
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Our choice is the encoder part of a transformer [Vaswani et al., $\boxed { 2 0 1 7 }$ , without any positional encoding, thus satisfying permutation equivariance. This model takes as input the set $\{ c o n c a t [ \mathbf { h } _ { T _ { i } } , \mathbf { h } _ { X } ] ; i \in [ 1 . . n ] \}$ in any order and synchronously updates the $n$ embeddings based on several transformer layers. The final layer projects the embeddings to 3 dimensions, resulting in a list $( \mathbf { p } _ { 1 } , \ldots , \mathbf { p } _ { n } ) \in \mathbb { R } ^ { 3 \times n }$ having the exact same node order as the input list.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 3: For each non-terminal atom X, we predict the relative 3D position of each of its graph neighbors, $\{ T _ { i } \} _ { i \in [ 1 \ldots n ] }$ , in a permutation equivariant manner.
|
| 95 |
+
|
| 96 |
+
Enforcing local consistency. We desire the LS model $f ( )$ to be distance-consistent, i.e., any bond distance $d ( X , Y )$ is the same, no matter if it is computed from the LS of node $\mathbf { X }$ or of node Y. To achieve this, we use the above transformer just to compute bond directions (which will be aligned using a separate approach described in section $\underline { { \widehat { | 2 . 4 ) } } }$ while we obtain the bond distances with a separate symmetric model. Concretely, let the above transformer $f ( )$ predict $( \mathbf { p } _ { 1 } , \ldots , \mathbf { p } _ { n } ) \in \mathbb { R } ^ { 3 \times n }$ , while the final local 3D coordinates are $\mathbf { p } _ { i } ^ { \prime } { \stackrel { \mathrm { d e f } } { = } } \frac { \mathbf { p } _ { i } } { \| \mathbf { p } _ { i } \| } d _ { G N N } ( \mathbf { h } _ { X } , \mathbf { h } _ { T _ { i } } ) , \forall i$ , where each bond distance is predicted with a symmetric model $d _ { G N N } ( \mathbf { h } _ { X } , \mathbf { h } _ { Y } ) \overset { \mathrm { d e f } } { = } \mathrm { s o f t p l u s } ( \psi ( \mathbf { h } _ { X } , \mathbf { h } _ { Y } ) + \psi ( \mathbf { h } _ { Y } , \mathbf { h } _ { X } ) ) , \forall ( X , Y ) \in E$ , with the same shared $\psi$ (e.g., an MLP). For notation simplicity, we will just use $\mathbf { p } _ { i }$ instead of $\mathbf { p } _ { i } ^ { \prime }$ .
|
| 97 |
+
|
| 98 |
+
Regarding SE(3) invariance. The above model is not SE(3)-invariant per se, but it is used as such. Namely, on one hand we compute SE(3)-invariant quantities: 1- hop distances $d ( T _ { i } , X )$ , 2-hop distances $d ( T _ { i } , T _ { j } )$ , and bending angles $\angle T _ { i } X T _ { j }$ . These will be compared to their ground-truth counterparts in the final loss, see section $2 . 5 .$
|
| 99 |
+
|
| 100 |
+
On the other hand, the LS of adjacent graph nodes are assembled together for computing torsion angles or for building the full conformer at test time. This process is explicitly defined to be SE(3)-invariant as described in section 2.4.
|
| 101 |
+
|
| 102 |
+
Tetrahedral chiral corrections. When embedding the local neighborhood of a node in 3D space, one has to carefully account for tetrahedral stereocenters (fig. 4). Tetrahedral chirality is a common form of stereochemistry which restricts the 3D location of neighboring substituents of a central atom with four distinct neighbors; molecules which differ by a single tetrahedral stereocenter, i.e., enantiomers, are mirror images of each other. Chirality heavily impacts some properties of small molecules–e.g., bioactivity. Existing MPNNs using only the molecular graph cannot distinguish chiral centers (fig. 4), but solutions exist [Pattanaik et al., 2020a]. Mathematically, enantiomers can be differentiated based on the oriented volume around the tetrahedral center. That is, given the ordered set of neighbor 3D coordinates around the center, namely $\mathbf { p } _ { 1 } , \mathbf { p } _ { 2 } , \mathbf { p } _ { 3 } , \mathbf { p } _ { 4 } \in \mathbb { R } ^ { 3 }$ , the sign of the volume of the tetrahedron formed by the neighbors is
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 4: Chirality: even if the two shown graphs are isomorphic, they have distinct 3D structures that can be distinguished by the order of the carbon center’s neighbors.
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
O V ( \mathbf { p } _ { 1 } , \mathbf { p } _ { 2 } , \mathbf { p } _ { 3 } , \mathbf { p } _ { 4 } ) \stackrel { \mathrm { d e f } } { = } s i g n \left( \left| \begin{array} { c c c c } { 1 } & { 1 } & { 1 } & { 1 } \\ { x _ { 1 } } & { x _ { 2 } } & { x _ { 3 } } & { x _ { 4 } } \\ { y _ { 1 } } & { y _ { 2 } } & { y _ { 3 } } & { y _ { 4 } } \\ { z _ { 1 } } & { z _ { 2 } } & { z _ { 3 } } & { z _ { 4 } } \end{array} \right| \right)
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Enantiomeric structures always have opposite signs for the oriented volume $[ \mathrm { C r i p p e n \ e t a l . } ] , [ \mathrm { 9 8 8 } ]$ Since we generate local 3D structures directly, we can also use local 3D chiral descriptors to ensure the correct generation of tetrahedral stereocenters. RDKit internally keeps track of these local chiral labels, denoted by CW/CCW labels (detailed in e.g., Pattanaik et al. $\pm { \overline { { [ 2 0 2 0 \mathrm { a } ] } } } )$ . Importantly, each local chiral label corresponds to a certain oriented volume ( $\boldsymbol { \overline { { \mathrm { C W } } } } = + 1$ and $\overline { { \mathrm { C C W } } } = - 1$ ). Thus, when generating an LS for a tetrahedral center, we calculate the oriented volume and check against the internal RDKit label. If it results in the incorrect oriented volume (i.e., the incorrect stereocenter was generated), we simply reflect the structure by flipping against the z-axis. This ensures that all tetrahedral stereocenters centers are generated exactly, and no iterative optimization is necessary as with traditional DG-based generators.
|
| 112 |
+
|
| 113 |
+
# 2.4 Torsion angle representation and local structure (LS) assembly
|
| 114 |
+
|
| 115 |
+
Once the LS of each atom/vertex is predicted, we assemble them in pairs corresponding to each non-terminal bond in the molecular graph. We describe this process for a bond connecting atoms $\mathrm { X }$ and Y, each having additional graph neighbors $\{ T _ { i } \} _ { i \in [ 1 , . . n ] }$ and, resp., $\{ Z _ { j } \} _ { j \in [ 1 . . m ] }$ . See fig. 5.
|
| 116 |
+
|
| 117 |
+
Torsion angle over-parameterization. We first note that, for any assembled bond XY (fig. 5, right), and $\forall i , k \in [ 1 . . n ] , \forall j , l \in [ 1 . . m ]$ , the dihedral angles $\angle ( X Y T _ { i } , \dot { X } Y T _ { k } )$ and $\angle ( X Y Z _ { l } , X { \bar { Y Z } } _ { j } )$ are fully determined by the LS of nodes $\mathrm { X }$ and Y, respectively, so they do not depend on the torsion angle of bond XY. Next, observe that there is exactly one torsion angle for any bond XY, given unique indexing of the neighbors. This happens because of the following constraint:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\angle ( X Y T _ { i } , X Y Z _ { j } ) = [ \angle ( X Y T _ { k } , X Y Z _ { l } ) + \angle ( X Y T _ { i } , X Y T _ { k } ) + \angle ( X Y Z _ { l } , X Y Z _ { j } ) ] ( \mathrm { m o d } 2 \pi )
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
Thus, in order to avoid unnecessary over-parameterization, we predict a single torsion angle $\alpha$ per each bond $X Y$ connecting non-terminal atoms.
|
| 124 |
+
|
| 125 |
+
Torsion angle formulation. However, it is still unclear at this point how to define this unique angle in a canonical way that is: i) permutation invariant w.r.t. the nodes in the set $\{ T _ { i } \} _ { i \in [ 1 , . . n ] }$ and, respectively, in the set $\{ Z _ { j } \} _ { j \in [ 1 . . m ] }$ , ii) SE(3)-invariant w.r.t. the full 3D conformer, and iii) agrees with eq. $( 3 )$ .
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 5: Assembly of the local structures of bonded atoms $\mathrm { X }$ and $\mathrm { Y }$ based on the predicted torsion angle.
|
| 129 |
+
|
| 130 |
+
Let $\Delta _ { i j } \ { \stackrel { \mathrm { d e f } } { = } } \ \angle ( X Y T _ { i } , X Y Z _ { j } )$ and $\begin{array} { r } { \mathbf { s } _ { i j } \ \stackrel { \mathrm { d e f } } { = } \ \left[ \stackrel { \cos \left( \Delta _ { i j } \right) } { \sin \left( \Delta _ { i j } \right) } \right] } \end{array}$ Let $c _ { i j } \in \mathbb { R }$ be real coefficients such that $\begin{array} { r } { \mathbf { s } \triangleq \sum _ { i , j } c _ { i j } \mathbf { s } _ { i j } \in \mathbb { R } ^ { 2 } } \end{array}$ is not the null vector. Then, we define the torsion angle as5: $\begin{array} { r } { \alpha \stackrel { \mathrm { d e f } } { = } a t a n 2 ( \frac { \mathbf { s } } { \| \mathbf { s } \| } ) } \end{array}$ . It is easy to see that this formulation satisfies both invariances claimed above. We further state (and prove in appendix $\mathbf { A } )$ that our proposed formulation gives a torsion angle uniquely determined by all local angles $\bar { \angle } ( Y X T _ { i } , Y X T _ { k } )$ , $\angle ( Y X Z _ { j } , Y X Z _ { l } )$ and by the true underlying torsion angle:
|
| 131 |
+
|
| 132 |
+
Proposition 1. Given $3 D$ coordinates of nodes $X , Y , T _ { i } , Z _ { j }$ and fixed weights $c _ { i j } \in \mathbb { R }$ such that $\textstyle \sum _ { i , j } c _ { i j } \mathbf { s } _ { i j } \in \mathbb { R } ^ { 2 }$ is not the null vector, then $\alpha \stackrel { \mathrm { d e f } } { = } a t a n 2 ( \frac { \mathbf { s } } { \| \mathbf { s } \| } )$ is unique, i.e., if we change the torsion angle of bond $X Y ,$ then $\alpha$ will change. Formally, if we rotate the set of bonds $\{ X T _ { i } \} _ { i }$ jointly around the line $X Y$ with the same angle $\gamma$ , then $\alpha$ will be exactly shifted with $\gamma$ .
|
| 133 |
+
|
| 134 |
+
How to set $c _ { i j } \mathbf { \hat { \theta } } ^ { } $ Breaking symmetries. A simple solution is to choose $c _ { i j } = 1 , \forall i , j$ . However, in some important cases, local symmetries may result in $\mathbf { s } = 0$ . For example, this happens if, for some betw $j$ , we have n the diffe $\begin{array} { r } { \Delta _ { i j } = \frac { 2 i \pi } { n } + \dot { c } \dot { t } . , \forall i \in [ 1 . . n ] } \end{array}$ . Oneerent lution is to use dif(and similarly for ent ). $c _ { i j }$ to differentiates is reminiscent $T _ { i }$ $Z _ { j }$ of traditional group priorities used for distinguishing $\mathrm { E } / \mathrm { Z }$ isomers. We devise a flexible solution to distinguish these subgraphs: a differentiable real valued function computed from the MPNN node embeddings as $c _ { i j } = \bar { M L P } ( \mathbf { h } _ { T _ { i } } + \mathbf { h } _ { Z _ { j } } ) \in \mathbb { R }$ , with MLP being a neural network shared across all bonds and molecules. Note that we constrain $c _ { i j } = c _ { j i }$ , thus guaranteeing that the same $\alpha$ is obtained if we swap $\mathrm { X }$ and $\mathrm { Y }$ (and their neighbors, respectively).
|
| 135 |
+
|
| 136 |
+
Final LS assembly for a single bond. We now describe the assembly process depicted in fig. $\boxed { 5 }$ We first predict the LS of node $\mathrm { X }$ as in section $\boxed { 2 . 3 }$ obtaining several 3D coordinates: $\mathbf { p } _ { X } = \mathbf { 0 } , \mathbf { p } _ { Y } , \mathbf { \overline { { \mathbf { p } } } } _ { T _ { i } } \in$ $\mathbb { R } ^ { 3 } , \dot { \forall } i \in [ 1 . . n ]$ , as well as the LS of node $\mathrm { Y }$ : $\mathbf { q } _ { Y } = \bar { \mathbf { 0 } _ { \cdot } } \mathbf { q } _ { X } , \mathbf { q } _ { Z _ { j } } \in \mathbb { R } ^ { 3 } , \forall j \in [ 1 . . m ]$ . By design, we have that $\| \mathbf { q } _ { X } \| = \| \mathbf { p } _ { Y } \|$ . These two sets are currently not aligned. To achieve this, we first rotate the LS of $\mathrm { X }$ such that $\mathbf { p } _ { Y }$ becomes $\left[ \left. \mathbf { p } _ { Y } \right. \quad 0 \quad 0 \right] ^ { \intercal }$ , while $\mathbf { p } _ { X }$ remains 0. Next, we rotate and translate the LS of $\mathrm { Y }$ such that $\mathbf { q } _ { Y }$ becomes $\mathbf { p } _ { Y }$ and $\mathbf { q } _ { X }$ becomes $\mathbf { p } _ { X } = \mathbf { 0 }$ . These two rotations have one degree of freedom each, which we set randomly. Exact formulas are in appendix B. Thus, the bond XY is now matched, but the torsional rotation is still arbitrary/random. The remaining step is to rotate the LS of $\mathrm { X }$ with an angle $\gamma$ such that all dihedrals $\angle ( X Y T _ { i } , X Y Z _ { j } )$ match their true counterparts. This is done by applying to all vectors $\mathbf { p } _ { T _ { i } }$ the same rotation of type: $\mathbf { H } _ { \gamma } : = \left[ \begin{array} { c c c } { 1 } & { 0 } & { 0 } \\ { 0 } & { \cos ( \gamma ) } & { - \sin ( \gamma ) } \\ { 0 } & { \sin ( \gamma ) } & { \cos ( \gamma ) } \end{array} \right] .$
|
| 137 |
+
|
| 138 |
+
How to compute $\gamma$ ? The current dihedrals $\Delta _ { i j } ^ { c u r } \ \stackrel { \mathsf { d e f } } { = } \ \angle ^ { c u r } ( X Y T _ { i } , X Y Z _ { j } )$ depend on the random torsional rotations from the initial assembly step of LS of $\mathbf { X }$ and of $\mathrm { Y }$ . After applying the $\mathbf { H } _ { \gamma }$ rotation, we obtain the new dihedral angles: $[ \Delta _ { i j } ^ { c u r } - \gamma ]$ mod $2 \pi$ that should match the ground truth dihedral angles $\Delta _ { i j } ^ { * } \ { \stackrel { \mathrm { d e f } } { = } } \ \angle ^ { * } ( X Y T _ { i } , X Y Z _ { j } )$ . This is equivalently written as $\mathbf { s } _ { i j } ^ { * } = \mathbf { A } _ { i j } ^ { c u r } \mathbf { s } _ { \gamma }$ , where $\mathbf { s } _ { \gamma } \ { \stackrel { \mathrm { d e f } } { = } } \ \left[ \cos ( \gamma ) \right]$ and Acurij def= $\begin{array} { r } { \mathbf { A } _ { i j } ^ { c u r } \stackrel { \mathrm { d e f } } { = } \left[ \begin{array} { c c } { \cos ( \Delta _ { i j } ^ { c u r } ) } & { \sin ( \Delta _ { i j } ^ { c u r } ) } \\ { \sin ( \Delta _ { i j } ^ { c u r } ) } & { - \cos ( \Delta _ { i j } ^ { c u r } ) } \end{array} \right] . } \end{array}$ . Let $\begin{array} { r } { \mathbf { s } ^ { * } \overset { \mathrm { d e f } } { = } \sum _ { i , j } c _ { i j } \mathbf { s } _ { i j } ^ { * } } \end{array}$ and $\mathbf { A } ^ { c u r } \ { \stackrel { \mathrm { d e } 1 } { = } }$ $\begin{array} { r } { \sum _ { i , j } c _ { i j } \mathbf { A } _ { i j } ^ { c u r } } \end{array}$ . The necessary condition for becomes $\mathbf { s } _ { \gamma } = \left( \mathbf { A } ^ { c u r } \right) ^ { \top } \mathbf { s } ^ { * }$ , which is also sufficient due i,j to proposition $\bigstar \bigstar \bigstar$ This implies it is enough to predict only the normalized $\frac { \mathbf { s } ^ { * } } { \| \mathbf { s } ^ { * } \| }$ and, in practice, we do that by predicting $\mathbf { s } _ { \alpha } \triangleq \left[ \cos ( \alpha ) \right]$ using a function commutative in $\mathrm { X }$ and $\mathrm { Y }$ (i.e., swapping $\mathrm { X }$ and $\mathrm { Y }$ does not change $\alpha$ ):
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\alpha = [ \phi ( \mathbf { h } _ { X } , \mathbf { h } _ { Y } , \mathbf { h } _ { m o l } ) + \phi ( \mathbf { h } _ { Y } , \mathbf { h } _ { X } , \mathbf { h } _ { m o l } ) ] { \bmod { 2 \pi } }
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where is a neural network (e.g., MLP). Finally, s = $\begin{array} { r } { { \bf s } _ { \gamma } = \left[ \begin{array} { c c } { \cos ( \gamma ) } \\ { \sin ( \gamma ) } \end{array} \right] = \frac { 1 } { \Vert ( { \bf A } ^ { c u r } ) ^ { \top } { \bf s } _ { \alpha } \Vert } \left( { \bf A } ^ { c u r } \right) ^ { \top } { \bf s } _ { \alpha } . } \end{array}$
|
| 145 |
+
|
| 146 |
+
# 2.5 An optimal transport (OT) loss function for diverse conformer generation
|
| 147 |
+
|
| 148 |
+
Loss per single conformer. Assume first that we predict a single conformer $\mathcal { C }$ . Based on all LS and torsion angle predictions, we deterministically compute all 1/2/3-hop distances and bond/torsion angles. If the corresponding ground truth conformer $\mathcal { C } ^ { * }$ is known, we feed those quantities into a negative log-likelihood loss, denote by ${ \mathcal { L } } ( { \mathcal { C } } , { \mathcal { C } } ^ { * } )$ and detailed in appendix $\bigtriangledown$ Similar to Senior et al. $\underline { { \lVert 2 0 2 0 \rVert } }$ , we fit distances using normal distributions and angles using von Mises distributions. This is a much faster approach compared to habitual RMSD losses that compare full conformers.
|
| 149 |
+
|
| 150 |
+
Node symmetries. Our current formulation has difficulties distinguishing pairs of symmetric graph nodes that are less than 3 hops away, e.g., hydrogen groups. We address this using a tailored matching loss detailed in appendix D and exemplified in fig. 6.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 6: Before (left) and after (right) introducing a matching loss to distinguish symmetric graph nodes. Hydrogen predictions in both groups are visibly improved.
|
| 154 |
+
|
| 155 |
+
Table 1: Results on the GEOM-DRUGS dataset. All models are without FF fine-tuning. "R" and "P" denote Recall and Precision. Note: OMEGA is an established commercial (C) software.
|
| 156 |
+
|
| 157 |
+
<table><tr><td rowspan=2 colspan=1>Models</td><td rowspan=1 colspan=2>COV -R(%) ↑</td><td rowspan=1 colspan=2>AMR -R(A)↓</td><td rowspan=1 colspan=2>COV - P(%) ↑</td><td rowspan=1 colspan=2>AMR -P(A)↓</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Median</td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Median</td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Median</td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Median</td></tr><tr><td rowspan=2 colspan=1>GraphDG (ML)CGCF (ML)</td><td rowspan=2 colspan=1>10.3754.35</td><td rowspan=1 colspan=1>0.00</td><td rowspan=2 colspan=1>1.9501.248</td><td rowspan=2 colspan=1>1.9331.224</td><td rowspan=2 colspan=1>3.9824.48</td><td rowspan=2 colspan=1>0.0015.00</td><td rowspan=2 colspan=1>2.4201.837</td><td rowspan=2 colspan=1>2.4201.829</td></tr><tr><td rowspan=1 colspan=1>56.74</td></tr><tr><td rowspan=1 colspan=1>RDKit/ETKDGOMEGA (C)</td><td rowspan=1 colspan=1>68.7881.64</td><td rowspan=1 colspan=1>76.0497.25</td><td rowspan=1 colspan=1>1.0420.851</td><td rowspan=1 colspan=1>0.9820.771</td><td rowspan=1 colspan=1>71.0677.18</td><td rowspan=1 colspan=1>88.2496.15</td><td rowspan=1 colspan=1>1.0360.951</td><td rowspan=1 colspan=1>0.9430.854</td></tr><tr><td rowspan=1 colspan=1>GEOMOL (s= 9.5)GEOMOL (s = 5)</td><td rowspan=1 colspan=1>86.0782.43</td><td rowspan=1 colspan=1>98.0695.10</td><td rowspan=1 colspan=1>0.8460.862</td><td rowspan=1 colspan=1>0.8200.837</td><td rowspan=1 colspan=1>71.7878.52</td><td rowspan=1 colspan=1>83.7794.40</td><td rowspan=1 colspan=1>1.0390.933</td><td rowspan=1 colspan=1>0.9820.856</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 2: Results on the GEOM-QM9 dataset. See caption of table 1.
|
| 160 |
+
|
| 161 |
+
<table><tr><td rowspan=2 colspan=1>Models</td><td rowspan=1 colspan=2>COV -R (%) ↑</td><td rowspan=1 colspan=2>AMR -R(A)↓</td><td rowspan=1 colspan=2>COV - P (%) ↑</td><td rowspan=1 colspan=2>AMR -P(A)↓</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Median</td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Median</td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Median</td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Median</td></tr><tr><td rowspan=1 colspan=1>GraphDG (ML)CGCF (ML)</td><td rowspan=1 colspan=1>74.6669.47</td><td rowspan=1 colspan=1>100.0096.15</td><td rowspan=1 colspan=1>0.3730.425</td><td rowspan=1 colspan=1>0.3370.374</td><td rowspan=1 colspan=1>63.0338.20</td><td rowspan=1 colspan=1>77.6033.33</td><td rowspan=1 colspan=1>0.4500.711</td><td rowspan=1 colspan=1>0.4040.695</td></tr><tr><td rowspan=1 colspan=1>RDKit/ETKDGOMEGA (C)</td><td rowspan=1 colspan=1>85.1385.51</td><td rowspan=1 colspan=1>100.00100.00</td><td rowspan=1 colspan=1>0.2350.177</td><td rowspan=1 colspan=1>0.1990.126</td><td rowspan=1 colspan=1>86.8082.86</td><td rowspan=1 colspan=1>100.00100.00</td><td rowspan=1 colspan=1>0.2320.224</td><td rowspan=1 colspan=1>0.2050.186</td></tr><tr><td rowspan=1 colspan=1>GEOMOL (s = 5)</td><td rowspan=1 colspan=1>91.52</td><td rowspan=1 colspan=1>100.00</td><td rowspan=1 colspan=1>0.225</td><td rowspan=1 colspan=1>0.193</td><td rowspan=1 colspan=1>86.71</td><td rowspan=1 colspan=1>100.00</td><td rowspan=1 colspan=1>0.270</td><td rowspan=1 colspan=1>0.241</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Total OT loss per ensemble of conformers. In practice, our model generates a set of conformers $\{ \mathcal { C } _ { k } \} _ { k \in [ 1 \ldots K ] }$ that needs to match a variable sized set of low-energy ground truth conformers, $\{ \mathcal { C } _ { l } ^ { * } \} _ { l \in [ 1 , . . L ] }$ . However, we do not know a priori the number $L$ of true conformers or the matching between generated and true conformers. We also wish to avoid expensive and problematic adversarial training. Our solution is an OT-based, minimization-only, loss function:
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\mathcal { L } ^ { e n s e m b l e } \stackrel { \mathrm { d e f } } { = } E M D _ { \mathcal { L } ( \cdot , \cdot ) } ( \{ \mathcal { C } _ { k } \} _ { k } , \{ \mathcal { C } _ { l } ^ { * } \} _ { l } ) = \operatorname* { m i n } _ { { \bf T } \in \mathcal { Q } _ { K , L } } \sum _ { k , l } T _ { k l } \mathcal { L } ( \mathcal { C } _ { k } , \mathcal { C } _ { l } ^ { * } )
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Distance, . The min $\mathbf { T }$ is the transpization w.r.t. t plan satisfying is computed qui $\mathcal { Q } _ { K , L } \overset { \mathtt { d e f } } { = } \{ \mathbf { T } \in \mathbb { R } _ { + } ^ { K \times L }$ $\begin{array} { r } { { \bf T 1 } _ { L } = \frac { 1 } { K } { \bf 1 } _ { K } , { \bf T } ^ { T } { \bf 1 } _ { K } = \frac { 1 } { L } { \bf 1 } _ { L } \Big \} } \end{array}$ $\mathbf { T }$ Distance and the POT library [Flamary and Courty, 2017].
|
| 170 |
+
|
| 171 |
+
# 2.6 Full conformer assembly at test time
|
| 172 |
+
|
| 173 |
+
Knowing all true LSs and torsion angles is, in theory, enough for a deterministic unique SE(3)- invariant reconstruction of the full conformer. However, in practice, these predictions might have small errors that accumulate, e.g., in rings. To mitigate this issue, we deterministically build the full conformer (only at test time) by first predicting a smoothed structure of (fused) rings separately, and then assembling the full conformer following any graph traversal order (any order gives the same conformer, so this procedure does not break the non-autoregressive behavior). We detail this step in appendix E.
|
| 174 |
+
|
| 175 |
+
# 3 Experiments
|
| 176 |
+
|
| 177 |
+
We empirically evaluate GEOMOL on the task of low-energy conformer ensemble generation for small and drug-like molecules. We largely follow the evaluation protocols of recent methods [Simm and Hernandez-Lobato, 2020, Xu et al., 2021], but also introduce new useful metrics.
|
| 178 |
+
|
| 179 |
+
Datasets & splits. We use two popular datasets: GEOM-QM9 [Ramakrishnan et al., 2014] and GEOM-DRUGS [Axelrod and Gomez-Bombarelli, $\textcircled { 2 0 2 0 2 }$ . Statistics and other details are in fig. 10 and in Mansimov et al. [2019]. Datasets are preprocessed as described in appendix $\boxed { \mathbf { G } }$ We split them randomly based on molecules into train/validation/test $( 8 0 \% / 1 0 \% / 1 0 \% )$ ). At the end, for each dataset, we sample 1000 random test molecules as the final test set. Thus, the splits contain 106586/13323/1000 and 243473/30433/1000 molecules for GEOM-QM9 and GEOM-DRUGS, resp.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 7: Left: Examples of generated structures. For every model, we show the best generated conformer, i.e., with the smallest RMSD to the shown ground truth. More examples are in appendix $\mathbb { N } .$ Right/top: Number of rotatable bonds per DRUGS test molecule versus COV Recall ( $9 5 \%$ confidence intervals). Right/bottom: conformer generation times for each model.
|
| 183 |
+
|
| 184 |
+
Baselines. We compare to established or recent baselines (discussed in section 1). ETKDG/RDKit [Riniker and Landrum, $\boxed { 2 0 1 5 } \|$ is likely the most popular open-source software, a stochastic DG-based method developed in the RDKit package. OMEGA [Hawkins et al., 2010, Hawkins and Nicholls, 2012, Friedrich et al., 2017], a rule-based method, is one of the most established commercial software, with more than a decade of continuous development. OMEGA and ETKDG are some of the fastest and best scaling existing approaches. Finally, we compare with the recent ML models of highest reported quality: GraphDG [Simm and Hernandez-Lobato, $\underline { 2 0 2 0 } \|$ and CGCF [Xu et al., 2021].
|
| 185 |
+
|
| 186 |
+
Evaluation metrics. We follow prior work [Simm and Hernandez-Lobato, 2020, Xu et al., 2021] and use root-mean-square deviation of atomic positions (RMSD) to compare any two conformers. This is defined as the normalized Frobenius norm of the two corresponding matrices of 3D coordinates after being SE(3)-aligned a priori (using the Kabsch alignment algorithm $\pm \pm \mathrm { { \mathbb { K } a b s c h } } \mathrm { { \mathbb { 1 9 7 6 } } } \mathrm { { \mathrm { I } } } .$ ). Next, we introduce four types of metrics to compare two conformer ensembles, generated by a method, $\{ \mathcal { C } _ { k } \} _ { k \in [ 1 \ldots K ] }$ , and ground truth, $\{ \mathcal { C } _ { l } ^ { * } \} _ { l \in [ 1 , . . L ] }$ . These metrics follow the established classification metrics of Precision and Recall and are defined for a given threshold $\delta > 0$ as:
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
\begin{array} { l } { \displaystyle \mathrm { C O V - R } ( \mathrm { R e c a l l } ) \stackrel { \mathrm { d e f } } { = } \frac { 1 } { L } | \{ l \in [ 1 . . L ] : \exists k \in [ 1 . . K ] , R M S D ( \mathscr { C } _ { k } , \mathscr { C } _ { l } ^ { * } ) < \delta \} | } \\ { \displaystyle \mathrm { A M R - R } ( \mathrm { R e c a l l } ) \stackrel { \mathrm { d e f } } { = } \frac { 1 } { L } \sum _ { l \in [ 1 . . L ] } \underset { k \in [ 1 . . K ] } { \operatorname* { m i n } } R M S D ( \mathscr { C } _ { k } , \mathscr { C } _ { l } ^ { * } ) } \end{array}
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
where AMR is "Average Minimum RMSD", COV is "Coverage", and $C O V - P$ (Precision) and AMR - $P$ (Precision) are defined as in eq. $\textcircled{5}$ , but with the generated and ground truth conformer sets swapped. The recall metrics measure how many of the ground truth conformers are correctly predicted, while the precision metrics indicate how many generated structures are of high quality. Specifically, in terms of recall, COV measures the percentage of correct generated conformers from the ground truth set (where a correct conformer is defined as one within an RMSD threshold of the true conformer), while AMR measures the average RMSD of each generated conformer with its closest groun truth match. Depending on the application, either of the metrics might be of greater interest. We follow Xu et al. [2021] and set $\delta = 0 . { \overset { - } { 5 } } { \overset { \circ } { \mathrm { A } } }$ for GEOM-QM9 and $\delta = 1 . 2 \bar { 5 } \mathring \mathrm { A }$ for GEOM-DRUGS.
|
| 193 |
+
|
| 194 |
+
Training and test details. For each input molecule having $K$ ground truth conformers, we generate exactly $2 K$ conformers using any of the considered methods. For GEOMOL, this is done by sampling different random noise vectors that are appended to node and edge features before the MPNN (eq. $\mathbb { \underline { { \left( \mathrm { 1 } \right) } } }$ ). At train time, our model uses a standard deviation (std) $s$ (see eq. $( 1 )$ ) of 5 for both GEOM-QM9 and GEOM-DRUGS. At test time, GEOMOL can use the same or different $s$ values, depending on the downstream application, i.e., higher $s$ results in more diverse conformers, while lower $s$ gives more quality (better precision). For OMEGA, it is not possible to specify a desired number of conformers. So, we tune the RMSD threshold (which decides how many conformers to keep) such that the total generated conformers by OMEGA are approximately $2 K$ . For GEOM-QM9, this corresponds to no RMSD cutoff (i.e., OMEGA generates all possible conformers), and for GEOM-DRUGS, this corresponds to a cutoff of $0 . 7 \mathring \mathrm { A }$ (meaning no two generated conformers will have a distance smaller than this cutoff). We discuss hyper-parameters and additional training details in appendix H.
|
| 195 |
+
|
| 196 |
+
Results & discussion. Results are shown in table $^ 1$ and table $2 ,$ and confidence intervals are in appendix $\mathbb { L }$ As noted above, GEOMOL can be run with different noise std at test time, depending on which metric the user is interested in. Even though OMEGA is an established commercial software with more than a decade of continuous development, our model remarkably frequently outperforms it. Note that OMEGA fails to generate any conformers for $7 \%$ of the QM9 test set (many of which include fused rings). Moreover, we also outperform the popular RDKit/ETKDG open-source model (except for AMR-P on QM9) and very recent ML models such as GraphDG and CGCF, sometimes by a large margin. For a qualitative insight, we show generated examples in fig. 7 and appendix N.
|
| 197 |
+
|
| 198 |
+
Additionally, we show in fig. $\perp$ how COV Recall results are affected by the increasing number of rotatable bonds in the test molecule. As expected, having more rotatable bonds makes the problem harder, and this affects all baselines, but GEOMOL maintains a reasonable coverage even for more difficult molecules. Moreover, in appendix K and table 8 we show energy calculations of the generated conformers to support their plausibility. Additionally, results with energy-based relaxations are given in appendix J.
|
| 199 |
+
|
| 200 |
+
Running time. Fig. 7 shows conformer generation test running times. Our model is the fastest method from the considered baselines, being much faster than CGCF or ETKDG/RDKit. Moreover, GEOMOL scales favorably for molecules with increasing number of rotatable bonds.
|
| 201 |
+
|
| 202 |
+
# 4 Conclusion
|
| 203 |
+
|
| 204 |
+
We proposed GEOMOL, an end-to-end generative approach for molecular 3D conformation ensembles that explicitly models various molecular geometric aspects such as torsion angles or chirality. We expect that such differentiable structure generators will significantly impact small molecule conformer generation along with many related applications (e.g., protein-ligand binding), thus speeding up areas such as drug discovery. GEOMOL’s full source code will be made publicly available.
|
| 205 |
+
|
| 206 |
+
Limitations & future work. A few current limitations are highlighted and left for future extensions (see also discussion in appendix $\bigstar$ . First, our model does not currently support disconnected molecular graphs, e.g., ionic salts, but it can be applied to each connected component, followed by a 3D alignment. Next, our approach would benefit from explicit modeling of long distance interactions, especially for macrocycles or large molecules. This remains to be addressed in an efficient manner. Third, explicitly using ground truth energy values could further improve GEOMOL. Last, we look forward to fine-tune GEOMOL on applications such as generating molecular docking poses or descriptors for 4D QSAR.
|
| 207 |
+
|
| 208 |
+
# Acknowledgments and Disclosure of Funding
|
| 209 |
+
|
| 210 |
+
OEG thanks Bracha Laufer, Tian Xie, Xiang Fu, Peter Mikhael, and the rest of the RB and TJ group members for their helpful comments and suggestions. LP thanks Camille Bilodeau and the rest of the WHG, KFJ, and CWC research groups for their useful discussions. We also thank Pat Walters, Simon Axelrod, and Rafael Gomez-Bombarelli for their insightful feedback as well as Minkai Xu and Shitong Luo for helping run the CGCF model. Both OEG and LP are funded by the Machine Learning for Pharmaceutical Discovery and Synthesis consortium.
|
| 211 |
+
|
| 212 |
+
# References
|
| 213 |
+
|
| 214 |
+
Mohammed AlQuraishi. End-to-end differentiable learning of protein structure. Cell systems, 8(4): 292–301, 2019.
|
| 215 |
+
|
| 216 |
+
Simon Axelrod and Rafael Gomez-Bombarelli. Geom: Energy-annotated molecular conformations for property prediction and molecular generation. arXiv preprint arXiv:2006.05531, 2020a.
|
| 217 |
+
|
| 218 |
+
Simon Axelrod and Rafael Gomez-Bombarelli. Molecular machine learning with conformer ensembles. arXiv preprint arXiv:2012.08452, 2020b.
|
| 219 |
+
|
| 220 |
+
Andrew J Ballard, Stefano Martiniani, Jacob D Stevenson, Sandeep Somani, and David J Wales. Exploiting the potential energy landscape to sample free energy. Wiley Interdisciplinary Reviews: Computational Molecular Science, 5(3):273–289, 2015.
|
| 221 |
+
|
| 222 |
+
Arghya Barman, Bruce Batiste, and Donald Hamelberg. Pushing the limits of a molecular mechanics force field to probe weak ch··· $\pi$ interactions in proteins. Journal of chemical theory and computation, 11(4):1854–1863, 2015.
|
| 223 |
+
|
| 224 |
+
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.
|
| 225 |
+
|
| 226 |
+
Lucian Chan, Garrett M Morris, and Geoffrey R Hutchison. Understanding conformational entropy in small molecules. Journal of Chemical Theory and Computation, 17(4):2099–2106, 2021.
|
| 227 |
+
|
| 228 |
+
Gordon M Crippen, Timothy F Havel, et al. Distance geometry and molecular conformation, volume 74. Research Studies Press Taunton, 1988.
|
| 229 |
+
|
| 230 |
+
Marco De Vivo, Matteo Masetti, Giovanni Bottegoni, and Andrea Cavalli. Role of molecular dynamics and related methods in drug discovery. Journal of medicinal chemistry, 59(9):4035–4061, 2016.
|
| 231 |
+
|
| 232 |
+
Rémi Flamary and Nicolas Courty. Pot python optimal transport library. GitHub: https://github. com/rflamary/POT, 2017.
|
| 233 |
+
|
| 234 |
+
Nils-Ole Friedrich, Christina de Bruyn Kops, Florian Flachsenberg, Kai Sommer, Matthias Rarey, and Johannes Kirchmair. Benchmarking commercial conformer ensemble generators. Journal of chemical information and modeling, 57(11):2719–2728, 2017.
|
| 235 |
+
|
| 236 |
+
Pablo Gainza, Freyr Sverrisson, Frederico Monti, Emanuele Rodola, D Boscaini, MM Bronstein, and BE Correia. Deciphering interaction fingerprints from protein molecular surfaces using geometric deep learning. Nature Methods, 17(2):184–192, 2020.
|
| 237 |
+
|
| 238 |
+
Vikas Garg, Stefanie Jegelka, and Tommi Jaakkola. Generalization and representational limits of graph neural networks. In International Conference on Machine Learning, pages 3419–3430. PMLR, 2020.
|
| 239 |
+
|
| 240 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1263–1272. JMLR. org, 2017.
|
| 241 |
+
|
| 242 |
+
Stefan Grimme. Exploration of chemical compound, conformer, and reaction space with metadynamics simulations based on tight-binding quantum chemical calculations. Journal of chemical theory and computation, 15(5):2847–2862, 2019.
|
| 243 |
+
|
| 244 |
+
Cristiano RW Guimaraes, Alan M Mathiowetz, Marina Shalaeva, Gilles Goetz, and Spiros Liras. Use of 3d properties to characterize beyond rule-of-5 property space for passive permeation. Journal of chemical information and modeling, 52(4):882–890, 2012.
|
| 245 |
+
|
| 246 |
+
Thomas A Halgren. Merck molecular force field. i. basis, form, scope, parameterization, and performance of mmff94. Journal of computational chemistry, 17(5-6):490–519, 1996.
|
| 247 |
+
|
| 248 |
+
Thomas A Halgren. Mmff vi. mmff94s option for energy minimization studies. Journal of Computational Chemistry, 20(7):720–729, 1999.
|
| 249 |
+
|
| 250 |
+
William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 1025–1035, 2017.
|
| 251 |
+
|
| 252 |
+
Timothy F Havel. Distance geometry: Theory, algorithms, and chemical applications. Encyclopedia of Computational Chemistry, 120:723–742, 1998.
|
| 253 |
+
|
| 254 |
+
Timothy F Havel, Gordon M Crippen, Irwin D Kuntz, and Jeffrey M Blaney. The combinatorial distance geometry method for the calculation of molecular conformation ii. sample problems and computational statistics. Journal of theoretical biology, 104(3):383–400, 1983a.
|
| 255 |
+
|
| 256 |
+
Timothy F Havel, Irwin D Kuntz, and Gordon M Crippen. The combinatorial distance geometry method for the calculation of molecular conformation. i. a new approach to an old problem. Journal of theoretical biology, 104(3):359–381, 1983b.
|
| 257 |
+
|
| 258 |
+
Paul CD Hawkins. Conformation generation: the state of the art. Journal of Chemical Information and Modeling, 57(8):1747–1756, 2017.
|
| 259 |
+
|
| 260 |
+
Paul CD Hawkins and Anthony Nicholls. Conformer generation with omega: learning from the data set and the analysis of failures. Journal of chemical information and modeling, 52(11):2919–2936, 2012.
|
| 261 |
+
|
| 262 |
+
Paul CD Hawkins, A Geoffrey Skillman, Gregory L Warren, Benjamin A Ellingson, and Matthew T Stahl. Conformer generation with omega: algorithm and validation using high quality structures from the protein databank and cambridge structural database. Journal of chemical information and modeling, 50(4):572–584, 2010.
|
| 263 |
+
|
| 264 |
+
John Ingraham, Adam Riesselman, Chris Sander, and Debora Marks. Learning protein structure with a differentiable simulator. In International Conference on Learning Representations, 2018.
|
| 265 |
+
|
| 266 |
+
Wolfgang Kabsch. A solution for the best rotation to relate two sets of vectors. Acta Crystallographica Section A: Crystal Physics, Diffraction, Theoretical and General Crystallography, 32(5):922–923, 1976.
|
| 267 |
+
|
| 268 |
+
Ilana Y Kanal, John A Keith, and Geoffrey R Hutchison. A sobering assessment of small-molecule force field methods for low energy conformer predictions. International Journal of Quantum Chemistry, 118(5):e25512, 2018.
|
| 269 |
+
|
| 270 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (ICLR), 2017.
|
| 271 |
+
|
| 272 |
+
Johannes Klicpera, Janek Groß, and Stephan Günnemann. Directional message passing for molecular graphs. In International Conference on Learning Representations, 2019.
|
| 273 |
+
|
| 274 |
+
Ashutosh Kumar and Kam YJ Zhang. Advances in the development of shape similarity methods and their application in drug discovery. Frontiers in chemistry, 6:315, 2018.
|
| 275 |
+
|
| 276 |
+
David Lagorce, Tania Pencheva, Bruno O Villoutreix, and Maria A Miteva. Dg-ammos: A new tool to generate 3d conformation of small molecules using d istance g eometry and a utomated m olecular m echanics o ptimization for in silico s creening. BMC Chemical Biology, 9(1):1–10, 2009.
|
| 277 |
+
|
| 278 |
+
Dominik Lemm, Guido Falk von Rudorff, and O Anatole von Lilienfeld. Energy-free machine learning predictions of ab initio structures. arXiv preprint arXiv:2102.02806, 2021.
|
| 279 |
+
|
| 280 |
+
Yi Liu, Limei Wang, Meng Liu, Xuan Zhang, Bora Oztekin, and Shuiwang Ji. Spherical message passing for 3d graph networks. arXiv preprint arXiv:2102.05013, 2021.
|
| 281 |
+
|
| 282 |
+
Elman Mansimov, Omar Mahmood, Seokho Kang, and Kyunghyun Cho. Molecular geometry prediction using a deep generative graph neural network. Scientific reports, 9(1):1–13, 2019.
|
| 283 |
+
|
| 284 |
+
Mark McGann. Fred pose prediction and virtual screening accuracy. Journal of chemical information and modeling, 51(3):578–596, 2011.
|
| 285 |
+
|
| 286 |
+
Frank Noé, Simon Olsson, Jonas Köhler, and Hao Wu. Boltzmann generators: Sampling equilibrium states of many-body systems with deep learning. Science, 365(6457), 2019.
|
| 287 |
+
|
| 288 |
+
Lagnajit Pattanaik, Octavian E Ganea, Ian Coley, Klavs F Jensen, William H Green, and Connor W Coley. Message passing networks for molecules with tetrahedral chirality. arXiv preprint arXiv:2012.00094, 2020a.
|
| 289 |
+
|
| 290 |
+
Lagnajit Pattanaik, John B Ingraham, Colin A Grambow, and William H Green. Generating transition states of isomerization reactions with deep learning. Physical Chemistry Chemical Physics, 22 (41):23618–23626, 2020b.
|
| 291 |
+
|
| 292 |
+
Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1(1):1–7, 2014.
|
| 293 |
+
|
| 294 |
+
Anthony K Rappé, Carla J Casewit, KS Colwell, William A Goddard III, and W Mason Skiff. Uff, a full periodic table force field for molecular mechanics and molecular dynamics simulations. Journal of the American chemical society, 114(25):10024–10035, 1992.
|
| 295 |
+
|
| 296 |
+
Sereina Riniker and Gregory A Landrum. Better informed distance geometry: using what we know to improve conformation generation. Journal of chemical information and modeling, 55(12): 2562–2574, 2015.
|
| 297 |
+
|
| 298 |
+
Kristof T Schütt, Huziel E Sauceda, P-J Kindermans, Alexandre Tkatchenko, and K-R Müller. Schnet–a deep learning architecture for molecules and materials. The Journal of Chemical Physics, 148(24):241722, 2018.
|
| 299 |
+
|
| 300 |
+
Kristof T Schütt, Oliver T Unke, and Michael Gastegger. Equivariant message passing for the prediction of tensorial properties and molecular spectra. arXiv preprint arXiv:2102.03150, 2021.
|
| 301 |
+
|
| 302 |
+
Christof H Schwab. Conformations and 3d pharmacophore searching. Drug Discovery Today: Technologies, 7(4):e245–e253, 2010.
|
| 303 |
+
|
| 304 |
+
Andrew W Senior, Richard Evans, John Jumper, James Kirkpatrick, Laurent Sifre, Tim Green, Chongli Qin, Augustin Žídek, Alexander WR Nelson, Alex Bridgland, et al. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792):706–710, 2020.
|
| 305 |
+
|
| 306 |
+
Jihyun Shim and Alexander D MacKerell Jr. Computational ligand-based rational design: role of conformational sampling and force fields in model development. MedChemComm, 2(5):356–370, 2011.
|
| 307 |
+
|
| 308 |
+
Gregor Simm and Jose Miguel Hernandez-Lobato. A generative model for molecular distance geometry. In International Conference on Machine Learning, pages 8949–8958. PMLR, 2020.
|
| 309 |
+
|
| 310 |
+
Freyr Sverrisson, Jean Feydy, Bruno Correia, and Michael Bronstein. Fast end-to-end learning on protein surfaces. bioRxiv, 2020.
|
| 311 |
+
|
| 312 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6000–6010, 2017.
|
| 313 |
+
|
| 314 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 315 |
+
|
| 316 |
+
Jitender Verma, Vijay M Khedkar, and Evans C Coutinho. 3d-qsar in drug design-a review. Current topics in medicinal chemistry, 10(1):95–115, 2010.
|
| 317 |
+
|
| 318 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? International Conference on Learning Representations (ICLR), 2019.
|
| 319 |
+
|
| 320 |
+
Minkai Xu, Shitong Luo, Yoshua Bengio, Jian Peng, and Jian Tang. Learning neural generative dynamics for molecular conformation generation. International Conference on Learning Representations (ICLR), 2021.
|
| 321 |
+
|
| 322 |
+
Kevin Yang, Kyle Swanson, Wengong Jin, Connor Coley, Philipp Eiden, Hua Gao, Angel GuzmanPerez, Timothy Hopper, Brian Kelley, Miriam Mathea, et al. Analyzing learned molecular representations for property prediction. Journal of chemical information and modeling, 59(8): 3370–3388, 2019.
|
md/train/hXWPpJedrVP/hXWPpJedrVP.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dataset Distillation with Infinitely Wide Convolutional Networks
|
| 2 |
+
|
| 3 |
+
# Timothy Nguyen† ∗
|
| 4 |
+
|
| 5 |
+
Roman Novak♠
|
| 6 |
+
|
| 7 |
+
Lechao Xiao♠
|
| 8 |
+
|
| 9 |
+
DeepMind† Google Research, Brain Team♠ timothycnguyen@deepmind.com {romann, xlc, jaehlee}@google.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
The effectiveness of machine learning algorithms arises from being able to extract useful features from large amounts of data. As model and dataset sizes increase, dataset distillation methods that compress large datasets into significantly smaller yet highly performant ones will become valuable in terms of training efficiency and useful feature extraction. To that end, we apply a novel distributed kernel-based meta-learning framework to achieve state-of-the-art results for dataset distillation using infinitely wide convolutional neural networks. For instance, using only 10 datapoints $0 . 0 2 \%$ of original dataset), we obtain over $65 \%$ test accuracy on CIFAR10 image classification task, a dramatic improvement over the previous best test accuracy of $40 \%$ . Our state-of-the-art results extend across many other settings for MNIST, Fashion-MNIST, CIFAR-10, CIFAR-100, and SVHN. Furthermore, we perform some preliminary analyses of our distilled datasets to shed light on how they differ from naturally occurring data.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Deep learning has become extraordinarily successful in a wide variety of settings through the availability of large datasets [Krizhevsky et al., 2012, Devlin et al., 2018, Brown et al., 2020, Dosovitskiy et al., 2020]. Such large datasets enable a neural network to learn useful representations of the data that are adapted to solving tasks of interest. Unfortunately, it can be prohibitively costly to acquire such large datasets and train a neural network for the requisite amount of time.
|
| 18 |
+
|
| 19 |
+
One way to mitigate this problem is by constructing smaller datasets that are nevertheless informative. Some direct approaches to this include choosing a representative subset of the dataset (i.e. a coreset) or else performing a low-dimensional projection that reduces the number of features. However, such methods typically introduce a tradeoff between performance and dataset size, since what they produce is a coarse approximation of the full dataset. By contrast, the approach of dataset distillation is to synthesize datasets that are more informative than their natural counterparts when equalizing for dataset size [Wang et al., 2018, Bohdal et al., 2020, Nguyen et al., 2021, Zhao and Bilen, 2021]. Such resulting datasets will not arise from the distribution of natural images but will nevertheless capture features useful to a neural network, a capability which remains mysterious and is far from being well-understood [Ilyas et al., 2019, Huh et al., 2016, Hermann and Lampinen, 2020].
|
| 20 |
+
|
| 21 |
+
The applications of such smaller, distilled datasets are diverse. For nonparametric methods that scale poorly with the training dataset (e.g. nearest-neighbors or kernel-ridge regression), having a reduced dataset decreases the associated memory and inference costs. For the training of neural networks, such distilled datasets have found several applications in the literature, including increasing the effectiveness of replay methods in continual learning [Borsos et al., 2020] and helping to accelerate neural architecture search [Zhao et al., 2021, Zhao and Bilen, 2021].
|
| 22 |
+
|
| 23 |
+
In this paper, we perform a large-scale extension of the methods of Nguyen et al. [2021] to obtain new state-of-the-art (SOTA) dataset distillation results. Specifically, we apply the algorithms KIP (Kernel Inducing Points) and LS (Label Solve), first developed in Nguyen et al. [2021], to infinitely wide convolutional networks by implementing a novel, distributed meta-learning framework that draws upon hundreds of accelerators per training. The need for such resources is necessitated by the computational costs of using infinitely wide neural networks built out of components occurring in modern image classification models: convolutional and pooling layers (see $\ S _ { \mathrm { B } }$ for details). The consequence is that we obtain distilled datasets that are effective for both kernel ridge-regression and neural network training.
|
| 24 |
+
|
| 25 |
+
Additionally, we initiate a preliminary study of the images and labels which KIP learns. We provide a visual and quantitative analysis of the data learned and find some surprising results concerning their interpretability and their dimensional and spectral properties. Given the efficacy of KIP and LS learned data, we believe a better understanding of them would aid in the understanding of feature learning in neural networks.
|
| 26 |
+
|
| 27 |
+
To summarize, our contributions are as follows:
|
| 28 |
+
|
| 29 |
+
1. We achieve SOTA dataset distillation results on a wide variety of datasets (MNIST, FashionMNIST, SVHN, CIFAR-10, CIFAR-100) for both kernel ridge-regression and neural network training. In several instances, our results achieve an impressively wide margin over prior art, including over $2 5 \%$ and $37 \%$ absolute gain in accuracy on CIFAR-10 and SVHN image classification, respectively, when using only 10 images (Tables 1, 2, A11).
|
| 30 |
+
2. We develop a novel, distributed meta-learning framework specifically tailored to the computational burdens of sophisticated neural kernels (§2.1).
|
| 31 |
+
3. We highlight and analyze some of the peculiar features of the distilled datasets we obtain, illustrating how they differ from natural data (§4).
|
| 32 |
+
4. We open source the distilled datasets, which used thousands of GPU hours, for the research community to further investigate at https://github.com/google-research/ google-research/tree/master/kip.
|
| 33 |
+
|
| 34 |
+
# 2 Setup
|
| 35 |
+
|
| 36 |
+
Background on infinitely wide convolutional networks. Recent literature has established that Bayesian and gradient-descent trained neural networks converge to Gaussian Processes (GP) as the number of hidden units in intermediary layers approaches infinity (see $\ S 5$ ). These results hold for many different architectures, including convolutional networks, which converge to a particular GP in the limit of infinite channels [Novak et al., 2019, Garriga-Alonso et al., 2019, Arora et al., 2019]. Bayesian networks are described by the Neural Network Gaussian Process (NNGP) kernel, while gradient descent networks are described by the Neural Tangent Kernel (NTK). Since we are interested in synthesizing datasets that can be used with both kernel methods and common gradient-descent trained neural networks, we focus on NTK in this work.
|
| 37 |
+
|
| 38 |
+
Infinitely wide networks have been shown to achieve SOTA (among non-parametric kernels) results on image classification tasks [Novak et al., 2019, Arora et al., 2019, Li et al., 2019, Shankar et al., 2020, Bietti, 2021] and even rival finite-width networks in certain settings [Arora et al., 2020, Lee et al., 2020]. This makes such kernels especially suitable for our task. As convolutional models, they encode useful inductive biases of locality and translation invariance [Novak et al., 2019], which enable good generalization. Moreover, flexible and efficient computation of these kernels are possible due to the Neural Tangent library [Novak et al., 2020].
|
| 39 |
+
|
| 40 |
+
Specific models considered. The central neural network (and corresponding infinite-width model) we consider is a simple 4-layer convolutional network with average pooling layers that we refer to as ConvNet throughout the text. This architecture is a slightly modified version of the default model used by Zhao and Bilen [2021], Zhao et al. [2021] and was chosen for ease of baselining (see $\ S$ for details). In several other settings we also consider convolutional networks without pooling layers ConvVec,2 and networks with no convolutions and only fully-connected layers FC. Depth of architecture (as measured by number of hidden layers) is indicated by an integer suffix.
|
| 41 |
+
|
| 42 |
+
Background on algorithms. We review the Kernel Inducing Points (KIP) and Label Solve (LS) algorithms introduced by Nguyen et al. [2021]. Given a kernel $K$ , the kernel ridge-regression (KRR) loss function trained on a support dataset $( X _ { s } , y _ { s } )$ and evaluated on a target dataset $( X _ { t } , y _ { t } )$ is
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
L ( X _ { s } , y _ { s } ) = \frac { 1 } { 2 } \left\| y _ { t } - K _ { X _ { t } X _ { s } } ( K _ { X _ { s } X _ { s } } + \lambda I ) ^ { - 1 } y _ { s } \right\| _ { 2 } ^ { 2 } ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where if $U$ and $V$ are sets, $K _ { U V }$ is the matrix of kernel elements $( K ( u , v ) ) _ { u \in U , v \in V }$ . Here $\lambda > 0$ is a fixed regularization parameter. The KIP algorithm consists of minimizing (1) with respect to the support set (either just the $X _ { s }$ or along with the labels $y _ { s }$ ). Here, we sample $( X _ { t } , y _ { t } )$ from a target dataset $\mathcal { D }$ at every (meta)step, and update the support set using gradient-based methods. Additional variations include augmenting the $X _ { t }$ or sampling a different kernel $K$ (from a fixed family of kernels) at each step.
|
| 49 |
+
|
| 50 |
+
The Label Solve algorithm consists of solving for the least-norm minimizer of (1) with respect to $y _ { s }$ This yields the labels
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
y _ { s } ^ { * } = \Big ( K _ { X _ { t } X _ { s } } ( K _ { X _ { s } X _ { s } } + \lambda I ) ^ { - 1 } \Big ) ^ { + } y _ { t } ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $A ^ { + }$ denotes the pseudo-inverse of the matrix $A$ . Note that here $( X _ { t } , y _ { t } ) = \mathcal { D }$ , i.e. the labels are solved using the whole target set.
|
| 57 |
+
|
| 58 |
+
In our applications of KIP and Label Solve, the target dataset $\mathcal { D }$ is always significantly larger than the support set $( X _ { s } , y _ { s } )$ . Hence, the learned support set or solved labels can be regarded as distilled versions of their respective targets. We also initialize our support images to be a subset of natural images, though they could also be initialized randomly.
|
| 59 |
+
|
| 60 |
+
Based on the infinite-width correspondence outlined above and in $\ S$ , dataset distillation using KIP or LS that is optimized for KRR should extend to the corresponding finite-width neural network training. Our experimental results in $\ S$ validate this expectation across many settings.
|
| 61 |
+
|
| 62 |
+
# 2.1 Client-Server Distributed Workflow
|
| 63 |
+
|
| 64 |
+
We invoke a client-server model of distributed computation3, in which a server distributes independent workloads to a large pool of client workers that share a queue for receiving and sending work. Our distributed implementation of the KIP algorithm has two distinct stages:
|
| 65 |
+
|
| 66 |
+
Forward pass: In this step, we compute the support-support and target-support matrices $K ( X _ { s } , X _ { s } )$ and $K ( X _ { t } , X _ { s } )$ . To do so, we partition $X _ { s } \times X _ { s }$ and $X _ { t } \times X _ { s }$ into pairs of images $( x , x ^ { \prime } )$ , each with batch size $B$ . We send such pairs to workers compute the respective matrix block $K ( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } )$ . The server aggregates all these blocks to obtain the $K ( \bar { X } _ { s } , X _ { s } )$ and $K ( X _ { t } , X _ { s } )$ matrices.
|
| 67 |
+
|
| 68 |
+
Backward pass: In this step, we need to compute the gradient of the loss $L$ (1) with respect to the support set $X _ { s }$ . We need only consider $\partial L / \partial { \bar { X } } _ { s }$ since $\partial L / \partial y _ { s }$ is cheap to compute. By the chain rule, we can write
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\frac { \partial L } { \partial X _ { s } } = \frac { \partial L } { \partial ( K ( X _ { s } , X _ { s } ) ) } \frac { \partial K ( X _ { s } , X _ { s } ) } { \partial X _ { s } } + \frac { \partial L } { \partial ( K ( X _ { t } , X _ { s } ) ) } \frac { \partial K ( X _ { t } , X _ { s } ) } { \partial X _ { s } } .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
The derivatives of $L$ with respect to the kernel matrices are inexpensive, since $L$ depends in a simple way on them (matrix multiplication and inversion). What is expensive to compute is the derivative of the kernel matrices with respect to the inputs. Each kernel element is an independent function of the inputs and a naive computation of the derivative of a block would require forwardmode differentiation, infeasible due to the size of the input images and the cost to compute the individual kernel elements. Thus our main novelty is to divide up the gradient computation into backward differentiation sub-computations, specifically by using the built-in function ${ \mathrm { j a x . v j p } }$ in JAX [Bradbury et al., 2018]. Denoting $K = K \bar { ( } X _ { s } , X _ { s } )$ or $K ( X _ { t } , X _ { s } )$ for short-hand, we divide the matrix $\partial L / \partial K$ , computed on the server, into $B \times B$ blocks corresponding to $\partial L / \partial K ( x , x ^ { ' } )$ , where $x$ and $x ^ { \prime }$ each have batch size $B$ . We send each such block, along with the corresponding block of image data $( x , x ^ { \prime } )$ , to a worker. The worker then treats the $\partial L / \partial K ( x , x ^ { \prime } )$ it receives as the cotangent vector argument of ${ \mathrm { j a x . v j p } }$ that, via contraction, converts the derivative of $K ( x , x ^ { \prime } )$ with respect to $x$ into a scalar. The server aggregates all these partial gradient computations performed by the workers, over all possible $B \times B$ blocks, to compute the total gradient $\partial L / \partial X _ { s }$ used to update $X _ { s }$ .
|
| 75 |
+
|
| 76 |
+
Table 1: Comparison with other methods. The left group consists of neural network based methods. The right group consists of kernel ridge-regression. All settings for KIP involve the use of label-learning. Grayscale datasets use standard channel-wise preprocessing while RGB datasets use regularized ZCA preprocessing.
|
| 77 |
+
|
| 78 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Imgs/ Class</td><td rowspan="2">DC1</td><td rowspan="2">DSA1</td><td rowspan="2">KIP FC1 aug</td><td rowspan="2">LS ConvNet2,3</td><td colspan="2"> KIP ConvNet2</td></tr><tr><td>no aug</td><td>aug</td></tr><tr><td rowspan="3">MNIST</td><td>1</td><td>91.7±0.5</td><td>88.7±0.6</td><td>85.5±0.1</td><td>73.4</td><td>97.3±0.1</td><td>96.5±0.1</td></tr><tr><td>10</td><td>97.4±0.2</td><td>97.8±0.1</td><td>97.2±0.2</td><td>96.4</td><td>99.1±0.1</td><td>99.1±0.1</td></tr><tr><td>50</td><td>98.8±0.1</td><td>99.2±0.1</td><td>98.4±0.1</td><td>98.3</td><td>99.4±0.1</td><td>99.5±0.1</td></tr><tr><td rowspan="3">Fashion- MNIST</td><td>1</td><td>70.5±0.6</td><td>70.6±0.6</td><td></td><td>65.3</td><td>82.9±0.2</td><td>76.7±0.2</td></tr><tr><td>10</td><td>82.3±0.4</td><td>84.6±0.3</td><td></td><td>80.8</td><td>91.0±0.1</td><td>88.8±0.1</td></tr><tr><td>50</td><td>83.6±0.4</td><td>88.7±0.2</td><td></td><td>86.9</td><td>92.4±0.1</td><td>91.0±0.1</td></tr><tr><td rowspan="3">SVHN</td><td>1</td><td>31.2±1.4</td><td>27.5±1.4</td><td></td><td>23.9</td><td>62.4±0.2</td><td>64.3±0.4</td></tr><tr><td>10</td><td>76.1±0.6</td><td>79.2±0.5</td><td></td><td>52.8</td><td>79.3±0.1</td><td>81.1±0.5</td></tr><tr><td>50</td><td>82.3±0.3</td><td>84.4±0.4</td><td>■</td><td>76.8</td><td>82.0±0.1</td><td>84.3±0.1</td></tr><tr><td rowspan="3">CIFAR-10</td><td>1</td><td>28.3±0.5</td><td>28.8±0.7</td><td>40.5±0.4</td><td>26.1</td><td>64.7±0.2</td><td>63.4±0.1</td></tr><tr><td>10</td><td>44.9±0.5</td><td>52.1±0.5</td><td>53.1±0.5</td><td>53.6</td><td>75.6±0.2</td><td>75.5±0.1</td></tr><tr><td>50</td><td>53.9±0.5</td><td>60.6±0.5</td><td>58.6±0.4</td><td>65.9</td><td>78.2±0.2</td><td>80.6±0.1</td></tr><tr><td rowspan="2">CIFAR-100</td><td>1</td><td>12.8±0.3</td><td>13.9±0.3</td><td>-</td><td>23.8</td><td>34.9±0.1</td><td>33.3±0.3</td></tr><tr><td>10</td><td>25.2±0.3</td><td>32.3±0.3</td><td>=</td><td>39.2</td><td>47.9±0.2</td><td>49.5±0.3</td></tr></table>
|
| 79 |
+
|
| 80 |
+
1 DC [Zhao et al., 2021], DSA [Zhao and Bilen, 2021], KIP FC [Nguyen et al., 2021]. 2 Ours. 3 LD [Bohdal et al., 2020] is another baseline which distills only labels using the AlexNet architecture. Our LS achieves higher test accuracy than theirs in every dataset category.
|
| 81 |
+
|
| 82 |
+
# 3 Experimental Results
|
| 83 |
+
|
| 84 |
+
# 3.1 Kernel Distillation Results
|
| 85 |
+
|
| 86 |
+
We apply the KIP and LS algorithms using the ConvNet architecture on the datasets MNIST [LeCun et al., 2010], Fashion MNIST [Xiao et al., 2017], SVHN [Netzer et al., 2011], CIFAR-10 [Krizhevsky, 2009], and CIFAR-100. Here, the goal is to condense the train dataset down to a learned dataset of size 1, 10, or 50 images per class. We consider a variety of hyperparameter settings (image preprocessing method, whether to augment target data, and whether to train the support labels for KIP), the full details of which are described in $\ S \mathrm { A }$ . For space reasons, we show a subset of our results in Table 1, with results corresponding to the remaining set of hyperparameters left to Tables A3-A10. We highlight here that a crucial ingredient for our strong results in the RGB dataset setting is the use of regularized ZCA preprocessing. Note the variable effect that our augmentations have on performance (see the last two columns of Table 1): they typically only provides a benefit for a sufficiently large support set. This result is consistent with Zhao et al. [2021], Zhao and Bilen [2021], in which gains from augmentations are also generally obtained from larger support sets. We tried varying the fraction (0.25 and 0.5) of each target batch that is augmented at each training step and found that while 10 images still did best without augmentations, 100 and 500 images typically did slightly better with some partial augmentations (versus none or full). For instance, for 500 images on CIFAR-10, we obtained $8 1 . 1 \%$ test accuracy using augmentation rate 0.5. Thus, our observation is that given that larger support sets can distill larger target datasets, as the former increases in size, the latter can be augmented more aggressively for obtaining optimal generalization performance.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 1: KIP with kernel sampling vs individual kernels. Left: Evaluation of three kernels, ConvNet, Conv-Vec3, Conv-Vec8 for KRR with respect to four train settings: sampling KIP (“all”) which uses all the kernels or else KIP trained with the individual kernels. For all three kernels, “all” is a close second place, outperformed only if the kernel used for training is exactly the same as the one used for testing. Right: We take the learned images of the four train settings described above and transfer them to finite-width neural networks corresponding to ConvNet, Conv-Vec3, Conv-Vec8. Each point is a neural network trained on a specified KIP learned checkpoint. Top row is sampling KIP images and bottom row is the baseline using just ConvNet for KIP. These plots indicate that sampling KIP improves performance across the architectures that are sampled, for both MSE and cross entropy loss. Settings: CIFAR-10, 100 images, no augmentations, no ZCA, no label learning.
|
| 90 |
+
|
| 91 |
+
Remarkably, our results in Table 1 outperform all prior baselines across all dataset settings. Our results are especially strong in the small support size regime, with our 1 image per class results for KRR outperforming over 100 times as many natural images (see Table A1). We also obtain a significant margin over prior art across all datasets, with our largest margin being a $37 \%$ absolute gain in test accuracy for the SVHN dataset.
|
| 92 |
+
|
| 93 |
+
# 3.2 Kernel Transfer
|
| 94 |
+
|
| 95 |
+
In $\ S$ , we focused on obtaining state-of-the-art dataset distillation results for image classification using a specific kernel (ConvNet). Here, we consider the variation of KIP in which we sample from a family of kernels (which we call sampling KIP). We validate that sampling KIP adds robustness to the learned images in that they perform well for the family of kernels sampled during training.
|
| 96 |
+
|
| 97 |
+
In Figure 1, we plot test performance of sampling KIP when using the kernels ConvNet, Conv-Vec3, and Conv-Vec8 (denoted by “all”) alongside KIP trained with just the individual kernels. Sampling KIP performs well at test time when using any of the three kernels, whereas datasets trained using a single kernel have a significant performance drop when using a different kernel.
|
| 98 |
+
|
| 99 |
+
# 3.3 Neural Network Transfer
|
| 100 |
+
|
| 101 |
+
In this section, we study how our distilled datasets optimized using KIP and LS transfer to the setting of finite-width neural networks. The main results are shown in Table 2. The third column shows the best neural network performance obtained by training on a KIP dataset of the corresponding size with respect to some choice of KIP and neural network training hyperparameters (see $\ S \mathrm { A }$ for details). Since the datasets are optimized for kernel ridge-regression and not for neural network training itself, we expect some performance loss when transferring to finite-width networks, which we record in the fourth column. Remarkably, the drop due to this transfer is quite moderate or small and sometimes the transfer can even lead to gain in performance (see LS for SVHN dataset with 10 images per class).
|
| 102 |
+
|
| 103 |
+
Overall, our transfer to finite-width networks outperforms prior art based on DC/DSA [Zhao et al., 2021, Zhao and Bilen, 2021] in the 1 image per class setting for all the RGB datasets (SVHN, CIFAR-10, CIFAR-100). Moreover, for CIFAR-10, we outperform DC/DSA in all settings.
|
| 104 |
+
|
| 105 |
+
Table 2: Transfer of KIP and LS to neural network training. Datasets obtained from KIP and LS using the ConvNet kernel are optimized for kernel ridge-regression and thus have reduced performance when used for training the corresponding finite-width ConvNet neural network. Remarkably, the loss in performance is mostly moderate and even small in many instances. Grayscale datasets use standard channel-wise preprocessing while RGB datasets use regularized ZCA preprocessing. The KIP datasets used here can have augmentations or no augmentations and, unlike those in Table 1, can have either fixed or learned labels. $^ *$ denotes best chosen transfer is obtained with learned labels.
|
| 106 |
+
|
| 107 |
+
<table><tr><td></td><td>Imgs/Class</td><td>DC/DSA</td><td>KIP to NN</td><td>Perf. change</td><td>LS to NN</td><td>Perf. change</td></tr><tr><td rowspan="3">MNIST</td><td>1</td><td>91.7±0.5</td><td>90.1±0.1</td><td>-5.5</td><td>71.0±0.2</td><td>-2.4</td></tr><tr><td>10</td><td>97.8±0.1</td><td>97.5±0.0</td><td>-1.1</td><td>95.2±0.1</td><td>-1.2</td></tr><tr><td>50</td><td>99.2±0.1</td><td>98.3±0.1</td><td>-0.8</td><td>97.9±0.0</td><td>-0.4</td></tr><tr><td rowspan="3">Fashion-MNIST</td><td>1</td><td>70.6±0.6</td><td>73.5±0.5*</td><td>-9.8</td><td>61.2±0.1</td><td>-4.1</td></tr><tr><td>10</td><td>84.6±0.3</td><td>86.8±0.1</td><td>-1.3</td><td>79.7±0.1</td><td>-1.2</td></tr><tr><td>50</td><td>88.7±0.2</td><td>88.0±0.1*</td><td>-4.5</td><td>85.0±0.1</td><td>-1.8</td></tr><tr><td rowspan="3">SVHN</td><td>1</td><td>31.2±1.4</td><td>57.3±0.1*</td><td>-8.3</td><td>23.8±0.2</td><td>-0.2</td></tr><tr><td>10</td><td>79.2±0.5</td><td>75.0±0.1</td><td>-1.6</td><td>53.2±0.3</td><td>0.4</td></tr><tr><td>50</td><td>84.4±0.4</td><td>80.5±0.1</td><td>-1.0</td><td>76.5±0.3</td><td>-0.4</td></tr><tr><td rowspan="3">CIFAR-10</td><td>1</td><td>28.8±0.7</td><td>49.9±0.2</td><td>-9.2</td><td>24.7±0.1</td><td>-1.4</td></tr><tr><td>10</td><td>52.1±0.5</td><td>62.7±0.3</td><td>-4.6</td><td>49.3±0.1</td><td>-4.3</td></tr><tr><td>50</td><td>60.6±0.5</td><td>68.6±0.2</td><td>-4.5</td><td>62.0±0.2</td><td>-3.9</td></tr><tr><td rowspan="2">CIFAR-100</td><td>1</td><td>13.9±0.3</td><td>15.7±0.2*</td><td>-18.1</td><td>11.8±0.2</td><td>-12.0</td></tr><tr><td>10</td><td>32.3±0.3</td><td>28.3±0.1</td><td>-17.4</td><td>25.0±0.1</td><td>-14.2</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Figures 2 and 3 provide a closer look at KIP transfer changes under various settings. The first of these tracks how transfer performance changes when adding additional layers as function of the number of KIP training steps used. The normalization layers appear to harm performance for MSE loss, which can be anticipated from their absence in the KIP and LS optimization procedures. However they appear to provide some benefit for cross entropy loss. For Figure 3, we observe that as KIP training progresses, the downstream finite-width network’s performance also improves in general. A notable exception is observed when learning the labels in KIP, where longer training steps lead to deterioration of information useful to training finite-width neural networks. We also observe that as predicted by infinite-width theory [Jacot et al., 2018, Lee et al., 2019], the overall gap between KIP or LS performance and finite-width neural network decreases as the width increases. While our best performing transfer is obtained with width 1024, Figure 3 (middle) suggest that even with modest width of 64, our transfer can outperform prior art of $6 0 . 6 \%$ by Zhao and Bilen [2021].
|
| 110 |
+
|
| 111 |
+
Finally, in Figure 4, we investigate the performance of KIP images over the course of training of a single run, as compared to natural images, over a range of hyperparameters. We find the outperformance of KIP images above natural images consistent across hyperparameters and checkpoints. This suggests that our KIP images may also be effective for accelerated hyperparameter search, an application of dataset distillation explored in Zhao et al. [2021], Zhao and Bilen [2021].
|
| 112 |
+
|
| 113 |
+
Altogether, we find our neural network training results encouraging. First, it validates the applicability of infinite-width methods to the setting of finite width [Huang and Yau, 2020, Dyer and Gur-Ari, 2020, Andreassen and Dyer, 2020, Yaida, 2020, Lee et al., 2020]. Second, we find some of the transfer results quite surprising, including efficacy of label solve and the use of cross-entropy for certain settings (see $\ S$ for the full details).
|
| 114 |
+
|
| 115 |
+
# 4 Understanding KIP Images and Labels
|
| 116 |
+
|
| 117 |
+
A natural question to consider is what causes KIP to improve generalization performance. Does it simplify support images, removing noise and minor sources of variation while keeping only the core features shared between many target images of a given class? Or does it make them more complex by producing outputs that combine characteristics of many samples in a single resulting collage? While properly answering this question is subject to precise definitions of simplicity and complexity, we find that KIP tends to increase the complexity of pictures based on the following experiments:
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 2: Robustness to neural network variations. KIP ConvNet images (trained with fixed labels) are tested on variations of the ConvNet neural network, including those which have various normalization layers (layer, instance, batch). A similar architecture to ConvNet, the Myrtle5 architecture (without normalization layers) [Shankar et al., 2020], which differs from the ConvNet architecture by having an additional convolutional layer at the bottom and a global average pooling that replaces the final local average pooling at the top, is also tested. Finally, mean-square error is compared with cross-entropy loss (left versus right). Settings: CIFAR-10, 500 images, ZCA, no label learning.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 3: Variations for neural network transfer. Left: Plot of transfer performance as a function of KIP training steps across various train settings. Here (a) denotes augmentations used during KIP training and $\left( \mathrm { a } { + } \mathrm { l } \right)$ denotes that additionally the labels were learned. MSE and XENT denote mean-square-error and cross entropy loss for the neural network, where for the case of XENT and $\left( \mathrm { a } \mathrm { + } \mathrm { l } \right)$ , the labels for the neural network are the argmax of the learned labels. Middle: Exploring the effect of width on transferability of vanilla KIP data. Right: The effect of width on the transferability of label solved data. Settings: CIFAR-10, 500 images, ZCA.
|
| 126 |
+
Figure 4: Hyperparameter robustness. In the above, KIP images across eight different checkpoints are used to train the ConvNet neural network. Each point in each plot is a neural network training with a different hyperparameter, and its location records the final test accuracy when training on natural images versus the KIP images obtained from initializing from such images. For both MSE and cross entropy loss, KIP images consistently exceed natural images across many hyperparameters. Settings: CIFAR-10, 500 images, ZCA, no augmentations, no label learning.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 5: Examples of learned images. Images are initialized from natural images in the top row (Init) and converge to images in the bottom row (Trained). Settings: 100 images distilled, no ZCA, no label training, augmentations.
|
| 130 |
+
|
| 131 |
+
• Visual analysis: qualitatively, KIP images tend to be richer in textures and contours. • Dimensional analysis: KIP produces images of higher intrinsic dimensionality (i.e. an estimate of the dimensionality of the manifold on which the images lie) than natural images. • Spectral analysis: unlike natural images, for which the bulk of generalization performance is explained by a small number of top few eigendirections, KIP images leverage the whole spectrum much more evenly.
|
| 132 |
+
|
| 133 |
+
Combined, these results let us conclude that KIP usually increases complexity, integrating features from many target images into much fewer support images.
|
| 134 |
+
|
| 135 |
+
Visual Analysis. A visual inspection of our learned data leads to intriguing observations in terms of interpretability. Figure 5 shows examples of KIP learned images from CIFAR-100. The resulting images are heterogeneous in terms of how they can be interpreted as distilling the data. For instance, the distilled apple image seems to consist of many apples nested within a possibly larger apple, whereas the distilled bottle image starts off as two bottles and before transforming into one, while other classes (like the beaver) are altogether visually indistinct. Investigating and quantifying aspects that make these images generalize so well is a promising avenue for future work. We show examples from other datasets in Figure A2.
|
| 136 |
+
|
| 137 |
+
In Figure 6, we compare MNIST KIP data learned with and without label learning. For the latter case with images and labels optimized jointly, while labels become more informative, encoding richer inter-class information, the images become less interpretable. This behavior consistently leads to superior KRR results, but appears to not be leveraged as efficiently in the neural network transfer setting (Table 2). Experimental details can be found in $\ S \mathrm { A }$ .
|
| 138 |
+
|
| 139 |
+
Dimensional Analysis. We study the intrinsic dimension of KIP images and find that they tend to grow. Intrinsic dimension (ID) was first defined by Bennett [1969] as “the number of free parameters required in a hypothetical signal generator capable of producing a close approximation to each signal in the collection”. In our context, it is the dimensionality of the manifold embedded into the image space which contains all the support images. Intuitively, simple datasets have a low ID as they can be described by a small number of coordinates on the low-dimensional data manifold.
|
| 140 |
+
|
| 141 |
+
ID can be defined and estimated differently based on assumptions on the manifold structure and the probability density function of the images on this manifold (see [Camastra and Staiano, 2016] for review). We use the “Two-NN” method developed by [Facco et al., 2017], which makes relatively few assumptions and allows to estimate ID only from two nearest-neighbor distances for each datapoint.
|
| 142 |
+
|
| 143 |
+
Figure 7 shows that the ID is increasing for the learned KIP images as a function of the training step across a variety of configurations (training with or without augmentations/label learning) and datasets. One might expect that a distillation procedure should decrease dimensionality. On the other hand, Ansuini et al. [2019] showed that ID increases in the earlier layers of a trained neural network. It remains to be understood if this latter observation has any relationship with our increased ID. Note that ZCA preprocessing, which played an important role for getting the best performance for our RGB datasets, increases dimensionality of the underlying data (see Figure A4).
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 6: Dataset distillation with trainable and non-trainable labels. Top row: initialization of support images and labels. Middle row: trained images if labels remain fixed. Bottom row: trained images and labels, jointly optimized. Settings: 100 images distilled, no augmentations.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 7: Intrinsic dimension of a learned datasets grows during training. As training progresses, intrinsic dimension of the learned dataset grows, indicating that training non-trivially transforms the data manifold. See Figures A2 and 6 for visual examples of learned images, and Figures A3 and A4 for similar observations using other metrics and settings. Settings: 500 images distilled, no ZCA.
|
| 150 |
+
|
| 151 |
+
Spectral Analysis. Another distinguishing property of KIP images is how their spectral components contribute to performance. In Figure 8, we spot how different spectral bands of KIP learned images affect test performance as compared to their initial natural images. Here, we use the FC2, Conv-Vec8, and ConvNet architectures. We note that for natural images (light bars), most of their performance is captured by the top $20 \%$ of eigenvalues. For KIP images, the performance is either more evenly distributed across the bands (FC and Conv-Vec8) or else is skewed towards the tail (ConvNet).
|
| 152 |
+
|
| 153 |
+
# 5 Related Work
|
| 154 |
+
|
| 155 |
+
Dataset distillation was first studied in Wang et al. [2018]. The work of Sucholutsky and Schonlau [2019], Bohdal et al. [2020] build upon it by distilling labels. Zhao et al. [2021] proposes condensing a training set by harnessing a gradient matching condition. Zhao and Bilen [2021] takes this idea further by applying a suitable augmentation strategy. Note that while Zhao and Bilen [2021] is limited in augmentation expressiveness (they have to apply a single augmentation per training iteration), we can sample augmentations independently per image in our target set per train step. Our work together with Nguyen et al. [2021] are, to the best of our knowledge, the only works using kernel-based methods for dataset distillation on image classification datasets.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 8: Spectral contribution to test accuracy shifts to the tail. By setting the ridge-parameter to zero in kernel-ridge regression and composing $K _ { X _ { s } X _ { s } } ^ { - 1 }$ with the spectral projection onto various eigenspaces, we can explore how different spectral bands affect test accuracy of kernel ridgeregression. We plot the relative change in test accuracy using contiguous bands of $20 \%$ of the eigenvalues. Settings: CIFAR-10, 500 images. Further details in $\ S$ .
|
| 159 |
+
|
| 160 |
+
Our use of kernels stems from the correspondence between infinitely-wide neural networks and kernel methods [Neal, 1994, Lee et al., 2018, Matthews et al., 2018, Jacot et al., 2018, Novak et al., 2019, Garriga-Alonso et al., 2019, Arora et al., 2019, Yang, 2019a,b, Hron et al., 2020] and the extended correspondence with the finite width corrections [Dyer and Gur-Ari, 2020, Huang and Yau, 2020, Yaida, 2020]. These correspondences underlie the transferability of our KRR results to neural networks , and have been utilized in understanding trainability [Xiao et al., 2020], generalizations [Adlam and Pennington, 2020], training dynamics [Lewkowycz et al., 2020, Lewkowycz and Gur-Ari, 2020], uncertainty [Adlam et al., 2021], and demonstrated their effectiveness for smaller datasets [Arora et al., 2020] and neural architecture search [Park et al., 2020, Chen et al., 2021].
|
| 161 |
+
|
| 162 |
+
# 6 Conclusion
|
| 163 |
+
|
| 164 |
+
We performed an extensive study of dataset distillation using the KIP and LS algorithms applied to convolutional architectures, obtaining SOTA results on a variety of image classification datasets. In some cases, our learned datasets were more effective than a natural dataset two orders of magnitude larger in size. There are many interesting followup directions and questions from our work:
|
| 165 |
+
|
| 166 |
+
First, integrating efficient kernel-approximation methods into our algorithms, such as those of Zandieh et al. [2021], will reduce computational burden and enable scaling up to larger datasets. In this direction, the understanding of how various resources (e.g. data, parameter count, compute) scale when optimizing for neural network performance has received significant attention as machine learning models continue to stretch computational limits [Hestness et al., 2017, Rosenfeld et al., 2020, Kaplan et al., 2020, Bahri et al., 2021]. Developing our understanding of how to harness smaller, yet more useful representations data would aid in such endeavors. In particular, it would be especially interesting to explore how well datasets can be compressed as they scale up in size.
|
| 167 |
+
|
| 168 |
+
Second, LS and KIP with label learning shows that optimizing labels is a very powerful tool for dataset distillation. The labels we obtain are quite far away from standard, interpretable labels and we feel their effectiveness suggests that understanding of how to optimally label data warrants further study.
|
| 169 |
+
|
| 170 |
+
Finally, the novel features obtained by our learned datasets, and those of dataset distillation methods in general, may reveal insights into interpretability and the nature of sample-efficient representations. For instance, observe the bee and bicycle images in Figure 5: the bee class distills into what appears to be spurious visual features (e.g. pollen), while the bicycle class distills to the essential contours of a typical bicycle. Additional analyses and explorations of this type could offer insights into the perennial question of how neural networks learn and generalize.
|
| 171 |
+
|
| 172 |
+
Acknowledgments We would like to acknowledge special thanks to Samuel S. Schoenholz, who proposed and helped develop the overall strategy for our distributed KIP learning methodology. We are also grateful to Ekin Dogus Cubuk and Manuel Kroiss for helpful discussions.
|
| 173 |
+
|
| 174 |
+
# References
|
| 175 |
+
|
| 176 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097–1105, 2012.
|
| 177 |
+
|
| 178 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 179 |
+
|
| 180 |
+
Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 181 |
+
|
| 182 |
+
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.
|
| 183 |
+
|
| 184 |
+
Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A Efros. Dataset distillation. arXiv preprint arXiv:1811.10959, 2018.
|
| 185 |
+
|
| 186 |
+
Ondrej Bohdal, Yongxin Yang, and Timothy Hospedales. Flexible dataset distillation: Learn labels instead of images. arXiv preprint arXiv:2006.08572, 2020.
|
| 187 |
+
|
| 188 |
+
Timothy Nguyen, Zhourong Chen, and Jaehoon Lee. Dataset meta-learning from kernel ridge-regression. In International Conference on Learning Representations, 2021.
|
| 189 |
+
|
| 190 |
+
Bo Zhao and Hakan Bilen. Dataset condensation with differentiable siamese augmentation. In International Conference on Machine Learning, 2021.
|
| 191 |
+
|
| 192 |
+
Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features, 2019.
|
| 193 |
+
|
| 194 |
+
Minyoung Huh, Pulkit Agrawal, and Alexei A Efros. What makes imagenet good for transfer learning? arXiv preprint arXiv:1608.08614, 2016.
|
| 195 |
+
|
| 196 |
+
Katherine L Hermann and Andrew K Lampinen. What shapes feature representations? exploring datasets, architectures, and training. arXiv preprint arXiv:2006.12433, 2020.
|
| 197 |
+
|
| 198 |
+
Zalán Borsos, Mojmír Mutny, and Andreas Krause. Coresets via bilevel optimization for continual learning and \` streaming. arXiv preprint arXiv:2006.03875, 2020.
|
| 199 |
+
|
| 200 |
+
Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. In International Conference on Learning Representations, 2021.
|
| 201 |
+
|
| 202 |
+
Roman Novak, Lechao Xiao, Jaehoon Lee, Yasaman Bahri, Greg Yang, Jiri Hron, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019.
|
| 203 |
+
|
| 204 |
+
Adrià Garriga-Alonso, Laurence Aitchison, and Carl Edward Rasmussen. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2019.
|
| 205 |
+
|
| 206 |
+
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, pages 8141–8150. Curran Associates, Inc., 2019.
|
| 207 |
+
|
| 208 |
+
Zhiyuan Li, Ruosong Wang, Dingli Yu, Simon S Du, Wei Hu, Ruslan Salakhutdinov, and Sanjeev Arora. Enhanced convolutional neural tangent kernels. arXiv preprint arXiv:1911.00809, 2019.
|
| 209 |
+
|
| 210 |
+
Vaishaal Shankar, Alex Chengyu Fang, Wenshuo Guo, Sara Fridovich-Keil, Ludwig Schmidt, Jonathan RaganKelley, and Benjamin Recht. Neural kernels without tangents. In International Conference on Machine Learning, 2020.
|
| 211 |
+
|
| 212 |
+
Alberto Bietti. Approximation and learning with deep convolutional models: a kernel perspective. arXiv preprint arXiv:2102.10032, 2021.
|
| 213 |
+
|
| 214 |
+
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. URL https://openreview.net/forum?id=rkl8sJBYvH.
|
| 215 |
+
Jaehoon Lee, Samuel S Schoenholz, Jeffrey Pennington, Ben Adlam, Lechao Xiao, Roman Novak, and Jascha Sohl-Dickstein. Finite versus infinite neural networks: an empirical study. In Advances in Neural Information Processing Systems, 2020.
|
| 216 |
+
Roman Novak, Lechao Xiao, Jiri Hron, Jaehoon Lee, Alexander A. Alemi, Jascha Sohl-Dickstein, and Samuel S. Schoenholz. Neural tangents: Fast and easy infinite neural networks in python. In International Conference on Learning Representations, 2020. URL https://github.com/google/neural-tangents.
|
| 217 |
+
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. JAX: composable transformations of Python $^ +$ NumPy programs, 2018. URL http://github.com/google/jax.
|
| 218 |
+
Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, 2, 2010.
|
| 219 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017.
|
| 220 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 221 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 222 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in Neural Information Processing Systems, 2018.
|
| 223 |
+
Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha Sohl-Dickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Advances in Neural Information Processing Systems, 2019.
|
| 224 |
+
Jiaoyang Huang and Horng-Tzer Yau. Dynamics of deep neural networks and neural tangent hierarchy. In International Conference on Machine Learning, 2020.
|
| 225 |
+
Ethan Dyer and Guy Gur-Ari. Asymptotics of wide networks from feynman diagrams. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\equiv$ S1gFvANKDS.
|
| 226 |
+
Anders Andreassen and Ethan Dyer. Asymptotics of wide convolutional neural networks. arxiv preprint arXiv:2008.08675, 2020.
|
| 227 |
+
Sho Yaida. Non-Gaussian processes and neural networks at finite widths. In Mathematical and Scientific Machine Learning Conference, 2020.
|
| 228 |
+
R. Bennett. The intrinsic dimensionality of signal collections. IEEE Transactions on Information Theory, 15(5): 517–525, 1969. doi: 10.1109/TIT.1969.1054365.
|
| 229 |
+
Francesco Camastra and Antonino Staiano. Intrinsic dimension estimation: Advances and open problems. Information Sciences, 328:26–41, 2016. ISSN 0020-0255. doi: https://doi.org/10.1016/j.ins.2015.08.029. URL https://www.sciencedirect.com/science/article/pii/S0020025515006179.
|
| 230 |
+
Elena Facco, Maria d’Errico, Alex Rodriguez, and Alessandro Laio. Estimating the intrinsic dimension of datasets by a minimal neighborhood information. Scientific reports, 7(1):1–8, 2017.
|
| 231 |
+
A. Ansuini, A. Laio, J. Macke, and D. Zoccolan. Intrinsic dimension of data representations in deep neural networks. In NeurIPS, 2019.
|
| 232 |
+
Ilia Sucholutsky and Matthias Schonlau. Soft-label dataset distillation and text dataset distillation. arXiv preprint arXiv:1910.02551, 2019.
|
| 233 |
+
Radford M. Neal. Priors for infinite networks (tech. rep. no. crg-tr-94-1). University of Toronto, 1994.
|
| 234 |
+
Jaehoon Lee, Yasaman Bahri, Roman Novak, Sam Schoenholz, Jeffrey Pennington, and Jascha Sohl-dickstein. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018.
|
| 235 |
+
Alexander G. de G. Matthews, Jiri Hron, Mark Rowland, Richard E. Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. In International Conference on Learning Representations, 2018.
|
| 236 |
+
|
| 237 |
+
Greg Yang. Scaling limits of wide neural networks with weight sharing: Gaussian process behavior, gradient independence, and neural tangent kernel derivation. arXiv preprint arXiv:1902.04760, 2019a.
|
| 238 |
+
|
| 239 |
+
Greg Yang. Wide feedforward or recurrent neural networks of any architecture are gaussian processes. In Advances in Neural Information Processing Systems, 2019b.
|
| 240 |
+
|
| 241 |
+
Jiri Hron, Yasaman Bahri, Jascha Sohl-Dickstein, and Roman Novak. Infinite attention: NNGP and NTK for deep attention networks. In International Conference on Machine Learning, 2020.
|
| 242 |
+
|
| 243 |
+
Lechao Xiao, Jeffrey Pennington, and Samuel S Schoenholz. Disentangling trainability and generalization in deep learning. In International Conference on Machine Learning, 2020.
|
| 244 |
+
|
| 245 |
+
Ben Adlam and Jeffrey Pennington. The neural tangent kernel in high dimensions: Triple descent and a multi-scale theory of generalization. In International Conference on Machine Learning, pages 74–84. PMLR, 2020.
|
| 246 |
+
|
| 247 |
+
Aitor Lewkowycz, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, and Guy Gur-Ari. The large learning rate phase of deep learning: the catapult mechanism. arXiv preprint arXiv:2003.02218, 2020.
|
| 248 |
+
|
| 249 |
+
Aitor Lewkowycz and Guy Gur-Ari. On the training dynamics of deep networks with l_2 regularization. In Advances in Neural Information Processing Systems, volume 33, pages 4790–4799, 2020.
|
| 250 |
+
|
| 251 |
+
Ben Adlam, Jaehoon Lee, Lechao Xiao, Jeffrey Pennington, and Jasper Snoek. Exploring the uncertainty properties of neural networks’ implicit priors in the infinite-width limit. In International Conference on Learning Representations, 2021.
|
| 252 |
+
|
| 253 |
+
Daniel S Park, Jaehoon Lee, Daiyi Peng, Yuan Cao, and Jascha Sohl-Dickstein. Towards nngp-guided neural architecture search. arXiv preprint arXiv:2011.06006, 2020.
|
| 254 |
+
|
| 255 |
+
Wuyang Chen, Xinyu Gong, and Zhangyang Wang. Neural architecture search on imagenet in four $\{ { \mathrm { g p u } } \}$ hours: A theoretically inspired perspective. In International Conference on Learning Representations, 2021.
|
| 256 |
+
|
| 257 |
+
Amir Zandieh, Insu Han, Haim Avron, Neta Shoham, Chaewon Kim, and Jinwoo Shin. Scaling neural tangent kernels via sketching and random features. In Advances in Neural Information Processing Systems, 2021.
|
| 258 |
+
|
| 259 |
+
Joel Hestness, Sharan Narang, Newsha Ardalani, Gregory F. Diamos, Heewoo Jun, Hassan Kianinejad, Md. Mostofa Ali Patwary, Yang Yang, and Yanqi Zhou. Deep learning scaling is predictable, empirically. CoRR, abs/1712.00409, 2017. URL http://arxiv.org/abs/1712.00409.
|
| 260 |
+
|
| 261 |
+
Jonathan S. Rosenfeld, Amir Rosenfeld, Yonatan Belinkov, and Nir Shavit. A constructive prediction of the generalization error across scales. In International Conference on Learning Representations, 2020.
|
| 262 |
+
|
| 263 |
+
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models, 2020.
|
| 264 |
+
|
| 265 |
+
Yasaman Bahri, Ethan Dyer, Jared Kaplan, Jaehoon Lee, and Utkarsh Sharma. Explaining neural scaling laws. arXiv preprint arXiv:2102.06701, 2021.
|
| 266 |
+
|
| 267 |
+
Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 268 |
+
|
| 269 |
+
Jascha Sohl-Dickstein, Roman Novak, Samuel S Schoenholz, and Jaehoon Lee. On the infinite width limit of neural networks with a standard parameterization. arXiv preprint arXiv:2001.07301, 2020.
|
md/train/jfDaBf8PAE/jfDaBf8PAE.md
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fast Minimum-norm Adversarial Attacks through Adaptive Norm Constraints
|
| 2 |
+
|
| 3 |
+
# Maura Pintor
|
| 4 |
+
|
| 5 |
+
University of Cagliari, Italy Pluribus One, Italy maura.pintor@unica.it
|
| 6 |
+
|
| 7 |
+
Fabio Roli
|
| 8 |
+
University of Cagliari, Italy
|
| 9 |
+
Pluribus One, Italy
|
| 10 |
+
roli@unica.it
|
| 11 |
+
|
| 12 |
+
# Wieland Brendel
|
| 13 |
+
|
| 14 |
+
Tübingen AI Center, University of Tübingen, Germany wieland.brendel@uni-tuebingen.de
|
| 15 |
+
|
| 16 |
+
Battista Biggio
|
| 17 |
+
University of Cagliari, Italy
|
| 18 |
+
Pluribus One, Italy
|
| 19 |
+
battista.biggio@unica.it
|
| 20 |
+
|
| 21 |
+
# Abstract
|
| 22 |
+
|
| 23 |
+
Evaluating adversarial robustness amounts to finding the minimum perturbation needed to have an input sample misclassified. The inherent complexity of the underlying optimization requires current gradient-based attacks to be carefully tuned, initialized, and possibly executed for many computationally-demanding iterations, even if specialized to a given perturbation model. In this work, we overcome these limitations by proposing a fast minimum-norm (FMN) attack that works with different $\ell _ { p }$ -norm perturbation models $( p = 0 , 1 , 2 , \infty )$ , is robust to hyperparameter choices, does not require adversarial starting points, and converges within few lightweight steps. It works by iteratively finding the sample misclassified with maximum confidence within an $\ell _ { p }$ -norm constraint of size $\epsilon$ , while adapting $\epsilon$ to minimize the distance of the current sample to the decision boundary. Extensive experiments show that FMN significantly outperforms existing $\ell _ { 0 } , \ \ell _ { 1 }$ , and $\ell _ { \infty }$ -norm attacks in terms of perturbation size, convergence speed and computation time, while reporting comparable performances with state-of-the-art $\ell _ { 2 }$ -norm attacks. Our open-source code is available at: https://github.com/pralab/Fast-Minimum-Norm-FMN-Attack.
|
| 24 |
+
|
| 25 |
+
# 1 Introduction
|
| 26 |
+
|
| 27 |
+
Learning algorithms are vulnerable to adversarial examples, i.e., intentionally-perturbed inputs aimed to mislead classification at test time [24, 3]. While adversarial examples have received much attention, evaluating the robustness of deep networks against them remains a challenge. Adversarial attacks solve a non-convex optimization problem and are thus prone to finding suboptimal solutions; in particular, all attacks make certain assumptions about the underlying geometry and properties of the optimization problem which, if violated, can derail the attack and may lead to premature conclusions regarding model robustness. That is why the vast majority of defenses published in recent years have later shown to be ineffective against more powerful white-box attacks [5, 1]. Having an arsenal of diverse attacks that can be adapted to specific defenses is one of the most promising avenues for increasing confidence in white-box robustness evaluations [6, 25]. While it may seem that the number of attacks is already large, most of them are just small variations of the same technique, make similar underlying assumptions and thus tend to fail jointly (see, e.g., [25], in which projected-gradient attacks all fail similarly against the “Ensemble Diversity” defense).
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: (a) Conceptual representation of the FMN attack algorithm (leftmost plot). The $\epsilon$ -step updates the constraint size $\epsilon$ to minimize its distance to the boundary. The $\delta$ -step updates the perturbation $\pmb { \delta }$ with a projected-gradient step to maximize misclassification confidence within the current $\epsilon { \cdot }$ -sized constraint. (b) Example of execution of our attack on a bi-dimensional problem (middle plot), along with the corresponding values of the loss function $L$ and the constraint size $\epsilon$ across iterations (rightmost plot). Our algorithm works by first pushing the initial point (red dot) towards the adversarial region (in red), and then perturbing it around the decision boundary to improve the current solution towards a local optimum. The vertical lines in the rightmost plot highlight the steps in which a better solution (smaller $\lVert \pmb { \delta } ^ { \star } \rVert$ and $L < 0$ ) is found.
|
| 31 |
+
|
| 32 |
+
In this work, we focus on minimum-norm attacks for evaluating adversarial robustness, i.e., attacks that aim to mislead classification by finding the smallest input perturbation according to a given norm. In contrast to maximum-confidence attacks, which maximize confidence in a wrong class within a given perturbation budget, the former are better suited to evaluate adversarial robustness as one can compute the accuracy of a classifier under attack for any perturbation budget without re-running the attack. Within the class of gradient-based minimum-norm attacks, there are three main sub-categories: (i) soft-constraint attacks, (ii) boundary attacks and (iii) projected-gradient attacks. Soft-constraint attacks like CW [5] optimize a trade-off between confidence of the misclassified samples and perturbation size. This class of attacks needs a sample-wise tuning of the trade-off hyperparameter to find the smallest possible perturbation, thus requiring many steps to converge. Boundary attacks like BB [4] and FAB [10] move along the decision boundary towards the closest point to the input sample. These attacks converge within relatively few steps, but BB requires an adversarial starting point, and both attacks need to solve a relatively expensive optimization problem in each step. Finally, recent minimum-norm projected-gradient attacks like DDN [23] perform a maximum-confidence attack in each step under a given perturbation budget $\epsilon$ , while iteratively adjusting $\epsilon$ to reduce the perturbation size. DDN combines the effectiveness of boundary attacks with the simplicity and per-step speed of soft-constraint attacks; however, it is specific to the $\ell _ { 2 }$ norm and cannot be readily extended to other norms.
|
| 33 |
+
|
| 34 |
+
To overcome the aforementioned limitations, in this work we propose a novel, fast minimum-norm (FMN) attack (Sect. 2), which retains the main advantages of DDN while generalizing it to different $\ell _ { p }$ norms $( p = 0 , 1 , 2 , \infty )$ . We perform large-scale experiments on different datasets and models (Sect. 3), showing that FMN is able to significantly outperform current minimum-norm attacks in terms of convergence speed and computation time (except for $\ell _ { 2 }$ -norm attacks, for which FMN achieves comparable results), while finding equal or better optima, on average, across almost all tested scenarios and $\ell _ { p }$ norms. FMN thus combines all desirable traits a good adversarial attack should have, providing an important step towards improving adversarial robustness evaluations. We conclude the paper by discussing related work (Sect. 4) and future research directions (Sect. 5).
|
| 35 |
+
|
| 36 |
+
# 2 Minimum-Norm Adversarial Examples with Adaptive Projections
|
| 37 |
+
|
| 38 |
+
Problem formulation. Given an input sample $\pmb { x } \in [ 0 , 1 ] ^ { d }$ , belonging to class $y \in \{ 1 , \ldots , c \}$ , the goal of an untargeted attack is to find the minimum-norm perturbation $\delta ^ { \star }$ such that the corresponding adversarial example $\pmb { x } ^ { \star } = \pmb { x } + \pmb { \delta } ^ { \star }$ is misclassified. This problem can be formulated as:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\begin{array} { r l } { \delta ^ { \star } \in \arg \operatorname* { m i n } \quad } & { \| \delta \| _ { p } , } \\ { \mathrm { s . t . } \quad } & { L ( x + \delta , y , \theta ) < 0 , } \\ & { x + \delta \in [ 0 , 1 ] ^ { d } , } \end{array}
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
# Algorithm 1 Fast Minimum-norm (FMN) Attack
|
| 45 |
+
|
| 46 |
+
Input: $_ { \textbf { \em x } }$ , the input sample; $t$ , a variable denoting whether the attack is targeted $( t = + 1$ ) or untargeted $\mathit { t } = - 1 ,$ ); $y$ , the target (true) class label if the attack is targeted (untargeted); $\gamma _ { 0 }$ and $\gamma _ { K }$ , the initial and final $\epsilon$ -step sizes; $\alpha _ { 0 }$ and $\alpha _ { K }$ , the initial and final $\delta$ -step sizes; $K$ , the total number of iterations.
|
| 47 |
+
|
| 48 |
+
Output: The minimum-norm adversarial example $\scriptstyle { \pmb x } ^ { \star }$ .
|
| 49 |
+
1: $\mathbf { \boldsymbol { x } } _ { 0 } \gets \mathbf { \boldsymbol { x } }$ , $\epsilon _ { 0 } = 0$ , $\delta _ { 0 } \mathbf { 0 }$ , $\delta ^ { \star } \infty$
|
| 50 |
+
2: for $k = 1 , \ldots , K$ do
|
| 51 |
+
3: $\pmb { \mathscr { g } } \gets \tau \cdot \nabla _ { \delta } L ( \pmb { x } _ { k - 1 } + \delta , y , \pmb { \theta } )$ // loss gradient
|
| 52 |
+
4: $\gamma _ { k } h ( \gamma _ { 0 } , \gamma _ { K } , k , K )$ // -step size decay (Eq. 6)
|
| 53 |
+
5: if $L ( x _ { k - 1 } , y , \pmb \theta ) \ge 0$ then
|
| 54 |
+
6: $\epsilon _ { k } = \| \pmb { \delta } _ { k - 1 } \| _ { p } + L ( \pmb { x } _ { k - 1 } , \pmb { y } , \pmb { \theta } ) / \| \pmb { g } \| _ { q }$ if adversarial not found yet else $\epsilon _ { k } = \epsilon _ { k - 1 } ( 1 + \gamma _ { k } )$
|
| 55 |
+
7: else
|
| 56 |
+
8: if $\| \delta _ { k - 1 } \| _ { p } \leq \| \delta ^ { \star } \| _ { p }$ then
|
| 57 |
+
9: $\delta ^ { \star } \gets \delta _ { k - 1 }$ // update best min-norm solution
|
| 58 |
+
10: end if
|
| 59 |
+
11: $\epsilon _ { k } = \operatorname* { m i n } ( \epsilon _ { k - 1 } ( 1 - \gamma _ { k } ) , \| \pmb { \delta } ^ { \star } \| _ { p } )$
|
| 60 |
+
12: end if
|
| 61 |
+
13: $\alpha _ { k } h ( \alpha _ { 0 } , \alpha _ { K } , k , K )$ // $\delta$ -step size decay (Eq. 6)
|
| 62 |
+
14: $\delta _ { k } \delta _ { k - 1 } + \alpha _ { k } \cdot g / \| g \| _ { 2 }$ // gradient-scaling step
|
| 63 |
+
15: $\delta _ { k } \gets \Pi _ { \epsilon } ( \pmb { x } _ { 0 } + \pmb { \delta } _ { k } ) - \pmb { x } _ { 0 }$
|
| 64 |
+
16: $\delta _ { k } \gets \mathrm { c l i p } ( { \pmb x } _ { 0 } + \delta _ { k } ) - { \pmb x } _ { 0 }$
|
| 65 |
+
17: ${ \pmb x } _ { k } { \pmb x } _ { 0 } + \delta _ { k }$
|
| 66 |
+
18: end for
|
| 67 |
+
19: return ${ \pmb x } ^ { \star } { \pmb x } _ { 0 } + \delta ^ { \star }$
|
| 68 |
+
|
| 69 |
+
where $| | \cdot | | _ { p }$ indicates the $\ell _ { p }$ -norm operator. The loss $L$ in the constraint in Eq. (2) is defined as:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
L ( { \boldsymbol { { x } } } , y , \mathbf { \theta } ) = f _ { y } ( { \boldsymbol { { x } } } , \theta ) - \operatorname* { m a x } _ { j \neq y } f _ { j } ( { \boldsymbol { { x } } } , \theta ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $f _ { j } ( { \pmb x } , { \pmb \theta } )$ is the confidence given by the model $f$ for classifying $_ { \textbf { \em x } }$ as class $j$ , and $\pmb \theta$ is the set of its learned parameters. Assuming that the classifier assigns $_ { \textbf { \em x } }$ to the class exhibiting the highest confidence, i.e., $y _ { . } ^ { \star } = \arg \operatorname* { m a x } _ { j \in 1 , \ldots , c } f _ { j } ( x , \pmb { \theta } )$ , the loss function $L ( x , y , \theta )$ takes on negative values only when $_ { \textbf { \em x } }$ is misclassified. Finally, the box constraint in Eq. (3) ensures that the perturbed sample $\pm \delta$ lies in the feasible input space. The aforementioned problem typically involves a non-convex loss function $L$ (w.r.t. its first argument), due to the non-convexity of the underlying decision function $f$ . For this reason, it may admit different locally-optimal solutions. Note also that the solution is trivial (i.e., $\delta ^ { \star } = \mathbf { 0 }$ ) when the input sample $_ { \textbf { \em x } }$ is already adversarial (i.e., $L ( x , y , \pmb \theta ) < 0 ,$ ).
|
| 76 |
+
|
| 77 |
+
Extension to the targeted case. The goal of a targeted attack is to have the input sample misclassified in a given target class $y ^ { \prime }$ . This can be accounted for by modifying the loss function in Eq. (4) as $L ^ { t } ( \bar { { \mathbf x } } , y ^ { \prime } , \pmb \theta ) = \operatorname* { m a x } _ { j \neq y ^ { \prime } } f _ { j } ( { \pmb x } , \pmb \theta ) - f _ { y ^ { \prime } } ( { \pmb x } , \pmb \theta ) = - L ( { \pmb x } , y ^ { \prime } , \pmb \theta )$ , i.e., changing its sign and using the target class label $y ^ { \prime }$ instead of the true class label $y$ .
|
| 78 |
+
|
| 79 |
+
Solution algorithm. To solve Problem (1)-(3), we reformulate it using an upper bound $\epsilon$ on $\| \delta \| _ { p }$
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\operatorname* { m i n } _ { \epsilon , \delta } \epsilon , \quad \mathrm { s . t . } \| \delta \| _ { p } \leq \epsilon ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
and to the constraints in Eqs. (2)-(3). This allows us to derive an algorithm that works in two main steps, similarly to DDN [23], by updating the maximum perturbation size $\epsilon$ separately from the actual perturbation $\pmb { \delta }$ , as represented in Fig. 1(a). In particular, the constraint size $\epsilon$ is adapted to reduce the distance of the constraint to the boundary ( $\cdot$ -step), while the perturbation $\delta$ is updated using a projected-gradient step to minimize the loss function $L$ within the given $\epsilon$ -sized constraint $\delta$ -step). This essentially amounts to a projected gradient descent algorithm that iteratively adapts the constraint size $\epsilon$ to find the minimum-norm adversarial example. The complete algorithm is given as Algorithm 1, while a more detailed explanation of the two aforementioned steps is given below.
|
| 86 |
+
|
| 87 |
+
$\epsilon$ -step. This step updates the upper bound $\epsilon$ on the perturbation norm (lines 4-12 in Algorithm 1). The underlying idea is to increase $\epsilon$ if the current sample is not adversarial (i.e., $L ( x _ { k - 1 } , y , \pmb \theta ) \ge 0 )$ , and to decrease it otherwise, while reducing the step size to dampen oscillations around the boundary and reach convergence. In the former case (-increase), the increment of $\epsilon$ depends on whether an adversarial example has been previously found or not. If not, we estimate the distance to the boundary with a first-order linear approximation, and set $\epsilon _ { k } = | | \delta _ { k - 1 } | | _ { p } + L ( \pmb { x } _ { k - 1 } , y , \pmb { \theta } ) / | | \nabla L ( \pmb { x } _ { k - 1 } , y , \pmb { \theta } ) | | _ { q }$ , where $q$ is the dual norm of $p$ . This approximation allows the attack point to make faster progress towards the decision boundary. Conversely, if an adversarial sample has been previously found, but the current sample is not adversarial, it is likely that the current estimate of $\epsilon$ is only slightly smaller than the minimum-norm solution. We thus increase $\epsilon$ by a small fraction as $\epsilon _ { k } = \epsilon _ { k - 1 } \left( 1 + \gamma _ { k } \right)$ , being $\gamma _ { k }$ a decaying step size. In the latter case $\epsilon$ -decrease), if the current sample is adversarial, i.e., $L ( x _ { k - 1 } , y , \pmb \theta ) < 0$ , we decrease $\epsilon$ as $\epsilon _ { k } = \epsilon _ { k - 1 } \left( 1 - \gamma _ { k } \right)$ , to check whether the current solution can be improved. If the corresponding $\epsilon _ { k }$ value is larger than the optimal $\| \delta ^ { \star } \| _ { p }$ found so far, we retain the best value and set $\epsilon _ { k } = \| \boldsymbol { \delta } ^ { \star } \| _ { p }$ . These multiplicative updates of $\epsilon$ exhibit an oscillating behavior around the decision boundary, due to the conflicting requirements of minimizing the perturbation size and finding an adversarial point. To ensure convergence, as anticipated before, the step size $\gamma _ { k }$ is decayed with cosine annealing:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \gamma _ { k } = h ( \gamma _ { 0 } , \gamma _ { K } , k , K ) = \gamma _ { K } + \frac { 1 } { 2 } ( \gamma _ { 0 } - \gamma _ { K } ) \left( 1 + \cos \left( \frac { k \pi } { K } \right) \right) , } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
being $k$ the current step, $K$ the total number of steps, and $\gamma _ { 0 }$ and $\gamma _ { K }$ the initial and final step sizes.
|
| 94 |
+
|
| 95 |
+
$\delta$ -step. This step updates $\delta$ (lines 13-17 in Algorithm 1). The goal is to find the adversarial example that is misclassified with maximum confidence (i.e., for which $L$ is minimized) within the current $\epsilon$ -sized constraint (Eq. 5) and bounds (Eq. 3). This amounts to performing a projected-gradient step along the negative gradient of $L$ . We consider a normalized steepest descent with decaying step size $\alpha$ to overcome potential issues related to noisy gradients while ensuring convergence (line 14). Note that this step only rescales the gradient by its $\ell _ { 2 }$ norm, while preserving its direction. The step size $\alpha$ is decayed using cosine annealing (Eq. 6). Once $\delta$ is updated, we project it onto the given $\epsilon$ -sized $\ell _ { p }$ -norm constraint via a projection operator $\Pi _ { \epsilon }$ (line 15), to fulfill the constraint in Eq. (5). The projection is trivial for $p = \infty$ and $p = 2$ . For $p = 1$ , we use the efficient algorithm by Duchi et al. [14]. For $p = 0$ , we retain only the first $\epsilon$ components of $\delta$ exhibiting the largest absolute value. We finally clip the components of $\pmb { \delta }$ that violate the bounds in Eq. (3) (line 16).
|
| 96 |
+
|
| 97 |
+
Execution example. In Fig. 1(b), we report an example of execution of our algorithm on a bidimensional problem. The initial sample is updated to follow the negative gradient of $L$ towards the decision boundary. When an adversarial point is found, the algorithm reduces $\epsilon$ to find a better solution. The point is thus projected back onto the non-adversarial region, and $\epsilon$ increased (by a smaller, decaying amount). These oscillations allow the point to walk on the boundary towards a local optimum, i.e., an adversarial point lying on the boundary, where the gradient of the loss function and that of the norm constraint have opposite direction. FMN tends to quickly converge to a good local optimum, provided that the step size is reduced to a sufficiently-small value and that a sufficiently-large number of iterations are performed. This is also confirmed empirically in Sect. 3.
|
| 98 |
+
|
| 99 |
+
Adversarial initialization. Our attack can be initialized from the input sample $_ { \textbf { \em x } }$ , or from a point $\pmb { x } _ { \mathrm { i n i t } }$ belonging either to a different class (if the attack is untargeted) or to the target class (if the attack is targeted). When initializing the attack from ${ \bf { x } } _ { \mathrm { { i n i t } } }$ , we perform a 10-step binary search between $_ { \textbf { \em x } }$ and ${ \bf { x } } _ { \mathrm { { i n i t } } }$ , to find an adversarial point which is closer to the decision boundary. In particular, we aim to find the minimum $\epsilon$ such that $L ( \pmb { x } + \Pi _ { \epsilon } ( \pmb { x } _ { \mathrm { i n i t } } - \pmb { x } ) , y , \pmb { \theta } ) < 0$ (or $L ^ { t } < 0$ for targeted attacks). Then we run our attack starting from the corresponding values of $\boldsymbol { x } _ { k } , \epsilon _ { k } , \delta _ { k }$ and $\delta ^ { \star }$ .
|
| 100 |
+
|
| 101 |
+
Differences with DDN. FMN applies substantial changes to both the algorithm and the formulation of DDN. The main difference is that (i) DDN always rescales the perturbation to have size $\epsilon$ . This operation is problematic when using other norms, especially sparse ones, as it hinders the ability of the attack to explore the neighboring space and find a suitable descent direction. Another difference is that (ii) FMN does not use the cross-entropy loss, but it uses the logit difference as the loss function $L$ , since the latter is less affected by saturation effects. Moreover, (iii) FMN does not need an initial value for $\epsilon$ , as $\epsilon$ is dynamically estimated; and (iv) $\gamma$ is decayed to improve convergence around better minimum-norm solutions, by more effectively dampening oscillations around the boundary. Finally, we include the possibility of (v) initializing the attack from an adversarial point, which can greatly increase the convergence speed of the algorithm, as it uses a fast line-search algorithm to find the boundary and the remaining queries to refine the result.
|
| 102 |
+
|
| 103 |
+
# 3 Experiments
|
| 104 |
+
|
| 105 |
+
We report here an extensive experimental analysis involving several state-of-the-art defenses and minimum-norm attacks, covering $\ell _ { 0 } , \ell _ { 1 } , \ell _ { 2 }$ and $\ell _ { \infty }$ norms. The goal is to empirically benchmark our attack and assess its effectiveness and efficiency as a tool for adversarial robustness evaluation.
|
| 106 |
+
|
| 107 |
+
# 3.1 Experimental Setup
|
| 108 |
+
|
| 109 |
+
Datasets. We consider two commonly-used datasets for benchmarking adversarial robustness of deep neural networks, i.e., the MNIST handwritten digits and CIFAR10. Following the experimental setup in [4], we use a subset of 1000 test samples to evaluate the considered attacks and defenses.
|
| 110 |
+
|
| 111 |
+
Models. We use a diverse selection of models to thoroughly evaluate attacks under different conditions. For MNIST, we consider the following four models: $M l$ , the 9-layer network used as the undefended baseline model by Papernot et al. [20], Carlini and Wagner [5]; $M 2$ , the robust model by Madry et al. [17], trained on $\ell _ { \infty }$ attacks (robustness claim: $8 9 . 6 \%$ accuracy with $\| \delta \| _ { \infty } \leq 0 . 3$ current best evaluation: $8 8 . 0 \%$ ); M3, the robust model by Rony et al. [23], trained on $\ell _ { 2 }$ attacks (robustness claim: $8 7 . 6 \%$ accuracy with $\lVert \delta \rVert _ { 2 } \leq 1 . 5 )$ ; and $M 4$ , the IBP Large Model by Zhang et al. [27] (robustness claim: $9 4 . 3 \%$ accuracy with $\| \delta \| _ { \infty } \leq 0 . 3 )$ . For CIFAR10, we consider three state-ofthe-art robust models from RobustBench [11]: $C I$ , the robust model by Madry et al. [17], trained on $\ell _ { \infty }$ attacks (robustness claim: $4 4 . 7 \%$ accuracy with $\| \delta \| _ { \infty } \leq 8 / 2 5 5$ , current best evaluation: $4 4 . 0 \%$ ); $C 2$ , the defended model by Carmon et al. [7] (top-5 in RobustBench), trained on $\ell _ { \infty }$ attacks and additional unsupervised data (robustness claim: $6 2 . 5 \%$ accuracy with $\| \delta \| _ { \infty } \leq 8 / 2 5 5$ , current best evaluation: $5 9 . 5 \%$ ); and $C 3$ , the robust model by Rony et al. [23], trained on $\ell _ { 2 }$ attacks (robustness claim: $6 7 . 9 \%$ accuracy with $\| \pmb { \delta } \| _ { 2 } \le 0 . 5$ , current best evaluation: $6 6 . 4 \%$ ).
|
| 112 |
+
|
| 113 |
+
Attacks. We compare our algorithm against different state-of-the-art attacks for finding minimumnorm adversarial perturbations across different norms: the Carlini & Wagner (CW) attack [5], the Decoupling Direction and Norm (DDN) attack [23], the Brendel & Bethge (BB) attack [4], and the Fast Adaptive Boundary (FAB) attack [10]. We use the implementation of FAB from Ding et al. [12], while for all the remaining attacks we use the implementation available in Foolbox [21, 22]. All these attacks are defined on the $\ell _ { 2 }$ norm. BB and FAB are also defined on the $\ell _ { 1 }$ and $\ell _ { \infty }$ norms, and only BB is defined on the $\ell _ { 0 }$ norm. We consider both untargeted and targeted attack scenarios, as defined in Sect. 2, except for FAB, which is only evaluated in the untargeted case.1
|
| 114 |
+
|
| 115 |
+
Hyperparameters. To ensure a fair comparison, we perform an extensive hyperparameter search for each of the considered attacks. We consider two main scenarios: tuning the hyperparameters at the sample-level and at the dataset-level. In the sample-level scenario, we select the optimal hyperparameters separately for each input sample by running each attack 10 to 16 times per sample, with a different hyperparameter configuration or random initialization point each time. In the datasetlevel scenario, we choose the same hyperparameters for all samples, selecting the configuration that yields the best attack performance. While sample-level tuning provides a fairer comparison across attacks, it is more computationally demanding and less practical than dataset-level tuning. In addition, the latter allows us to understand how robust attacks are to suboptimal hyperparameter choices. We select the hyperparameters to be optimized for each attack as recommended by the corresponding authors [4, 5, 10, 23]. The hyperparameter configurations considered for each attack are detailed below. For attacks that are claimed to be robust to hyperparameter changes, like BB and FAB, we follow the recommendation of using a larger number of random restarts rather than increasing the number of hyperparameter configurations to be tested. In addition, as BB requires being initialized from an adversarial starting point, we initialize it by randomly selecting a sample either from a different class (in the untargeted case) or from the target class (in the targeted case). Finally, as each attack performs operations with different levels of complexity within each iteration, possibly querying the model multiple times, we set the number of steps for each attack such that at least 1, 000 forward passes (i.e., queries) are performed. This ensures a fairer comparison also in terms of the computational time and resources required to execute each attack.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 2: Query-distortion curves for MNIST (M2, top) and CIFAR10 (C1, bottom) models (untargeted scenario).
|
| 119 |
+
|
| 120 |
+
CW. This attack minimizes the soft-constraint version of our problem, i.e., $\begin{array} { r l } { \operatorname* { m i n } _ { \pmb { \delta } } \| \pmb { \delta } \| _ { p } + c \cdot \operatorname* { m i n } ( L ( \pmb { x } + } & { { } } \end{array}$ ${ \delta , y , \theta } ) , - \kappa )$ . The hyperparameters $\kappa$ and $c$ are used to tune the trade-off between perturbation size and misclassification confidence. To find minimum-norm perturbations, CW requires setting $\kappa = 0$ , while the constant $c$ is tuned via binary search (re-running the attack at each iteration). We set the number of binary-search steps to 9, and the maximum number of iterations to 250, to ensure that at least $1 , 0 0 0$ queries are performed. We also set different values for $c , \eta \in \{ 1 0 ^ { - 3 } , 1 0 ^ { - 2 } , 1 0 ^ { - 1 } , 1 \}$ .
|
| 121 |
+
|
| 122 |
+
DDN. This attack, similarly to ours, maximizes the misclassification confidence within an $\epsilon$ -sized constraint, while adjusting $\epsilon$ to minimize the perturbation size. We consider initial values of $\epsilon _ { 0 } \in$ $\{ 0 . 0 3 , 0 . 1 , 0 . 3 , 1 , 3 \}$ , and run the attack with a different number of iterations $K \in \{ 2 0 0 , 1 0 0 0 \}$ , as this affects the size of each update on $\pmb { \delta }$ .
|
| 123 |
+
|
| 124 |
+
$B B ,$ . This attack starts from a randomly-drawn adversarial point, performs a 10-step binary search to find a point which is closer to the decision boundary, and then updates the point to minimize its perturbation size by following the decision boundary. In each iteration, BB computes the optimal update within a given trust region of radius $\rho$ . We consider different values for $\rho \in \{ 1 0 ^ { - 3 } , 1 \dot { 0 } ^ { - 2 } , 1 0 ^ { - \dot { 1 } } , 1 \}$ while we fix the number of steps to 1000. We run the attack 3 times by considering different initialization points, and eventually retain the best solution.
|
| 125 |
+
|
| 126 |
+
$F A B$ . This attack iteratively optimizes the attack point by linearly approximating its distance to the decision boundary. It uses an adaptive step size bounded by $\alpha _ { \mathrm { m a x } }$ and an extrapolation step $\eta$ to facilitate finding adversarial points. As suggested by Croce and Hein [10], we tune $\alpha _ { \mathrm { m a x } } \in$ $\{ 0 . 1 , 0 . 0 5 \}$ and $\eta \in \{ 1 . 0 5 , 1 , 3 \}$ . We consider 3 different random initialization points, and run the attack for 500 steps each time, eventually selecting the best solution.
|
| 127 |
+
|
| 128 |
+
FMN. We run FMN for $K = 1 0 0 0$ steps, using $\gamma _ { 0 } \in \{ 0 . 0 5 , 0 . 3 \}$ , $\gamma _ { K } = 1 0 ^ { - 4 }$ , and $\alpha _ { K } = 1 0 ^ { - 5 }$ . For $\ell _ { 0 } , \ell _ { 1 }$ , and $\ell _ { 2 }$ , we set $\alpha _ { 0 } \in \{ 1 , 5 , 1 0 \}$ . For $\ell _ { \infty }$ , we set $\alpha _ { 0 } \in \{ 1 0 ^ { 1 } , 1 0 ^ { 2 } , 1 0 ^ { 3 } \}$ , as the normalized $\ell _ { 2 }$ step yields much smaller updates in the $\ell _ { \infty }$ norm. For each hyperparameter setting we run the attack twice, starting from (i) the input sample and (ii) an adversarial point.
|
| 129 |
+
|
| 130 |
+
Evaluation criteria. We evaluate the attacks along four different criteria: (i) perturbation size and (ii) robustness to hyperparameter selection, measured as the median $\| \delta ^ { \star } \| _ { p }$ on the test set (for a fixed budget of $Q$ queries and for sample- and dataset-level hyperparameter tuning, where by “robustness” we mean that a fixed hyperparameter configuration works well across different samples); (iii) execution time, measured as the average time spent per query (in milliseconds); and (iv) convergence speed, measured as the average number of queries required to converge to a good-enough solution (within $10 \%$ of the best value found at $Q = 1 0 0 0 ^ { \cdot }$ ). When computing the median, we follow the evaluation in [4]: the perturbation size is set to 0 if a clean sample is misclassified, while it is set to $\infty$ when the attack fails (no adversarial is found). The median perturbation size thus represents the value for which $50 \%$ of the samples evade a particular model.
|
| 131 |
+
|
| 132 |
+
# 3.2 Experimental Results
|
| 133 |
+
|
| 134 |
+
Query-distortion $( Q D )$ curves. To evaluate each attack in terms of perturbation size under the same query budget $Q$ , we use the so-called QD curves introduced by Brendel et al. [4]. These curves report, for each attack, the median value of $\delta ^ { \star }$ as a function of the number of queries $Q$ . For each given $Q$ value, the optimal $\delta ^ { \star }$ for each point is selected among the different attack executions (i.e., using different hyperparameters and/or initialization points, as described in Sect. 3.1). In Fig. 2, we report the QD curves for the MNIST and CIFAR10 challenge models (i.e., M2 and C1) in the untargeted scenario. The remaining QD curves exhibit a similar behavior and can be found in the supplementary material. It is worth noting that our attack attains comparable results in terms of perturbation size across all norms, while significantly outperforming FAB and BB in the $\ell _ { 1 }$ case. It typically requires also less iterations than the other attacks to converge. While the QD curves show the complete behavior of each attack as $Q$ increases, a more compact and thorough summary of our evaluation is reported below, according to the four evaluation criteria described in Sect. 3.1.
|
| 135 |
+
|
| 136 |
+
Perturbation size. Table 1 reports the median value of $\lVert \delta ^ { \star } \rVert$ at $Q = 1 0 0 0$ queries (i.e., the last value from the query-distortion curve), for all models, attacks and norms. The values obtained with sample-level hyperparamter tuning confirm that our attack can find smaller or comparable perturbations with those found by the competing attacks, in most of the untargeted and targeted cases, and that the biggest margin is achieved in the $\ell _ { 1 }$ case. FMN is only slightly worse than DDN and BB in a few cases, including $\ell _ { 2 }$ -DDN on M4 and $\ell _ { \infty }$ -BB on M2 and M4. The reason may be that these robust models exhibit noisy gradients and flat regions around the clean input samples, hindering the initial optimization steps of the FMN attack.
|
| 137 |
+
|
| 138 |
+
Robustness to hyperparameter selection. The values reported in the lower part of Table 1 show that, when using dataset-level hyperparameter tuning, FMN outperforms the other attacks in a much larger number of cases. This shows that FMN is more robust to hyperparameter changes, while other attacks like $\ell _ { 0 } \cdot$ and $\ell _ { 1 }$ -BB suffer when using the same hyperparameters for all samples.
|
| 139 |
+
|
| 140 |
+
Execution time. The average runtime per query for each attack-model pair, measured on a workstation with an NVIDIA GeForce RTX 2080 Ti GPU with 11GB of RAM, can be found in Table 2. The results show that our attack is up to 2-3 times faster, with the exception of DDN in the $\ell _ { 2 }$ case. This is however compensated by the fact that FMN finds better solutions. The advantage is that our attack avoids costly inner projections as in BB and FAB. FMN is slightly less time-efficient than DDN and CW, as it simultaneously updates the adversarial point and the norm constraint. In particular, the update on the constraint may initially require computing the norm of the gradient $\textbf { { g } }$ (line 6 in Algorithm 1), which increases the runtime of our attack. FAB computes a similar step, but for all the output classes, which hinders its scalability to problems with many classes.
|
| 141 |
+
|
| 142 |
+
Convergence speed. To get an estimate of the convergence speed, we measure the number of queries required by each attack to reach a perturbation size that is within $10 \%$ of the value found at $Q = 1 0 0 0$ queries (the lower the better). Results are shown in Table 3. Our attack converges on par with or faster than all other attacks for almost all models, often requiring only half or a fifth as many queries as the state of the art. Exceptions are MNIST and CIFAR10 challenge models (M2 and C1) for $\ell _ { 2 }$ and $\ell _ { \infty }$ , where BB and DDN occasionally converge faster. FMN rarely needs more than 100 steps, reaching the minimal perturbation after only 10-30 queries on many datasets, models and norms.
|
| 143 |
+
|
| 144 |
+
Robust accuracy. Despite our attack being not tailored to target specific defenses, and our evaluation restricted to a subset of the testing samples, it is worth remarking that the robust accuracies of the models against our attack are aligned with that reported in current evaluations, with the notable exception of C3, where our attack can decrease robust accuracy from $6 7 . 9 \%$ to $6 5 . 5 \%$ .
|
| 145 |
+
|
| 146 |
+
Experiments on ImageNet. We conclude our experiments by running an additional comparison between FMN and a widely-used maximum-confidence attack, i.e., the Projected Gradient Descent (PGD) attack [17], on two pretrained ImageNet models (i.e., ResNet18 and VGG16), considering $\ell _ { 1 }$ , $\ell _ { 2 }$ and $\ell _ { \infty }$ norms. The hyperparameters are tuned at the dataset-level using 20 validation samples. For FMN, we fix the hyperparameters as discussed before, and only tune $\alpha _ { 0 } \in \{ 0 . 1 , 1 , 2 , 8 \}$ , without using adversarial initialization. For PGD, we tune the step size $\alpha \in \{ 0 . 0 0 1 , 0 . 0 1 , 0 . 1 , 1 , 2 , 8 \}$ . We run both attacks for $Q = 1 , 0 0 0$ queries on a separate set of $1 , 0 0 0$ samples. The success rates of both attacks at fixed $\epsilon$ values are reported in Table 4. The results show that FMN outperforms or equals PGD in all norms.
|
| 147 |
+
|
| 148 |
+
Table 1: Median $\| \delta ^ { \star } \| _ { p }$ value at $Q = 1 0 0 0$ queries for targeted and untargeted attacks, with samplelevel and dataset-level hyperparameter tuning.
|
| 149 |
+
|
| 150 |
+
<table><tr><td></td><td></td><td colspan="6">MNIST</td><td colspan="6"></td><td colspan="5"></td></tr><tr><td></td><td></td><td colspan="3">Untargeted M2</td><td colspan="2"></td><td colspan="3">Targeted</td><td colspan="2">M4</td><td colspan="2">Untargeted C2</td><td colspan="2"></td><td colspan="2">Targeted C2</td></tr><tr><td>Model</td><td>M1</td><td></td><td>M3</td><td></td><td>M4</td><td>M1</td><td>M2 Sample-level Hyperparameter Tuning</td><td>M3</td><td></td><td>C1</td><td></td><td></td><td>C3</td><td>C1</td><td></td><td>C3</td></tr><tr><td>l</td><td>BB</td><td>8</td><td></td><td>15</td><td>94</td><td>14</td><td>27</td><td>24</td><td>93</td><td>8</td><td>12</td><td>13</td><td>19</td><td></td><td>32 32</td><td>25</td></tr><tr><td>l1</td><td>Ours FAB BB</td><td>7 6.60 6.26</td><td>9 3.08 5.81</td><td>15 14.23 13.16</td><td>5 109.4 5.44</td><td>14 1 12.42</td><td>20 1 10.38</td><td>24 1 20.41</td><td>23 1 6.25</td><td>8 4.79 3.75</td><td>11 5.17 4.29</td><td>14 8.79 8.62</td><td>19 1 8.04</td><td></td><td>- 10.93</td><td>27 - 15.71</td></tr><tr><td>l</td><td>Ours FAB Cw BB</td><td>5.57 1.45 1.49 1.43</td><td>2.95 1.36 4.22 1.34</td><td>12.04 2.62 2.78 2.61</td><td>1.96 2.97 1 1.61</td><td>12.20 - 2.33 2.27</td><td>6.75 1 6.97 2.04</td><td>18.79 1 3.54 3.23</td><td>7.31 - - 1.79</td><td>3.04 0.66 0.67 0.63</td><td>3.43 0.72 0.74 0.70</td><td>8.26 0.94 0.91 0.91</td><td>7.07 - 1.08 1.07</td><td></td><td>9.40 1 1.27 1.26</td><td>15.24 - 1.38 1.38</td></tr><tr><td>lo</td><td>DDN Ours FAB</td><td>1.46 1.41 .138</td><td>1.71 1.23 .337</td><td>2.56 2.50 .233</td><td>0.79 0.94 .421</td><td>2.29 2.28 -</td><td>2.20 1.89 1</td><td>3.27 3.19</td><td>1.33 1.85</td><td>0.64 0.61</td><td>0.73 0.69</td><td>0.91 0.91</td><td></td><td>1.09 1.03</td><td>1.29 1.21</td><td>1.39 1.38</td></tr><tr><td></td><td>BB Ours</td><td>.138 .134</td><td>.330 .339</td><td>.227 .226</td><td>.402 .404</td><td>.202 .201</td><td>.355 .389</td><td>1 .271 .272</td><td>.403 .406</td><td>.033 .032 .032</td><td>.043 .041 .040</td><td>.025 .024 .024</td><td>1 .055 .055</td><td></td><td>- .064 .063</td><td>- .037 .037</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>Dataset-level Hyperparameter Tuning</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>l</td><td>BB Ours</td><td>12 9</td><td>152 33</td><td>52 18</td><td>145 15</td><td>20 16</td><td>179 48</td><td>39 28</td><td>183 55</td><td>28 11</td><td>44 17</td><td>32 16</td><td>29 25</td><td>65 38</td><td></td><td>33 32</td></tr><tr><td>l1</td><td>FAB BB Ours</td><td>8.66 10.60 7.13</td><td>225.7 49.83 4.18</td><td>163.9 17.57 13.66</td><td>312.3 46.99 4.99</td><td>1 16.60 13.18</td><td>1 53.11 8.33</td><td>1 29.89</td><td>1 54.31</td><td>1 7.02 4.28</td><td>1 10.20 4.82</td><td>20.48 17.13 9.52</td><td>1 11.41</td><td></td><td>1 15.26 10.40</td><td>1 23.37 17.32</td></tr><tr><td>l</td><td>FAB Cw</td><td>1.54 1.63</td><td>1.59 5.15</td><td>2.81 3.71</td><td>16.30</td><td>1 2.50</td><td>1 1</td><td>21.37 1</td><td>12.16 1</td><td>0.77 0.86</td><td>1.11 1.00</td><td>1.06 0.99</td><td></td><td>8.51 1</td><td>- 2.90</td><td>- 1.55</td></tr><tr><td></td><td>BB</td><td></td><td></td><td></td><td>4.57</td><td>2.64</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1.73</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>2.30</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1.31</td><td>1.40</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>2.31</td><td></td><td></td><td>1.96</td><td>0.66</td><td>0.77</td><td>0.91</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>1.15</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>1.75</td><td>1.82</td><td>3.02</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1.36 1.25</td><td>1.45</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>-</td><td></td><td>2.59</td><td>4.72 3.52</td><td>- 5.31</td><td>0.86</td><td>0.95</td><td>1.10</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>DDN</td><td>1.47</td><td>2.01</td><td>2.62</td><td></td><td></td><td>2.72</td><td>3.36</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>1.56</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1.11</td><td></td><td></td></tr><tr><td></td><td></td><td>1.61</td><td>1.42</td><td>2.61</td><td></td><td></td><td>2.13</td><td>3.24</td><td>2.41</td><td>0.67</td><td>0.74</td><td>0.91</td><td></td><td></td><td></td><td>1.38</td></tr><tr><td></td><td>Ours</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1.09</td><td>1.28</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>:</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>l</td><td>FAB</td><td>.148</td><td>.365</td><td>.248</td><td>.900</td><td></td><td>-</td><td>-</td><td>1</td><td>.038</td><td>.052</td><td>.029 .029</td><td></td><td>- .059</td><td>- .074</td><td>, .042</td></tr><tr><td></td><td>BB</td><td>.159 .140</td><td>.336 .357</td><td>.243 .233</td><td>.409 .408</td><td>.223 .206</td><td>.361 .426</td><td>.280 .277</td><td>.477 .434</td><td></td><td>.044 .054 .034 .042</td></table>
|
| 151 |
+
|
| 152 |
+
Table 2: Average execution time (milliseconds / query) for each attack-model pair.
|
| 153 |
+
|
| 154 |
+
<table><tr><td></td><td></td><td colspan="7">MNIST</td><td colspan="7"></td></tr><tr><td rowspan="2"></td><td rowspan="2">Model</td><td colspan="3">Untargeted</td><td rowspan="2">M1</td><td colspan="3">Targeted</td><td rowspan="2"></td><td colspan="3">Untargeted</td><td colspan="3">Targeted</td></tr><tr><td>M1 M2</td><td>M3</td><td>M4</td><td>M2</td><td>M3</td><td>M4</td><td>C1</td><td>C2</td><td>C3</td><td>C1</td><td>C2</td><td>C3</td></tr><tr><td>l</td><td>BB</td><td>10.76</td><td>11.85</td><td>10.19</td><td>12.02</td><td>60.88</td><td>62.17</td><td>62.31</td><td>57.74</td><td>46.51</td><td>50.31</td><td>50.43</td><td>99.71</td><td>105.28</td><td>103.53</td></tr><tr><td></td><td>Ours</td><td>5.15</td><td>4.87</td><td>5.87</td><td>9.70</td><td>5.14</td><td>4.75</td><td>5.85</td><td>9.71</td><td>26.26</td><td>30.54</td><td>30.89</td><td>26.13</td><td>30.26</td><td>30.81</td></tr><tr><td>l1</td><td>FAB BB</td><td>9.38 6.73</td><td>8.88 7.03</td><td>12.61</td><td>36.00</td><td>- 43.25</td><td>- 43.54</td><td></td><td></td><td>84.04 32.56</td><td>108.91</td><td>108.64 37.59</td><td>- 68.99</td><td>73.33 =</td><td>- 74.03</td></tr><tr><td></td><td>Ours</td><td>5.43</td><td>5.14</td><td>7.31 6.10</td><td>12.50 9.35</td><td>5.44</td><td>5.10</td><td>43.69 6.09</td><td>43.86 9.35</td><td>27.34</td><td>37.40 31.17</td><td>31.18</td><td>26.00</td><td>30.98</td><td>31.03</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>l2</td><td>FAB</td><td>10.22</td><td>10.13</td><td>13.45</td><td>36.72</td><td>-</td><td>-</td><td>-</td><td>-</td><td>84.27</td><td>109.43</td><td>108.87</td><td>-</td><td>1</td><td>、 31.30</td></tr><tr><td></td><td>Cw</td><td>4.22</td><td>4.09</td><td>5.17</td><td>10.07</td><td>4.23</td><td>4.14</td><td>5.15</td><td>10.06</td><td>25.90</td><td>31.32</td><td>31.31</td><td>25.78</td><td>31.32</td><td>54.07</td></tr><tr><td></td><td>BB</td><td>4.44</td><td>4.15</td><td>5.03</td><td>12.38</td><td>26.20</td><td>26.76</td><td>27.24</td><td>31.00</td><td>26.64</td><td>31.82</td><td>31.90</td><td>48.74</td><td>54.35</td><td>29.52</td></tr><tr><td></td><td>DDN Ours</td><td>3.42 4.46</td><td>3.33 4.42</td><td>4.30</td><td>8.59</td><td>3.42</td><td>3.35</td><td>4.32</td><td>8.60</td><td>24.14</td><td>29.62</td><td>29.48</td><td>23.61</td><td>29.61</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td>5.48</td><td>9.15</td><td>4.50</td><td>4.44</td><td>5.47</td><td>9.09</td><td>24.88</td><td>30.22</td><td>30.08</td><td>25.39</td><td>30.21</td><td>30.04</td></tr><tr><td>l8</td><td>FAB</td><td>10.85</td><td>10.61</td><td>14.05</td><td>36.23</td><td>-</td><td>-</td><td>-</td><td>-</td><td>84.62</td><td>109.83</td><td>109.57</td><td>-</td><td>-</td><td>-</td></tr><tr><td></td><td>BB</td><td>14.26</td><td>16.36</td><td>13.51</td><td>15.44</td><td>38.61</td><td>38.87</td><td>36.39</td><td>34.85</td><td>61.34</td><td>62.36</td><td>62.63</td><td>83.70</td><td>87.64</td><td>88.90</td></tr><tr><td></td><td>Ours</td><td>4.25</td><td>4.33</td><td>5.30</td><td>9.17</td><td>4.33</td><td>4.23</td><td>5.31</td><td>9.10</td><td>24.84</td><td>30.15</td><td>30.01</td><td>24.78</td><td>30.19</td><td>30.03</td></tr></table>
|
| 155 |
+
|
| 156 |
+
# 4 Related Work
|
| 157 |
+
|
| 158 |
+
Gradient-based attacks on machine learning have a long history [3, 2]. Maximum-confidence attacks optimize the adversarial loss (e.g., the difference between the logits of the true class and the best non-true class) to find an adversarial point misclassifed with maximum confidence within a given, bounded perturbation size. While attacks in this category like FGSM [15], PGD [16, 17] and momentum-based extensions of PGD [26, 13] are popular, they only partially evaluate the adversarial robustness of a model. Minimum-norm attacks aim to minimize the norm of the perturbation subject to being adversarial. Attacks from this class give a more complete picture of the model robustness and allow us to compute the accuracy of the model under attacks with any post-hoc defined maximum perturbation size. L-BFGS [24] solves this problem with a quasi-Newton optimizer while CW [5] and EAD [8] use first-order gradient-based optimizers to minimize a weighted loss between perturbation size and misclassification confidence. To find the smallest adversarial perturbation, both CW and EAD need to tune the relative weighting which makes them query-inefficient. DeepFool [19] and SparseFool [18] compute gradients with respect to all classes in each step to estimate a linear approximation of the model from which the optimal adversarial perturbation can be computed. These two attacks are fast but do not converge to competitive solutions. BB [4] and FAB [10] use complex projections and approximations to stay close to the decision boundary (using the gradient to estimate the local geometry of the boundary) while minimizing the norm. This way of formulating minimum-norm optimization bypasses the tuning of a weighting term, but in the case of BB it also requires an adversarial starting point to begin with. The DDN attack [23] maximizes the adversarial criterion within a given norm constraint, and iteratively reduces the norm to find the smallest possible adversarial perturbation; however, it is constrained to $\ell _ { 2 }$ and does not perform well on other $\ell _ { p }$ norms.
|
| 159 |
+
|
| 160 |
+
Table 3: Number of queries required by each attack to reach a perturbation size that is within $10 \%$ o f the value obtained at $Q = 1 0 0 0$ .
|
| 161 |
+
|
| 162 |
+
<table><tr><td></td><td></td><td colspan="7">MNIST</td><td colspan="7">CIFAR10</td></tr><tr><td colspan="2"></td><td colspan="3">Untargeted</td><td></td><td colspan="3">Targeted</td><td colspan="3">Untargeted</td><td colspan="3">Targeted C1</td></tr><tr><td colspan="2">Model</td><td>M1</td><td>M2</td><td>M3</td><td>M4</td><td>M1</td><td>M2</td><td>M3</td><td>M4</td><td>C1</td><td>C2</td><td>C3</td><td>C2</td><td>C3</td></tr><tr><td>l</td><td>BB Ours</td><td>22 22</td><td>43 82</td><td>68 38</td><td>114 182</td><td>30 27</td><td>443 165</td><td>71 46</td><td>376 145</td><td>497 48</td><td>372 71</td><td>58 37</td><td>384 500 271</td><td>85</td></tr><tr><td>l1</td><td>FAB</td><td>44</td><td></td><td></td><td>569</td><td>1</td><td>1</td><td>-</td><td></td><td></td><td></td><td></td><td>146</td><td>70</td></tr><tr><td></td><td>BB</td><td>24</td><td>242 314</td><td>152 83</td><td>391</td><td>45</td><td>614 233</td><td>- 722</td><td>124 674</td><td>220 570</td><td>72 34</td><td>- 526</td><td>1 464</td><td>1 206</td></tr><tr><td></td><td>Ours</td><td>21</td><td>363</td><td>34</td><td>631</td><td>25</td><td>37</td><td>336</td><td>48</td><td>85</td><td>31</td><td>89</td><td>130</td><td>38</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>243</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>l2</td><td>FAB CW</td><td>14 110</td><td>60 799</td><td>40 335</td><td>532 -</td><td>- 100</td><td></td><td>-</td><td>18</td><td>28</td><td>14</td><td>-</td><td>-</td><td>- 42</td></tr><tr><td></td><td>BB</td><td>20</td><td>24</td><td>337</td><td>21</td><td>913 61</td><td>469 20</td><td>- 692</td><td>67 22</td><td>39 23</td><td>33 22</td><td>56 26</td><td>144 27</td><td>29</td></tr><tr><td></td><td></td><td></td><td></td><td>20</td><td></td><td></td><td>26</td><td>670</td><td>13</td><td>20</td><td>4</td><td>18</td><td>19</td><td>18</td></tr><tr><td></td><td>DDN Ours</td><td>12 16</td><td>136 94</td><td>15</td><td>474 190</td><td>12</td><td>149</td><td>188</td><td>28</td><td>23</td><td>7</td><td>25</td><td>29</td><td>13</td></tr><tr><td></td><td></td><td></td><td></td><td>16</td><td></td><td>11</td><td>136</td><td>16</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>lo</td><td>FAB BB</td><td>36</td><td>50</td><td>44</td><td>11 5</td><td>- 24</td><td>- 17</td><td></td><td>50</td><td>50</td><td>54</td><td></td><td>-</td><td>1</td></tr><tr><td></td><td></td><td>19</td><td>17</td><td>20</td><td></td><td></td><td>22 26</td><td>5 5</td><td>20 22</td><td>24 15</td><td>21 14</td><td>27 20</td><td>33 29</td><td>29</td></tr><tr><td></td><td>Ours</td><td>9</td><td>10</td><td>22</td><td>5</td><td>27</td><td>8</td><td></td><td></td><td></td><td></td><td></td><td></td><td>34</td></tr></table>
|
| 163 |
+
|
| 164 |
+
The proposed FMN attack belongs to the category of minimum-norm attacks, and builds on BB, FAB and DDN to retain their main advantages. First, FMN is not specific to a given norm, and converges in many fewer steps than soft-constraint attacks like CW, as it does not need to optimize the trade-off between perturbation size and misclassification confidence. FMN needs significantly less computational time per step than the other attacks, it is very accurate and easy to use, and it does not necessarily require being initialized from an adversarial starting point.
|
| 165 |
+
|
| 166 |
+
Table 4: Success rate $( \% )$ of FMN against PGD on ImageNet models.
|
| 167 |
+
|
| 168 |
+
<table><tr><td></td><td>ResNet18</td><td></td><td>VGG</td></tr><tr><td rowspan="2">l1 (∈ = 1.0)</td><td>PGD</td><td>31.4</td><td>30.4</td></tr><tr><td>FMN</td><td>38.4</td><td>39.8</td></tr><tr><td rowspan="2">l2 (∈= 0.15)</td><td>PGD</td><td>61.7</td><td>61.4</td></tr><tr><td>FMN</td><td>65.8</td><td>66.2</td></tr><tr><td rowspan="2">l (∈=4·10-4)</td><td>PGD</td><td>51.0</td><td>49.0</td></tr><tr><td>FMN</td><td>55.2</td><td>49.0</td></tr></table>
|
| 169 |
+
|
| 170 |
+
# 5 Contributions, Limitations, and Future Work
|
| 171 |
+
|
| 172 |
+
This work introduces a novel minimum-norm attack that combines all desirable traits to help improve current adversarial evaluations: (i) finding smaller or comparable minimum-norm perturbations across a range of models and datasets; (ii) being less sensitive to hyperparameter choices; and being extremely fast, by (iii) reducing runtime up to 3 times per query with respect to competing attacks and (iv) converging within less iterations. FMN also works with different $\ell _ { p }$ norms $( p = 0 , 1 , 2 , \infty )$ and it does not necessarily require being initialized from an adversarial starting point. Our experiments have shown that FMN rivals or surpasses other attacks in speed, reliability, efficacy and versatility. While FMN is able to find smaller perturbations consistently when compared against $\ell _ { 0 }$ and $\ell _ { 1 }$ attacks, it only rivals the performance of other attacks for $\ell _ { 2 }$ and $\ell _ { \infty }$ norms, especially when tested against robust models which may present obfuscated gradients. To overcome this limitation, FMN may be extended using smoothing strategies that help find better descent directions, e.g., by averaging gradients on randomly-perturbed inputs. This can be regarded as an interesting extension of FMN towards attacking robust models. In this respect, we also believe that FMN may facilitate minimumnorm adaptive evaluations in a more general sense. Adaptive evaluations, where the attack is modified to be maximally effective against a new defense, are the key element towards properly evaluating adversarial robustness [6, 25]. PGD attacks are popular in part for the ease by which they can be adapted to new defenses. Since FMN combines PGD with a dynamic minimization of the perturbation size, we argue that our attack can also be easily adapted to new defenses, thereby facilitating adaptive evaluations. FMN may also benefit from other improvements that have been suggested for PGD, including momentum, cyclical step sizes or restarts. We leave such improvements to future work.
|
| 173 |
+
|
| 174 |
+
To conclude, we firmly believe that FMN will establish itself as a useful tool in the arsenal of robustness evaluation. By facilitating more reliable robustness evaluations, we expect that FMN will foster advancements in the development of machine-learning models with improved robustness guarantees. We thus argue that there are neither ethical aspects nor evident future societal consequences with potential negative impacts that should be specifically addressed in the context of this work.
|
| 175 |
+
|
| 176 |
+
# Acknowledgements
|
| 177 |
+
|
| 178 |
+
This work has been partly supported by the PRIN 2017 project RexLearn (grant no. 2017TWNMH2), funded by the Italian Ministry of Education, University and Research; by the EU H2020 project ALOHA, under the European Union’s Horizon 2020 research and innovation programme (grant no. 780788); and by BMK, BMDW, and the Province of Upper Austria in the frame of the COMET Programme managed by FFG in the COMET Module S3AI. Wieland Brendel acknowledges support from the German Federal Ministry of Education and Research (BMBF) through the Competence Center for Machine Learning (TUE.AI, FKZ 01IS18039A), from the German Science Foundation (DFG) under grant no. BR 6382/1-1 (Emmy Noether Program) as well as support by Open Philantropy and the Good Ventures Foundation.
|
| 179 |
+
|
| 180 |
+
# References
|
| 181 |
+
|
| 182 |
+
[1] A. Athalye, N. Carlini, and D. A. Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In ICML, volume 80 of JMLR Workshop and Conf. Proceedings, pages 274–283. JMLR.org, 2018.
|
| 183 |
+
[2] B. Biggio and F. Roli. Wild patterns: Ten years after the rise of adversarial machine learning. Pattern Recognition, 84:317–331, 2018.
|
| 184 |
+
[3] B. Biggio, I. Corona, D. Maiorca, B. Nelson, N. Šrndic, P. Laskov, G. Giacinto, and F. Roli. ´ Evasion attacks against machine learning at test time. In H. Blockeel, K. Kersting, S. Nijssen, and F. Železný, editors, Machine Learning and Knowledge Discovery in Databases (ECML PKDD), Part III, volume 8190 of LNCS, pages 387–402. Springer Berlin Heidelberg, 2013.
|
| 185 |
+
[4] W. Brendel, J. Rauber, M. Kümmerer, I. Ustyuzhaninov, and M. Bethge. Accurate, reliable and fast robustness evaluation. In Advances in Neural Inf. Proc. Systems, pages 12861–12871, 2019.
|
| 186 |
+
[5] N. Carlini and D. Wagner. Towards evaluating the robustness of neural networks. In 2017 ieee symposium on security and privacy (sp), pages 39–57. IEEE, 2017.
|
| 187 |
+
[6] N. Carlini, A. Athalye, N. Papernot, W. Brendel, J. Rauber, D. Tsipras, I. Goodfellow, A. Madry, and A. Kurakin. On evaluating adversarial robustness. arXiv preprint arXiv:1902.06705, 2019.
|
| 188 |
+
[7] Y. Carmon, A. Raghunathan, L. Schmidt, J. C. Duchi, and P. S. Liang. Unlabeled data improves adversarial robustness. In Advances in Neural Inf. Proc. Systems, pages 11192–11203, 2019.
|
| 189 |
+
[8] P.-Y. Chen, Y. Sharma, H. Zhang, J. Yi, and C.-J. Hsieh. EAD: Elastic-net attacks to deep neural networks via adversarial examples. arXiv preprint arXiv:1709.04114, 2017.
|
| 190 |
+
[9] F. Croce and M. Hein. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks. In ICML, 2020.
|
| 191 |
+
[10] F. Croce and M. Hein. Minimally distorted adversarial examples with a fast adaptive boundary attack. In Int’l Conf. on Machine Learning, pages 2196–2205. PMLR, 2020.
|
| 192 |
+
[11] F. Croce, M. Andriushchenko, V. Sehwag, N. Flammarion, M. Chiang, P. Mittal, and M. Hein. Robustbench: a standardized adversarial robustness benchmark. arXiv preprint arXiv:2010.09670, 2020.
|
| 193 |
+
[12] G. W. Ding, L. Wang, and X. Jin. AdverTorch v0.1: An adversarial robustness toolbox based on pytorch. arXiv preprint arXiv:1902.07623, 2019.
|
| 194 |
+
[13] Y. Dong, F. Liao, T. Pang, H. Su, J. Zhu, X. Hu, and J. Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition, 2018.
|
| 195 |
+
[14] J. Duchi, S. Shalev-Shwartz, Y. Singer, and T. Chandra. Efficient projections onto the l 1-ball for learning in high dimensions. In Proceedings of the 25th Int’l Conf. on Machine learning, pages 272–279, 2008.
|
| 196 |
+
[15] I. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. In Int’l Conf. on Learning Representations, 2015. URL http://arxiv.org/abs/1412.6572.
|
| 197 |
+
[16] A. Kurakin, I. Goodfellow, and S. Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 198 |
+
[17] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 199 |
+
[18] A. Modas, S.-M. Moosavi-Dezfooli, and P. Frossard. Sparsefool: a few pixels make a big difference. In The IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 200 |
+
[19] S.-M. Moosavi-Dezfooli, A. Fawzi, and P. Frossard. Deepfool: A simple and accurate method to fool deep neural networks. In The IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), June 2016.
|
| 201 |
+
[20] N. Papernot, P. McDaniel, X. Wu, S. Jha, and A. Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In 2016 IEEE symposium on security and privacy (SP), pages 582–597. IEEE, 2016.
|
| 202 |
+
[21] J. Rauber, W. Brendel, and M. Bethge. Foolbox: A python toolbox to benchmark the robustness of machine learning models. In Reliable Machine Learning in the Wild Workshop, 34th Int’l Conf. on Machine Learning, 2017. URL http://arxiv.org/abs/1707.04131.
|
| 203 |
+
[22] J. Rauber, R. Zimmermann, M. Bethge, and W. Brendel. Foolbox native: Fast adversarial attacks to benchmark the robustness of machine learning models in pytorch, tensorflow, and jax. Journal of Open Source Software, 5(53):2607, 2020. doi: 10.21105/joss.02607. URL https://doi.org/10.21105/joss.02607.
|
| 204 |
+
[23] J. Rony, L. G. Hafemann, L. S. Oliveira, I. B. Ayed, R. Sabourin, and E. Granger. Decoupling direction and norm for efficient gradient-based l2 adversarial attacks and defenses. In Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition, pages 4322–4330, 2019.
|
| 205 |
+
[24] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. In Int’l Conf. on Learning Representations, 2014. URL http://arxiv.org/abs/1312.6199.
|
| 206 |
+
[25] F. Tramer, N. Carlini, W. Brendel, and A. Madry. On adaptive attacks to adversarial example defenses. In Advances in Neural Inf. Proc. Systems, 2020.
|
| 207 |
+
[26] J. Uesato, B. O’Donoghue, A. v. d. Oord, and P. Kohli. Adversarial risk and the dangers of evaluating against weak attacks. arXiv preprint arXiv:1802.05666, 2018.
|
| 208 |
+
[27] H. Zhang, H. Chen, C. Xiao, S. Gowal, R. Stanforth, B. Li, D. Boning, and C.-J. Hsieh. Towards stable and efficient training of verifiably robust neural networks. In Int’l Conf. on Learning Representations, 2020. URL https://openreview.net/forum?id $\equiv$ Skxuk1rFwB.
|
md/train/l0BP1lHpPW/l0BP1lHpPW.md
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Optimal Client Sampling for Federated Learning
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 It is well understood that client-master communication can be a primary bottleneck
|
| 11 |
+
2 in Federated Learning. In this work, we address this issue with a novel client sub
|
| 12 |
+
3 sampling scheme, where we restrict the number of clients allowed to communicate
|
| 13 |
+
4 their updates back to the master node. In each communication round, all partici
|
| 14 |
+
5 pated clients compute their updates, but only the ones with “important” updates
|
| 15 |
+
6 communicate back to the master. We show that importance can be measured using
|
| 16 |
+
7 only the norm of the update and give a formula for optimal client participation.
|
| 17 |
+
8 This formula minimizes the distance between the full update, where all clients
|
| 18 |
+
9 participate, and our limited update, where the number of participating clients is
|
| 19 |
+
10 restricted. In addition, we provide a simple algorithm that approximates the optimal
|
| 20 |
+
11 formula for client participation which only requires secure aggregation and thus
|
| 21 |
+
12 does not compromise client privacy. We show both theoretically and empirically
|
| 22 |
+
13 that our approach leads to superior performance for Distributed SGD (DSGD) and
|
| 23 |
+
14 Federated Averaging (FedAvg) compared to the baseline where participating clients
|
| 24 |
+
15 are sampled uniformly. Our approach is orthogonal to and compatible with ex
|
| 25 |
+
16 isting methods for reducing communication overhead, such as local methods and
|
| 26 |
+
17 communication compression methods.
|
| 27 |
+
|
| 28 |
+
# 18 1 Introduction
|
| 29 |
+
|
| 30 |
+
19 We consider the standard cross-device Federated Learning (FL) setting [13], where the objective is of
|
| 31 |
+
20 the form
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } \left[ f ( x ) : = \sum _ { i = 1 } ^ { n } w _ { i } f _ { i } ( x ) \right] ,
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
21 where $\boldsymbol { x } \in \mathbb { R } ^ { d }$ represents the parameters of a statistical model we aim to find, $n$ is the total number of
|
| 38 |
+
22 23 clients, owned $f _ { i } \colon { \mathbb { R } ^ { d } } \to { \mathbb { R } }$ $i$ ia $f _ { i } = \mathrm { E } _ { \xi \sim D _ { i } } \left[ f ( x , \xi ) \right]$ entiab, and $w _ { i } \geq 0$ loss function which dependsare client weights such that $\textstyle \sum _ { i = 1 } ^ { n } w _ { i } = 1$ $\mathcal { D } _ { i }$
|
| 39 |
+
24 We assume the classical FL setup in which a central master (server) orchestrates the training by
|
| 40 |
+
25 securely aggregating updates from clients without seeing the raw data.
|
| 41 |
+
|
| 42 |
+
# 26 1.1 Communication as the Bottleneck
|
| 43 |
+
|
| 44 |
+
27 It is well understood that cost of communication can be the primary bottleneck in Federated Learning.
|
| 45 |
+
28 Indeed, wireless links and other end-user internet connections typically operate at lower rates than
|
| 46 |
+
29 intra-datacenter or inter-datacenter links and can be potentially expensive and unreliable. Moreover,
|
| 47 |
+
30 the capacity of the aggregating master and other FL system considerations impose direct or indirect
|
| 48 |
+
31 constrains on the number of clients that are allowed to participate in each communication round.
|
| 49 |
+
32 These considerations have led to significant interest in reducing the communication bandwidth of FL
|
| 50 |
+
33 systems.
|
| 51 |
+
|
| 52 |
+
Submitted to 35th Conference on Neural Information Processing Systems (NeurIPS 2021). Do not distribute.
|
| 53 |
+
|
| 54 |
+
35 One of the most popular strategies is to reduce the frequency of communication and put more
|
| 55 |
+
36 emphasis on computation. This is usually achieved by asking the devices to perform multiple local
|
| 56 |
+
37 steps before communicating their updates. A prototype method in this category is the Federated
|
| 57 |
+
38 Averaging (FedAvg) algorithm [23]. The original work was a heuristic, offering no theoretical
|
| 58 |
+
39 guarantees, which motivated the community to try to understand the method and various existing and
|
| 59 |
+
40 new variants theoretically [35, 21, 15, 37, 17, 9].
|
| 60 |
+
|
| 61 |
+
# 41 1.1.2 Communication Compression
|
| 62 |
+
|
| 63 |
+
42 Another popular approach is to reduce the size of the object (typically gradients) communicated from
|
| 64 |
+
43 clients to the master. These techniques are usually referred to as gradient/communication compression.
|
| 65 |
+
44 In this approach, instead of transmitting the full-dimensional gradient/update vector $g \in \mathbf { \mathbb { R } } ^ { d }$ , one
|
| 66 |
+
45 transmits a compressed vector $\mathcal C ( g )$ , where $\mathcal { C } : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ is a (possibly random) operator chosen
|
| 67 |
+
46 such that $\mathcal { C } ( g )$ can be represented using fewer bits, for instance by using limited bit representation
|
| 68 |
+
47 (quantization) or by enforcing sparsity (sparsification). A particularly popular class of quantization
|
| 69 |
+
48 operators is based on random dithering [7, 30]; see [1, 41, 42, 28]. A new variant of random dithering
|
| 70 |
+
49 developed in [10] offers an exponential improvement on standard dithering. Sparse vectors can be
|
| 71 |
+
50 obtained by random sparsification techniques that randomly mask the input vectors and preserve a
|
| 72 |
+
51 constant number of coordinates only [40, 18, 36, 24, 39]. There is also a line of work [10, 3] where a
|
| 73 |
+
52 combination of sparsification and quantization was proposed to obtain a more aggressive combined
|
| 74 |
+
53 effect.
|
| 75 |
+
|
| 76 |
+
# 54 1.2 Related Work
|
| 77 |
+
|
| 78 |
+
55 Importance sampling methods for optimization have been studied extensively in the last few years in
|
| 79 |
+
56 several contexts, including convex optimization and deep learning. LASVM developed in [5], which is
|
| 80 |
+
57 an online algorithm that uses importance sampling to train kernelized support vector machines. The
|
| 81 |
+
58 first importance sampling for randomized coordinate descent methods was proposed in a seminal
|
| 82 |
+
59 paper in [26]. It was showed in [29] that the proposed sampling is optimal. Later, several extensions
|
| 83 |
+
60 and improvements followed [33, 20, 6, 27, 2, 38]. Another branch of work studies sample complexity.
|
| 84 |
+
61 In [25, 43], the authors make a connection with the variance of the gradient estimates of SGD and
|
| 85 |
+
62 show that the optimal sampling distribution is proportional to the per-sample gradient norm. In terms
|
| 86 |
+
63 of computation, obtaining this distribution is as hard as the computation of the full gradient, thus
|
| 87 |
+
64 it is not practical. For simpler problems, one can sample proportionally to the norms of the inputs,
|
| 88 |
+
65 which can be linked to the Lipschitz constants of the per-sample loss function for linear and logistic
|
| 89 |
+
66 regression. For instance, it was shown in [11] that static optimal sampling can be constructed even
|
| 90 |
+
67 for mini-batches and the probability is proportional to these Lipschitz constants under the assumption
|
| 91 |
+
68 that these constants of the per-sample loss function are known. Unfortunately, importance measures
|
| 92 |
+
69 such as smoothness of the gradient are often hard to compute/estimate for more complicated models
|
| 93 |
+
70 such as those arising in deep learning, where most of the importance sampling schemes are based
|
| 94 |
+
71 on heuristics. A manually designed sampling scheme was proposed in [4]. It was inspired by the
|
| 95 |
+
72 perceived way that human children learn; in practice, they provide the network with examples of
|
| 96 |
+
73 increasing difficulty in an arbitrary manner. In a diametrically opposite approach, it is common for
|
| 97 |
+
74 deep embedding learning to sample hard examples because of the plethora of easy non-informative
|
| 98 |
+
75 ones [32, 34]. Other approaches use a history of losses for previously seen samples to create the
|
| 99 |
+
76 sampling distribution and sample either proportionally to the loss or based on the loss ranking [31, 22].
|
| 100 |
+
77 In [16], the authors propose to sample based on the gradient norm of a small uniformly sampled
|
| 101 |
+
78 subset of samples.
|
| 102 |
+
79 In our work, we avoid all the aforementioned problems as our motivation is not to reduce computation,
|
| 103 |
+
80 which is not the main bottleneck of Federated Learning, but to use importance sampling to decrease
|
| 104 |
+
81 the number of bits communicated. This, as we show in Section 2, allows us to construct optimal
|
| 105 |
+
82 adaptive sampling; that is, we do not need to rely on any heuristics, historical losses, or partial
|
| 106 |
+
83 information.
|
| 107 |
+
85 In this work, we propose a new approach to addressing the communication bandwidth issues appearing
|
| 108 |
+
86 in FL. Our approach is based on the observation that in the situation where partial participation
|
| 109 |
+
87 is desired and a budget on the number of participating clients is applied, careful selection of the
|
| 110 |
+
88 participating clients can lead to better communication complexity, and hence faster training. In other
|
| 111 |
+
89 words, we claim that in any given communication round, some clients will have “more informative”
|
| 112 |
+
90 updates than others and that the training procedure will benefit from capitalizing on this fact by
|
| 113 |
+
91 ignoring some of the worthless updates.
|
| 114 |
+
92 In particular, we propose a principled optimal client sampling scheme capable of identifying the most
|
| 115 |
+
93 informative clients in any given communication round. Our scheme works by minimizing the variance
|
| 116 |
+
94 of the stochastic gradient produced by the partial participation procedure, which then translates to
|
| 117 |
+
95 a probable reduction in the number of communication rounds. To the best of our knowledge, this
|
| 118 |
+
96 approach was not considered before. Moreover, our proposal is orthogonal to and hence combinable
|
| 119 |
+
97 with existing approaches to communication reduction such as communication compression or local
|
| 120 |
+
98 updates (Section 3.2).
|
| 121 |
+
|
| 122 |
+
99 Our contributions can be summarized as follows:
|
| 123 |
+
|
| 124 |
+
• we propose a novel adaptive partial participation strategy for reducing communication in FL that works by a careful selection of the clients that are allowed to communicate their updates to the master node in any given communication round;
|
| 125 |
+
our adaptive client sampling procedure is optimal in the sense that it minimizes the variance of the master update;
|
| 126 |
+
• we propose an approximation to our optimal adaptive sampling strategy which only requires aggregation, thus allows for secure aggregation and stateless clients;
|
| 127 |
+
• we show theoretically that our approach allows for larger learning rates for Distributed SGD and FedAvg algorithms than the baseline which performs uniform client sampling, and as a result leads to better communication complexity.
|
| 128 |
+
• we show empirically that the performance of our approach is superior to uniform sampling and is close to full participation.
|
| 129 |
+
|
| 130 |
+
# 112 2 Smart Client Sampling for Reducing Communication
|
| 131 |
+
|
| 132 |
+
113 We now describe our client sampling strategy for reducing the communication bottleneck in Federated
|
| 133 |
+
114 Learning. Each client $i$ participating in round $k$ computes an update vector $\mathbf { U } _ { i } ^ { k } \in \mathbb { R } ^ { d }$ . For simplicity
|
| 134 |
+
115 and ease of exposition, we assume that all clients $i \in [ n ] : = \{ 1 , 2 , \dots , n \}$ are available in each round.
|
| 135 |
+
116 However, we would like to point out that this is not a limiting factor, and all presented theory can be
|
| 136 |
+
117 easily extended to the case of partial participation with an arbitrary distribution. In our framework,
|
| 137 |
+
118 only a subset of clients communicates their updates to the master node in each communication round
|
| 138 |
+
119 in order to reduce the number of transmitted bits.
|
| 139 |
+
120 In order to provide analysis in this framework, we consider a general partial participation frame
|
| 140 |
+
121 work [12], where we assume that the subset of participating clients is determined by an arbitrary
|
| 141 |
+
122 random set-valued mapping $\mathbb { S }$ (a “sampling”) with values in $\mathbf { \bar { 2 } } ^ { [ n ] }$ . A sampling $\mathbb { S }$ is uniquely defined
|
| 142 |
+
123 by assigning probabilities to all $2 ^ { n }$ subsets of $[ n ]$ . With each sampling $\mathbb { S }$ we associate a probability
|
| 143 |
+
124 matrix $\mathbf { \bar { P } } \in \mathbf { \bar { \mathbb { R } } } ^ { n \times n }$ defined by $\mathbf { P } _ { i j } : = \mathrm { P r o b } ( \{ i , j \} \subseteq \mathbb { S } )$ . The probability vector associated with $\mathbb { S }$ is
|
| 144 |
+
125 the vector composed of the diagonal entries of $\mathbf { P }$ : $p = ( p _ { 1 } , \ldots , p _ { n } ) \in \mathbb { R } ^ { n }$ , where $p _ { i } : = \mathrm { P r o b } ( i \in \mathbb { S } )$ .
|
| 145 |
+
126 We say that $\mathbb { S }$ is proper if $p _ { i } > 0$ for all $i$ . It is easy to show that $\begin{array} { r } { b : = \operatorname { E } \left[ | \mathbb { S } | \right] = \operatorname { T r a c e } \left( \mathbf { P } \right) = \sum _ { i = 1 } ^ { n } p _ { i } } \end{array}$
|
| 146 |
+
127 and hence $b$ can be seen as the expected number of clients participating in each communication round.
|
| 147 |
+
128 Given parameters $p _ { 1 } , \ldots , p _ { n } \in [ 0 , 1 ] .$ , consider a random set $\mathbb { S } \subseteq [ n ]$ generated as follows: for each
|
| 148 |
+
129 $i \in [ n ]$ , we include $i$ in $\mathbb { S }$ with probability $p _ { i }$ . This is called independent sampling, since the event
|
| 149 |
+
130 $i \in \mathbb S$ is independent of $j \in \mathbb S$ for any $i \neq j$ .
|
| 150 |
+
131 While our client sampling strategy can be adapted to essentially any underlying learning method, we
|
| 151 |
+
132 give details here for DSGD:
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
x ^ { k + 1 } = x ^ { k } - \eta ^ { k } \mathbf { G } ^ { k } , \quad \mathbf { G } ^ { k } : = \sum _ { i \in S ^ { k } } \frac { w _ { i } } { p _ { i } ^ { k } } \mathbf { U } _ { i } ^ { k } ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where $S ^ { k } \sim \mathbb { S } ^ { k }$ and $\mathbf { U } _ { i } ^ { k } = g _ { i } ^ { k }$ is an unbiased estimator of $\nabla f _ { i } ( x ^ { k } )$ . The scaling factor $\frac { 1 } { p _ { i } ^ { k } }$ is necessary in order to obtain an unbiased estimator of the true update, i.e., $\begin{array} { r } { \mathrm { E } _ { S ^ { k } } \left[ { \bf G } ^ { k } \right] = \sum _ { i = 1 } ^ { n } w _ { i } \mathbf { \bar { U } } _ { i } ^ { k } } \end{array}$ .
|
| 158 |
+
|
| 159 |
+
# 2.1 Optimal Client Sampling
|
| 160 |
+
|
| 161 |
+
We start with a simple observation that the variance of our gradient estimator 136 $\mathbf { G } ^ { k }$ can be decomposed 137 as
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\mathrm { E } \left[ \left. \mathbf { G } ^ { k } - \nabla f ( x ^ { k } ) \right. ^ { 2 } \right] = \mathrm { E } \left[ \left. \mathbf { G } ^ { k } - \sum _ { i = 1 } ^ { n } w _ { i } \mathbf { U } _ { i } ^ { k } \right. ^ { 2 } \right] + \mathrm { E } \left[ \left. \sum _ { i = 1 } ^ { n } w _ { i } \mathbf { U } _ { i } ^ { k } - \nabla f ( x ^ { k } ) \right. ^ { 2 } \right] .
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
138 Note that the second term on the right-hand side is independent of the sampling procedure and
|
| 168 |
+
139 the first term is zero if every client sends its update (i.e., if $p _ { i } ^ { k } = 1$ for all $i$ ). In order to provide
|
| 169 |
+
140 meaningful results, we restrict the expected number of clients to communicate in each round by
|
| 170 |
+
141 bounding $\begin{array} { r } { b ^ { k } : = \sum _ { i = 1 } ^ { n } p _ { i } ^ { k } } \end{array}$ by some positive integer $m \leq n$ . This raises the following question: What
|
| 171 |
+
142 is the sampling procedure that minimizes (3) for any given $m$ ? We answer this question using the
|
| 172 |
+
143 following technical lemma:
|
| 173 |
+
|
| 174 |
+
Lemma 1. Let 144 $\zeta _ { 1 } , \zeta _ { 2 } , \ldots , \zeta _ { n }$ be vectors in $\mathbb { R } ^ { d }$ and $w _ { 1 } , w _ { 2 } , \ldots , w _ { n }$ be non-negative real numbers such that 145 $\textstyle \sum _ { i = 1 } ^ { n } w _ { i } = 1$ . Define $\textstyle { \tilde { \zeta } } : = \sum _ { i = 1 } ^ { n } w _ { i } \zeta _ { i }$ . Let $S$ be a proper sampling. If $v \in \mathbb { R } ^ { n }$ is such that
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\mathbf { P } - p p ^ { \top } \preceq \mathbf { D i a g } ( p _ { 1 } v _ { 1 } , p _ { 2 } v _ { 2 } , \ldots , p _ { n } v _ { n } ) ,
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
146 then
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\operatorname { E } \left[ \left\| \sum _ { i \in S } { \frac { w _ { i } \zeta _ { i } } { p _ { i } } } - { \tilde { \zeta } } \right\| ^ { 2 } \right] \leq \sum _ { i = 1 } ^ { n } w _ { i } ^ { 2 } { \frac { v _ { i } } { p _ { i } } } \left\| \zeta _ { i } \right\| ^ { 2 } ,
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
where the expectation is taken over 147 $S$ . Whenever (3) holds, it must be the case that $v _ { i } \geq 1 - p _ { i }$
|
| 187 |
+
|
| 188 |
+
148 It turns out that given probabilities $\{ p _ { i } \}$ , among all samplings $S$ satisfying $p _ { i } = { \mathrm { P r o b } } ( i \in S )$ , the
|
| 189 |
+
149 independent sampling minimizes the left-hand side of (4). This is due to two nice properties: a) any
|
| 190 |
+
150 independent sampling admits optimal choice of $v$ , i.e., $v _ { i } = 1 - p _ { i }$ for all $i$ , and b) for independent
|
| 191 |
+
151 sampling (4) holds as equality. In the context of our method, these properties can be written as
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
\operatorname { E } \left[ \left\| \mathbf { G } ^ { k } - \sum _ { i = 1 } ^ { n } w _ { i } \mathbf { U } _ { i } ^ { k } \right\| ^ { 2 } \right] = \operatorname { E } \left[ \sum _ { i = 1 } ^ { n } w _ { i } ^ { 2 } { \frac { 1 - p _ { i } ^ { k } } { p _ { i } ^ { k } } } \left\| \mathbf { U } _ { i } ^ { k } \right\| ^ { 2 } \right] .
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
152 It now only remains to find the parameters $\{ p _ { i } ^ { k } \}$ defining the optimal independent sampling, i.e., one
|
| 198 |
+
153 that minimizes (5) subject to the constraints $0 \leq p _ { i } ^ { k } \leq 1$ and $\begin{array} { r } { \bar { b } ^ { k } : = \sum _ { i = 1 } ^ { n } p _ { i } ^ { k } \le m } \end{array}$ . It turns out that
|
| 199 |
+
154 this problem has the following closed-form solution:
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
p _ { i } ^ { k } = \left\{ \begin{array} { l l } { ( m + l - n ) \frac { \left\| \tilde { U } _ { i } ^ { k } \right\| } { \sum _ { j = 1 } ^ { l } \left\| \tilde { U } _ { ( j ) } ^ { k } \right\| } , } & { \quad \mathrm { i f } i \notin A ^ { k } , } \\ { 1 , } & { \quad \mathrm { i f } i \in A ^ { k } , } \end{array} \right.
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
where $\tilde { U } _ { i } ^ { k } : = w _ { i } \mathbf { U } _ { i } ^ { k }$ , and $\left\| \tilde { U } _ { ( j ) } ^ { k } \right\|$ is the $j$ -th largest value in $\left\{ \left\| \tilde { U } _ { i } ^ { k } \right\| \right\} _ { i = 1 } ^ { n } , l$ is the largest integer for which $\begin{array} { r } { 0 < m + l - n \leq \frac { \sum _ { i = 1 } ^ { l } \left. \tilde { U } _ { ( i ) } ^ { k } \right. } { \left. \tilde { U } _ { ( l ) } ^ { k } \right. } } \end{array}$ (note that this inequality at least holds for $l = n - m + 1 ,$ ), and $A ^ { k }$ contains indices $i$ such that $\left\| \tilde { U } _ { i } ^ { k } \right\| \geq \left\| \tilde { U } _ { ( l + 1 ) } ^ { k } \right\|$ . We summarize this procedure in Algorithm 1.
|
| 206 |
+
|
| 207 |
+
# 2.2 Secure Aggregation
|
| 208 |
+
|
| 209 |
+
Note that in the case $l = n$ , the optimal probabilities $p _ { i } ^ { k } = m \frac { \left\| \tilde { U } _ { i } ^ { k } \right\| } { \sum _ { j = 1 } ^ { n } \left\| \tilde { U } _ { j } ^ { k } \right\| }$ can be computed easily: the master aggregates the norm of each update and then sends the sum back to the clients. However, if $l < n$ , in order to compute optimal probabilities, the master would need to identify the norm of every
|
| 210 |
+
|
| 211 |
+
# Algorithm 1 Optimal Client Sampling (OCS).
|
| 212 |
+
|
| 213 |
+
1: Input: expected batch size $m$
|
| 214 |
+
2: each client $i$ computes a local update $\mathbf { U } _ { i } ^ { k }$ (in parallel)
|
| 215 |
+
3: each client $i$ sends the norm of its update $u _ { i } ^ { k } = w _ { i } \left\| \mathbf { U } _ { i } ^ { k } \right\|$ to the master (in parallel)
|
| 216 |
+
4: master computes optimal probabilities $p _ { i } ^ { k }$ using equation (6)
|
| 217 |
+
5: master broadcasts $p _ { i } ^ { k }$ to all clients
|
| 218 |
+
6: each client $i$ sends its update $\begin{array} { r } { \frac { w _ { i } } { p _ { i } ^ { k } } \mathbf { U } _ { i } ^ { k } } \end{array}$ to the master with probability $p _ { i } ^ { k }$ (in parallel)
|
| 219 |
+
162 update and perform partial sorting, which can be computationally expensive and also slightly violates
|
| 220 |
+
163 the privacy requirements of clients in $\mathrm { F L }$ .
|
| 221 |
+
164 Therefore, we develop an algorithm for approximately solving the problem, which only requires to
|
| 222 |
+
165 perform aggregation at the master node without compromising privacy of any client. The construction
|
| 223 |
+
166 of this algorithm is similar to [40]. We first set $\begin{array} { r } { \tilde { p } _ { i } ^ { k } = \frac { m \left\| \tilde { U } _ { i } ^ { k } \right\| } { \sum _ { j = 1 } ^ { n } \left\| \tilde { U } _ { j } ^ { k } \right\| } } \end{array}$ and $p _ { i } ^ { k } = \operatorname* { m i n } \{ \tilde { p } _ { i } ^ { k } , 1 \}$ . In an ideal
|
| 224 |
+
167 situation, this would be sufficient. However, due to the truncation operation, the expected minibatch
|
| 225 |
+
168 $\begin{array} { r } { b ^ { k } = \sum _ { i = 1 } ^ { n } p _ { i } ^ { k } \leq \sum _ { i = 1 } ^ { n } { \frac { m \left\| g _ { i } ^ { k } \right\| } { \sum _ { j = 1 } ^ { n } \left\| g _ { j } ^ { k } \right\| } } = m } \end{array}$ = m can be strictly less than m if p˜ki > 1 holds true for at
|
| 226 |
+
169 least one $i$ . Hence, we employ an iterative procedure to fix this gap by rescaling the probabilities
|
| 227 |
+
170 which are smaller than 1, as summarized in Algorithm 2. This algorithm is much easier to implement
|
| 228 |
+
171 and computationally more efficient on parallel computing architectures. In addition, it only requires a
|
| 229 |
+
172 secure aggregation procedure on the master, which is essential in privacy preserving $\mathrm { F L }$ , and thus it is
|
| 230 |
+
173 compatible with existing FL software and hardware. We realize that Algorithm 2 brings some extra
|
| 231 |
+
174 communication costs, but this is not an issue as it only requires to communicate $\mathcal { O } ( j _ { \operatorname* { m a x } } )$ extra floats
|
| 232 |
+
175 for each client. We pick $j _ { \mathrm { m a x } } = \mathcal { O } ( 1 )$ , and thus it is negligible for large models of size $d$ .
|
| 233 |
+
76 Remark 1. We realize that our algorithm requires two communication rounds per optimization round,
|
| 234 |
+
77 but the first round is negligible due to the minimal number of communicated bits as argued above.
|
| 235 |
+
|
| 236 |
+
# 178 3 Convergence Guarantees
|
| 237 |
+
|
| 238 |
+
179 In this section, we provide convergence analysis of DSGD and FedAvg with our optimal client sampling
|
| 239 |
+
180 technique and compare it with full participation and independent uniform sampling of $m$ clients.
|
| 240 |
+
181 We use standard assumptions [14] and assume throughout that $f$ has a unique minimizer $x ^ { \star }$ with
|
| 241 |
+
182 $f ^ { \star } = f ( x ^ { \star } ) > - \infty$ . We further assume that $f$ is $\mu$ -strongly convex and $f _ { i }$ ’s are $L$ -smooth and
|
| 242 |
+
183 convex. Detailed definitions of convexity and smoothness can be found in the Appendix. Note that
|
| 243 |
+
184 nothing prevents us from extending the results in this section to convex and non-convex cases with a
|
| 244 |
+
185 similar standard analysis, since our proposed method only affects the aggregation step as described in
|
| 245 |
+
186 Section 2, which is independent of the strong convexity assumption.
|
| 246 |
+
|
| 247 |
+
Assumption 1 (Gradient oracle for DSGD). The stochastic gradient estimator 187 $g _ { i } ^ { k } = \nabla f _ { i } ( x ^ { k } ) + \xi _ { i } ^ { k }$ of the local gradient 188 $\nabla f _ { i } ( x ^ { k } )$ , for each round $k$ and all $i = 1 , \ldots , n$ , satisfies
|
| 248 |
+
|
| 249 |
+
$$
|
| 250 |
+
\mathrm { E } \left[ \xi _ { i } ^ { k } \right] = 0
|
| 251 |
+
$$
|
| 252 |
+
|
| 253 |
+
189 and
|
| 254 |
+
|
| 255 |
+
$$
|
| 256 |
+
\begin{array} { r } { \mathrm { E } \left[ \left. \xi _ { i } ^ { k } \right. ^ { 2 } | x _ { i } ^ { k } \right] \leq M \left. \nabla f _ { i } ( x ^ { k } ) \right. ^ { 2 } + \sigma ^ { 2 } , \mathrm { ~ f o r ~ s o m e ~ } M \geq 0 . } \end{array}
|
| 257 |
+
$$
|
| 258 |
+
|
| 259 |
+
This further implies that 190 $\begin{array} { r } { \mathrm { E } \left[ \frac { 1 } { n } \sum _ { i = 1 } ^ { n } g _ { i } ^ { k } \mid x ^ { k } \right] = \nabla f ( x ^ { k } ) . } \end{array}$
|
| 260 |
+
|
| 261 |
+
Assumption 2 (Gradient oracle for FedAvg). The stochastic gradient estimator 191 $g _ { i } ( y _ { i , r } ^ { k } ) =$ 192 $\nabla f _ { i } ( y _ { i , r } ^ { k } ) + \xi _ { i , r } ^ { k }$ of the local gradient $\nabla f _ { i } ( y _ { i , r } ^ { k } )$ , for each round $k$ , each local step $r = 0 , \ldots , R$ and 193 all $i = 1 , \ldots , n$ , satisfies
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\mathrm { E } \left[ \xi _ { i , r } ^ { k } \right] = 0
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
194 and
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
\begin{array} { r } { \mathrm { E } \left[ \left. \xi _ { i , r } ^ { k } \right. ^ { 2 } | y _ { i , r } ^ { k } \right] \leq M \left. \nabla f _ { i } ( y _ { i , r } ^ { k } ) \right. ^ { 2 } + \sigma ^ { 2 } , \mathrm { ~ f o r ~ s o m e ~ } M \geq 0 , } \end{array}
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
where 195 $y _ { i , 0 } ^ { k } = x ^ { k }$ and $y _ { i , r } ^ { k } = y _ { i , r - 1 } ^ { k } - \eta _ { l } g _ { i } ( y _ { i , r } ^ { k } ) , r = 1 , \cdot \cdot \cdot , R .$
|
| 274 |
+
|
| 275 |
+
# Algorithm 2 Approximate Optimal Client Sampling (AOCS).
|
| 276 |
+
|
| 277 |
+
1: Input: expected batch size $m$ , maximum number of iteration $j _ { \mathrm { m a x } }$
|
| 278 |
+
2: each client $i$ computes an update $\mathbf { U } _ { i } ^ { k }$ (in parallel)
|
| 279 |
+
3: each client $i$ sends the norm of its update $u _ { i } ^ { k } = w _ { i } \left\| \mathbf { U } _ { i } ^ { k } \right\|$ to the master (in parallel)
|
| 280 |
+
4: master aggregates $\begin{array} { r } { u ^ { k } = \sum _ { i = 1 } ^ { n } u _ { i } ^ { k } } \end{array}$
|
| 281 |
+
5: master broadcasts $u ^ { k }$ to all clients
|
| 282 |
+
6: each client $i$ computes $\begin{array} { r } { p _ { i } ^ { k } = \operatorname* { m i n } \{ \frac { m u _ { i } ^ { k } } { u ^ { k } } , 1 \} } \end{array}$ (in parallel)
|
| 283 |
+
7: for $j = 1 , \cdots , j _ { m a x } \ : \epsilon$ do
|
| 284 |
+
8: each client $i$ sends $t _ { i } ^ { k } = ( 1 , p _ { i } ^ { k } )$ to the master if $p _ { i } ^ { k } < 1$ ; else sends $t _ { i } ^ { k } = ( 0 , 0 )$ (in parallel)
|
| 285 |
+
9: master aggregates $\begin{array} { r } { ( I ^ { k } , P ^ { k } ) = \sum _ { i = 1 } ^ { n } t _ { i } ^ { k } } \end{array}$
|
| 286 |
+
10: master computes Ck = (m−n+Ik)
|
| 287 |
+
11: master broadcasts $C ^ { k }$ to all clients
|
| 288 |
+
12: each client $i$ recalibrates $p _ { i } ^ { k } = \operatorname* { m i n } \{ C ^ { k } p _ { i } ^ { k } , 1 \}$ if $p _ { i } ^ { k } < 1$ (in parallel)
|
| 289 |
+
13: if $C ^ { k } \leq 1$ then
|
| 290 |
+
14: break
|
| 291 |
+
15: end if
|
| 292 |
+
16: end for
|
| 293 |
+
17: each clients $i$ sends its update $\begin{array} { r } { \frac { w _ { i } } { p _ { i } ^ { k } } \mathbf { U } _ { i } ^ { k } } \end{array}$ to master with probability $p _ { i } ^ { k }$ (in parallel)
|
| 294 |
+
|
| 295 |
+
196 We also define two quantities, which appear in our convergence guarantees:
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
R _ { i } : = f _ { i } ( x ^ { \star } ) - f _ { i } ^ { \star } , \quad r ^ { k } : = x ^ { k } - x ^ { \star } ,
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
where 97 $f _ { i } ^ { \star }$ is the functional value of $f _ { i }$ at its optimum. $R _ { i }$ represents the mismatch between the local and global minimizer, and 98 $r ^ { k }$ captures the distance of the current point to the minimizer of $f$ .
|
| 302 |
+
|
| 303 |
+
199 Equipped with these assumptions, we are ready to proceed with our convergence guarantees. We start
|
| 304 |
+
200 with the definition of the improvement factor
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\alpha ^ { k } : = \frac { \mathrm { E } \left[ \left. \sum _ { i \in S ^ { k } } \frac { w _ { i } } { p _ { i } ^ { k } } \mathbf { U } _ { i } ^ { k } - \sum _ { i = 1 } ^ { n } w _ { i } \mathbf { U } _ { i } ^ { k } \right. ^ { 2 } \right] } { \mathrm { E } \left[ \left. \sum _ { i \in U ^ { k } } \frac { w _ { i } } { p _ { i } ^ { U } } \mathbf { U } _ { i } ^ { k } - \sum _ { i = 1 } ^ { n } w _ { i } \mathbf { U } _ { i } ^ { k } \right. ^ { 2 } \right] } ,
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
201 where $S ^ { k } \sim \mathbb { S } ^ { k }$ with $p _ { i } ^ { k }$ defined in (6) and $U ^ { k } \sim \mathbf { U }$ is an independent uniform sampling with
|
| 311 |
+
202 $p _ { i } ^ { U } = m / n$ . By construction, $\alpha ^ { k }$ is less than or equal to one, as $\mathbb { S } ^ { k }$ minimizes the variance term. In
|
| 312 |
+
203 addition, $\alpha ^ { k }$ can reach zero in the case where there are at most $m$ non-zero updates. If $\alpha ^ { k } = 0$ ,
|
| 313 |
+
204 our method performs as if all updates were communicated. In the worst-case $\hat { \alpha ^ { k } } = 1$ , our method
|
| 314 |
+
205 performs as if we picked $m$ updates uniformly at random, and one cannot do better due to the
|
| 315 |
+
206 structure of the updates $\mathbf { U } _ { i } ^ { k }$ . In the following subsections, we analyze specific methods for solving the
|
| 316 |
+
207 optimization problem (1) under the aforementioned assumptions. The proofs and detailed description
|
| 317 |
+
208 are deferred to the Appendix.
|
| 318 |
+
209 Fairness. Based on our sampling strategy, it might be tempting to assume that the obtained solution
|
| 319 |
+
210 could exhibit fairness issues. In our convergence analysis, we show that this is not the case, as our
|
| 320 |
+
211 proposed methods converge to the optimal solution. Hence, as long as the original objective has no
|
| 321 |
+
212 inherent issue with fairness, our methods do not exhibit any fairness issues. Besides, our algorithm
|
| 322 |
+
213 can be used in conjunction with other “more fair” objectives, e.g., tilted ERM [19].
|
| 323 |
+
|
| 324 |
+
# 214 3.1 Distributed SGD with Optimal Client Sampling
|
| 325 |
+
|
| 326 |
+
215 We begin with the convergence analysis for DSGD (see (2)) with optimal client sampling.
|
| 327 |
+
|
| 328 |
+
1: Input: initial global model $x ^ { 1 }$ , global and local step-sizes $\eta _ { g } ^ { k }$ , $\eta _ { l } ^ { k }$
|
| 329 |
+
2: for each round $k = 1 , \ldots , K$ do
|
| 330 |
+
3: master broadcasts $x ^ { k }$ to all clients $i \in [ n ]$
|
| 331 |
+
4: for each client $i \in [ n ]$ (in parallel) do
|
| 332 |
+
5: initialize local model $y _ { i , 0 } ^ { k } \gets x ^ { k }$
|
| 333 |
+
6: for $r = 1 , \ldots , R$ do
|
| 334 |
+
7: compute mini-batch gradient $g _ { i } ( y _ { i , r - 1 } ^ { k } )$
|
| 335 |
+
8: update $y _ { i , r } ^ { k } y _ { i , r - 1 } ^ { k } - \eta _ { l } ^ { k } g _ { i } ( y _ { i , r - 1 } ^ { k } )$
|
| 336 |
+
9: end for
|
| 337 |
+
10: compute $\mathbf { U } _ { i } ^ { k } : = \Delta y _ { i } ^ { k } = x ^ { k } - y _ { i , R } ^ { k }$
|
| 338 |
+
11: compute $p _ { i } ^ { k }$ using Algorithm 1 or 2
|
| 339 |
+
12: send $\begin{array} { r } { \frac { w _ { i } } { p _ { i } ^ { k } } \Delta y _ { i } ^ { k } } \end{array}$ to master with probability $p _ { i } ^ { k }$
|
| 340 |
+
13: end for
|
| 341 |
+
14: master computes $\begin{array} { r } { \Delta x ^ { k } = \sum _ { i \in S ^ { k } } \frac { w _ { i } } { p _ { i } ^ { k } } \Delta y _ { i } ^ { k } } \end{array}$
|
| 342 |
+
15: master updates global model $x ^ { k + 1 } \gets x ^ { k } - \eta _ { g } ^ { k } \Delta x ^ { k }$
|
| 343 |
+
16: end for
|
| 344 |
+
|
| 345 |
+
216 Theorem 2. Let $f _ { i }$ be $L$ -smooth and convex for all $i = 1 , \ldots , n .$ . Let $f$ be $\mu$ -strongly convex. Suppose that Assumption 1 holds. Choose 217 $\begin{array} { r } { \eta ^ { k } \in \left( 0 , \frac { \gamma ^ { k } } { ( 1 + \operatorname* { m a x } _ { i \in [ n ] } \left\{ w _ { i } \right\} M ) L } \right) } \end{array}$ , where
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\gamma ^ { k } : = \frac { m } { \alpha ^ { k } ( n - m ) + m } \in \left[ \frac { m } { n } , 1 \right] , \quad k = 0 , \dots , K - 1 .
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
218 Define
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\beta _ { 1 } : = \sum _ { i = 1 } ^ { n } w _ { i } ^ { 2 } \big ( 2 L \big ( 1 + M \big ) R _ { i } + \sigma ^ { 2 } \big ) \quad a n d \quad \beta _ { 2 } : = 2 L \sum _ { i = 1 } ^ { n } w _ { i } ^ { 2 } R _ { i } .
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
219 Then, the iterates of DSGD with optimal client sampling (6) satisfy
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\mathrm { E } \left[ \left. r ^ { k + 1 } \right. ^ { 2 } \right] \leq ( 1 - \mu \eta ^ { k } ) \mathrm { E } \left[ \left. r ^ { k } \right. ^ { 2 } \right] + ( \eta ^ { k } ) ^ { 2 } \left( \frac { \beta _ { 1 } } { \gamma ^ { k } } - \beta _ { 2 } \right) .
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
Interpretation. In order to understand the results of Theorem 2, we first look at the best and worst case scenarios. In the best case scenario, we have $\gamma ^ { k } = 1$ for all $k$ . This implies that there is no loss of speed comparing to the method with full participation. It is indeed confirmed by our theory as our obtained recursion recovers the best-known rate of DSGD in the full participation regime [8]. Similarly, in the worst case, we have $\gamma ^ { k } = m / n$ for all $k$ ’s, which corresponds to uniform sampling with sample size $m$ and our recursion recovers the best-know rate for DSGD in this regime. This is expected as (12) implies that each update $\mathbf { U } _ { i } ^ { k }$ is equivalent, thus we cannot hope for better rate than the uniform sampling. In the general scenario, our obtain recursion sits somewhere between full and uniform partial participation, where the actual position is determined by $\gamma ^ { k }$ which capture the distribution of updates (here gradients) on clients. For instance, with a larger number of $\gamma ^ { k }$ ’s tending to 1, we are closer to full participation regime. Similarly, with more $\gamma ^ { \overline { { k } } }$ ’s tending to $m / n$ , we are closer to the rate of partial participation.
|
| 364 |
+
|
| 365 |
+
# 3.2 FedAvg with Optimal Client Sampling
|
| 366 |
+
|
| 367 |
+
One of the most common approaches to optimization for Federated Learning is Federated Averaging (FedAvg) [23], an adaption of local-update to parallel SGD. In FedAvg, each client runs some number of SGD steps locally, and then local updates are averaged to form the global update which is then used for the global model on the master. Pseudo-code that adapts the standard FedAvg algorithm to our framework is given in Algorithm 3.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 1: Distributions of the three datasets considered.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 2: (Dataset 1) validation accuracy and (local) training loss as a function of the number of communication rounds and the number of bits communicated from clients to the master.
|
| 374 |
+
|
| 375 |
+
Theorem 3. Assume that 238 $f _ { i }$ is $L$ -smooth and $\mu$ -strongly convex for all $i = 1 , \ldots , n$ and Assumption 2 holds. Let 239 $\eta ^ { k } : = R \eta _ { l } ^ { k } \eta _ { g } ^ { k }$ be the effective step-size and $\begin{array} { r } { \eta _ { g } ^ { k } \ge \sqrt { \frac { \gamma ^ { k } } { \sum _ { i } w _ { i } ^ { 2 } } } } \end{array}$ , where
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\gamma ^ { k } : = \frac { m } { \alpha ^ { k } ( n - m ) + m } \in \left[ \frac { m } { n } , 1 \right] .
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
If 240 $\begin{array} { r } { \eta ^ { k } \leq \frac { 1 } { 8 } \operatorname* { m i n } \bigg \{ \frac { 1 } { L ( 2 + M / R ) } , \frac { \gamma ^ { k } } { ( 1 + \operatorname* { m a x } _ { i \in [ n ] } \{ w _ { i } \} ( 1 + M / R ) ) L } \bigg \} } \end{array}$ , then the iterates of FedAvg $R \geq 2 ,$ ) with 241 optimal client sampling (6) satisfy
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\frac { 3 } { 8 } \mathrm { E } \left[ \left( f ( x ^ { k } ) - f ^ { \star } \right) \right] \leq \frac { 1 } { \eta ^ { k } } \left( 1 - \frac { \mu \eta ^ { k } } { 2 } \right) \mathrm { E } \left[ \left. r ^ { k } \right. ^ { 2 } \right] - \frac { 1 } { \eta ^ { k } } \mathrm { E } \left[ \left. r ^ { k + 1 } \right. ^ { 2 } \right] + \eta ^ { k } \beta _ { 1 } ^ { k } + ( \eta ^ { k } ) ^ { 2 } \beta _ { 2 } ,
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
242 where
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\beta _ { 1 } ^ { k } : = \frac { 2 \sigma ^ { 2 } } { \gamma ^ { k } R } \sum _ { i = 1 } ^ { n } w _ { i } ^ { 2 } + 4 L \left( \frac M R + 1 - \gamma ^ { k } \right) \sum _ { i = 1 } ^ { n } w _ { i } ^ { 2 } R _ { i } \quad a n d \quad \beta _ { 2 } : = 7 2 L ^ { 2 } \left( 1 + \frac M R \right) \sum _ { i = 1 } ^ { n } w _ { i } R _ { i } .
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
243 Interpretation. Similar to DSGD, the convergence guarantees of FedAvg with optimal client sam
|
| 394 |
+
244 pling (Algorithm 3) sits somewhere between the performances of those with full and uniform partial
|
| 395 |
+
245 participations, where the actual position is again determined by the distribution of updates which
|
| 396 |
+
246 directly impact $\alpha ^ { k }$ ’s that are linked to $\gamma ^ { k }$ ’s. In the edge cases, i.e. $\gamma ^ { k } = 1$ (best case) or $\gamma ^ { k } = m / n$
|
| 397 |
+
247 (worst case), we recover the state-of-the-art complexity guarantees provided in [15] in both regimes.
|
| 398 |
+
248 Note that our results are slightly more general, as [15] assumes $M = 0$ and $w _ { i } = 1 / n$ .
|
| 399 |
+
|
| 400 |
+
# 249 4 Experiments
|
| 401 |
+
|
| 402 |
+
In this section, we empirically evaluate our optimal client sampling method, comparing it with 1) the baseline where participating clients are sampled uniformly from available clients in each round and 2) full participation where all available clients participate. We simulate the cross-device FL setting and train our models using TensorFlow Federated (TFF)1. For all three methods, we report validation accuracy and (local) training loss (vertical axis) as a function of the number of communication rounds and the number of bits communicated from clients to the master (horizontal axis). Each figure displays the mean performance with standard error over 5 independent runs. For a fair comparison, we use the same random seed for the three compared methods in a single run and vary random seeds across different runs.
|
| 403 |
+
|
| 404 |
+
Setup. We conclude an evaluation on FedAvg where we extend the TFF implementation of FedAvg2 to fit our framework. For the model, we use the two-layer Convolutional Neural Network (CNN)
|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
Figure 3: (Dataset 2) validation accuracy and (local) training loss as a function of the number of communication rounds and the number of bits communicated from clients to the master.
|
| 408 |
+
|
| 409 |
+

|
| 410 |
+
Figure 4: (Dataset 3) validation accuracy and (local) training loss as a function of the number of communication rounds and the number of bits communicated from clients to the master.
|
| 411 |
+
|
| 412 |
+
261 provided in the implementation. The default dataset is Federated EMNIST with only digits, but as this
|
| 413 |
+
262 is a well-balanced dataset with mostly the same quality data on each client, we modify it by removing
|
| 414 |
+
263 some clients or some of their training images, in order to better simulate conditions in which our
|
| 415 |
+
264 proposed methods bring significant theoretical improvements. As a result, we produce 3 unbalanced
|
| 416 |
+
265 datasets as summarized in Figure 1, on which we train the CNN model. For validation, we use the
|
| 417 |
+
266 unchanged validation set in the Federated EMNIST dataset, which consists of 40, 832 validation
|
| 418 |
+
267 images. In each communication round of FedAvg, $n = 3 2$ clients are sampled uniformly from the
|
| 419 |
+
268 client pool, each of which then performs several SGD steps on its local training images for 1 epoch
|
| 420 |
+
269 with batch size 20. For partial participation, the expected number of clients allowed to communicate
|
| 421 |
+
270 their updates back to the master is set to $m = 3$ for all the experiments. We use constant step sizes,
|
| 422 |
+
271 where we set $\eta _ { g } = 1$ and tune $\eta _ { l }$ from the set of values $\{ 2 ^ { - 1 } , 2 ^ { - 2 } , 2 ^ { - 3 } , 2 ^ { - 4 } , 2 ^ { - 5 } \}$ using a holdout
|
| 423 |
+
272 set. We implement our sampling procedure using Algorithm 2, as this supports stateless clients and
|
| 424 |
+
273 secure aggregation. We include extra communication costs in our results, where we set $j _ { \mathrm { m a x } } = 4$
|
| 425 |
+
274 More details of the hyper-parameters that we use can be found in the Appendix.
|
| 426 |
+
275 Results and Discussions. As predicted by our theory, the performance of FedAvg with our proposed
|
| 427 |
+
276 optimal client sampling strategy is in between the performances of that with full and uniform partial
|
| 428 |
+
277 participation. Figures 2, 3 and 4 (red curves: optimal sampling; blue curves: uniform sampling; green
|
| 429 |
+
278 curves: full participation) show that, for all three datasets, the optimal sampling strategy performs
|
| 430 |
+
279 slightly worse than but is still competitive with the full participation strategy in terms of the number
|
| 431 |
+
280 of communication rounds – it almost reached the performance of full participation while only less
|
| 432 |
+
281 than $1 0 \%$ of the available clients communicate their updates back to the master. Note that the uniform
|
| 433 |
+
282 sampling strategy performs significantly worse, which indicates that a careful choice of sampling
|
| 434 |
+
283 probabilities can go a long way towards closing the gap between the performance of naive uniform
|
| 435 |
+
284 sampling and full participation.
|
| 436 |
+
285 More importantly, and this was the main motivation of our work, our optimal sampling strategy is
|
| 437 |
+
286 significantly better than both the uniform sampling and full participation strategies when we compare
|
| 438 |
+
287 validation accuracy as a function of the number of bits communicated from clients to the master.
|
| 439 |
+
288 For instance, in case of Dataset 1 (Figure 2), while our optimal sampling approach reached around
|
| 440 |
+
289 $8 5 \%$ validation accuracy after $2 ^ { 6 } \times 1 0 ^ { 8 }$ communicated bits, neither the full nor the uniform sampling
|
| 441 |
+
290 strategies are able to exceed $40 \%$ validation accuracy within the same communication budget. Indeed,
|
| 442 |
+
291 to reach the same $85 \%$ validation accuracy, full participation approach needs to communicate more
|
| 443 |
+
292 than $2 ^ { 9 } \times 1 0 ^ { 8 }$ bits, i.e., $8 \times$ more, and uniform sampling approach needs to communicate about the
|
| 444 |
+
293 same number of bits as full participation or even more. The results for Datasets 2 and 3 are of a
|
| 445 |
+
294 similar qualitative nature, showing that these conclusions are robust across the datasets considered.
|
| 446 |
+
295 In the Appendix, we include additional figures which show the current best validation accuracy as a
|
| 447 |
+
296 function of the number of communication rounds and the number of bits communicated from clients
|
| 448 |
+
297 to the master.
|
| 449 |
+
|
| 450 |
+
98 References [1] Dan Alistarh, Jerry Li, Ryota Tomioka, and Milan Vojnovic. QSGD: Randomized quantization for communication-optimal stochastic gradient descent. arXiv preprint arXiv:1610.02132, 2016. [2] Zeyuan Allen-Zhu, Zheng Qu, Peter Richtárik, and Yang Yuan. Even faster accelerated coordinate descent using non-uniform sampling. In International Conference on Machine Learning, pages 1110–1119, 2016. [3] Debraj Basu, Deepesh Data, Can Karakus, and Suhas Diggavi. Qsparse-local-SGD: Distributed SGD with quantization, sparsification and local computations. In Advances in Neural Information Processing Systems, pages 14668–14679, 2019. [4] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pages 41–48, 2009. [5] Antoine Bordes, Seyda Ertekin, Jason Weston, and Léon Bottou. Fast kernel classifiers with online and active learning. Journal of Machine Learning Research, 6(Sep):1579–1619, 2005. [6] Olivier Fercoq and Peter Richtárik. Accelerated, parallel, and proximal coordinate descent. SIAM Journal on Optimization, 25(4):1997–2023, 2015. [7] WM Goodall. Television by pulse code modulation. Bell System Technical Journal, 30(1):33–49, 1951. [8] Robert Mansel Gower, Nicolas Loizou, Xun Qian, Alibek Sailanbayev, Egor Shulgin, and Peter Richtárik. SGD: General analysis and improved rates. Proceedings of the 36th International Conference on Machine Learning, Long Beach, California, 2019. [9] Filip Hanzely and Peter Richtárik. Federated learning of a mixture of global and local models. arXiv:2002.05516, 2020. [10] Samuel Horváth, Chen-Yu Ho, L’udovit Horváth, Atal Narayan Sahu, Marco Canini, and Peter Richtárik. Natural compression for distributed deep learning. arXiv preprint arXiv:1905.10988, 2019. [11] Samuel Horváth and Peter Richtárik. Nonconvex variance reduced optimization with arbitrary sampling. Proceedings of the 36th International Conference on Machine Learning, 2019. [12] Samuel Horváth and Peter Richtárik. A better alternative to error feedback for communicationefficient distributed learning. arXiv preprint arXiv:2006.11077, 2020. [13] Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Keith Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019. [14] Hamed Karimi, Julie Nutini, and Mark Schmidt. Linear convergence of gradient and proximalgradient methods under the polyak-łojasiewicz condition. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 795–811. Springer, 2016. [15] Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank J Reddi, Sebastian U Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for on-device federated learning. arXiv preprint arXiv:1910.06378, 2019. [16] Angelos Katharopoulos and François Fleuret. Not all samples are created equal: Deep learning with importance sampling. arXiv preprint arXiv:1803.00942, 2018. [17] Ahmed Khaled, Konstantin Mishchenko, and Peter Richtárik. Tighter theory for local SGD on identical and heterogeneous data. In The 23rd International Conference on Artificial Intelligence and Statistics (AISTATS 2020), 2020. [18] Jakub Konecný and Peter Richtárik. Randomized distributed mean estimation: Accuracy vs. ˇ communication. Frontiers in Applied Mathematics and Statistics, 4:62, 2018.
|
| 451 |
+
|
| 452 |
+
[19] Tian Li, Ahmad Beirami, Maziar Sanjabi, and Virginia Smith. Tilted empirical risk minimization. In International Conference on Learning Representations, 2021.
|
| 453 |
+
[20] Qihang Lin, Zhaosong Lu, and Lin Xiao. An accelerated proximal coordinate gradient method. In Advances in Neural Information Processing Systems, pages 3059–3067, 2014.
|
| 454 |
+
[21] Tao Lin, Sebastian U Stich, Kumar Kshitij Patel, and Martin Jaggi. Don’t use large mini-batches, use local SGD. arXiv preprint arXiv:1808.07217, 2018.
|
| 455 |
+
[22] Ilya Loshchilov and Frank Hutter. Online batch selection for faster training of neural networks. arXiv preprint arXiv:1511.06343, 2015.
|
| 456 |
+
[23] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pages 1273–1282, 2017.
|
| 457 |
+
[24] Konstantin Mishchenko, Filip Hanzely, and Peter Richtárik. $9 9 \%$ of parallel optimization is inevitably a waste of time. arXiv preprint arXiv:1901.09437, 2019.
|
| 458 |
+
[25] Deanna Needell, Rachel Ward, and Nati Srebro. Stochastic gradient descent, weighted sampling, and the randomized kaczmarz algorithm. In Advances in neural information processing systems, pages 1017–1025, 2014.
|
| 459 |
+
[26] Yu Nesterov. Efficiency of coordinate descent methods on huge-scale optimization problems. SIAM Journal on Optimization, 22(2):341–362, 2012.
|
| 460 |
+
[27] Zheng Qu, Peter Richtárik, and Tong Zhang. Quartz: Randomized dual coordinate ascent with arbitrary sampling. In Advances in Neural Information Processing Systems 28, pages 865–873, 2015.
|
| 461 |
+
[28] Ali Ramezani-Kebrya, Fartash Faghri, and Daniel M Roy. NUQSGD: Improved communication efficiency for data-parallel SGD via nonuniform quantization. arXiv preprint arXiv:1908.06077, 2019.
|
| 462 |
+
[29] Peter Richtárik and Martin Takác. Iteration complexity of randomized block-coordinate descent ˇ methods for minimizing a composite function. Mathematical Programming, 144(1-2):1–38, 2014.
|
| 463 |
+
[30] Lawrence Roberts. Picture coding using pseudo-random noise. IRE Transactions on Information Theory, 8(2):145–154, 1962.
|
| 464 |
+
[31] Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015.
|
| 465 |
+
[32] Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 815–823, 2015.
|
| 466 |
+
[33] Shai Shalev-Shwartz and Tong Zhang. Accelerated proximal stochastic dual coordinate ascent for regularized loss minimization. In International conference on machine learning, pages 64–72, 2014.
|
| 467 |
+
[34] Edgar Simo-Serra, Eduard Trulls, Luis Ferraz, Iasonas Kokkinos, Pascal Fua, and Francesc Moreno-Noguer. Discriminative learning of deep convolutional feature point descriptors. In Proceedings of the IEEE International Conference on Computer Vision, pages 118–126, 2015.
|
| 468 |
+
[35] Sebastian U Stich. Local SGD converges fast and communicates little. ICLR 2019 - International Conference on Learning Representations, 2019.
|
| 469 |
+
[36] Sebastian U Stich, Jean-Baptiste Cordonnier, and Martin Jaggi. Sparsified SGD with memory. In Advances in Neural Information Processing Systems, pages 4447–4458, 2018.
|
| 470 |
+
[37] Sebastian U Stich and Sai Praneeth Karimireddy. The error-feedback framework: Better rates for SGD with delayed gradients and compressed communication. ICLR 2020 - International Conference on Learning Representations, 2020.
|
| 471 |
+
[38] Sebastian U Stich, Anant Raj, and Martin Jaggi. Safe adaptive importance sampling. In Advances in Neural Information Processing Systems, pages 4381–4391, 2017.
|
| 472 |
+
[39] Thijs Vogels, Sai Praneeth Karimireddy, and Martin Jaggi. PowerSGD: Practical low-rank gradient compression for distributed optimization. In Advances in Neural Information Processing Systems, pages 14236–14245, 2019.
|
| 473 |
+
[40] Jianqiao Wangni, Jialei Wang, Ji Liu, and Tong Zhang. Gradient sparsification for communication-efficient distributed optimization. In Advances in Neural Information Processing Systems, pages 1299–1309, 2018.
|
| 474 |
+
[41] Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in Neural Information Processing Systems, pages 1509–1519, 2017.
|
| 475 |
+
[42] Hantian Zhang, Jerry Li, Kaan Kara, Dan Alistarh, Ji Liu, and Ce Zhang. Zipml: Training linear models with end-to-end low precision, and a little bit of deep learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 4035–4043. JMLR. org, 2017.
|
| 476 |
+
[43] Peilin Zhao and Tong Zhang. Stochastic optimization with importance sampling for regularized loss minimization. In international conference on machine learning, pages 1–9, 2015.
|
| 477 |
+
|
| 478 |
+
1. For all authors...
|
| 479 |
+
|
| 480 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 481 |
+
(b) Did you describe the limitations of your work? [Yes] See Remark 1, where we acknowledge that our algorithm requires two (although the first one is negligible) communication rounds per iteration.
|
| 482 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] We discussed potential fairness issues in Section 3.
|
| 483 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 484 |
+
|
| 485 |
+
2. If you are including theoretical results...
|
| 486 |
+
|
| 487 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 3 and Appendix A.
|
| 488 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] See Appendix C-F for complete proofs. We also provided interpretations of our theorems in the main paper and discussed the relationship between our results and related results in the literature.
|
| 489 |
+
|
| 490 |
+
3. If you ran experiments...
|
| 491 |
+
|
| 492 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplemental material.
|
| 493 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4 and Appendix B
|
| 494 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We ran every experiment 5 times with different random seeds and reported results with error bars.
|
| 495 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] Since we only run simulations, this is not applicable.
|
| 496 |
+
|
| 497 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 498 |
+
|
| 499 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 4
|
| 500 |
+
(b) Did you mention the license of the assets? [Yes] All the data and assets we used in this manuscript are open-source.
|
| 501 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We included an anonymized URL in the supplemental material for the datasets used.
|
| 502 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 503 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 504 |
+
|
| 505 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 506 |
+
|
| 507 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 508 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 509 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/l3YcqzaPlx0/l3YcqzaPlx0.md
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEIGHBOR2SEQ: DEEP LEARNING ON MASSIVE GRAPHS BY TRANSFORMING NEIGHBORS TO SEQUENCES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Modern graph neural networks (GNNs) use a message passing scheme and have achieved great success in many fields. However, this recursive design inherently leads to excessive computation and memory requirements, making it not applicable to massive real-world graphs. In this work, we propose the Neighbor2Seq to transform the hierarchical neighborhood of each node into a sequence. This novel transformation enables the subsequent use of general deep learning operations, such as convolution and attention, that are designed for grid-like data. Therefore, our Neighbor2Seq naturally endows GNNs with the efficiency and advantages of deep learning operations on grid-like data by precomputing the Neighbor2Seq transformations. In addition, our Neighbor2Seq can alleviate the over-squashing issue suffered by GNNs based on message passing. We evaluate our method on a massive graph, with more than 111 million nodes and 1.6 billion edges, as well as several medium-scale graphs. Results show that our proposed method is scalable to massive graphs and achieves superior performance across massive and mediumscale graphs.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Graph neural networks (GNNs) have shown effectiveness in many fields with rich relational structures, such as citation networks (Kipf & Welling, 2016; Velickovi ˇ c et al., 2018), social net- ´ works (Hamilton et al., 2017), drug discovery (Gilmer et al., 2017; Stokes et al., 2020), physical systems (Battaglia et al., 2016), and point clouds (Wang et al., 2019). Most current GNNs follow a message passing scheme (Gilmer et al., 2017; Battaglia et al., 2018), in which the representation of each node is recursively updated by aggregating the representations of its neighbors. Various GNNs (Li et al., 2016; Kipf & Welling, 2016; Velickovi ˇ c et al., 2018; Xu et al., 2019) mainly differ ´ in the forms of aggregation functions.
|
| 12 |
+
|
| 13 |
+
Real-world applications usually generate massive graphs, such as social networks. However, message passing methods have difficulties in handling such large graphs as the recursive message passing mechanism leads to prohibitive computation and memory requirements. To date, sampling methods (Hamilton et al., 2017; Ying et al., 2018; Chen et al., 2018a;b; Huang et al., 2018; Zou et al., 2019; Zeng et al., 2020; Gao et al., 2018; Chiang et al., 2019; Zeng et al., 2020) and precomputing methods (Wu et al., 2019; Rossi et al., 2020; Bojchevski et al., 2020) have been proposed to scale GNNs on large graphs. While the sampling methods can speed up training, they might result in redundancy, still incur high computational complexity, lead to loss of performance, or introduce bias (see Section 2.2). Generally, precomputing methods can scale to larger graphs as compared to sampling methods as recursive message passing is still required in sampling methods.
|
| 14 |
+
|
| 15 |
+
In this work, we propose the Neighbor2Seq that transforms the hierarchical neighborhood of each node to a sequence in a precomputing step. After the Neighbor2Seq transformation, each node and its associated neighborhood tree are converted to an ordered sequence. Therefore, each node can be viewed as an independent sample and is no longer constrained by the topological structure. This novel transformation from graphs to grid-like data enables the use of mini-batch training for subsequent models. As a result, our models can be used on extremely large graphs, as long as the Neighbor2Seq step can be precomputed.
|
| 16 |
+
|
| 17 |
+
As a radical departure from existing precomputing methods, we consider the hierarchical neighborhood of each node as an ordered sequence. The order information corresponds to hops between nodes. As a result of our Neighbor2Seq transformation, generic deep learning operations for gridlike data, such as convolution and attention, can be applied in subsequent models. In addition, our Neighbor2Seq can alleviate the over-squashing issue (Alon & Yahav, 2020) suffered by current GNNs. Experimental results indicate that our proposed method can be used on a massive graph, where most current methods cannot be applied. Furthermore, our method achieves superior performance as compared with previous sampling and precomputing methods.
|
| 18 |
+
|
| 19 |
+
# 2 ANALYSIS OF CURRENT GRAPH NEURAL NETWORK METHODS
|
| 20 |
+
|
| 21 |
+
We start by defining necessary notations. A graph is formally defined as $\mathcal { G } = ( V , E )$ , where $V$ is the set of nodes and $E \subseteq V \times V$ is the set of edges. We use $n = | V |$ and $m = | E |$ to denote the numbers of nodes and edges, respectively. The nodes are indexed from 1 to $n$ . We consider a node feature matrix $\ b { X } \in \mathbb { R } ^ { n \times \breve { d } }$ , where each row $\pmb { x } _ { i } \in \mathbb { R } ^ { d }$ is the $d$ -dimensional feature vector associated with node $i$ . The topology information of the graph is encoded in the adjacency matrix $\ b { A } \in \mathbb { R } ^ { n \times n }$ , where $A _ { ( i , j ) } = 1$ if an edge exists between node $i$ and node $j$ , and $A _ { ( i , j ) } = 0$ otherwise.
|
| 22 |
+
|
| 23 |
+
# 2.1 GRAPH NEURAL NETWORKS VIA MESSAGE PASSING
|
| 24 |
+
|
| 25 |
+
There are two primary deep learning methods on graphs (Bronstein et al.); those are, spectral methods and spatial methods. The spectral method in Bruna et al. (2014) extends convolutional neural networks (LeCun et al., 1989) to the graph domain based on the spectrum of the graph Laplacian. The main limitation of spectral methods is the high complexity. ChebNet (Defferrard et al., 2016) and GCN (Kipf & Welling, 2016) simplify the spectral methods and can be understood from the spatial perspective. In this work, we focus on the analysis of the current mainstream spatial methods. Generally, most existing spatial methods, such as ChebNet (Defferrard et al., 2016), GCN (Kipf & Welling, 2016), GG-NN (Li et al., 2016), GAT (Velickovi ˇ c et al., 2018), and GIN (Xu et al., ´ 2019), can be understood from the message passing perspective (Gilmer et al., 2017; Battaglia et al., 2018). Specifically, we iteratively update node representations by aggregating representations from its immediate neighbors. These message passing methods have been shown to be effective in many fields. However, they have inherent difficulties when applied on large graphs due to their excessive computation and memory requirements, as described in Section 2.2.
|
| 26 |
+
|
| 27 |
+
# 2.2 GRAPH NEURAL NETWORKS ON LARGE GRAPHS
|
| 28 |
+
|
| 29 |
+
The above message passing methods are often trained in full batch. This requires the whole graph, i.e., all the node representations and edge connections, to be in memory to allow recursive message passing on the whole graph. Usually, the number of neighbors grows very rapidly with the increase of receptive field. Hence, these methods cannot be applied directly on large-scale graphs due to the prohibitive requirements on computation and memory. To enable deep learning on large graphs, two families of methods have been proposed; those are methods based on sampling and precomputing.
|
| 30 |
+
|
| 31 |
+
To circumvent the recursive expansion of neighbors across layers, sampling methods apply GNNs on a sampled subset of nodes with mini-batch training. Sampling methods can be further divided into three categories. First, node-wise sampling methods perform message passing for each node in its sampled neighborhood. This strategy is first proposed in GraphSAGE (Hamilton et al., 2017), where neighbors are randomly sampled. This is extended by PinSAGE (Ying et al., 2018), which selects neighbors based on random walks. VR-GCN (Chen et al., 2018a) further proposes to use variance reduction techniques to obtain a convergence guarantee. Although these node-wise sampling methods can reduce computation, the remaining computation is still very expensive and some redundancy might have been introduced, as described in Huang et al. (2018). Second, layer-wise sampling methods sample a fixed number of nodes for each layer. In particular, FastGCN (Chen et al., 2018b) samples a fixed number of nodes for each layer independently based on the degree of each node. AS-GCN (Huang et al., 2018) and LADIES (Zou et al., 2019) introduce between-layer dependencies during sampling, thus alleviating the loss of information. Layer-wise sampling methods can avoid the redundancy introduced by node-wise sampling methods. However, the expensive sampling algorithms that aim to ensure performance may themselves incur high computational cost, as pointed out in Zeng et al. (2020). Third, graph-wise sampling methods build mini-batches on sampled subgraphs. Specifically, LGCN (Gao et al., 2018) proposes to leverage mini-batch training on subgraphs selected by Breadth-First-Search algorithms. ClusterGCN (Chiang et al., 2019) conducts mini-batch training on sampled subgraphs that are obtained by a graph clustering algorithm. GraphSAINT (Zeng et al., 2020) proposes to derive subgraphs by importance-sampling and introduces normalization techniques to eliminate biases. These graph-wise sampling methods usually have high efficiency. The main limitation is that the nodes in a sampled subgraph are usually clustered together. This implies that two distant nodes in the original graph usually cannot be feeded into the GNNs in the same mini-batch during training, potentially leading to bias in the trained models.
|
| 32 |
+
|
| 33 |
+
The second family of methods for enabling GNNs training on large graphs are based on procomputing. Specifically, SGC (Wu et al., 2019) removes the non-linearity between GCN layers, resulting in a simplification as $Y = \mathrm { s o f t m a x } ( \hat { A } ^ { L } X W )$ . In this formulation, $\hat { \pmb { A } } = \tilde { \pmb { D } } ^ { - \frac 1 2 } \tilde { \pmb { A } } \tilde { \pmb { D } } ^ { - \frac 1 2 }$ is the symmetrically normalized adjacency matrix, ${ \tilde { A } } = A + I$ is the adjacency matrix with self-loops, $\tilde { D }$ is the corresponding diagonal node degree matrix with $\begin{array} { r } { \tilde { D } _ { ( i , i ) } = \mathrm { \bar { \sum } } _ { j } \tilde { A } _ { ( i , j ) } } \end{array}$ , $L$ is the size of receptive field (i.e., the number of considered neighboring hops), which is the same as a $L$ -layer GCN, $\mathbf { Y }$ is the output of the softmax classifier. Since there is no learnable parameters in $\hat { A } ^ { L } X$ , this term can be precomputed as a feature pre-processing step. Similarly, SIGN (Rossi et al., 2020) applies an inception-like model to the precomputed features ${ \hat { A } } ^ { \ell } X$ for $\ell \in \{ 1 , \cdots , L \}$ , where $L$ is the predefined size of receptive field. Instead of precomputing the smoothing features as in SGC and SIGN, PPRGo (Bojchevski et al., 2020) extends the idea of PPNP (Klicpera et al., 2018) by approximately precomputing the personalized PageRank (Page et al., 1999) matrix, thereby enabling model training on large graphs using mini-batches. Generally, the precomputing methods can scale to larger graphs than sampling methods because the latter still needs to perform the recursive message passing during training. Differing from these precomputing methods, we consider the hierarchical neighborhood of each node as an ordered sequence, thus retaining the useful information about hops between nodes and enabling subsequent powerful and efficient operations.
|
| 34 |
+
|
| 35 |
+
# 3 THE PROPOSED NEIGHBOR2SEQ METHOD AND ANALYSIS
|
| 36 |
+
|
| 37 |
+
In this section, we describe our proposed method, known as Neighbor2Seq, which transforms the hierarchical neighborhood of each node into an ordered sequence, thus enabling the subsequent use of general deep learning operations. We analyze the scalability of our method (See Section 3.5) and describe how our method can alleviate the over-squashing issue suffered by current message passing methods (See Section 3.6).
|
| 38 |
+
|
| 39 |
+
# 3.1 OVERVIEW
|
| 40 |
+
|
| 41 |
+
As described in Section 2.1, existing message passing methods recursively update each node’s representation by aggregating information from its immediate neighbors. Hence, what these methods aim at capturing for each node is essentially its corresponding hierarchical neighborhood, i.e., the neighborhood tree rooted at current node, as illustrated in Figure 1 (b). In this work, we attempt to go beyond the message passing scheme to overcome the limitations mentioned in Section 2. We propose to capture the information of this hierarchical neighborhood by transforming it into an ordered sequence, instead of recursively squashing it into a fixed-length vector. Our proposed method is composed of three steps. First, we transform a neighborhood to a sequence for each node. Second, we apply a normalization technique to the derived sequence features. Third, we use general deep learning operations, i.e., convolution and attention, to learn from these sequence features and then make predictions for nodes. In the following, we describe these three steps in detail.
|
| 42 |
+
|
| 43 |
+
# 3.2 NEIGHBOR2SEQ: TRANSFORMING NEIGHBORHOODS TO SEQUENCES
|
| 44 |
+
|
| 45 |
+
The basic idea of Neighbor2Seq is to transform the hierarchical neighborhood of each node to an ordered sequence by integrating the features of nodes in each layer of the neighborhood tree. Following the notations defined in Section 2, we let $z _ { 0 } ^ { i } , z _ { 1 } ^ { i } , \cdots , z _ { L } ^ { i }$ denote the resulting sequence for node $i$ , where $L$ is the height (i.e., the number of hops we consider) of the neighborhood tree rooted at node $i$ . $z _ { \ell } ^ { i } \in \mathbb { R } ^ { d }$ denotes the $\ell$ -th feature of the sequence. The length of the resulting sequence for each node is $L + 1$ . Formally, for each node $i$ , our Neighbor2Seq can be expressed as
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: (a) An illustration of the original graph. The current node is denoted as two concentric circles. (b) Message passing in the neighborhood tree. (c) Our proposed Neighbor2Seq. (d) Our proposed models: Neighbor2Seq $^ +$ Conv and Neighbor2Seq+Attn.
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
z _ { \ell } ^ { i } = \sum _ { j = 1 } ^ { n } w ( i , j , \ell ) { \pmb x } _ { j } , \quad \forall \ell \in \{ 0 , 1 , 2 , \cdot \cdot \cdot , L \} ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $w ( i , j , \ell )$ denotes the number of walks with length $\ell$ between node $i$ and $j , n$ is the number of nodes in the graph. We define $w ( i , j , 0 )$ as 1 for $j = i$ and 0 otherwise. Hence, $z _ { 0 } ^ { i }$ is the original node feature $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ . Intuitively, $\boldsymbol { z } _ { \ell } ^ { i }$ is obtained by computing a weighted sum of features of all nodes with walks of length $\ell$ to $i$ , and the numbers of qualified walks are used as the corresponding weights. Our Neighbor2Seq is illustrated in Figure 1 (c). Note that the derived sequence has meaningful order information, indicating the hops between nodes. After we obtain ordered sequences from the original hierarchical neighborhoods, we can use generic deep learning operations to learn from these sequences, as detailed below.
|
| 55 |
+
|
| 56 |
+
# 3.3 NORMALIZATION
|
| 57 |
+
|
| 58 |
+
Since the number of nodes in the hierarchical neighborhood grows exponentially as the hop number increases, different layers in the neighborhood tree have drastically different numbers of nodes. Hence, feature vectors of a sequence computed by Equation (1) have very different scales. In order to make the subsequent learning easier, we propose a layer to normalize the sequence features. We use a normalization technique similar to layer normalization (Ba et al., 2016). In particular, each feature of a sequence is normalized based on the mean and the standard deviation of its own feature values. Formally, our normalization process for each node $i$ can be written as
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { r l } & { { \boldsymbol y } _ { \ell } ^ { i } = W _ { \ell } \boldsymbol z _ { \ell } ^ { i } , \quad { \boldsymbol o } _ { \ell } ^ { i } = \frac { \boldsymbol y _ { \ell } ^ { i } - { \boldsymbol \mu } _ { \ell } ^ { i } } { \sigma _ { \ell } ^ { i } } \odot \gamma _ { \ell } + \beta _ { \ell } , \quad \forall \ell \in \{ 0 , 1 , 2 , \cdots , L \} } \\ & { \boldsymbol \mu _ { \ell } ^ { i } = \frac { 1 } { d ^ { \prime } } \displaystyle \sum _ { c = 1 } ^ { d ^ { \prime } } { \boldsymbol y } _ { \ell } ^ { i } [ \boldsymbol c ] , \quad { \boldsymbol \sigma } _ { \ell } ^ { i } = \sqrt { \frac { 1 } { d ^ { \prime } } \displaystyle \sum _ { c = 1 } ^ { d ^ { \prime } } ( { \boldsymbol y } _ { \ell } ^ { i } [ \boldsymbol c ] - { \boldsymbol \mu } _ { \ell } ^ { i } ) ^ { 2 } } . } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
We first apply a linear transformation $W _ { \ell } \in \mathbb { R } ^ { d ^ { \prime } \times d }$ to produce a low-dimensional representation $\boldsymbol { y } _ { \ell } ^ { i } \in \mathbb { R } ^ { d ^ { \prime } }$ for the $\ell$ -th feature of the sequence, since the original feature dimension $d$ is usually large. $\mu _ { \ell } ^ { i } \in \mathbb { R }$ and $\sigma _ { \ell } ^ { i } \in \mathbb { R }$ are the mean and standard deviation of the corresponding representation $\boldsymbol { y } _ { \ell } ^ { i }$ . $\gamma _ { \ell } \in \mathbb { R } ^ { d ^ { \prime } }$ and $\beta _ { \ell } \in \mathbb { R } ^ { d ^ { \prime } }$ denote the learnable affine transformation parameters. $\odot$ denotes the element-wise multiplication. Note that the learnable parameters in this normalization layer is associated with $\ell$ , implying that each feature of the sequence is normalized separately. Using this normalization layer, we obtain the normalized feature vector $o _ { \ell } ^ { i } \in \mathbb { R } ^ { d ^ { \prime } }$ for every $\ell \in \{ 0 , 1 , 2 , \cdot \cdot \cdot , L \}$ .
|
| 65 |
+
|
| 66 |
+
# 3.4 NEIGHBOR2SEQ $^ +$ CONV AND NEIGHBOR2SEQ $^ +$ ATTN
|
| 67 |
+
|
| 68 |
+
After obtaining an ordered sequence for each node, we can view each node in the graph as a sequence of feature vectors. We can use general deep learning techniques to learn from these sequences. In this work, we propose two models, namely Neighbor2Seq $^ +$ Conv and Neighbor2Seq+Attn, in which convolution and attention are applied on the sequences of each node.
|
| 69 |
+
|
| 70 |
+
As illustrated in Figure 1 (d), Neighbor2Seq+Conv applies a 1-D convolutional neural network to the sequence features and then use an average pooling to yield a representation for the sequence. Formally, for each node $i$ ,
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\left( \hat { \sigma } _ { 0 } ^ { i } , \hat { \sigma } _ { 1 } ^ { i } , \cdots , \hat { \sigma } _ { L } ^ { i } \right) = { \bf C } { \bf N } { \bf N } \left( o _ { 0 } ^ { i } , o _ { 1 } ^ { i } , \cdots , o _ { L } ^ { i } \right) , \quad r ^ { i } = { \frac { 1 } { L + 1 } } \sum _ { \ell = 0 } ^ { L } \hat { \sigma } _ { \ell } ^ { i } ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\mathrm { C N N } ( \cdot )$ denotes a 1-D convolutional neural network. $r ^ { i }$ denotes the obtained representation of node $i$ that is used as the input to a linear classifier to make predictions for this node. Specifically, we implement $\mathrm { C N N } ( \cdot )$ as a 2-layer convolutional neural network composed of two 1-D convolutions. The kernel size is set according to the length of input sequence. The activation function between layers is ReLU (Krizhevsky et al., 2012).
|
| 77 |
+
|
| 78 |
+
Incorporating attention is another natural idea to learn from sequences. As shown in Figure 1 (d), Neighbor2Seq+Attn uses an attention mechanism (Bahdanau et al., 2015) to integrate sequential feature vectors in order to derive a representation. Unlike convolutional neural networks, the vanilla attention mechanism cannot make use of the order of the sequence. Hence, we add positional encodings (Vaswani et al., 2017) to the features such that the position information of different features in the sequence can be incorporated. Formally, for each node $i$ , we add positional encoding for each feature in the sequence as
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
k _ { \ell } ^ { i } = o _ { \ell } ^ { i } + p _ { \ell } ^ { i } , \quad p _ { \ell } ^ { i } [ m ] = \left\{ \begin{array} { l l } { { \sin \left( \displaystyle { \frac { \ell } { 1 0 0 0 0 ^ { \frac { 2 n } { d ^ { \prime } } } } } \right) } } & { { m = 2 n } } \\ { { \cos \left( \displaystyle { \frac { \ell } { 1 0 0 0 0 ^ { \frac { 2 n } { d ^ { \prime } } } } } \right) } } & { { m = 2 n + 1 } } \end{array} \right. .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
The positional encoding for $\ell$ -th feature of node $i$ is denoted as $\pmb { p } _ { \ell } ^ { i } \in \mathbb { R } ^ { d ^ { \prime } }$ . $m \in \{ 1 , 2 , \cdots , d ^ { \prime } \}$ is the dimensional index. Intuitively, a position-dependent vector is added to each feature such that the order information can be captured. Then we use the attention mechanism with learnable query (Yang et al., 2016) to combine these sequential feature vectors to obtain the final representations $r ^ { i }$ for each node $i$ . Formally,
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\pmb { r } ^ { i } = \sum _ { \ell = 0 } ^ { L } \alpha _ { \ell } ^ { i } \pmb { k } _ { \ell } ^ { i } , \quad \alpha _ { \ell } ^ { i } = \frac { \exp ( \pmb { k } _ { \ell } ^ { i ^ { T } } \pmb { q } ) } { \sum _ { \ell = 0 } ^ { L } \exp ( \pmb { k } _ { \ell } ^ { i ^ { T } } \pmb { q } ) } .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
$\boldsymbol { q } \in \mathbb { R } ^ { d ^ { \prime } }$ is the learnable query vector that is trained along with other model parameters. The derived representation $r ^ { i }$ will be taken as the input to a linear classifier to make prediction for node $i$ .
|
| 91 |
+
|
| 92 |
+
# 3.5 ANALYSIS OF SCALABILITY
|
| 93 |
+
|
| 94 |
+
Precomputing Neighbor2Seq. A well-known fact is that the value of $w ( i , j , \ell )$ in Equation (1) can be obtained by computing the power of the original adjacency matrix $\pmb { A }$ . Following GCN, we add self-loops to make each node connected to itself. Concretely, $w ( i , j , \ell ) = \tilde { A } _ { ( i , j ) } ^ { \ell }$ Hence, the Neighbor2Seq can be implemented by computing the matrix multiplications $\tilde { A } ^ { \ell } X$ for $\forall \ell \in$ $\{ 0 , 1 , 2 , \bar { \cdot } \cdot \cdot , L \}$ . Since there is no learnable parameters in the Neighbor2Seq step, these matrix multiplications can be precomputed sequentially for large graphs on CPU platforms with large memory.
|
| 95 |
+
|
| 96 |
+
This can be easily precomputed because the matrix $\tilde { A }$ is usually sparse. For extremely large graphs, this precomputation can even be performed on distributed systems.
|
| 97 |
+
|
| 98 |
+
Enabling mini-batch training. After we obtain the precomputed sequence features, each node in the graph corresponds to a sequence of feature vectors. Therefore, each node can be viewed as an independent sample. That is, we are no longer restricted by the original graph connectivity anymore. Then, we can randomly sample from all the training nodes to conduct mini-batch training. This is more flexible and unbiased than sampling methods as reviewed in Section 2.2. Our mini-batches can be randomly extracted over all nodes, opening the possibility that any pair of nodes can be sampled in the same mini-batch. In contrast, mini-batches in sampling methods are usually restricted by the fixed sampling strategies. This advantage opens the door for subsequent model training on extremely large graphs, as long as the corresponding Neighbor2Seq step can be precomputed.
|
| 99 |
+
|
| 100 |
+
Computational complexity comparison. We compare our methods with several existing sampling and precomputing methods in terms of computational complexity. We let $L$ denote the number of hops we consider. For simplicity, we assume the feature dimension $d$ is fixed for all layers. For sampling methods, $s$ is the number of sampled neighbors for each node. The computation of Neighbor2Seq $^ +$ Conv mainly lies in the linear transformation (i.e., $\mathcal { O } ( L d ^ { 2 } \bar { n } ) )$ in the normalization step and the 1-D convolutional neural networks (i.e.,
|
| 101 |
+
|
| 102 |
+
Table 1: Comparison of computational complexity for precomputing and forward pass corresponding to an entire epoch.
|
| 103 |
+
|
| 104 |
+
<table><tr><td>Method</td><td>Precomputing</td><td>Forward Pass</td></tr><tr><td>GCN</td><td></td><td>O(Ldm + Ld²n)</td></tr><tr><td>GraphSAGE</td><td>O(sLn)</td><td>O(sLd²n)</td></tr><tr><td>ClusterGCN</td><td>O(m)</td><td>O(Ldm + Ld²n)</td></tr><tr><td>GraphSAINT</td><td>O(sn)</td><td>O(Ldm +Ld²n)</td></tr><tr><td>SGC</td><td>O(Ldm)</td><td>O(d²n)</td></tr><tr><td>SIGN</td><td>O(Ldm)</td><td>O(Ld²n)</td></tr><tr><td>Neighbor2Seq+Conv</td><td>O(Ldm)</td><td>O(Ld²+Lkd²)n)</td></tr><tr><td>Neighbor2Seq+Attn</td><td>O(Ldm)</td><td>O(Ld²+Ld)n)</td></tr></table>
|
| 105 |
+
|
| 106 |
+
$O ( L k d ^ { 2 } n )$ , where $k$ is the kernel size). Hence, the computational complexity for the forward pass of Neighbo $_ { 1 2 \mathrm { S e q + C o n v } }$ is $\mathcal { O } ( ( L d ^ { 2 } + L k d ^ { 2 } ) n )$ . Neighbor2Seq+Attn has a computational complexity of $\mathcal { \bar { O } } ( ( L d ^ { 2 } + \bar { L } d ) n )$ because the attention mechanism is more efficient than 1-D convolutional neural networks. As shown in Table 1, the forward pass complexities of precomputing methods, including our Neighbor2Seq+Conv and Neighbor2Seq+Attn, are all linear with respect to the number of nodes $n$ and do not depend on the number of edges $m$ . Hence, the training processes of our models are computationally efficient.
|
| 107 |
+
|
| 108 |
+
# 3.6 ALLEVIATING THE OVER-SQUASHING ISSUE
|
| 109 |
+
|
| 110 |
+
An inherent problem in message passing methods is known as the over-squashing (Alon & Yahav, 2020). In particular, recursively propagating information between neighbors creates a bottleneck because the number of nodes in the receptive field grows exponentially with the number of layers. This bottleneck causes the over-squashing issue; that is, information from the exponentially-growing receptive field is compressed into fixed-length vectors. Consequently, message passing methods fail to capture the message flowing from distant nodes and performs poorly when long-range information is essential for the prediction tasks. Note that the over-squashing issue is not identical to the oversmoothing issue. Over-smoothing is related to the phenomenon that node representations converge to indistinguishable limits when the number of layers increases (Li et al., 2018; Wu et al., 2019; NT & Maehara, 2019; Liu et al., 2020a; Oono & Suzuki, 2020; Cai & Wang, 2020; Chen et al., 2020). The virtual edges added in Gilmer et al. (2017) and recent non-local aggregations (Pei et al., 2020; Liu et al., 2020b) can be viewed as attempts to alleviate the over-squashing issue by incorporating distant nodes. Another study (Ma et al., 2019) considers message passing along all possible paths between two nodes, instead of propagating information between neighbors.
|
| 111 |
+
|
| 112 |
+
Our Neighbor2Seq can alleviate the over-squashing issue because we transform the exponentiallygrowing nodes in hierarchical neighborhoods into an ordered sequence, instead of recursively squashing them into a fixed-size vector. With our Neighbor2Seq, capturing long-range information on graphs becomes similar to achieving this on sequence data, such as texts.
|
| 113 |
+
|
| 114 |
+
# 4 DISCUSSIONS
|
| 115 |
+
|
| 116 |
+
# 4.1 INFORMATION LOSS IN NEIGHBOR2SEQ
|
| 117 |
+
|
| 118 |
+
As shown in Figure 1 (c), Neighbor2Seq obtains the sequence by integrating features of nodes in each layer of the neighborhood tree. This transformation may lose the cross-layer dependency information in the tree. Specifically, the Neighbor2Seq ignores the identities of nodes that each walk passes through and only considers what are the nodes in each layer of the neighborhood tree. Nevertheless, this information can neither be captured by message passing methods because the aggregation is usually permutation-invariant. This implies that messages from different neighbors cannot be distinguished, as pointed in Pei et al. (2020). According to our experimental results in Table 5, our models without this information can outperform message passing methods, such as GCN. It is intriguing to have an in-depth exploration of whether such information is useful and how it can be captured.
|
| 119 |
+
|
| 120 |
+
# 4.2 RELATIONS WITH THE WEISFEILER-LEHMAN HIERARCHY
|
| 121 |
+
|
| 122 |
+
As shown in Xu et al. (2019), most of current GNNs are at most as powerful as the WeisfeilerLehman (WL) graph isomorphism test (Weisfeiler & Lehman, 1968) in distinguishing graph structures. Our Neighbor2Seq is still under the WL hierarchy because the neighborhood tree used to obtain the sequence is indeed the one that the WL test uses to distinguish different graphs. We would be interested in exploring how Neighbor2Seq can be extended to go beyond the WL hierarchy as a future direction.
|
| 123 |
+
|
| 124 |
+
# 4.3 BRIDGING THE GAP BETWEEN GRAPH AND GRID-LIKE DATA
|
| 125 |
+
|
| 126 |
+
The main difference between graph and grid-like data lies in the notion and properties of locality. Specifically, the numbers of neighbors differ for different nodes, and there is no order information among the neighbors of a node in graphs. These are the main obstacles preventing the use of generic deep learning operations on graphs. Our Neighbor2Seq is an attempt to bridge the gap between graph and grid-like data. Base on our Neighbor2Seq, many effective strategies for grid-like data can be naturally transferred to graph data. These include self-supervised learning and pre-training on graphs (Hu et al., 2019; Velickovic et al., 2019; Sun et al., 2019; Hassani & Khasahmadi, 2020; You et al., 2020; Hu et al., 2020b; Qiu et al., 2020; Jin et al., 2020).
|
| 127 |
+
|
| 128 |
+
We notice an existing work AWE Ivanov & Burnaev (2018) which also embed the information in graph as a sequence. In order to avoid confusion, we make a clarification about the fundamental and significant differences between AWE and our Neighbor2Seq. First, AWE produces a sequence embedding for the entire graph, while our Neighbor2Seq yields a sequence embedding for each node in the graph. Second, each element in the obtained sequence in AWE is the probability of an anonymous walk embedding. In our Neighbor2Seq, each feature vector in the obtained sequence for one node is computed by summing up the features of all nodes in the corresponding layer of the neighborhood tree. This point distinguishes these two methods fundamentally.
|
| 129 |
+
|
| 130 |
+
# 5 EXPERIMENTAL STUDIES
|
| 131 |
+
|
| 132 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 133 |
+
|
| 134 |
+
Datasets. We evaluate our proposed models on 1 massive-scale graph and 4 medium-scale graphs using node classification tasks. The massive-scale graph ogbn-papers100M provided by the Open Graph Benchmark (OGB) (Hu et al., 2020a) is the existing largest benchmark dataset for node classification. Medium-scale graphs include ogbn-products (Hu et al., 2020a), Reddit (Hamilton et al., 2017), Yelp Zeng et al. (2020), and Flickr Zeng et al. (2020). These tasks cover inductive and transductive settings. The statistics of these datasets are summarized in Table 2. The detailed description of these datasets are provided in Appendix A.1.
|
| 135 |
+
|
| 136 |
+
Table 2: Statistics of datasets. “m” denotes multi-label classification.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Dataset</td><td>Scale</td><td>#Nodes</td><td>#Edges</td><td>Avg. Deg.</td><td>#Features</td><td>#Classes</td><td>Train/Val/Test</td></tr><tr><td>ogbn-papers100M</td><td>Massive</td><td>111,059,956</td><td>1,615,685,872</td><td>29</td><td>128</td><td>172</td><td>0.78/0.08/0.14</td></tr><tr><td>ogbn-products</td><td>Medium</td><td>2,449,029</td><td>61,859,140</td><td>51</td><td>100</td><td>47</td><td>0.08/0.02/0.90</td></tr><tr><td>Reddit</td><td>Medium</td><td>232,965</td><td>11,606,919</td><td>50</td><td>602</td><td>41</td><td>0.66/0.10/0.24</td></tr><tr><td>Yelp</td><td>Medium</td><td>716,857</td><td>6,997,410</td><td>10</td><td>300</td><td>100(m)</td><td>0.75/0.10/0.15</td></tr><tr><td>Flickr</td><td>Medium</td><td>89,250</td><td>899,756</td><td>10</td><td>500</td><td>7</td><td>0.50/0.25/0.25</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Implementation. We implemented our methods using Pytorch (Paszke et al., 2017) and Pytorch Geometric (Fey & Lenssen, 2019). For our proposed methods, we conduct the precomputation on
|
| 141 |
+
|
| 142 |
+
the CPU, after which we train our models on a GeForce RTX 2080 Ti GPU. We perform a grid search for the following hyperparameters: number of hops $L$ , batch size, learning rate, hidden dimension $d ^ { \prime }$ , dropout rate, weight decay, and convolutional kernel size $k$ . The chosen hyperparameters for our Neighbor2Seq+Conv and Neighbor2Seq+Attn are summarized in Appendix A.2 for reproducibility.
|
| 143 |
+
|
| 144 |
+
# 5.2 RESULTS ON MASSIVE-SCALE GRAPHS
|
| 145 |
+
|
| 146 |
+
Since ogbn-papers100M is a massive graph with more than $1 1 1 \ \mathrm { m i l }$ - lion nodes and 1.6 billion edges, most existing methods have difficulty handling such a graph. We consider three baselines that have available results evaluated by OGB: Multilayer Perceptron (MLP), Node2Vec (Grover & Leskovec, 2016), and SGC (Wu et al., 2019). The results under transductive setting is reported in Table 3. Following OGB, we report accuracies for all models on training, validation, and test sets. The previous state-of-theart result on ogbn-papers100M is ob
|
| 147 |
+
|
| 148 |
+
Table 3: Results on ogbn-papers100M in terms of classification accuracy (in percent). The reported accuracy is averaged over 10 random runs. Note that existing sampling methods cannot scale to this massive graph. During precomputation, both SGC and our models have to randomly remove $4 0 \%$ edges to avoid a memory overflow on CPU. This implies that the performance could be further improved if more advanced precomuting platform is used.
|
| 149 |
+
|
| 150 |
+
<table><tr><td>Method</td><td>Training</td><td>Validation</td><td>Test</td></tr><tr><td>MLP</td><td>54.84±0.43</td><td>49.60±0.29</td><td>47.24±0.31</td></tr><tr><td>Node2vec</td><td>1</td><td>58.07±0.28</td><td>55.60±0.23</td></tr><tr><td>SGC</td><td>67.54±0.43</td><td>66.48±0.20</td><td>63.29±0.19</td></tr><tr><td>Neighbor2Seq+Conv</td><td>69.87±0.81</td><td>67.46±0.16</td><td>64.04±0.22</td></tr><tr><td>Neighbor2Seq+Attn</td><td>68.83±0.30</td><td>66.90±0.10</td><td>63.59±0.17</td></tr></table>
|
| 151 |
+
|
| 152 |
+
tained by the precomputing method SGC. Our models outperform the baselines consistently in terms of training, validation, and test, which demonstrates the expressive power and the generalization ability of our method on massive graphs.
|
| 153 |
+
|
| 154 |
+
# 5.3 RESULTS ON MEDIUM-SCALE GRAPHS
|
| 155 |
+
|
| 156 |
+
We also evaluate our models on medium-scale graphs, thus enabling comparison with more existing works. We conduct transductive learning on ogbn-products, a medium-scale graph from OGB. We also conduct inductive learning on Reddit, Yelp, and Flickr, which are frequently used for inductive learning by the community. The following baselines are considered: MLP, Node2Vec (Grover & Leskovec, 2016), GCN (Kipf & Welling, 2016), SGC Wu et al. (2019), GraphSAGE (Hamilton et al., 2017), FastGCN (Chen et al., 2018b), VR-GCN (Chen et al., 2018a), AS-GCN (Huang et al., 2018), ClusterGCN (Chiang et al., 2019), GraphSAINT (Zeng et al., 2020), and SIGN (Rossi et al., 2020).
|
| 157 |
+
|
| 158 |
+
Table 4: Results on ogbn-products in terms of classification accuracy (in percent). The reported accuracy is averaged over 10 random runs. Obtaining the results of GCN requires a GPU with 33GB of memory.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Method</td><td>Training</td><td>Validation</td><td>Test</td></tr><tr><td>MLP</td><td>84.03±0.93</td><td>75.54±0.14</td><td>61.06±0.08</td></tr><tr><td>Node2vec</td><td>93.39±0.10</td><td>90.32±0.06</td><td>72.49±0.10</td></tr><tr><td>GCN</td><td>93.56±0.09</td><td>92.00±0.03</td><td>75.64±0.21</td></tr><tr><td>GraphSAGE</td><td>92.96±0.07</td><td>91.70±0.09</td><td>78.70±0.36</td></tr><tr><td>ClusterGCN</td><td>93.75±0.13</td><td>92.12±0.09</td><td>78.97±0.33</td></tr><tr><td>GraphSAINT</td><td>92.71±0.14</td><td>91.62±0.08</td><td>79.08±0.24</td></tr><tr><td>SGC</td><td>92.60±0.10</td><td>91.19±0.06</td><td>72.46±0.27</td></tr><tr><td>SIGN</td><td>96.92±0.46</td><td>93.10±0.08</td><td>77.60±0.13</td></tr><tr><td>Neighbor2Seq+Conv</td><td>95.32±0.10</td><td>92.92±0.05</td><td>79.67±0.16</td></tr><tr><td>Neighbor2Seq+Attn</td><td>92.82±0.14</td><td>92.20±0.02</td><td>79.35±0.17</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Table 5: Results for inductive learning on three datasets in terms of F1-micro score. The reported score is averaged over 10 random runs. The results of baselines are partially obtained from Zeng et al. (2020); Rossi et al. (2020).
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Method</td><td>Reddit</td><td>Flickr</td><td>Yelp</td></tr><tr><td>GCN</td><td>0.933±0.000</td><td>0.492±0.003</td><td>0.378±0.001</td></tr><tr><td>FastGCN</td><td>0.924±0.001</td><td>0.504±0.001</td><td>0.265±0.053</td></tr><tr><td>VR-GCN</td><td>0.964±0.001</td><td>0.482±0.003</td><td>0.640±0.002</td></tr><tr><td>AS-GCN</td><td>0.958±0.001</td><td>0.504±0.002</td><td>-</td></tr><tr><td>GraphSAGE</td><td>0.953±0.001</td><td>0.501±0.013</td><td>0.634±0.006</td></tr><tr><td>ClusterGCN</td><td>0.954±0.001</td><td>0.481±0.005</td><td>0.609±0.005</td></tr><tr><td>GraphSAINT</td><td>0.966±0.001</td><td>0.511±0.001</td><td>0.653±0.003</td></tr><tr><td>SGC</td><td>0.949±0.000</td><td>0.502±0.001</td><td>0.358±0.006</td></tr><tr><td>SIGN</td><td>0.968±0.000</td><td>0.514±0.001</td><td>0.631±0.003</td></tr><tr><td>Neighbor2Seq+Conv</td><td>0.967±0.000</td><td>0.527±0.003</td><td>0.647±0.003</td></tr><tr><td>Neighbor2Seq+Attn</td><td>0.967±0.000</td><td>0.523±0.002</td><td>0.647±0.001</td></tr></table>
|
| 165 |
+
|
| 166 |
+
The ogbn-products dataset is challenging because the splitting is not random. The splitting procedure is more realistic. The nodes (i.e., products) are sorted according to their sales ranking and the top $8 \%$ nodes are used for training, next $2 \%$ for validation, and the rest $9 0 \%$ for testing. This matches the real-world application where manual labeling is prioritized to important nodes and models are subsequently used to make prediction on less important nodes. Hence, ogbn-products is an ideal benchmark dataset to improve out-of-distribution prediction. As shown in Table 4, our Neighbor2Seq+Conv and Neighbor2Seq+Attn outperfom baselines on test set (i.e., $9 0 \%$ nodes), which further demonstrates the generalization ability of our method.
|
| 167 |
+
|
| 168 |
+
The results on inductive tasks are summarized in Table 5. On Reddit, our models perform better than all sampling methods and achieve the competitive result as SIGN. On Flickr, our models obtain significantly better results. Specifically, our Neighbor2Seq $+$ Conv outperforms the previous state-ofthe-art models by an obvious margin. Although our models perform not as good as GraphSAINT on $Y e l p$ , we outperform other sampling methods and the precomputing model SIGN consistently on this dataset.
|
| 169 |
+
|
| 170 |
+
# 5.4 COMPARISONS OF COMPUTIONAL EFFICIENCY
|
| 171 |
+
|
| 172 |
+
In order to show the computational efficiency, we conduct an empirical comparison with existing methods in terms of time comsuming during preprocessing, training, and inference. We consider the following representative sampling methods and precom
|
| 173 |
+
|
| 174 |
+
Table 6: Computational efficiency in terms of preprocessing, training (per epoch), and inference times (in seconds) on ogbn-products. The reported time is averaged over 10 runs.
|
| 175 |
+
|
| 176 |
+
<table><tr><td>Method</td><td>Preprocessing (↓)</td><td>Training (↓)</td><td>Inferenece (↓)</td><td>Test Accuracy (↑)</td></tr><tr><td>ClusterGCN</td><td>44.15±0.77</td><td>11.87±0.84</td><td>87.03±0.24</td><td>78.97±0.33</td></tr><tr><td>GraphSAINT</td><td>80.78±3.5</td><td>4.29±0.48</td><td>107.26±0.94</td><td>79.08±0.24</td></tr><tr><td>SGC</td><td>153.36±3.6</td><td>0.15±0.01</td><td>1.08±0.01</td><td>72.46±0.27</td></tr><tr><td>SIGN</td><td>151.47±3.5</td><td>1.22±0.02</td><td>2.93±0.06</td><td>77.60±0.13</td></tr><tr><td>Neighbor2Seq+Conv</td><td>153.42±3.2</td><td>4.09±0.12</td><td>31.52±1.44</td><td>79.67±0.16</td></tr><tr><td>Neighbor2Seq+Attn</td><td>153.42±3.2</td><td>2.67±0.08</td><td>31.24±0.61</td><td>79.35±0.17</td></tr></table>
|
| 177 |
+
|
| 178 |
+
puting methods: ClusterGCN Chiang et al. (2019), GraphSAINT Zeng et al. (2020), SGC Wu et al. (2019), and SIGN Rossi et al. (2020). The comparison is performed on ogbn-products and the similar trend can be observed on other datasets. As demonstrated in Table 6, our approaches, like existing precomputing methods, are more computationally efficient than sampling methods in terms of training and inference. Compared with existing precomputing methods, our methods achieve a better balance between performance and efficiency.
|
| 179 |
+
|
| 180 |
+
# 5.5 ABLATION STUDY ON ORDER INFORMATION
|
| 181 |
+
|
| 182 |
+
Table 7: Comparison of models with and without capturing order information. Neighbor2Seq+Attn w/o PE denotes the Neighbor2Seq+Attn without adding positional encoding.
|
| 183 |
+
|
| 184 |
+
<table><tr><td>Model</td><td>Order</td><td>ogbn-papers100M</td><td>ogbn-products</td><td>Reddit</td><td>Flickr</td><td>Yelp</td></tr><tr><td>Neighbor2Seq+Conv</td><td>:</td><td>64.04±0.22</td><td>79.67±0.16</td><td>0.967±0.000</td><td>0.527±0.003</td><td>0.647±0.003</td></tr><tr><td>Neighbor2Seq+Attn</td><td></td><td>63.59±0.17</td><td>79.35±0.17</td><td>0.967±0.000</td><td>0.523±0.002</td><td>0.647±0.001</td></tr><tr><td>Neighbor2Seq+Attn w/o PE</td><td>X</td><td>63.61±0.09</td><td>78.54±0.25</td><td>0.965±0.000</td><td>0.521±0.003</td><td>0.646±0.001</td></tr></table>
|
| 185 |
+
|
| 186 |
+
Intuitively, the order information in the sequence obtained by Neighbor2Seq indicates the hops between nodes. Hence, we conduct an ablation study to verify the significance of this order information. We remove the positional encoding in Neighbor2Seq $+ .$ Attn, leading to a model without the ability to capture the order information. The comparison is demonstrated in Table 7. Note that Neighbor2Seq $^ +$ Attn and Neighbor2Seq $+ .$ Attn w/o PE have the same number of parameters. Hence, Comparing the results of these two models, we can conclude that the order information is usually necessary. Neighbor2Seq+Conv and Neighbor2Seq $+ .$ Attn both can capture the order information. There are two possible reasons why Neighbor2Seq $\Vdash$ Conv performs better. First, Neighbor2Seq+Conv has more learnable parameters than Neighbor2Se+Attn, which only has a learnable query. Second, the convolutional neural network in Neighbor2Seq $^ +$ Conv can additionally investigate the dependencies between feature dimensions because each feature dimension of the output depends on every feature dimension of the input.
|
| 187 |
+
|
| 188 |
+
# 6 CONCLUSIONS AND OUTLOOK
|
| 189 |
+
|
| 190 |
+
In this work, we propose Neighbor2Seq, for transforming the heirarchical neighborhoods to ordered sequences. Neighbor2Seq enables the subsequent use of powerful general deep learning operations, leading to the proposed Neighbor2Seq $^ +$ Conv and Neighbor2Seq+Attn. Our models can be deployed on massive graphs and trained efficiently. The extensive expriments demonstrate the scalability and the promising performance of our method. As discussed in Section 4, based on our Neighbor2Seq, several significant directions can be further explored in the future research.
|
| 191 |
+
|
| 192 |
+
# REFERENCES
|
| 193 |
+
|
| 194 |
+
Uri Alon and Eran Yahav. On the bottleneck of graph neural networks and its practical implications. arXiv preprint arXiv:2006.05205, 2020.
|
| 195 |
+
|
| 196 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 197 |
+
|
| 198 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015.
|
| 199 |
+
|
| 200 |
+
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.
|
| 201 |
+
|
| 202 |
+
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.
|
| 203 |
+
|
| 204 |
+
Kush Bhatia, Kunal Dahiya, Himanshu Jain, Yashoteja Prabhu, and Manik Varma. The extreme classification repository: multi-label datasets & code. URL http://manikvarma. org/downloads/XC/XMLRepository. html, 2016.
|
| 205 |
+
|
| 206 |
+
Aleksandar Bojchevski, Johannes Klicpera, Bryan Perozzi, Amol Kapoor, Martin Blais, Benedek Rozemberczki, Michal Lukasik, and Stephan G ´ unnemann. Scaling graph neural networks with ¨ approximate pagerank. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2464–2473, 2020.
|
| 207 |
+
|
| 208 |
+
Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34.
|
| 209 |
+
|
| 210 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. In International Conference on Learning Representations, 2014.
|
| 211 |
+
|
| 212 |
+
Chen Cai and Yusu Wang. A note on over-smoothing for graph neural networks. arXiv preprint arXiv:2006.13318, 2020.
|
| 213 |
+
|
| 214 |
+
Deli Chen, Yankai Lin, Wei Li, Peng Li, Jie Zhou, and Xu Sun. Measuring and relieving the oversmoothing problem for graph neural networks from the topological view. In Thirty-fourth AAAI Conference on Artificial Intelligence, pp. 3438–3445, 2020.
|
| 215 |
+
|
| 216 |
+
Jianfei Chen, Jun Zhu, and Le Song. Stochastic training of graph convolutional networks with variance reduction. In International Conference on Machine Learning, pp. 942–950, 2018a.
|
| 217 |
+
|
| 218 |
+
Jie Chen, Tengfei Ma, and Cao Xiao. Fastgcn: Fast learning with graph convolutional networks via importance sampling. In International Conference on Learning Representations, 2018b.
|
| 219 |
+
|
| 220 |
+
Wei-Lin Chiang, Xuanqing Liu, Si Si, Yang Li, Samy Bengio, and Cho-Jui Hsieh. Cluster-gcn: An efficient algorithm for training deep and large graph convolutional networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 257–266, 2019.
|
| 221 |
+
|
| 222 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. In Advances in neural information processing systems, pp. 3844–3852, 2016.
|
| 223 |
+
|
| 224 |
+
Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
|
| 225 |
+
|
| 226 |
+
Hongyang Gao, Zhengyang Wang, and Shuiwang Ji. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1416–1424, 2018.
|
| 227 |
+
|
| 228 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1263–1272, 2017.
|
| 229 |
+
|
| 230 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855–864, 2016.
|
| 231 |
+
|
| 232 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pp. 1024–1034, 2017.
|
| 233 |
+
|
| 234 |
+
Kaveh Hassani and Amir Hosein Khasahmadi. Contrastive multi-view representation learning on graphs. In International Conference on Machine Learning, 2020.
|
| 235 |
+
|
| 236 |
+
Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In International Conference on Learning Representations, 2019.
|
| 237 |
+
|
| 238 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020a.
|
| 239 |
+
|
| 240 |
+
Ziniu Hu, Yuxiao Dong, Kuansan Wang, Kai-Wei Chang, and Yizhou Sun. Gpt-gnn: Generative pre-training of graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1857–1867, 2020b.
|
| 241 |
+
|
| 242 |
+
Wenbing Huang, Tong Zhang, Yu Rong, and Junzhou Huang. Adaptive sampling towards fast graph representation learning. In Advances in neural information processing systems, pp. 4558–4567, 2018.
|
| 243 |
+
|
| 244 |
+
Sergey Ivanov and Evgeny Burnaev. Anonymous walk embeddings. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2191–2200, Stockholmsmassan, ¨ Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/ v80/ivanov18a.html.
|
| 245 |
+
|
| 246 |
+
Wei Jin, Tyler Derr, Haochen Liu, Yiqi Wang, Suhang Wang, Zitao Liu, and Jiliang Tang. Self-supervised learning on graphs: Deep insights and new direction. arXiv preprint arXiv:2006.10141, 2020.
|
| 247 |
+
|
| 248 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2016.
|
| 249 |
+
|
| 250 |
+
Johannes Klicpera, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: ¨ Graph neural networks meet personalized pagerank. In International Conference on Learning Representations, 2018.
|
| 251 |
+
|
| 252 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 253 |
+
|
| 254 |
+
Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989.
|
| 255 |
+
|
| 256 |
+
Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence (AAAI-18), pp. 3538–3545. Association for the Advancement of Artificial Intelligence, 2018.
|
| 257 |
+
|
| 258 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In International Conference on Learning Representations, 2016.
|
| 259 |
+
|
| 260 |
+
Meng Liu, Hongyang Gao, and Shuiwang Ji. Towards deeper graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 338–348, 2020a.
|
| 261 |
+
|
| 262 |
+
Meng Liu, Zhengyang Wang, and Shuiwang Ji. Non-local graph neural networks. arXiv preprint arXiv:2005.14612, 2020b.
|
| 263 |
+
|
| 264 |
+
Zheng Ma, Ming Li, and Yuguang Wang. Pan: Path integral based convolution for deep graph neural networks. arXiv preprint arXiv:1904.10996, 2019.
|
| 265 |
+
|
| 266 |
+
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.
|
| 267 |
+
|
| 268 |
+
Hoang NT and Takanori Maehara. Revisiting graph neural networks: All we have is low-pass filters. arXiv preprint arXiv:1905.09550, 2019.
|
| 269 |
+
|
| 270 |
+
Kenta Oono and Taiji Suzuki. Graph neural networks exponentially lose expressive power for node classification. In International Conference on Learning Representations, 2020.
|
| 271 |
+
|
| 272 |
+
Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry Winograd. The pagerank citation ranking: Bringing order to the web. Technical report, Stanford InfoLab, 1999.
|
| 273 |
+
|
| 274 |
+
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.
|
| 275 |
+
|
| 276 |
+
Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. Geom-gcn: Geometric graph convolutional networks. In International Conference on Learning Representations, 2020.
|
| 277 |
+
|
| 278 |
+
Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543, 2014.
|
| 279 |
+
|
| 280 |
+
Jiezhong Qiu, Qibin Chen, Yuxiao Dong, Jing Zhang, Hongxia Yang, Ming Ding, Kuansan Wang, and Jie Tang. Gcc: Graph contrastive coding for graph neural network pre-training. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1150–1160, 2020.
|
| 281 |
+
|
| 282 |
+
Emanuele Rossi, Fabrizio Frasca, Ben Chamberlain, Davide Eynard, Michael Bronstein, and Federico Monti. Sign: Scalable inception graph neural networks. arXiv preprint arXiv:2004.11198, 2020.
|
| 283 |
+
|
| 284 |
+
Jonathan M Stokes, Kevin Yang, Kyle Swanson, Wengong Jin, Andres Cubillos-Ruiz, Nina M Donghia, Craig R MacNair, Shawn French, Lindsey A Carfrae, Zohar Bloom-Ackerman, et al. A deep learning approach to antibiotic discovery. Cell, 180(4):688–702, 2020.
|
| 285 |
+
|
| 286 |
+
Fan-Yun Sun, Jordan Hoffman, Vikas Verma, and Jian Tang. Infograph: Unsupervised and semisupervised graph-level representation learning via mutual information maximization. In International Conference on Learning Representations, 2019.
|
| 287 |
+
|
| 288 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 289 |
+
|
| 290 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. In International Conference on Learning Representations, 2018.
|
| 291 |
+
|
| 292 |
+
Petar Velickovic, William Fedus, William L Hamilton, Pietro Lio, Yoshua Bengio, and R Devon \` Hjelm. Deep graph infomax. In International Conference on Learning Representations, 2019.
|
| 293 |
+
|
| 294 |
+
Kuansan Wang, Zhihong Shen, Chiyuan Huang, Chieh-Han Wu, Yuxiao Dong, and Anshul Kanakia. Microsoft academic graph: When experts are not enough. Quantitative Science Studies, 1(1):396– 413, 2020.
|
| 295 |
+
|
| 296 |
+
Yue Wang, Yongbin Sun, Ziwei Liu, Sanjay E Sarma, Michael M Bronstein, and Justin M Solomon. Dynamic graph cnn for learning on point clouds. Acm Transactions On Graphics (tog), 38(5): 1–12, 2019.
|
| 297 |
+
|
| 298 |
+
Boris Weisfeiler and Andrei A Lehman. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12–16, 1968.
|
| 299 |
+
|
| 300 |
+
Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. Simplifying graph convolutional networks. In International Conference on Machine Learning, pp. 6861–6871, 2019.
|
| 301 |
+
|
| 302 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019.
|
| 303 |
+
|
| 304 |
+
Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alex Smola, and Eduard Hovy. Hierarchical attention networks for document classification. In Proceedings of the 2016 conference of the North American chapter of the association for computational linguistics: human language technologies, pp. 1480–1489, 2016.
|
| 305 |
+
|
| 306 |
+
Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 974– 983, 2018.
|
| 307 |
+
|
| 308 |
+
Yuning You, Tianlong Chen, Zhangyang Wang, and Yang Shen. When does self-supervision help graph convolutional networks? In International Conference on Machine Learning, 2020.
|
| 309 |
+
|
| 310 |
+
Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. Graphsaint: Graph sampling based inductive learning method. In International Conference on Learning Representations, 2020.
|
| 311 |
+
|
| 312 |
+
Difan Zou, Ziniu Hu, Yewen Wang, Song Jiang, Yizhou Sun, and Quanquan Gu. Layer-dependent importance sampling for training deep and large graph convolutional networks. In Advances in Neural Information Processing Systems, pp. 11249–11259, 2019.
|
| 313 |
+
|
| 314 |
+
# A APPENDIX
|
| 315 |
+
|
| 316 |
+
# A.1 DATASET DESCRIPTIONS
|
| 317 |
+
|
| 318 |
+
ogbn-papers100M (Hu et al., 2020a) is the existing largest benckmark dataset for node classification. It is a directed citation graph of 111 million papers indexed by Microsoft Academic Graph (MAG) (Wang et al., 2020). For simplicity, it is converted to an undirected graph in baselines and our method. Each node is a paper and each directed edge indicates that one paper cites another one. Each node is associated with a 128-dimensional feature vector obtained by averaging the word2vec (Mikolov et al., 2013) embeddings of words in its title and abstract. Among the node set, approximately 1.5 millione of them are ARXIV papers, each of which has a label with one of ARXIV’s subject areas. The rest nodes (i.e., non-ARXIV papers) are not associated with label information. The task is to leverage the entire citation graph to infer the labels of the ARXIV papers. The time-based splitting is used as the splitting strategy. To be more specifical, the training nodes are all ARXIV papers published until 2017, while the validation nodes are the ARXIV papers published in 2018, and the ARXIV papers published since 2019 are treated as test nodes.
|
| 319 |
+
|
| 320 |
+
ogbn-products (Hu et al., 2020a) is an undirected Amazon product co-purchasing graph (Bhatia et al., 2016). Nodes denote products and edges between two nodes indicate that the corresponding products are purchased together. Node features are derived by extracting bag-of-words representations from the product descriptions. Further, a Principal Component Analysis is applied to these features to reduce the dimension to 100. The task is to predict the category of a product. A realistic splitting scheme is used in this data. Specifically, the products are firstly sorted according to their sales ranking, and then the top $1 0 \%$ products are used for training, next $\mathrm { \bar { 2 } \% }$ for validation, and the rest for testing. This strategy matches the real-world situation where manual labeling is prioritized to important nodes and models are subsequently deployed to predict the less important ones.
|
| 321 |
+
|
| 322 |
+
Reddit (Hamilton et al., 2017), Yelp (Zeng et al., 2020), and Flickr (Zeng et al., 2020) are widely used datasets for inductive learning. During training, only the node features of training nodes and the edges between training nodes are visible. Reddit is a social netowork extracted from Reddit forum. Nodes represent posts and edges between two posts indicate the same user comments on both posts. Node features are fromed by GloVe CommonCrawl word vectors Pennington et al. (2014) of the posts. The task is to predict which community different posts belong to. The splitting is also time-based. Yelp is a social netowork constructed from Yelp website. Nodes are users and edges between two nodes indicate they are friends. Node features of users are obtained by the word2vec embeddings of their corresponding reviews. The task is to predict the categories of businesses reviewed by different users, which is multi-label classification task. Flickr is a social network based on Flickr, a photo sharing website. Nodes represent images and there is an edge between two nodes if two images share some common properties. The node features are fromed by the bag-of-words representations of the images. The task is to predict the category each image belongs to.
|
| 323 |
+
|
| 324 |
+
# A.2 HYPERPARAMETER CONFIGURATIONS
|
| 325 |
+
|
| 326 |
+
We conduct a grid search for hyperparameters. Table 8 summarizes the chosen hyperparameters for our models.
|
| 327 |
+
|
| 328 |
+
Table 8: The chosen hyperparameters for our models on all datasets.
|
| 329 |
+
|
| 330 |
+
<table><tr><td>Model</td><td>Hyperparameter</td><td>ogbn-papers100M</td><td>ogbn-products</td><td>Reddit</td><td>Flickr</td><td>Yelp</td></tr><tr><td rowspan="7">Neighbor2Seq+Conv</td><td>number of hopsL</td><td>3</td><td>7</td><td>3</td><td>10</td><td>2</td></tr><tr><td>hidden dimension d'</td><td>512</td><td>512</td><td>256</td><td>256</td><td>512</td></tr><tr><td>convolutional kernel size k</td><td>5</td><td>7</td><td>5</td><td>7</td><td>3</td></tr><tr><td>learning rate</td><td>5e-4</td><td>2e-5</td><td>8e-5</td><td>8e-4</td><td>5e-4</td></tr><tr><td>batch size</td><td>12288</td><td>64</td><td>32768</td><td>24576</td><td>8192</td></tr><tr><td>weight decay</td><td>5e-5</td><td>5e-5</td><td>0</td><td>5e-5</td><td>0</td></tr><tr><td>dropout rate</td><td>0.25</td><td>0.5</td><td>0.5</td><td>0.5</td><td>0</td></tr><tr><td rowspan="6">Neighbor2Seq+Attn</td><td>number of hopsL</td><td>3</td><td>7</td><td>3</td><td>10</td><td>2</td></tr><tr><td>hidden dimension d'</td><td>512</td><td>512</td><td>256</td><td>256</td><td>512</td></tr><tr><td>learning rate</td><td>5e-4</td><td>1e-3</td><td>2e-3</td><td>2e-3</td><td>5e-4</td></tr><tr><td>batch size</td><td>12288</td><td>3072</td><td>32768</td><td>256</td><td>8192</td></tr><tr><td>weight decay</td><td>5e-6</td><td>5e-5</td><td>0</td><td>5e-5</td><td>0</td></tr><tr><td>dropout rate</td><td>0.25</td><td>0.5</td><td>0.5</td><td>0.5</td><td>0</td></tr></table>
|
md/train/lgNx56yZh8a/lgNx56yZh8a.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/rC8sJ4i6kaH/rC8sJ4i6kaH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/rJeIGkBKPS/rJeIGkBKPS.md
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVING CONFIDENT-CLASSIFIERS FOR OUT-OFDISTRIBUTION DETECTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Discriminatively trained neural classifiers can be trusted, only when the input data comes from the training distribution (in-distribution). Therefore, detecting outof-distribution (OOD) samples is very important to avoid classification errors. In the context of OOD detection for image classification, one of the recent approaches proposes training a classifier called “confident-classifier” by minimizing the standard cross-entropy loss on in-distribution samples and minimizing the KL divergence between the predictive distribution of OOD samples in the low-density “boundary” of in-distribution and the uniform distribution (maximizing the entropy of the outputs). Thus, the samples could be detected as OOD if they have low confidence or high entropy. In this paper, we analyze this setting both theoretically and experimentally. We also propose a novel algorithm to generate the “boundary” OOD samples to train a classifier with an explicit “reject” class for OOD samples. We compare our approach against several recent classifier-based OOD detectors including the confident-classifiers on MNIST and Fashion-MNIST datasets. Overall the proposed approach consistently performs better than others across most of the experiments.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Discriminatively trained deep neural networks have achieved state of the art results in many classification tasks such as speech recognition, image classification, and object detection. This has resulted in deployment of these models in real life applications where safety is paramount (e.g., autonomous driving). However, recent progress has shown that deep neural network (DNN) classifiers make overconfident predictions even when the input does not belong to any of the known classes (Nguyen et al. (2015)). This follows from the design of DNN classifiers that are optimized over in-distribution data without the knowledge of OOD data. The resulting decision boundaries are typically “unbounded/open” as shown in Figure 1a resulting in over-generalization (Spigler (2019), Scheirer et al. (2012)).
|
| 12 |
+
|
| 13 |
+
There have been many approaches proposed to address this problem under the umbrella of OOD detection1. Lee et al. (2018a) propose to explicitly train a classifier using the OOD samples generated by a GAN (Goodfellow et al. (2014a)). They empirically try to show that, for effective OOD detection, the generated OOD samples should follow and be close to the low-density boundaries of in-distribution, and the proposed GAN training indeed tries to do that. A multi-class softmax DNN classifier is trained with in-distribution samples to minimize the standard cross-entropy loss (minimizing the output entropy) and the generated OOD samples are trained to minimize a KL loss that forces the classifier’s predictive distribution to follow a uniform one (maximizing the output entropy). The resulting classifier is called a “confident-classifier”. One can then classify a sample as being in or out-of distribution based on the maximum prediction probability or the entropy of the output. Sricharan & Srivastava (2018) also follow a similar approach with slight modifications.
|
| 14 |
+
|
| 15 |
+
Contribution. One of the key assumptions in Lee et al. (2018a) and Sricharan & Srivastava (2018) is that the effect of maximizing the entropy for OOD samples close to the low-density boundaries of in-distribution might also propagate to samples that are far away from in-distribution. This training is expected to result in “bounded/closed” regions in input space with lower entropy over the in-distribution, and the rest of the region (corresponding to OOD), with higher entropy. The ideal decision boundary in such a scenario would be as shown in Figure 1b. We find that even though such a solution exists, the proposed training algorithm is unlikely to reach it. We justify this both theoretically and experimentally for a ReLU network (network with ReLU activation units) that was indeed used in Lee et al. (2018a). Assuming training with OOD samples close to the in-distribution boundary, we find that having an explicit reject class for OOD samples results in a solution close to the one depicted in Figure 1b. Therefore we propose to use such a classifier instead. We give intuitive arguments to justify the proposal. This forms the first key contribution of our paper.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Figure shows how the decision boundaries would change and become more bounded when a typical classifier is trained with an auxiliary (“reject”) class containing OOD samples. (a) The unbounded decision boundaries of a typical 4-class classifier. Digit 9 is incorrectly classified as digit 2 with very high confidence. (b) A 5-class classifier trained with OOD samples $\mathbf { \epsilon } \cdot \mathbf { \gamma } _ { \mathbf { X } } \mathbf { \epsilon } )$ that are close to in-distribution and form the fifth (“reject���) class, resulting in bounded decision boundaries. Digit 9 is correctly classified as belonging to the “reject” (OOD) class.
|
| 19 |
+
|
| 20 |
+
Moreover, with toy experiments (refer to section D in appendix) on low-dimensional synthetic data, we analyze if GAN can indeed produce samples that can follow the low-density boundaries of indistribution. We find that, even though GAN produces samples close to the low-density boundaries of in-distribution, it is unable to cover the whole boundary, thus resulting in a sub-optimal OOD detector when trained on such samples. We therefore propose a novel algorithm to generate “boundary” OOD samples using a manifold learning network, (e.g., variational auto-encoder (VAE)) and show that the generated samples are diverse and cover the in-distribution boundaries better than the method proposed in Lee et al. (2018a). The resulting classifier trained with those samples improves the OOD detection results. This forms the second key contribution of our paper.
|
| 21 |
+
|
| 22 |
+
# 2 BACKGROUND
|
| 23 |
+
|
| 24 |
+
Lee et al. (2018a) propose a joint training of GAN and a classifier based on the following objective:
|
| 25 |
+
|
| 26 |
+
$$
|
| 27 |
+
\begin{array} { r l } & { \underset { G } { \mathop { \operatorname* { m i n } } } \underset { D } { \mathop { \operatorname* { m a x } } } \underset { \theta } { \underbrace { \operatorname* { m i n } } } \underbrace { { \mathbb { E } } _ { P _ { i n } ( \hat { x } , \hat { y } ) } [ - \log P _ { \theta } ( y = \hat { y } | \hat { x } ) ] } _ { ( \mathrm { a } ) } + \beta \underbrace { { \mathbb { E } } _ { P _ { G } ( x ) } [ \mathrm { K L } ( \mathcal { U } ( y ) | | P _ { \theta } ( y | x ) ) ] } _ { ( \mathrm { b } ) } } \\ & { \qquad + \underbrace { { \mathbb { E } } _ { P _ { i n } ( x ) } [ \log D ( x ) ] + { \mathbb { E } } _ { P _ { G } ( x ) } [ \log ( 1 - D ( x ) ) ] } _ { ( \mathrm { c } ) } } \end{array}
|
| 28 |
+
$$
|
| 29 |
+
|
| 30 |
+
where $( \mathsf { b } ) { + } ( \mathsf { c } )$ is the modified GAN loss and $\mathrm { ( a ) } { + } \mathrm { ( b ) }$ is the classifier loss $\boldsymbol { \theta }$ is the classifier’s parameter) called the confidence loss. The difference from the regular GAN objective is the additional KL loss in (1), which when combined with the original loss, forces the generator to generate samples in the low-density boundaries of the in-distribution $( P _ { i n } ( x ) )$ space. $\beta$ is a hyper-parameter that controls how close the OOD samples are to the in-distribution boundary. For the classifier, the KL loss pushes the OOD samples generated by GAN to produce a uniform distribution at the output, and therefore have higher entropy. This enables one to detect OOD samples based on the entropy or the confidence at the output of the classifier.
|
| 31 |
+
|
| 32 |
+
# 3 WHY MINIMIZING CONFIDENCE LOSS IS INSUFFICIENT FOR OOD DETECTION
|
| 33 |
+
|
| 34 |
+
Let $f : \mathbb { R } ^ { d } \mathbb { R } ^ { K }$ be the neural network function that maps input in $\mathbb { R } ^ { d }$ to $K$ output classes (input to the softmax layer). Let $f _ { k } : \mathbb { R } ^ { d } \mathbb { R }$ be the function that maps the input to output for a specific class $k \in \{ 1 , 2 , 3 . . . K \}$ . For a neural network with affine activations (e.g., ReLU and Leaky ReLU), each $f _ { k }$ is a continuous piece-wise affine function over a finite set of polytopes, $\{ Q _ { 1 } , Q _ { 2 } , \dot { \cdots } , Q _ { M } \}$ such that $\textstyle \mathbb { R } ^ { d } = \bigcup _ { l = 1 } ^ { M } Q _ { l }$ , as described in Croce & Hein (2018). This means that each $f _ { k }$ is affine within each $Q _ { l }$ $( l \in \{ 1 , 2 , 3 . . . M \} )$ . If the input space is $\mathbb { R } ^ { d }$ , some of these polytopes stretch to infinity (grow without bounds). Let $Q _ { l } ^ { \infty } \equiv Q _ { l }$ denote these “infinity polytopes”. The choice of the neural network structure and the weights define $f _ { k }$ ’s. Figure 2a illustrates these polytopes and $f _ { k }$ ’s for a simple 3-class ReLU classifier, where the input space is $\mathbb { R }$ . In this example, there are 4 polytopes in which $Q _ { 1 } ^ { \infty }$ and $Q _ { 4 } ^ { \infty }$ stretch to infinity.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: $f _ { k }$ ’s and $Q _ { r }$ ’s for an example 3-class ReLU classifier where the input $x \in \mathbb { R }$ . $Q _ { 1 } ^ { \infty }$ and $Q _ { 4 } ^ { \infty }$ are infinity polytopes. (a) For sufficiently large (small) $x$ , there is a unique $k ^ { * } = 1$ in $Q _ { 4 } ^ { \infty }$ $k ^ { * } = 1$ in $Q _ { 1 } ^ { \infty }$ ). (b) For sufficiently large $x$ , there are multiple $k ^ { * }$ ’s in $Q _ { 4 } ^ { \infty }$ $( k ^ { * } = \{ 2 , 3 \}$ ). For sufficiently small $x$ , there is a unique $k ^ { * } = 3$ in $Q _ { 1 } ^ { \infty }$ .
|
| 38 |
+
|
| 39 |
+
Hein et al. (2019) mathematically show that a ReLU classifier (with softmax output) produces arbitrarily high confidence predictions (approaching 1) far away from the training data in almost all directions on an unbounded input space. This happens over $Q _ { l } ^ { \infty }$ ’s. Their results are summarized as follows.
|
| 40 |
+
|
| 41 |
+
For any $\pmb { x } \in \mathbb { R } ^ { d }$ , there exists a $\beta _ { l } ~ > ~ 0$ such that for all $\alpha _ { l } ~ \ge ~ \beta _ { l }$ , $\alpha _ { l } \pmb { x } \in Q _ { l } ^ { \infty }$ . Let $f _ { k } ^ { l } ( { \pmb x } ) =$ $\langle \pmb { v } _ { k } ^ { l } , \pmb { x } \rangle + a _ { k } ^ { l }$ be the piece-wise affine function for class $k$ over $Q _ { l }$ . Let $k ^ { * } = \arg \operatorname* { m a x } _ { k } \langle \pmb { v } _ { k } ^ { l } , \beta _ { l } \pmb { x } \rangle ^ { 2 }$ . Then, as $\alpha _ { l } \infty$ , the confidence for input $\alpha \boldsymbol { l } ^ { \mathbf { \mathcal { X } } }$ for class $k ^ { * }$ becomes arbitrarily high if $k ^ { * }$ is unique. i.e,
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\operatorname* { l i m } _ { \alpha _ { l } \to \infty } { \frac { e ^ { f _ { k ^ { * } } \left( \alpha _ { l } \pmb x \right) } } { \sum _ { l = 1 } ^ { K } e ^ { f _ { l } \left( \alpha _ { l } \pmb x \right) } } } = 1
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
But if there are multiple $k ^ { * }$ ’s, arbitrarily large confidence values cannot be obtained far away from the in-distribution in the direction of $x$ . For instance, as shown in Figure $2 { \mathbf { b } } ^ { 3 }$ , for $Q _ { 4 } ^ { \infty }$ , $k ^ { * } =$ $\{ 2 , 3 \}$ and therefore arbitrarily high confidence predictions cannot be achieved as $\alpha _ { l } \infty$ . Having multiple $k ^ { * }$ ’s for every $Q _ { l } ^ { \infty }$ is highly unlikely, given that we are dealing with floating point numbers and also that it is not explicitly enforced during training. Therefore, arbitrarily high confidence values far away from the in-distribution are likely inevitable.
|
| 48 |
+
|
| 49 |
+
The above analysis is for the case where the input domain is unbounded $( R ^ { d } )$ . For bounded domains (for example, $[ \bar { 0 } , 1 ] ^ { d }$ for images), as pointed out in Hein et al. (2019), since we cannot let $\alpha _ { l } \to \infty$ , the above analysis cannot be directly applied to get arbitrary high confidence values. However the above technique in principle can be applied to increase the prediction confidence for samples far away from the in-distribution. Hein et al. (2019) conduct experiments to support the claim. The theoretical analysis of which can be done as follows. Let $\bar { \mathbb Z } ^ { d }$ represent the bounded input domain. Similar to the unbounded case, let $Q _ { l } ^ { \infty }$ denote “infinity polytopes” that stretch till the bounds of the input domain $\mathbb { Z } ^ { d }$ . For any $\pmb { x } \in \mathbb { Z } ^ { d }$ , there exists a $\beta _ { l } > 0$ such that for all $\alpha _ { l } \geq \beta _ { l }$ , $\alpha _ { l } \pmb { x } \in Q _ { l } ^ { \infty }$ . Let $\bar { f } _ { k } ^ { l } ( { \pmb x } ) = \langle { \pmb v } _ { k } ^ { l } , { \pmb x } \rangle + a _ { k } ^ { l }$ be the piece-wise affine function for class $k$ over $Q _ { l }$ . Let $k ^ { * } =$ arg $\operatorname* { m a x } _ { k } \langle \pmb { v } _ { k } ^ { l } , \beta _ { l } \pmb { x } \rangle$ . Then, as $\alpha _ { l }$ increases, the confidence for input $\alpha \boldsymbol { l } \mathbf { x }$ for class $k ^ { * }$ keeps increasing until the bounds of the domain is reached if $k ^ { * }$ is unique. If $f _ { k ^ { * } } ( \beta _ { l } x ) \ > > \ f _ { k } ( \beta _ { l } x ) \ \forall k \ \ne \ k ^ { * }$ (ignoring the effect of bias term for simplicity), the confidence for input $\alpha _ { l } x$ for the class $k ^ { * }$ is very high. Therefore, even for the case of bounded input space, one can obtain confidence predictions for OOD samples high enough for it to be considered as in-distribution samples.
|
| 50 |
+
|
| 51 |
+
Corollary. The higher the confidence of the output, the lower is the entropy. Hence a direct corollary of Hein et al. (2019)’s result is that the entropy of the classifier output for data far away from the in-distribution data in all directions would almost always be arbitrarily low (approaching 0) like the in-distribution samples. This makes it almost impossible to detect OOD samples based on the confidence or the entropy of the classifier outputs. For the case of bounded input domain, as one can increase the prediction confidence for OOD samples far from the in-distribution, the entropy of classifier output also decreases making those OOD samples to be classified as in-distribution samples. Therefore, the approaches in Lee et al. (2018a) and Sricharan & Srivastava (2018) would not be applicable.
|
| 52 |
+
|
| 53 |
+
# 4 ADDING AN EXPLICIT “REJECT” CLASS
|
| 54 |
+
|
| 55 |
+
When OOD samples are generated close to the in-distribution and follow its low-density boundaries as proposed in Lee et al. (2018a) and Sricharan & Srivastava (2018), we recommend adding an explicit reject class for OOD samples instead of minimizing the loss in Eq.1(b). Let the resulting classifier be called the reject-classifier. By adding an explicit reject class, our goal is to obtain a decision boundary close to the ideal decision boundary shown in Figure.1b, where the decision boundary of a $K + 1$ classifier divides the input space into regions such that the in-distribution region is classified as one of the first $K$ classes and the rest of the region as the $K + 1 ^ { t h }$ class, i.e., the reject class. The intuition on how such a decision boundary can be obtained is as follows. The arbitrarily high confidence predictions happen in polytopes that stretch to infinity (or stretch till the bounds of input space in case of bounded input space). Each of the “infinity polytopes” has its own class (or classes), $k ^ { * } ( \mathrm { o r } k ^ { * } \mathrm { s } )$ where high confidence predictions occur. If adding an explicit “reject” class results in $k ^ { * } =$ reject-class for all the “infinity polytopes” (i.e there is only one $k ^ { * }$ ), the arbitrarily high confidence predictions would only happen at the reject class for OOD samples far-off from training data. Therefore, these samples will be detected as OOD. We argue that in reject-classifier training, since we explicitly maximize the prediction confidence of $K \bar { + } 1 ^ { t h }$ -class for boundary OOD samples, we expect the same effect to persist for OOD samples far from the in-distribution as well (i.e., $k ^ { * } = K + 1$ ) resulting in close to ideal decision boundaries depicted in Figure.1b. This claim is supported by our experiments on a toy dataset (Figure. 5) and the superior performance of the reject-classifier over the confident-classifier on MNIST and Fashion MNIST datasets (Table. 1). Note that how close the resulting decision boundary of the reject-classifier is to the ideal one depends on how well the OOD samples follow the in-distribution boundary. We find that the method proposed in Lee et al. (2018a) to generate boundary OOD samples is not diverse enough as evidenced by experiments shown in the appendix (Section. D). Therefore we propose a novel approach for boundary OOD sample generation which is described in the next section that results in better boundary OOD samples that cover the in-distribution boundary quite effectively. This evident from our experiments described in the appendix (Section. D).
|
| 56 |
+
|
| 57 |
+
Lee et al. (2018a) indeed experiment with adding an explicit reject class instead of using a confidentclassifier, but the results are found to be worse. But this is because instead of using the boundary OOD samples they use another natural image dataset called “seen OOD” similar to Hendrycks et al. (2019) to train the classifier. However for images, it is difficult to represent the entire OOD space with a small number of samples such methods may not perform that well. Moreover as pointed out in both Lee et al. (2018a) and Hendrycks et al. (2019), as these “seen OOD” samples aren’t diverse, when used to train a reject classifier they can overfit to these training OOD samples. However we use boundary OOD samples that can guide the decision boundary of the classifier to be bounded around the in-distribution regions as depicted in Figure. 1b
|
| 58 |
+
|
| 59 |
+
Note that both the reject-classifier and the confident-classifier use boundary OOD samples for training. The confident-classifier tries to equalize $f _ { k }$ ’s for boundary OOD samples (i.e., maximize the entropy of output predictions) and expect this to persist over OOD samples far from the in-distribution as well (i.e., have multiple $k ^ { * }$ ’s). The reject-classifier on the other hand maximizes the prediction confidence of $K + 1 ^ { t h }$ for boundary OOD samples and expects it to persists over OOD samples far from the in-distribution (i.e., have a single $k ^ { * }$ at $k = K + 1 ,$ ). confidence $f _ { k }$ . In the unbounded case, for a confident-classifier, while it is proven that one can almost always find arbitrarily high confidence regions far from the in-distribution, for a reject classifier we can still expect those OOD samples to be classified as belonging to the $K + 1 ^ { t h }$ class. In the bounded case too as shown previously, one can obtain decreasingly low entropy regions far from the in-distribution for the confident classifier whereas for the reject-classifier it is similar to the unbounded case. As evident from the experimental results in Figure. 5 we can indeed find OOD samples with low entropy for the confident-classifiers without stretching to infinity, whereas for the reject-classifier, all those OOD samples far away from the in-distribution are correctly classified as OOD. The results in Table. 1 further reinforces the superiority of the reject-classifier over the confident classifier.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 3: Categories of OOD samples that we generate: (a) Type I (yellow), which includes samples that are close to the data but outside the in-distribution sub-manifolds, and (b) Type II (black), which includes samples that lie on the in-distribution sub-manifolds and trace the in-distribution boundary; in-distribution clusters are represented through blue and red points.
|
| 63 |
+
|
| 64 |
+
# 5 OUT-OF-DISTRIBUTION SAMPLE GENERATION
|
| 65 |
+
|
| 66 |
+
The proposed approach leverages the following generic assumptions (Cayton (2005), Narayanan & Mitter (2010), Rifai et al. (2011)) that hold true for a wide range of problems, primarily for image data, which is the data used to validate our approach.
|
| 67 |
+
|
| 68 |
+
The manifold hypothesis states that the higher dimensional real-world data in the input space is likely concentrated on a much lower-dimensional sub-manifold.
|
| 69 |
+
|
| 70 |
+
The multi-class manifold hypothesis states that, if data contains multiple classes, different classes correspond to disjoint sub-manifolds separated by low-density regions in the input space.
|
| 71 |
+
|
| 72 |
+
To fully cover the “boundary” of in-distribution, we identify two categories of OOD samples that are to be generated. As shown in Figure 3, Type I) are the OOD samples that are close but outside the in-distribution sub-manifolds; Type II) are the OOD samples that are on the sub-manifolds but close to the “boundary” of the in-distribution.
|
| 73 |
+
|
| 74 |
+
# 5.1 OOD SAMPLES OUTSIDE THE DATA MANIFOLD
|
| 75 |
+
|
| 76 |
+
These samples are obtained by adding small perturbations to in-distribution samples that are concentrated on the manifold. These perturbations should be added in directions such that the resulting samples should fall outside the manifold. The directions locally normal to the data-supporting manifold can be thought of as the directions that are less likely to contain in-distribution samples and the tangent directions as the more likely ones. Therefore we add perturbations in the normal directions to get OOD samples.
|
| 77 |
+
|
| 78 |
+
Deep generative models such as VAEs (Kingma & Welling, 2013) and GANs (Goodfellow et al., 2014b) can model the data manifold of observations $\pmb { x } \in X$ through corresponding latent variables $z \in Z$ via a mapping function $g : Z \to X$ as $x = g ( z )$ . With a choice of reasonably lower dimensional $_ { z }$ and a flexible generative function $g$ , the model can efficiently represent the true data manifold. Following the multi-class manifold hypothesis, we use a conditional generative model that is conditioned over the class labels. For our experiments, we use a conditional variational autoencoder (CVAE).
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 4: Generated OOD samples using the proposed method; Type I OOD samples typically modify the background pixels (normal components have the least variance), while Type II OOD samples modify the object pixels.
|
| 82 |
+
|
| 83 |
+
Let $h : X \to Z$ and $g : Z \to { \hat { X } }$ denote the encoder and decoder functions of CVAE respectively. The tangent space of the manifold at a point $\pmb { x } \in X$ is given by the column space of the Jacobian4
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
J ( { \pmb x } ) = \frac { \partial g ( { \pmb z } ) } { \partial { \pmb z } } \bigg | _ { { \pmb z } = h ( { \pmb x } ) }
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Let ${ \cal N } ( { \pmb x } )$ denote the null-space of ${ \pmb J } ^ { T } ( { \pmb x } )$ (left null space of $\pmb { J } ( \pmb { x } ) )$ . Then the basis vectors of ${ \cal N } ( x )$ span the normal bundle of the manifold at $_ { \textbf { \em x } }$ . Let ${ \pmb v } ( { \pmb x } ) \sim { \pmb N } ( { \pmb x } )$ be a randomly sampled unit vector from ${ \cal N } ( { \pmb x } )$ , then the perturbed sample is given by,
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\tilde { \pmb { x } } = \pmb { x } + \beta \pmb { v } ( \pmb { x } )
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $\beta \in \mathbb { R }$ is a hyper-parameter that controls how far the perturbed sample is from the indistribution point. In our experiments, we use a stochastic $\beta$ that is uniformly sampled from in the range [0.1, 1.0]. As discussed before, for better OOD detection, the boundary samples generated should be diverse; because the proposed approach generates OOD samples by randomly perturbing every in-distribution training sample, the diversity of the generated samples is ensured. This is visually apparent from the experimental results on a 3D-dataset shown in section D of appendix. Figure 4 illustrates the perturbed samples for MNIST and Fashion MNIST datasets. One can observe that the perturbations added mostly modify the background pixels than the object pixels. This is because the normal directions to the manifold mostly represent least variance components of the image.
|
| 96 |
+
|
| 97 |
+
# 5.2 OOD SAMPLES ON THE DATA MANIFOLD
|
| 98 |
+
|
| 99 |
+
These are the samples that are in the low-density regions of the input space but close to the indistribution boundaries on the manifold.
|
| 100 |
+
|
| 101 |
+
For a variational auto-encoder, the aggregate posterior $q ( z )$ (Makhzani et al., 2015) is given by,
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
q ( z ) = \int _ { \pmb { x } } q ( \pmb { z } | \pmb { x } ) p _ { i n } ( \pmb { x } ) d z
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $p _ { i n } ( { \pmb x } )$ is the probability density function of in-distribution and $q ( \pmb { z } / \pmb { x } )$ is the approximate posterior. Assuming a smooth decoder, the high-density regions in the aggregate posterior can be thought of as corresponding to densely populated regions in the input space, and the input space density would gradually decrease as we sample away from the high-density regions in the aggregate posterior. Therefore the in-distribution boundary on the manifold can be approximated by regions at a distance away from the high-density areas where the density dips below a certain threshold. For our experiments, we approximate $q ( z )$ with a uni-modal Gaussian distribution whose mean $\hat { \mu }$ and co-variance $\hat { \Sigma }$ are estimated using the encoder mappings of in-distribution samples. We use Mahalanobis distance as a criterion to determine the distance from the mean to sample and generate the required OOD samples. Let $r$ be the Mahalanobis distance from the mean of $q ( z )$ that encompasses $9 5 \%$ of the training data. The OOD samples are generated by decoding the uniformly sampled samples from the latent space over the surface of a hyper-ellipsoid (Rubinstein, 1982) defined by 5, where $\hat { \mu } _ { z }$ and $\hat { \Sigma } _ { z }$ are the mean and co-variance estimates of $q ( z )$ , respectively.
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
( z - \hat { \mu } _ { z } ) ^ { T } \hat { \Sigma } _ { z } ^ { - 1 } ( z - \hat { \mu } _ { z } ) = r ^ { 2 }
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
It is fair to assume a uni-modal Gaussian distribution for $q ( z )$ as we fit a Gaussian per class. Moreover, a substantial gain in the ODD detection results when the classifier is trained with these samples can also be taken as evidence pointing towards the validity of such an assumption.
|
| 114 |
+
|
| 115 |
+
The generated OOD samples described in 5.1 and 5.2 are then used to train an $n + 1$ class softmax classifier, where the $n + \mathbf { \hat { l } } ^ { t h }$ class represents the OOD class.
|
| 116 |
+
|
| 117 |
+
# 6 EXPERIMENTS
|
| 118 |
+
|
| 119 |
+
Experiments5 are divided into 2 sections; the first section explains the toy experiments on a lowdimensional dataset to support our theoretical analysis of the confident-classifier, the second section gives details of OOD detection experiments on MNIST and Fashion MNIST ((Xiao et al., 2017)) using the proposed method.
|
| 120 |
+
|
| 121 |
+
# 6.1 LIMITATIONS OF CONFIDENT-CLASSIFIERS
|
| 122 |
+
|
| 123 |
+
In these experiments, the input space is $\mathbb { R } ^ { 2 }$ and the in-distribution consists of 2-classes. The samples for each of these classes are generated by sampling from 2 Gaussians with identity co-variances and means (-10, 0) and (10, 0) respectively, on the Cartesian coordinates. Anything outside 3 standard deviations (Mahalanobis distance) from the in-distribution means is considered OOD. The architecture of the neural network used is similar to the one used in Lee et al. (2018a), which is a ReLU-classifier with 2 fully-connected hidden layers with 500 neurons each.
|
| 124 |
+
|
| 125 |
+
Following the case in Lee et al. (2018a), for training, OOD samples are generated close to the indistribution as shown in Figure 5a. For testing, OOD samples are uniformly sampled from a 2D box $[ - 5 0 , 5 0 ] ^ { 2 }$ excluding the in-distribution regions.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 5: Plots for boundary OOD samples experiments. (a) Training data in 2D. (b) Maximum prediction output on test data for a confident-classifier. (c) Classification output of a classifier with a “reject” class on test data $\mathrm { T C } =$ true class, $\mathbf { P C = }$ predicted class).
|
| 129 |
+
|
| 130 |
+
From Figure 5b, we observe that the ReLU-classifier trained to optimize confidence loss results in highly confident predictions for many OOD samples far from the in-distribution data. This renders the classifier ineffective at classifying the in and out of distribution samples based on the maximum prediction score (confidence) or the entropy of the output. However, from Figure 5c, for a classifier trained with explicit reject class, the test OOD samples are indeed classified as OOD. This supports the aforementioned intuitions in 4.
|
| 131 |
+
|
| 132 |
+
Note that these are not the results specific to a certain architecture of the neural network. Experiments with different hyper-parameters such as the number of hidden neurons, changing input dimensions, using sigmoid activation functions instead of ReLU lead to similar results. We remark however that for sigmoid networks, the results were not as extreme (in terms of the number of OOD samples with high-confidence) as for ReLU networks. This is understandable because sigmoid activation outputs will not produce arbitrarily large values, unlike the ReLU counterparts.
|
| 133 |
+
|
| 134 |
+
# 6.2 MNIST AND FASHION MNIST EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
We validated our approach on MNIST and Fashion MNIST as in-distribution datasets and several other OOD datasets. For all MNIST as in-distribution experiments, we use a CVAE with a latent dimension of 8, and for Fashion MNIST, the latent dimension is set to 10. We compare our approach against the recent classifier-based OOD detectors such as confident-classifier, ODIN and Mahalanobis distance-based approach without feature ensemble $( \mathrm { M D } ) ^ { 6 }$ . The architecture for both CVAE and the classifier used are shown in the appendix. Both the networks are trained till convergence.
|
| 137 |
+
|
| 138 |
+
# 6.2.1 OOD DATASETS
|
| 139 |
+
|
| 140 |
+
MNIST is used as an OOD dataset for Fashion MNIST as in-distribution, and vice-versa. For MNIST 0-4 experiment, we use images in class 0 through 4 as in-distribution and class 5 through 9 as OOD. We use both character datasets and noise generated images as OOD datasets. The character datasets are Omniglot (Lake et al., 2015), EMNIST-letters (Cohen et al., 2017) and NotMNIST (Bulatov, 2011). The noise generated images are described below.
|
| 141 |
+
|
| 142 |
+
Gaussian noise includes gray-scale images, where each pixel is sampled from an independent normal distribution with 0.5 mean and unit-variance.
|
| 143 |
+
|
| 144 |
+
Uniform noise includes gray-scale images where each pixel is sampled from an independent uniform distribution in the range $[ 0 , 1 ]$ .
|
| 145 |
+
|
| 146 |
+
Sphere OOD contains images sampled from the surface of a 784 dimensional hyper-sphere centered at the origin with a radius equal to the maximum Euclidean distance of in-distribution samples from the origin and reshaped to $2 8 \times 2 8$ . This is used to show the effectiveness of our approach not only on the datasets that are restricted to a finite range such as $[ 0 , 1 ] ^ { d }$ for images in $[ 0 , \dot { 1 } ] ^ { d }$ but also for a general case of $\mathbb { R } ^ { d }$ .
|
| 147 |
+
|
| 148 |
+
# 6.2.2 EVALUATION METRICS FOR OOD DETECTION
|
| 149 |
+
|
| 150 |
+
We experimented with two different metrics as OOD score to determine if the given input sample is in or out of distribution. OOD class probability is the $n + 1 ^ { t h }$ class prediction probability. Indistribution max probability is the maximum prediction probabilities of the in-distribution classes. A higher (lower) OOD class probability (in-distribution max probability) indicates a higher probability of a sample being OOD. Except for MNIST 0-4 experiments, we find that the former metric gives the best results. We report only the best score in Table 1. We use the area under the ROC curve (AUROC↑), the area under the precision-recall curve (AUPR↑), the false positive rate at $9 5 \%$ true positive rate (FPR95↓) and the detection error as the metrics for evaluation. These metrics are commonly used for evaluating OOD detection methods (Lee et al., 2018a; Hendrycks et al., 2019). The details of which are in the appendix.
|
| 151 |
+
|
| 152 |
+
# 6.2.3 DETECTION RESULTS
|
| 153 |
+
|
| 154 |
+
Table 1 compares our approach with other approaches for experiments on MNIST and Fashion MNIST as in-distribution datasets. Since the classifier is trained with OOD samples, there is a possibility of reduction in the classification accuracy of in-distribution classes in comparison to training without OOD class. We therefore report classification accuracy of a classifier trained with and without OOD samples. We find that there is no significant change in accuracy. Training our method requires tuning hyper-parameter such as $\beta$ from Eq. 4, OOD class weight, and learning rate. The hyper-parameters were chosen based on the in-distribution classification accuracy and the AUROC of the validation generated OOD samples and the random noise datasets. For all our experiments we use a stochastic $\beta$ uniformly sampled in the range [0.1, 1], OOD class weight is set to 0.1, while the weights for the rest of the classes is set to 1.0, and Adadelta (Zeiler, 2012) is the optimizer used with learning rates of 0.1 and 0.01 for Fashion-MNIST and MNIST experiments, respectively. We do not tune the hyper parameters per OOD dataset unlike ODIN and Mahalanobis distance-based approaches, where the perturbation magnitude is tuned per OOD dataset. Even without this advantage, our method still performs better than these baselines for most of the OOD datasets.
|
| 155 |
+
|
| 156 |
+
Table 1: OOD detection results
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan="2">ID Model (acc before OOD/ acc after OOD)</td><td rowspan="2">OOD</td><td>FPR at 95% TPR↓</td><td>Detection Error↓</td><td>AUROC↑</td><td>AUPR Out↑</td><td>AUPR In↑</td></tr><tr><td colspan="6">Ours/Confident-Classifier/ODIN/MD</td></tr><tr><td rowspan="6">MNIST (99.0/98.9)</td><td>F-MNIST EMNIST-letters</td><td>0.0/7.9/0.4/94.2 1.6/31.0/25.7/31.2</td><td>0.2/5.6/1.8/11.9 3.0/13.2/11.7/13.6</td><td>100.0/98.5/99.8/86.6 99.6/93.0/94.4/93.2</td><td>100.0/98.8/99.8/92.0 99.6/93.0/94.3/92.7</td><td>100.0/98.4/99.8/74.0 99.6/92.4/94.1/93.2</td></tr><tr><td>NotMNIST</td><td>0.0/26.5/11.3/34.8</td><td>0.0/12.3/6.9/16.3</td><td>100.0/94.0/97.8/91.7</td><td>100.0/93.9/100.0/91.7</td><td>100.0/93.8/97.7/92.3</td></tr><tr><td>Omniglot</td><td>0.0/0.0/0.0/98.5</td><td>0.0/1.0/0.2/46.9 0.0/0.0/0.0/24.6</td><td>100.0/100.0/100.0/19.8 100.0/100.0/100.0/50.9</td><td>100.0/100.0/100.0/40.8 100.0/100.0/100.0/71.8</td><td>100.0/100.0/100.0/35.0</td></tr><tr><td>Gaussian-Noise</td><td>0.0/0.0/0.0/99.9 0.0/0.0/0.0/82.6</td><td>0.0/0.0/0.0/26.4</td><td>100.0/100.0/100.0/65.0</td><td>100.0/100.0/100.0/76.0</td><td>100.0/100.0/100.0/35.1</td></tr><tr><td>Uniform-Noise Sphere-OOD</td><td>0.0/21.6/0.0/80.4</td><td>0.1/6.6/1.4/14.9</td><td>100.0/96.8/99.8/87.6</td><td>100.0/97.8/99.9/91.7</td><td>100.0/100.0/100.0/63.9 100.0/95.2/99.8/79.9</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="6">F-MNIST (91.9/91.2)</td><td>MNIST EMNIST-letters</td><td>4.1/87.4/70.2/2.4 6.4/87.3/83.5/10.1</td><td>4.2/36.3/28.9/3.6 5.4/41.8/13.6/7.3</td><td>98.7/67.0/76.7/99.5</td><td>98.2/65.2/73.2/99.5</td><td>100.0/64.8/77.3/99.4</td></tr><tr><td></td><td></td><td></td><td>97.9/61.1/66.6/98.1</td><td>96.8/60.0/62.0/98.3</td><td>98.5/61.6/66.6/98.1</td></tr><tr><td>NotMNIST</td><td>0.8/78.9/80.2/7.2</td><td>1.2/32.2/33.9/5.8 0.9/22.1/7.1/26.8</td><td>99.7/73.7/69.3/97.8</td><td>99.5/73.0/63.0/97.4</td><td>99.8/72.4/70.5/98.2</td></tr><tr><td>Omniglot</td><td>0.0/59.8/9.6/58.4</td><td>0.2/9.6/3.8/19.9</td><td>99.8/85.6/97.9/83.2 99.8/95.8/98.0/80.0</td><td>99.9/85.8/97.6/84.9</td><td>99.6/85.1/98.2/83.4</td></tr><tr><td>Gaussian-Noise Uniform-Noise</td><td>0.0/32.2/4.5/99.7 0.2/71.0/99.4/1.7</td><td>1.3/16.4/24.7/3.3</td><td>99.8/88.6/74.7/98.9</td><td>99.9/96.7/96.7/87.0 99.8/91.8/82.9/99.2</td><td>99.5/94.7/95.6/66.3</td></tr><tr><td>Sphere-OOD</td><td>0.6/99.3/100.0/0.0</td><td>0.8/50.0/50.0/0.0</td><td>99.7/29.6/0.25/100.0</td><td>99.4/39.1/30.7/100.0</td><td>99.8/82.9/61.6/97.9 99.8/37.4/30.7/100.0</td></tr><tr><td rowspan="8">MNIST0-4 (99.8/99.6)</td><td>MNIST5-9</td><td>17.2/21.9/20.4/50.0</td><td>10.0/12.0/11.5/14.4</td><td>95.1/92.9/93.4/92.3</td><td>94.0/92.1/91.3/93.8</td><td>94.9/93.6/94.2/90.1</td></tr><tr><td>F-MNIST</td><td>0.2/1.7/2.0/41.4</td><td>1.6/3.1/3.4/15.1</td><td>99.8/99.4/99.4/92.5</td><td>99.8/99.5/99.4/93.3</td><td>99.7/99.3/99.3/91.9</td></tr><tr><td>EMNIST-letters</td><td>2.7/22.1/26.4/12.9</td><td>3.8/12.4/13.9/7.6</td><td>99.2/92.9/92.3/96.9</td><td>99.3/92.0/90.4/96.6</td><td>99.1/93.6/93.2/97.1</td></tr><tr><td>NotMNIST</td><td>0.0/10.9/28.0/2.8</td><td>0.1/7.7/13.3/3.1</td><td>100.0/97.5/93.5/99.3</td><td>100.0/97.5/92.7/99.2</td><td>100.0/97.6/93.7/99.4</td></tr><tr><td>Omniglot</td><td>0.0/0.0/2.3/0.0</td><td>0.0/0.1/3.6/0.4</td><td>100.0/100.0/99.1/100.0</td><td>100.0/100.0/99.3/100.0</td><td>100.0/100.0/98.8/100.0</td></tr><tr><td>Gaussian-Noise</td><td>0.0/0.0/0.0/0.2</td><td>0.0/0.0/0.1/2.4</td><td>100.0/100.0/100.0/97.5</td><td>100.0/100.0/100.0/98.6</td><td>100.0/100.0/99.7/92.2</td></tr><tr><td>Uniform-Noise</td><td>0.0/0.0/0.0/25.9</td><td>0.0/0.0/0.4/5.1</td><td>100.0/100.0/99.9/95.9</td><td>100.0/100.0/99.9/97.6</td><td>100.0/100.0/99.6/89.4</td></tr><tr><td>Sphere-OOD</td><td>0.0/7.1/0.2/22.7</td><td>0.1/5.5/2.0/6.9</td><td>100.0/98.2/99.6/96.5</td><td>100.0/98.6/99.7/97.6</td><td>100.0/97.4/99.3/93.8</td></tr><tr><td rowspan="8">F-MNIST0-4 (94.2/94.8)</td><td>F-MNIST5-9</td><td>19.7/55.8/29.2/75.8</td><td>12.3/17.1/14.6/26.4</td><td>92.5/89.5/92.1/79.5</td><td>88.7/90.2/91.3/79.8</td><td></td></tr><tr><td>MNIST</td><td>1.8/67.3/53.5/2.0</td><td>2.3/23.6/21.1/3.4</td><td>99.5/83.5/86.4/99.0</td><td>99.4/84.2/86.1/99.3</td><td>94.3/87.1/92.8/77.7</td></tr><tr><td>EMNIST-letters</td><td>1,2/71.6/48.4/14.1</td><td>2.4/24.2/20.3/7.6</td><td>99.6/82.6/87.9/97.6</td><td>99.6/83.8/87.7/98.0</td><td>99.6/81.7/85.7/98.5</td></tr><tr><td>NotMNIST</td><td>0.2/76.0/57.7/11.0</td><td>1.2/26.8/23.6/8.0</td><td>99.9/79.9/84.1/97.0</td><td>99.8/81.3/83.8/96.8</td><td>99,7/79.8/87.9/96.9 99.9/77.1/83.9/97.2</td></tr><tr><td>Omniglot</td><td>1.0/62.3/15.5/11.1</td><td>2.5/18.3/9.1/7.1</td><td>99.5/88.6/96.5/97.5</td><td>99.6/90.6/96.0/97.9</td><td>99.3/85.8/96.7/95.7</td></tr><tr><td>Gaussian-Noise</td><td>0.0/0.3/0.0/99.3</td><td>0.4/2.0/0.4/41.7</td><td>100.0/99.7/100.0/53.4</td><td>100.0/99.8/100.0/62.6</td><td>100.0/99.7/100.0/47.9</td></tr><tr><td>Uniform-Noise</td><td>0.0/9.8/1.3/36.3</td><td>0.3/5.4/3.0/8.5</td><td>100.0/98.1/99.2/95.0</td><td>100.0/98.6/99.4/96.6</td><td>100.0/97.5/98.9/90.1</td></tr><tr><td>Sphere-OOD</td><td>0.0/89.6/95.5/0.0</td><td>0.0/38.3/41.6/0.0</td><td>100.0/65.8/59.8/100.0</td><td>100.0/67.7/62.4/100.0</td><td>100.0/61.9/55.0/100.0</td></tr></table>
|
| 159 |
+
|
| 160 |
+
We would like to remark that our approach gives good OOD detection results consistently on all the OOD datasets used unlike the baselines compared. This indicates that our approach is robust to change in OOD datasets.
|
| 161 |
+
|
| 162 |
+
# 7 CONCLUSION
|
| 163 |
+
|
| 164 |
+
We have shown in the paper that the confident-classifier almost always has OOD samples that produce high confidence outputs (in the contexts described earlier). We provided empirical evidence that favor using an explicit “reject” class instead. However, the ODD detection capabilities of a reject-classifier depend on the extent to which the generated OOD samples follow the low-density boundaries of in-distribution. We also propose a novel algorithm for generating “effective” OOD samples for training an $n + 1$ -class classifier for OOD detection and the results for most of the experiments on gray-scale datasets are consistently better for our approach in comparisons to other methods compared. For future research, we would like to investigate its effectiveness on non-grayscale datasets such as CIFAR and TinyImageNet. However we would like to point out that the nullspace calculation for colored images is computationally quite expensive, hence requires a larger compute (refer appendix E).
|
| 165 |
+
|
| 166 |
+
# REFERENCES
|
| 167 |
+
|
| 168 |
+
Yaroslav Bulatov. Notmnist dataset. Google (Books/OCR), Tech. Rep.[Online]. Available: http://yaroslavvb. blogspot. it/2011/09/notmnist-dataset. html, 2, 2011.
|
| 169 |
+
|
| 170 |
+
L Cayton. Algorithms for manifold learning. Technical Report CS2008-0923, UCSD., 2005.
|
| 171 |
+
|
| 172 |
+
Gregory Cohen, Saeed Afshar, Jonathan Tapson, and Andre van Schaik. Emnist: an extension of ´ mnist to handwritten letters. arXiv preprint arXiv:1702.05373, 2017.
|
| 173 |
+
|
| 174 |
+
Francesco Croce and Matthias Hein. A randomized gradient-free attack on relu networks. arXiv preprint arXiv:1811.11493, 2018.
|
| 175 |
+
|
| 176 |
+
Terrance DeVries and Graham W Taylor. Learning confidence for out-of-distribution detection in neural networks. arXiv preprint arXiv:1802.04865, 2018.
|
| 177 |
+
|
| 178 |
+
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pp. 1050–1059, 2016.
|
| 179 |
+
|
| 180 |
+
Yarin Gal, Riashat Islam, and Zoubin Ghahramani. Deep bayesian active learning with image data. CoRR, abs/1703.02910, 2017.
|
| 181 |
+
|
| 182 |
+
Yonatan Geifman, Guy Uziel, and Ran El-Yaniv. Boosting uncertainty estimation for deep neural classifiers. CoRR, 2018.
|
| 183 |
+
|
| 184 |
+
I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, S. Ozair D. Warde-Farley, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in neural information processing systems (NIPS), 2014a.
|
| 185 |
+
|
| 186 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014b.
|
| 187 |
+
|
| 188 |
+
C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger. On calibration of modern neural. In International Conference on Machine Learning (ICML), 2017.
|
| 189 |
+
|
| 190 |
+
M. Hein, M. Andriushchenko, and J. Bitterwolf. Why relu networks yield high-confidence predictions far away from the training data and how to mitigate the problem. arXiv preprint arXiv:1812.05720, 2019.
|
| 191 |
+
|
| 192 |
+
Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution. In International Conference on Learning Representations (ICLR), 2016.
|
| 193 |
+
|
| 194 |
+
Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep anomaly detection with outlier exposure. In International Conference on Learning Representations (ICLR), 2019.
|
| 195 |
+
|
| 196 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 197 |
+
|
| 198 |
+
Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. URL https: //science.sciencemag.org/content/350/6266/1332.
|
| 199 |
+
|
| 200 |
+
Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. International Conference on Learning Representations (ICLR), 2018a.
|
| 201 |
+
|
| 202 |
+
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. arXiv preprint arXiv:1807.03888, 2018b.
|
| 203 |
+
|
| 204 |
+
Shiyu Liang, Yixuan Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. In International Conference on Learning Representations (ICLR), 2018.
|
| 205 |
+
|
| 206 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
|
| 207 |
+
|
| 208 |
+
H Narayanan and S Mitter. Sample complexity of testing the manifold hypothesis. Advances in Neural Information Processing Systems, 2010.
|
| 209 |
+
|
| 210 |
+
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Computer Vision and Pattern Recognition (CVPR), 2015.
|
| 211 |
+
|
| 212 |
+
S. Pidhorskyi, R. Almohsen, D. A. Adjeroh, and G. Doretto. Generative probabilistic novelty detection with adversarial autoencoders. In Advances in neural information processing systems (NeuRIPS), 2018.
|
| 213 |
+
|
| 214 |
+
Jie Ren, Peter J. Liu, Emily Fertig, Jasper Snoek, Ryan Poplin, Mark A. DePristo, Joshua V. Dillon, and Balaji Lakshminarayanan. Likelihood ratios for out-of-distribution detection. arXiv preprint arXiv:1906.02845, 2019.
|
| 215 |
+
|
| 216 |
+
Salah Rifai, Yann N, Dauphin, Pascal Vincent, Yoshua Bengio, and Xavier Muller. The manifold tangent classifier. Advances in Neural Information Processing Systems, 2011.
|
| 217 |
+
|
| 218 |
+
R. Y. Rubinstein. Generating random vectors uniformly distributed inside and on the surface of different regions. European Journal of Operational Research, 1982.
|
| 219 |
+
|
| 220 |
+
W. J. Scheirer, A. Rocha, A. Sapkota, and T. E. Boult. Towards open set recognition. IEEE transactions on pattern analysis and machine intelligence, 2012.
|
| 221 |
+
|
| 222 |
+
G. Spigler. Denoising autoencoders for overgeneralization in neural networks. arXiv preprint arXiv:1709.04762, 2019.
|
| 223 |
+
|
| 224 |
+
K. Sricharan and A. Srivastava. Building robust classifiers through generation of confident out of distribution examples. Third workshop on Bayesian Deep Learning (NeurIPS), 2018.
|
| 225 |
+
|
| 226 |
+
W. Wang, A. Wang, A. Tamar, X. Chen, and P. Abbeel. Safer classification by synthesis. arXiv preprint arXiv:1711.08534, 2017.
|
| 227 |
+
|
| 228 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017.
|
| 229 |
+
|
| 230 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
|
| 231 |
+
|
| 232 |
+
A APPENDIX
|
| 233 |
+
|
| 234 |
+
# B RELATED WORK
|
| 235 |
+
|
| 236 |
+
There have been many approaches in the literature proposed to address the problem of OOD detection in the context of image data. Most of the successful ones are either generative ((Pidhorskyi et al., 2018; Wang et al., 2017; Ren et al., 2019)) or classifier-based approaches (Hendrycks & Gimpel, 2016; Hendrycks et al., 2019; DeVries & Taylor, 2018; Liang et al., 2018; Lee et al., 2018b). Generative approaches either explicitly or implicitly estimate the input density or use reconstruction error as a criterion to decide if input belongs to OOD. Classifier-based approaches, on the other hand, incorporate OOD detection as a part of the classifier network. The approach proposed in this paper belongs to the latter category. Therefore we limit our related work discussion to only classifier-based approaches.
|
| 237 |
+
|
| 238 |
+
Typical discriminatively trained classifiers that model the conditional probability $P ( \boldsymbol { y } | \boldsymbol { x } )$ without any additional constraints, by definition can make reliable classification decisions only on indistribution data. For out-of-distribution data, the classifier output is arbitrary. Moreover, any meta information from the output of the classifier or the features learned are also conditioned on the data belonging to in-distribution. Therefore this information in-principle cannot be used to ascertain if the input is in or out of distribution. However, most of the recent approaches ((Hendrycks & Gimpel, 2016; Lee et al., 2018b; Liang et al., 2018; DeVries & Taylor, 2018))in the literature follow this approach.
|
| 239 |
+
|
| 240 |
+
Hendrycks & Gimpel (2016) propose a baseline approach to detect OOD inputs, called max-softmax by thresholding the maximum softmax output of a pre-trained classifier. Liang et al. (2018) improve upon this using temperature scaling (ODIN, (Guo et al., 2017)) and adding input perturbations. The assumptions is that these changes result in larger separation between in and out of distribution data in terms of their output predictions. Lee et al. (2018b) propose an approach based on the assumption that the class-conditional features of a softmax classifier follow a Gaussian distribution. Therefore, Mahalanobis distance (MD) from the mean of the Gaussian is used as a score to detect OOD. This is then combined with input perturbations similar to ODIN to enhance the OOD detection results. This method obtains state-of-the-art results on most of the baseline datasets used in OOD detection literature. Despite good results, the method can be seen as OOD detection on feature space rather than pixel space not conforming to the usual definition of OOD (By definition, the in-distribution, $p _ { i n } ( x )$ is defined for $x \in \mathbb { X }$ in pixel space, and hence OOD is also defined in the same space). Hence the effectiveness of the method highly depends on the features learned by the classifier, and also there is no guarantee that the optimization algorithm forces the features to follow a Gaussian distribution. Hendrycks et al. (2019) propose to train a classifier with a confidence loss where OOD data is sampled from a large natural dataset. Hein et al. (2019) also follow a similar approach using a confidence loss and uniformly generated random OOD samples from the input space. In addition, they not only minimize the confidence at the generated OOD samples, but also in the neighbourhood of those samples. However, because both these approaches use the confidence-loss, they suffer from the problems explained in this paper. Moreover, such approaches are only feasible for input spaces where it is possible to represent the support of OOD with finite samples (assuming uniform distribution over OOD space). This is not possible when the input space is $\mathbb { R } ^ { d }$ , whereas the method proposed in this paper is still applicable.
|
| 241 |
+
|
| 242 |
+
Geifman et al. (2018) propose to use Bayesian prediction uncertainties given by MC-Dropout (Gal & Ghahramani, 2016) for OOD detection. However, on the theoretical front, the Bayesian uncertainty measure only characterizes the uncertainty in in-distribution. Therefore in principle should not be applied to OOD detection.
|
| 243 |
+
|
| 244 |
+
# C TOY EXPERIMENT ON GENERAL OOD SAMPLES
|
| 245 |
+
|
| 246 |
+
In this case, both train and test OOD samples are uniformly sampled from a 2D box $[ - 5 0 , 5 0 ] ^ { 2 }$ excluding the in-distribution regions. From Figure 6, we observe that both confidence loss and reject class based classifiers are able to distinguish in and out of distribution samples effectively. Therefore, there is no clear winner between the two. However as mentioned previously, such approaches are only feasible for input spaces where (approximately) representing the entire OOD region with a finite number of samples is possible. This is definitely not possible for example when the input space is $\mathbb { R } ^ { d }$ .
|
| 247 |
+
|
| 248 |
+
# D GENERATING OOD SAMPLES USING A GAN VS OUR APPROACH
|
| 249 |
+
|
| 250 |
+
Lee et al. (2018a) propose to generate OOD samples in the low-density regions of in-distribution by optimizing a joint GAN-classifier loss, (1). With a toy experiment, they show that the generator indeed produces such samples and also these samples follow the “boundary” of the in-distribution data. However, in the experiment, they use a pre-trained classifier. The classifier is pre-trained to optimize the confidence loss on in-distribution and OOD samples sampled close to the in-distribution. Therefore the classifier already has the knowledge of those OOD samples. When GAN is then trained following the objective in (1), GAN likely generates those OOD samples close to the indistribution. But it is evident that this setting is not realistic as one cannot have a fully informative prior knowledge of those OOD samples if our objective is to generate them.
|
| 251 |
+
|
| 252 |
+
Therefore, we experiment by directly optimizing (1) where the classifier is not pre-trained. The indistribution data for the experiment is obtained by sampling over the surface of a unit sphere from its diagonally opposite quadrants to form 2 classes respectively as shown in Figure 7. We find that (with much hyper-parameter tuning), even though GAN ends up producing OOD samples close to the in-distribution, it does an unsatisfactory job at producing samples that could follow the entire indistribution boundary. Moreover, there is less diversity in the generated samples which make them ineffective at improving the classifier performance in OOD detection. Our intuition is that the loss $\left( 1 ( \mathsf { b } ) { + } 1 ( \mathsf { c } ) \right)$ that forces the generator of the GAN to generate samples in the high entropy regions of the classifier doesn’t necessarily enforce it to produce samples that follow the entire in-distribution boundary. The inability of GANs to generate such samples for a simple 3D dataset indicates that it would be even more difficult in higher dimensions.
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 6: Plots for general OOD samples experiments. (a) Training data in 2D. (b) Maximum prediction output on test data for a confident-classifier. (c) Classification output of a classifier with a “reject” class on test data.
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 7: Generated OOD samples using a joint training of a GAN and a confident-classifier. We observe that the generated OOD samples don’t cover the entire in-distribution boundary.
|
| 259 |
+
|
| 260 |
+
In comparison to the GAN based boundary OOD generation, our approach as visually apparent from Figure 8 produces samples that cover the in-distribution boundary quite effectively. While it is difficult to visualize how well the off-manifold OOD samples cover the boundary, one can imagine them having a good coverage on the off-manifold boundary as they are obtained by perturbing each training sample in the direction given by the null-spaces. Hence the diversity of the OOD samples is ensured. For on-manifold boundary OOD samples, as evident from Figure 8c, it forms a closed boundary around the in-distribution points.
|
| 261 |
+
|
| 262 |
+
# E DISCUSSION ON SAMPLE GENERATION COMPLEXITY
|
| 263 |
+
|
| 264 |
+
For generating OOD samples outside the manifold, we randomly sample from the left-null-space of the Jacobian as described earlier. But the complexity of this step depends on the number of basis vectors in the null-space and its dimensions. For the MNIST case, with the input dimensions $2 8 \times 2 8$ and latent dimension of 8, there are 776 basis vectors in the left-nullspace, each of dimension 784 (i.e., $2 8 \times 2 8$ ). For colored images such as CIFAR and TinyImagenet, the number of basis vectors are almost 3 times of that for gray-scaled images. To cover the in-distribution boundary effectively in all directions, many OOD samples for each in-distribution training sample are to be generated by taking random linear combinations of the basis vectors, which is quite expensive. This gives a quantitative measure of effective OOD sample complexity. However, we find that only a few OOD samples are sufficient to guide the decision boundary of the classifier to be bounded around the in-distribution regions evidenced by their OOD detection results.
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 8: Generated boundary OOD samples using our approach. (a) 3d plot of in-distribution data with out-of-manifold boundary OOD samples. (b) 3d plot of in-distribution data with on-manifold boundary OOD samples. (c) 2d projection of in-distribution data with on-manifold boundary samples to show that they cover the in-distribution boundary on the manifold.
|
| 268 |
+
|
| 269 |
+
# F EXPERIMENTAL ARCHITECTURE
|
| 270 |
+
|
| 271 |
+
The encoder and the decoder parts of the CVAE architecture, and the classifier used are described in Figure 9a, 9b and ${ 9 \mathrm { c } }$ respectively. The latent dimension $( d )$ is chosen per dataset. For MNIST, $d = 8$ and for Fashion MNIST, $d = 1 0$ . The number of features after the convolutions in the encoder is represented by $f$ . “cond $\mathbf { \nabla } _ { \mathbf { X } } \mathbf { \vec { \Omega } } ^ { \mathbf { { \nabla } } }$ is the one hot representation of class labels. $k$ in the classifier architecture represents the number of classes in the training data.
|
| 272 |
+
|
| 273 |
+
# G METRICS DEFINITIONS
|
| 274 |
+
|
| 275 |
+
The definitions of metrics used to evaluate OOD detection are as follows.
|
| 276 |
+
|
| 277 |
+
FPR at $95 \%$ TPR is the probability of an OOD input being misclassified as in-distribution when $9 5 \%$ of in-distribution samples are correctly classified as in-distribution (i.e, the true positive rate (TPR) is at $9 5 \%$ ). True positive rate is calculated as, $\begin{array} { r } { T P R = \frac { T P } { T P + F N } } \end{array}$ , where TP and FN denote the true positives and false negatives, respectively. The false positive rate (FPR) is computed as $\begin{array} { r } { F P R = \frac { F P } { F P + T N } } \end{array}$ , where FP and TN denote the false positives and true negatives, respectively.
|
| 278 |
+
|
| 279 |
+
Detection error is the minimum mis-classification probability over all possible thresholds over the OOD score. We assume that the test set contains equal number of in and out of distribution samples.
|
| 280 |
+
|
| 281 |
+
AUROC is the area under the receiver operating characteristic curve, which is a threshold independent metric. ROC curve is a plot of TPR versus FPR. AUROC can be interpreted as the probability that a positive example is assigned a higher detection score than a negative example. For a perfect detector, AUROC is $100 \%$ .
|
| 282 |
+
|
| 283 |
+
AUPR is the Area under the Precision-Recall (PR) curve. PR curve is a plot of precision $T P =$ $( T P + F P ) \rangle$ versus recall $( T P = ( T P + F N ) )$ . The metric AUPR-In and AUPR-Out represent the area under the PR curve depending on if in or out of distribution data are specified as positives, respectively.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
|
| 287 |
+
# H MORE RESULTS
|
| 288 |
+
|
| 289 |
+
We report the OOD detection results for OOD detection methods based on softmax-score (Hendrycks & Gimpel (2016)), uncertainty of classifier obtained via MC-dropout (Gal & Ghahramani (2016)), and mutual information between predictions and model posterior (Gal et al. (2017)). The results are shown in Table 2.
|
| 290 |
+
|
| 291 |
+
Table 2: Results
|
| 292 |
+
|
| 293 |
+
<table><tr><td rowspan="2">ID Model</td><td rowspan="2">OOD</td><td>FPR at 95% TPR↓</td><td>Detection Error↓</td><td>AUROC↑</td><td>AUPR Out↑</td><td>AUPR In↑</td></tr><tr><td colspan="5">Softmax/MC-Dropout/Mutual-Info</td></tr><tr><td rowspan="7">MNIST</td><td>F-MNIST</td><td>1.61/2.1/54.3</td><td>3.3/3.5/14.5</td><td>99.5/99.4/90.8</td><td>99.5/99.5/91.5</td><td>99.5/99.4/86.2</td></tr><tr><td>EMNIST-letters</td><td>28.0/24.5/22.0</td><td>12.6/11.2/11.1</td><td>93.6/94.6/95.0</td><td>93.4/94.4/94.7</td><td>93.0/94.1/94.7</td></tr><tr><td>NotMNIST</td><td>13.1/12.5/22.1</td><td>7.1/6.7/9.1</td><td>97.4/97.6/95.5</td><td>97.8/97.9/96.0</td><td>97.0/97.1/94.0</td></tr><tr><td>Omniglot</td><td>0.0/0.0/92.8</td><td>0.5/0.6/19.5</td><td>100.0/100.0/84.5</td><td>100.0/100.0/88.7</td><td>100.0/100.0/73.9</td></tr><tr><td>Gaussian-Noise</td><td>0.0/0.0/100.0</td><td>0.0/0.0/49.3</td><td>100.0/100.0/17.2</td><td>100.0/100.0/37.7</td><td>100.0/100.0/34.0</td></tr><tr><td>Uniform-Noise</td><td>0.0/0.0/100.0</td><td>0.0/0.0/43.8</td><td>100.0/100.0/45.2</td><td>100.0/100.0/56.4</td><td>100.0/100.0/42.9</td></tr><tr><td>Sphere-OOD</td><td>0.8/1.3/7.6</td><td>2.6/3.1/4.2</td><td>99.3/99.2/97.3</td><td>99.5/99.4/99.3</td><td>99.1/99.0/93.1</td></tr><tr><td rowspan="7">F-MNIST</td><td>MNIST</td><td>84.5/68.9/19.4</td><td>34.5/25.0/11.9</td><td>70.6/82.2/93.5</td><td>70.9/83.0/91.3</td><td>68.2/80.3/94.9</td></tr><tr><td>EMNIST-letters</td><td>88.1/77.8/37.6</td><td>41.1/33.1/21.1</td><td>62.3/73.4/84.2/</td><td>62.3/73.2/79.6</td><td>61.3/72.2/87.9</td></tr><tr><td>NotMNIST</td><td>83.1/67.0/24.2</td><td>35.2/25.1/14.3</td><td>68.9/81.7/91.7</td><td>66.4/80.3/87.6</td><td>68.6/80.8/93.6</td></tr><tr><td>Omniglot</td><td>39.0/32.5/26.8</td><td>17.1/14.8/10.4</td><td>91.4/93.5/95.2</td><td>91.4/93.7/95.6</td><td>91.8/95.5/93.1</td></tr><tr><td>Gaussian-Noise</td><td>99.1/98.5/72.2</td><td>17.5/15.8/9.6</td><td>80.0/82.1/92.5</td><td>87.8/89.1/95.3</td><td>65.5/67.9/83.4</td></tr><tr><td>Uniform-Noise</td><td>96.9/96.5/48.8</td><td>29.4/24.2/16.8</td><td>70.1/76.8/90.9</td><td>78.6/84.0/92.5</td><td>58.11/64.8/87.9</td></tr><tr><td>Sphere-OOD</td><td>97.2/71.2/1.8</td><td>50.0/17.0/2.5</td><td>48.4/88.2/99.6</td><td>50.6/91.4/99.5</td><td>47.7/82.4/99.6</td></tr><tr><td rowspan="8">MNIST0-4</td><td>MNIST5-9</td><td>18.2/15.7/15.3</td><td>10.6/9.7/9.9</td><td>94.2/94.8/94.5</td><td>93.0/93.1/92.8</td><td>94.8/95.4/95.1</td></tr><tr><td>F-MNIST</td><td>3.1/4.4/8.8</td><td>4.0/4.6/5.9</td><td>99.0/98.8.97.8</td><td>99.2/99.0/98.4</td><td>98.7/98.4/96.6</td></tr><tr><td>EMNIST-LETTERS</td><td>25.3/21.6/21.4</td><td>12.8/12.2/12.2</td><td>92.8/93.5/93.4</td><td>90.6/91.6/91.3</td><td>93.3/93.9/94.1</td></tr><tr><td>NotMNIST</td><td>21.4/16.2/15.9</td><td>10.44/9.3/9.4</td><td>95.5/96.4/96.5</td><td>95.5/96.4/96.1</td><td>95.0/95.9/96.4</td></tr><tr><td>Omniglot</td><td>0.2/0.1/0.5</td><td>1.7/1.9/2.4</td><td>99.4/99.4/99.2</td><td>99.6/99.6/99.4</td><td>98.9/99.0/98.8</td></tr><tr><td>Gaussian-Noise</td><td>0.0/0.0/0.0</td><td>0.3/0.4/1.0</td><td>99.7/99.7/98.8</td><td>99.8.99.8/99.4</td><td>98.9/98.9/95.8</td></tr><tr><td>Uniform-Noise</td><td>0.0/0.0/0.0</td><td>0.6/0.9/2.2</td><td>99.7/99.6/98.3</td><td>99.8/99.8/99.0</td><td>99.1/99.0/95.2</td></tr><tr><td>Sphere-OOD</td><td>1.0/1.9/2.5</td><td>2.8/3.4/3.6</td><td>99.2/99.0/98.6</td><td>99.4/99.3/99.1</td><td>98.6/98.5/97.5</td></tr><tr><td rowspan="8">F-MNIST0-4</td><td>F-MNIST5-9</td><td>73.5/67.1/32.8</td><td>26.1/23.4/17.3</td><td>80.1/83.4/89.8</td><td>80.4/83.3/87.6</td><td>78.1/82.0/91.2</td></tr><tr><td>MNIST</td><td>44.9/43.9/73.9</td><td>15.9/16.0/16.9</td><td>91.0/91.4/87.7</td><td>91.2/91.3/89.5</td><td>90.4/90.5/82.3</td></tr><tr><td>EMNIST-letters</td><td>69.8/66.6/43.1</td><td>26.7/25.4/20.5</td><td>80.4/82.2/87.4</td><td>81.1/82.8/86.5</td><td>79.6/81.5/97.9</td></tr><tr><td>NotMNIST</td><td>71.9/67.0/38.6</td><td>24.3/20.8/17.0</td><td>82.8.86.1/90.8</td><td>84.3/87.7/90.4</td><td>80.2/83.4/91.0</td></tr><tr><td>Omniglot</td><td>44.8/41.3/29.6</td><td>15.3/14.0/11.5</td><td>91.6/93.0/94.7</td><td>92.1/93.8/94.9</td><td>91.0/92.2/93.9</td></tr><tr><td>Gaussian-Noise</td><td>0.3/0.5/98.3</td><td>2.3/2.3/12.2</td><td>99.8/99.7/87.3</td><td>99.8/99.8.92.4</td><td>99.7/99.7.74.2</td></tr><tr><td>Uniform-Noise</td><td>27.7/20.5/8.4</td><td>8.6/7.9/5.3</td><td>96.4/97.2/98.0</td><td>97.2/97.8/98.6</td><td>95.5/96.5/96.6</td></tr><tr><td>Sphere-OOD</td><td>86.5/67.3/10.7</td><td>33.7/20.4/7.8</td><td>71.6/86.2/97.3</td><td>73.4/88.0/96.7</td><td>67.3/83.0/97.8</td></tr></table>
|
md/train/rJgVwTVtvS/rJgVwTVtvS.md
ADDED
|
@@ -0,0 +1,554 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Gradient Perturbation is Underrated for Differentially Private Convex Optimization
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Gradient perturbation, widely used for differentially private optimization, injects noise at every iterative update to guarantee differential privacy. Previous work first determines the noise level that can satisfy the privacy requirement and then analyzes the utility of noisy gradient updates as in non-private case. In this paper, we explore how the privacy noise affects the optimization property. We show that for differentially private convex optimization, the utility guarantee of both DP-GD and DP-SGD is determined by an expected curvature rather than the minimum curvature. The expected curvature represents the average curvature over the optimization path, which is usually much larger than the minimum curvature and hence can help us achieve a significantly improved utility guarantee. By using the expected curvature, our theory justifies the advantage of gradient perturbation over other perturbation methods and closes the gap between theory and practice. Extensive experiments on real world datasets corroborate our theoretical findings.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Machine learning has become a powerful tool for many practical applications. The training process often needs access to some private dataset, e.g., applications in financial and medical fields. Recent work has shown that the model learned from training data may leak unintended information of individual records (Fredrikson et al., 2015; Wu et al., 2016; Shokri et al., 2017; Hitaj et al., 2017). It is known that Differential privacy (DP) (Dwork et al., 2006a;b) is a golden standard for privacy preserving data analysis. It provides provable privacy guarantee by ensuring the influence of any individual record is negligible. It has been deployed into real world applications by large-scale corporations and U.S. Census Bureau (Erlingsson et al., 2014; McMillan, 2016; Abowd, 2016; Ding et al., 2017).
|
| 12 |
+
|
| 13 |
+
We study the fundamental problem when differential privacy meets machine learning: the differentially private empirical risk minimization (DP-ERM) problem (Chaudhuri & Monteleoni, 2009; Chaudhuri et al., 2011; Kifer et al., 2012; Bassily et al., 2014; Talwar et al., 2015; Wu et al., 2017; Zhang et al., 2017; Wang et al., 2017; Smith et al., 2017; Jayaraman et al., 2018; Feldman et al., 2018; Iyengar et al., 2019; Wang & Gu, 2019). DP-ERM minimizes the empirical risk while guaranteeing that the output of learning algorithm is differentially private with respect to the training data. Such privacy guarantee provides strong protection against potential adversaries (Hitaj et al., 2017; Rahman et al., 2018). In order to guarantee privacy, it is necessary to introduce randomness to the algorithm. There are usually three ways to introduce randomness according to the time of adding noise: output perturbation, objective perturbation and gradient perturbation.
|
| 14 |
+
|
| 15 |
+
Output perturbation (Wu et al., 2017; Zhang et al., 2017) first runs the learning algorithm the same as in the non-private case then adds noise to the output parameter. Objective perturbation (Chaudhuri et al., 2011; Kifer et al., 2012; Iyengar et al., 2019) perturbs the objective (i.e., the empirical loss) then release the minimizer of the perturbed objective. Gradient perturbation (Song et al., 2013; Bassily et al., 2014; Abadi et al., 2016; Wang et al., 2017; Lee & Kifer, 2018; Jayaraman et al., 2018) perturbs each intermediate update. If each update is differentially private, the composition theorem of differential privacy ensures the whole learning procedure is differentially private.
|
| 16 |
+
|
| 17 |
+
Gradient perturbation comes with several advantages over output/objective perturbations. Firstly, gradient perturbation does not require strong assumption on the objective because it only needs to bound the sensitivity of gradient update rather than the whole learning process. Secondly, gradient perturbation can release the noisy gradient at each iteration without damaging the privacy guarantee as differential privacy is immune to post processing (Dwork et al., 2014). Thus, it is a more favorable choice for certain applications such as distributed optimization (Rajkumar & Agarwal, 2012; Agarwal et al., 2018; Jayaraman et al., 2018). At last, gradient perturbation often achieves better empirical utility than output/objective perturbations for DP-ERM.
|
| 18 |
+
|
| 19 |
+
However, the existing theoretical utility guarantee for gradient perturbation is the same as or strictly inferior to that of other perturbation methods as shown in Table 1. This motivates us to ask
|
| 20 |
+
|
| 21 |
+
“What is wrong with the theory for gradient perturbation? Can we justify the empirical advantage of gradient perturbation theoretically?”
|
| 22 |
+
|
| 23 |
+
We revisit the analysis for gradient perturbation approach. Previous work (Bassily et al., 2014; Wang et al., 2017; Jayaraman et al., 2018) derive the utility guarantee of gradient perturbation via two steps. They first determine the noise variance at each step that meets the privacy requirement and then derive the utility guarantee by using the convergence analysis the same as in non-private case. However, the noise to guarantee privacy naturally affects the optimization procedure, but previous approach does not exploit the interaction between privacy noise and optimization of gradient perturbation.
|
| 24 |
+
|
| 25 |
+
In this paper, we utilize the fact the privacy noise affects the optimization procedure and establish new and much tighter utility guarantees for gradient perturbation approaches. Our contribution can be summarized as follows.
|
| 26 |
+
|
| 27 |
+
• We introduce an expected curvature that can characterize the optimization property accurately when there is perturbation noise at each gradient update. • We establish the utility guarantees for DP-GD for both convex and strongly convex objectives based on the expected curvature rather than the usual minimum curvature. • We also establish the the utility guarantees for DP-SGD for both convex and strongly convex objectives based on the expected curvature. To the best of our knowledge, this is the first work to remove the dependency on minimum curvature for DP-ERM algorithms.
|
| 28 |
+
|
| 29 |
+
In DP-ERM literature, there is a gap between the utility guarantee of non-strongly convex objectives and that of strongly convex objectives. However, by using the expected curvature, we show that some of the non-strongly convex objectives can achieve the same order of utility guarantee as the strongly convex objectives, matching the empirical observation. This is because the expected curvature could be relatively large even for non-strongly convex objectives.
|
| 30 |
+
|
| 31 |
+
As we mentioned earlier, prior to our work, there is a mismatch between theoretical guarantee and empirical observation of gradient perturbation approach compared with other two perturbation approaches. Our result theoretically justifies the advantage of gradient perturbation and close the mismatch.
|
| 32 |
+
|
| 33 |
+
# 1.1 Paper Organization
|
| 34 |
+
|
| 35 |
+
The rest of this paper is organized as follows. Section 2 introduces notations and the DP-ERM task. In Sections 3, we first introduce the expected curvature and establish the utility guarantee of both DP-GD and DP-SGD based on such expected curvature. Then we give some discussion on three perturbation approaches. We conduct extensive experiments in Section 4. Finally, we conclude in Section 5.
|
| 36 |
+
|
| 37 |
+
Table 1: Expected excess empirical risk bounds under $( \epsilon , \delta )$ -DP, where $n$ and $p$ are the number of samples and the number of parameters, respectively, and $\beta , \mu$ and $\nu$ are the smooth coefficient, the strongly convex coefficient and the expected curvature, respectively, and $\nu \geq \mu$ (see Section 3.1). We note that $\mu = 0$ denotes the convex but not strongly convex objective. The Lipschitz constant $L$ is assumed to be 1. We omit $\log \left( 1 / \delta \right)$ for simplicity.
|
| 38 |
+
|
| 39 |
+
<table><tr><td rowspan=1 colspan=1>Authors</td><td rowspan=1 colspan=1>Perturbation</td><td rowspan=1 colspan=1>Algorithm</td><td rowspan=1 colspan=1>Utility (μ = 0)</td><td rowspan=1 colspan=3>Utility(u>0)</td></tr><tr><td rowspan=1 colspan=1>Chaudhuri et al. (2011)</td><td rowspan=1 colspan=1>Objective</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=2>0 pun22</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Zhang et al. (2017)</td><td rowspan=1 colspan=1>Output</td><td rowspan=1 colspan=1>GD</td><td rowspan=1 colspan=1>0 ()2/3)ne</td><td rowspan=1 colspan=2>0 βpHn2c²</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Bassily et al. (2014)</td><td rowspan=1 colspan=1>Gradient</td><td rowspan=1 colspan=1>SGD</td><td rowspan=1 colspan=1>0Vplog3/2(n)ne</td><td rowspan=1 colspan=3>0plog²(n)μn2c²</td></tr><tr><td rowspan=1 colspan=1>Jayaraman et al. (2018)</td><td rowspan=1 colspan=1>Gradient</td><td rowspan=1 colspan=1>GD</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=3>0βplog²(n)μ²n2e2</td></tr><tr><td rowspan=1 colspan=1>Ours</td><td rowspan=1 colspan=1>Gradient</td><td rowspan=1 colspan=1>GD</td><td rowspan=1 colspan=1>0 V>Bplog(n)v²n2e²nE</td><td rowspan=1 colspan=3>0βplog(n)v²n2c2</td></tr><tr><td rowspan=1 colspan=1>Ours</td><td rowspan=1 colspan=1>Gradient</td><td rowspan=1 colspan=1>SGD</td><td rowspan=1 colspan=1>0Vplog(n)>plog(n)nevn2e2</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>plog(n)vn2e2</td><td rowspan=1 colspan=1></td></tr></table>
|
| 40 |
+
|
| 41 |
+
# 2 Preliminary
|
| 42 |
+
|
| 43 |
+
We introduce notations and definitions in this section. Given dataset $D = \{ d _ { 1 } , \ldots , d _ { n } \}$ , the objective function $F ( { \pmb x } ; D )$ is defined as $\begin{array} { r } { F ( \pmb { x } ; D ) \triangleq \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f ( \pmb { x } ; d _ { i } ) } \end{array}$ , where $f ( \pmb { x } ; d _ { i } ) : \mathbb { R } ^ { p } \mathbb { R }$ is the loss of model $\pmb { x } \in \mathbb { R } ^ { p }$ for the record $d _ { i }$ .
|
| 44 |
+
|
| 45 |
+
For simplicity, we use $F ( { \pmb x } )$ to denote $F ( { \pmb x } ; D )$ . We use $\lVert \boldsymbol { v } \rVert$ to denote the $l _ { 2 }$ norm of a vector $_ { v }$ . We use $\begin{array} { r } { \mathcal { X } _ { f } ^ { * } = \arg \operatorname* { m i n } _ { { \pmb x } \in \mathbb { R } ^ { p } } f ( { \pmb x } ) } \end{array}$ to denote the set of optimal solutions of $f ( { \pmb x } )$ . Throughout this paper, we assume $\mathcal { X } _ { f } ^ { \ast }$ non-empty.
|
| 46 |
+
|
| 47 |
+
Definition 1 (Objective properties). For any $\ b { x } , \ b { y } \in \mathbb { R } ^ { p }$ , $a$ function $f : \mathbb { R } ^ { p } \mathbb { R }$
|
| 48 |
+
|
| 49 |
+
• is $L$ -Lipschitz if $| f ( \pmb { x } ) - f ( \pmb { y } ) | \leq L \| \pmb { x } - \pmb { y } \|$ .
|
| 50 |
+
• is $\beta$ -smooth if $\begin{array} { r } { f ( \pmb { y } ) \leq f ( \pmb { x } ) + \langle \nabla f ( \pmb { x } ) , \pmb { y } - \pmb { x } \rangle + \frac { \beta } { 2 } \left. \pmb { y } - \pmb { x } \right. ^ { 2 } . } \end{array}$
|
| 51 |
+
• is convex if $\langle \nabla f ( { \pmb x } ) - \nabla f ( { \pmb y } ) , { \pmb x } - { \pmb y } \rangle \geq 0$ .
|
| 52 |
+
• is $\mu$ -strongly convex (or $\mu$ -SC) if $\left. \nabla f ( { \pmb x } ) - \nabla f ( { \pmb y } ) , { \pmb x } - { \pmb y } \right. \geq \mu \left. { \pmb x } - { \pmb y } \right. ^ { 2 } .$
|
| 53 |
+
|
| 54 |
+
The strong convexity coefficient $\mu$ is the lower bound of the minimum curvature of function $f$ over the domain.
|
| 55 |
+
|
| 56 |
+
We say that two datasets $D , D ^ { \prime }$ are neighboring datasets (denoted as $D \sim D ^ { ' }$ ) if $D$ can be obtained by arbitrarily modifying one record in $D ^ { \prime }$ (or vice versa). In this paper we consider $( \epsilon , \delta )$ -differential privacy as follows.
|
| 57 |
+
|
| 58 |
+
Definition 2 ( $( \epsilon , \delta )$ -DP (Dwork et al., 2006a;b)). A randomized mechanism $\mathcal { M } : D \mathcal { R }$ guarantees $( \epsilon , \delta )$ -differential privacy if for any two neighboring input datasets $D , D ^ { ' }$ and for any subset of outputs $S \subseteq { \mathcal { R } }$ it holds that $P r [ \mathcal { M } ( D ) \in S ] \leq e ^ { \epsilon } P r [ \mathcal { M } ( D ^ { ' } ) \in S ] + \delta$ .
|
| 59 |
+
|
| 60 |
+
We note that $\delta$ can be viewed as the probability that original $\epsilon$ -DP fails and a meaningful setting requires $\begin{array} { r } { \delta \ll \frac { 1 } { n } } \end{array}$ . By its definition, differential privacy controls the maximum influence that any individual record can produce. Smaller $\epsilon , \delta$ implies less information leak but usually leads to worse utility. One can adjust $\epsilon , \delta$ to trade off between privacy and utility.
|
| 61 |
+
|
| 62 |
+
DP-ERM requires the output $\pmb { x } _ { o u t } \in \mathbb { R } ^ { p }$ is differentially private with respect to the input dataset $D$ . Let ${ \pmb x } _ { * } \in \mathcal { X } _ { F } ^ { * }$ be one of the optimal solutions of $F ( { \pmb x } )$ , the utility of DP-ERM algorithm is measured by expected excess empirical risk : $\mathbb { E } [ F ( { \pmb x } _ { o u t } ) - F ( { \pmb x } _ { * } ) ]$ , where the expectation is taken over the algorithm randomness.
|
| 63 |
+
|
| 64 |
+
# 3 Main Results
|
| 65 |
+
|
| 66 |
+
In this section, we first define the expected curvature $\nu$ and explain why it depends only on the average curvature. We then use such expected curvature to improve the analysis of both DP-SGD and DP-GD.
|
| 67 |
+
|
| 68 |
+
# 3.1 Expected Curvature
|
| 69 |
+
|
| 70 |
+
In non-private setting, the analysis of convex optimization relies on the strongly convex coefficient $\mu$ , which is the minimum curvature over the domain and can be extremely small for some common objectives. Previous work on DP-ERM uses the same analysis as in non-private case and therefore the resulting utility bounds rely on the minimum curvature. In our analysis, however, we avoid the dependency on the minimum curvature by exploiting how the privacy noise affects the optimization. With the perturbation noise, the expected curvature that the optimization path encounters is related to the average curvature instead of the minimum curvature. Definition 3 uses $\nu$ to capture such average curvature with Gaussian noise. We use $\begin{array} { r } { \pmb { x } _ { * } = \arg \operatorname* { m i n } _ { \pmb { x } \in \mathcal { X } _ { * } } \| \pmb { x } - \pmb { x } _ { 1 } \| } \end{array}$ to denote the closest solution to the initial point.
|
| 71 |
+
|
| 72 |
+
Definition 3 (Expected curvature). A convex function $F : \mathbb { R } ^ { p } \to \mathbb { R }$ , has expected curvature $\nu$ with respect to noise $\mathcal { N } ( 0 , \sigma ^ { 2 } I _ { p } )$ if for any $\pmb { x } \in \mathbb { R } ^ { p }$ and ${ \tilde { \pmb { x } } } = { \pmb { x } } - { \boldsymbol { z } }$ where $z \sim { \mathcal { N } } ( 0 , \sigma ^ { 2 } I _ { p } )$ it holds that
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbb { E } [ \langle \nabla F ( \tilde { \pmb { x } } ) , \tilde { \pmb { x } } - \pmb { x } _ { * } \rangle ] \geq \nu \mathbb { E } [ \| \tilde { \pmb { x } } - \pmb { x } _ { * } \| ^ { 2 } ] ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where the expectation is taken with respect to $_ { z }$
|
| 79 |
+
|
| 80 |
+
Claim 1. If $F ^ { \prime }$ is $\mu$ -strongly convex, we have $\nu \geq \mu$
|
| 81 |
+
|
| 82 |
+
Proof. It can be verified that $\nu = \mu$ always holds because of the strongly convex definition.
|
| 83 |
+
|
| 84 |
+
In fact, $\nu$ represents the average curvature and is much larger than $\mu$ . We use $\mathbf { x } ^ { \prime }$ to denote the transpose of $_ { x }$ . Let $H _ { x } = \nabla ^ { 2 } F ( { \pmb x } )$ be the Hessian matrix evaluated at $_ { x }$ . We use Taylor expansion to approximate the left hand side of Eq (1) as follows
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array} { r } { \mathbb { E } [ \langle \nabla F ( \tilde { \pmb { x } } ) , \tilde { \pmb { x } } - \pmb { x } _ { * } \rangle ] \approx \mathbb { E } [ \langle \nabla F ( \pmb { x } ) - \pmb { H } _ { \pmb { x } } \pmb { z } , \pmb { x } - \pmb { z } - \pmb { x } _ { * } \rangle ] } \\ { = \langle \nabla F ( \pmb { x } ) , \pmb { x } - \pmb { x } _ { * } \rangle + \mathbb { E } [ \pmb { z } ^ { \prime } H _ { \pmb { x } } \pmb { z } ] } \\ { = \langle \nabla F ( \pmb { x } ) , \pmb { x } - \pmb { x } _ { * } \rangle + \sigma ^ { 2 } \operatorname { t r } ( H _ { \pmb { x } } ) . } \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
For convex objective, the Hessian matrix is positive semi-definite and $\mathrm { t r } ( H _ { \pmb { x } } )$ is the sum of the eigenvalues of $H _ { x }$ . We can further express out the right hand side of Eq (1) as follows
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r } { \mathbb { E } [ \| \tilde { \pmb { x } } - \pmb { x } _ { * } \| ^ { 2 } ] = \mathbb { E } [ \| \pmb { x } - \pmb { z } - \pmb { x } _ { * } \| ^ { 2 } ] = \nu \left( \| \pmb { x } - \pmb { x } _ { * } \| ^ { 2 } + p \sigma ^ { 2 } \right) . } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
Based on the above approximation, we can estimate the value of $\nu$ in Definition 3: $\nu \lesssim$ $\frac { \mathop { \mathrm { t r } } ( H _ { \pmb { x } } ) \sigma ^ { 2 } + \mu \| \pmb { x } - \pmb { x } _ { * } \| ^ { 2 } } { p \sigma ^ { 2 } + \| \pmb { x } - \pmb { x } _ { * } \| ^ { 2 } }$ . For relatively large $\sigma ^ { 2 }$ , this implies $\begin{array} { r } { \nu \approx \frac { \mathrm { t r } ( H _ { x } ) } { p } } \end{array}$ tr(Hx) that is the average curvature at $_ { x }$ . Large variance is a reasonable setting because meaningful differential privacy guarantee requires non-trivial amount of noise.
|
| 97 |
+
|
| 98 |
+
The above analysis suggests that $\nu$ can be independent of and much larger than $\mu$ . This is indeed true for many convex objectives. Let us take the $l _ { 2 }$ regularized logistic regression as an example. The objective is strongly convex only due to the $l _ { 2 }$ regularizer. Thus, the minimum curvature (strongly convex coefficient) is the regularization coefficient $\lambda$ . Sharmir et al. [1] shows the optimal choice of $\lambda$ is $\Theta ( n ^ { - 1 / 2 } )$ (Section 4.3 in [1]). In practice, typical choice of $\lambda$ is even smaller and could be on the order of $n ^ { - 1 }$ . Figure 1 compares the minimum and average curvatures of regularized logistic regression during the training process. The average curvature is basically unaffected by the regularization term $\lambda$ . In contrast, the minimum curvature reaches $\lambda$ in first few steps. Therefore removing the dependence on minimum curvature is a significant improvement. We also plot the curvatures for another dataset KDDCup99 in the Appendix C. The resulting curvatures are similar to Figure 1.
|
| 99 |
+
|
| 100 |
+
Perturbation noise is necessary to attain $\nu > \mu$ . We note that $\nu = \mu$ when the training process does not involve perturbation noise (corresponding to $\sigma = 0$ in Definition 3). For example, objective/output perturbation cannot utilize this expected curvature condition as no noise is injected in their training process. Therefore, among three existing perturbation methods, gradient perturbation is the only method can leverage such effect of noise.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 1: Curvatures of regularized logistic regression on Adult dataset over training. Dot/cross symbol represents average/minimum curvature respectively.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 2: Illustration of a generic loss function in the high dimensional setting ( $p { > } n$ , Figure 3 in Negahban et al. (2012)).
|
| 107 |
+
|
| 108 |
+
We note that $\mu = 0$ does not necessarily lead to $\nu = 0$ . A concrete example is given in Figure 2 (from Negahban et al. (2012)). It provides an illustration of the loss function in the high-dimensional $( p > n )$ setting, i.e., the resticted strongly convex scenario: the loss is curved in certain directions but completely flat in others. The average curvature of such objective is always positive but the worst curvature is 0. Though some recent work shows the utility guarantee of high dimensional DP-ERM task may not depend on the worst curvature (Wang & Gu, 2019), Figure 2 still provides a good illustration for the case of $\nu > \mu = 0$ Moreover, as shown in Figure 1, the average curvature of logistic regression on Adult dataset is above 0 during the training procedure even the regularization term is 0. As we will show later, a positive $\nu$ over the optimization path is sufficient for our optimization analysis.
|
| 109 |
+
|
| 110 |
+
# 3.2 Utility Guarantee of DP-GD Based on Expected Curvature
|
| 111 |
+
|
| 112 |
+
In this section we show that the expected curvature can be used to improve the utility bound of DP-GD (Algorithm 1).
|
| 113 |
+
|
| 114 |
+
<table><tr><td>Algorithm 1: Differentially Private Gradient Descent (DP-GD)</td></tr><tr><td>Input: Privacy parameters e,δ; running steps T; learning rate n. Loss function F(x) with Lipschitz constant L.</td></tr><tr><td>for t=1 to T do</td></tr><tr><td>Compute gt = VF(xt).</td></tr><tr><td>Update parameter Xt+1 = xt - Nt (gt + zt), where zt ~ N(0,σ²Ip). end for</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Algorithm 1 is $( \epsilon , \delta )$ -DP if we set $\begin{array} { r } { \sigma _ { t } = \Theta \left( \frac { L \sqrt { T \log ( 1 / \delta ) } } { n \epsilon } \right) } \end{array}$ (Jayaraman et al., 2018). Let $\pmb { x } _ { 1 } , \ldots , \pmb { x } _ { T }$ be the training path and $\nu = \operatorname* { m i n } \{ \nu _ { 1 } , \dots , \nu _ { T } \}$ be the minimum expected curvature over the path. Now we present the utility guarantee of DP-GD for the case of $\nu > 0$ .
|
| 117 |
+
|
| 118 |
+
Theorem 1 (Utility guarantee, $\nu > 0$ .). Suppose $F ^ { \prime }$ is $L$ -Lipschitz and $\beta$ -smooth with $\nu$ expected curvature. Set $\begin{array} { r } { \eta \le { \frac { 1 } { \beta } } } \end{array}$ , $\begin{array} { r } { T = \frac { 2 \log ( n ) } { \eta \nu } } \end{array}$ and $\sigma _ { t } = \Theta \left( L \sqrt { T \log ( 1 / \delta ) } / n \epsilon \right)$ , we have
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathbb { E } \left[ F \left( \pmb { x } _ { T + 1 } \right) - F \left( \pmb { x } _ { \ast } \right) \right] = \mathcal { O } \left( \frac { \beta p \log { \left( n \right) L ^ { 2 } } \log { \left( 1 / \delta \right) } } { \nu ^ { 2 } n ^ { 2 } \epsilon ^ { 2 } } \right) .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Proof. All proofs in this paper are relegated to Appendix A.
|
| 125 |
+
|
| 126 |
+
Remark 1. Theorem 3 only depends on the expected curvature over the training path $\nu$ .
|
| 127 |
+
|
| 128 |
+
The expectation is taken over the algorithm randomness if without specification. Theorem 1 significantly improves the original analysis of DP-GD because of our arguments in Section 3.1. If $\nu = 0$ , then the curvatures are flatten in all directions. One example is the linear function, which is used by Bassily et al. (2014) to derive their utility lower bound. Such simple function may not be commonly used as loss function in practice. Nonetheless, we give the utility guarantee for the case of $\nu = 0$ in Theorem 2.
|
| 129 |
+
|
| 130 |
+
Theorem 2 (Utility guarantee, $\nu = 0$ .). Suppose $F$ is $L$ -Lipschitz and $\beta$ -smooth. Set $\begin{array} { r } { \eta = \frac { 1 } { \beta } } \end{array}$ , T = nβ√ and $\sigma _ { t } = \Theta \left( L \sqrt { T \log ( 1 / \delta ) } / n \epsilon \right)$ . Let $\begin{array} { r } { \bar { \pmb x } = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } \pmb x _ { i + 1 } } \end{array}$ , we have
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\mathbb { E } [ F \left( \bar { \pmb { x } } \right) - F \left( \pmb { x } _ { \ast } \right) ] = \mathcal { O } \left( \frac { \sqrt { p } L ^ { 2 } \log \left( 1 / \delta \right) } { n \epsilon } \right) .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
We use parameter averaging to reduce the influence of perturbation noise because gradient update does not have strong contraction effect when $\nu = 0$ .
|
| 137 |
+
|
| 138 |
+
# 3.3 Utiltiy Guarantee of DP-SGD Based on Expected Curvature
|
| 139 |
+
|
| 140 |
+
Stochastic gradient descent has become one of the most popular optimization methods because of the cheap one-iteration cost. In this section we show that expected curvature can also improve the utility analysis for DP-SGD (Algorithm 2). We note that $\nabla f ( { \pmb x } )$ represents an element from the subgradient set evaluated at $_ { x }$ when the objective is not smooth. Before stating our theorem, we introduce the moments accountant technique (Lemma 1) that is essential to establish privacy guarantee.
|
| 141 |
+
|
| 142 |
+
Lemma 1 (Abadi et al. (2016)). There exist constants $c _ { 1 }$ and $c _ { 2 }$ so that given running steps $T$ , for any √ $\epsilon < c _ { 1 } T / n ^ { 2 }$ , Algorithm $\mathcal { Q }$ is $( \epsilon , \delta )$ -differentially private for any $\delta > 0$ if we choose $\sigma \ge c _ { 2 } \frac { \sqrt { T l o g ( 1 / \delta ) } } { n \epsilon }$
|
| 143 |
+
|
| 144 |
+
# Algorithm 2: Differentially Private Stochastic Gradient Descent (DP-SGD)
|
| 145 |
+
|
| 146 |
+
Input : Dataset $D = \{ d _ { 1 } , \ldots , d _ { n } \}$ . Individual loss function: $f _ { i } \left( \pmb { x } \right) = f \left( \pmb { x } ; d _ { i } \right)$ with Lipschitz constant $L$ . Number of iterations: $T$ . Learning rate: $\eta _ { t }$ .
|
| 147 |
+
|
| 148 |
+
1 for $t = 1$ to $T$ do
|
| 149 |
+
|
| 150 |
+
Sample $i _ { t }$ from $[ n ]$ uniformly.
|
| 151 |
+
Compute ${ \pmb g } _ { t } = \nabla f _ { i _ { t } } \left( { \pmb x } _ { t } \right)$ .
|
| 152 |
+
Update parameter ${ \pmb x } _ { t + 1 } = { \pmb x } _ { t } - \eta _ { t } \left( { \pmb g } _ { t } + { \pmb z } _ { t } \right)$ , where $z _ { t } \sim \mathcal { N } \left( 0 , L ^ { 2 } \sigma ^ { 2 } I _ { p } \right)$ .
|
| 153 |
+
|
| 154 |
+
5 end
|
| 155 |
+
|
| 156 |
+
For the case of $\nu > 0$ , Theorem 3 presents the utility guarantee of DP-SGD.
|
| 157 |
+
|
| 158 |
+
Theorem 3 (Utility guarantee, $\nu > 0$ .). Suppose $F$ is $L$ -Lipschitz with $\nu$ expected curvature. Choose $\sigma$ based on Lemma $\mathit { 1 }$ to guarantee $( \epsilon , \delta )$ -DP. Set $\begin{array} { r } { \eta _ { t } = \frac { 1 } { \nu t } } \end{array}$ and $T = n ^ { 2 } \epsilon ^ { 2 }$ , we have
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\mathbb { E } [ F \left( \pmb { x } _ { T } \right) - F \left( \pmb { x } _ { \ast } \right) ] = \mathcal { O } \left( \frac { p L ^ { 2 } \log \left( n \right) \log \left( 1 / \delta \right) } { n ^ { 2 } \epsilon ^ { 2 } \nu } \right) .
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
Remark 2. Theorem 3 does not require smooth assumption.
|
| 165 |
+
|
| 166 |
+
Theorem 3 shows the utility guarantee of DP-SGD also depends on $\nu$ rather than $\mu$ . We set $T = \Theta ( n ^ { 2 } )$ following Bassily et al. (2014). We note that $T = \Theta ( n ^ { 2 } )$ is necessary even for non-private SGD to reach $1 / n ^ { 2 }$ precision. We next show for a relatively coarse precision, the running time can be reduced significantly.
|
| 167 |
+
|
| 168 |
+
Theorem 4. SupposeLemma 1 to guarantee $F ^ { \prime }$ s- $L$ Lipsc. Set th a $\nu$ curvatur. Suppose oose , we $\sigma$ based onave $( \epsilon , \delta )$ $D P$ $\begin{array} { r } { \eta _ { t } = \frac { 1 } { \nu t } } \end{array}$ $\begin{array} { r } { T = \frac { n \epsilon } { \sqrt { p } } } \end{array}$ $p < n ^ { 2 }$
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\mathbb { E } [ F \left( \mathbf { x } _ { T } \right) - F \left( \mathbf { x } _ { * } \right) ] = { \mathcal { O } } \left( { \frac { { \sqrt { p } } L ^ { 2 } \log ( n ) } { n \epsilon \nu } } \right) .
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
We note that the analysis of Bassily et al. (2014) yields E[F (xT )−F (x∗)] = O √pL2 log2(n)nµ if setting $\begin{array} { r } { T = \frac { n \epsilon } { \sqrt { p } } } \end{array}$ , w till depends on the minimum curvature. Theorem 5 shows the $\nu = 0$
|
| 175 |
+
|
| 176 |
+
Theorem 5 (Utility guarantee, $\nu = 0$ .). Suppose $F$ is $L$ -Lipschitz. Assume $\| \pmb { x } _ { t } \| \le D$ for $t \in [ T ]$ . Choose $\sigma$ based on Lemma $\mathit { 1 }$ to guarantee $( \epsilon , \delta )$ -DP. Let $G = L \sqrt { 1 + p \sigma ^ { 2 } }$ , set ηt = DG√t and $T = n ^ { 2 } \epsilon ^ { 2 }$ , we have
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\mathbb { E } [ F \left( \pmb { x } _ { T } \right) - F \left( \pmb { x } _ { \ast } \right) ] = \mathcal { O } \left( \frac { \sqrt { p \log \left( 1 / \delta \right) } L \log \left( n \right) } { n \epsilon } \right) .
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
This utility guarantee can be derived from Theorem 2 in (Shamir $\&$ Zhang, 2013).
|
| 183 |
+
|
| 184 |
+
# 3.4 Discussion on three perturbation approaches.
|
| 185 |
+
|
| 186 |
+
In this section, we briefly discuss two other perturbation approaches and compare them to the gradient perturbation approach.
|
| 187 |
+
|
| 188 |
+
Output perturbation (Wu et al., 2017; Zhang et al., 2017) perturbs the learning algorithm after training. It adds noise to the resulting model of non-private learning process. The magnitude of perturbation noise is propositional to the maximum influence one record can cause on the learned model. Take the gradient descent algorithm as an example. At each step, the gradient of different records would diverge the two sets of parameters generated by neighboring datasets, the maximum distance expansion is related to the Lipschitz coefficient. At the same time, the gradient of the same records in two datasets would shrink the parameter distance because of the contraction effect of the gradient update. The contraction effect depends on the smooth and strongly convex coefficient. Smaller strongly convex coefficient leads to weaker contraction. The sensitivity of output perturbation algorithm is the upper bound on the largest possible final distance between two sets of parameters.
|
| 189 |
+
|
| 190 |
+
Objective perturbation (Chaudhuri et al., 2011; Kifer et al., 2012; Iyengar et al., 2019) perturbs the objective function before training. It requires the objective function to be strongly convex to guarantee the uniqueness of the solution. It first adds $L _ { 2 }$ regularization to obtain strong convexity if the original objective is not strongly convex. Then it perturbs the objective with a random linear term. The sensitivity of objective perturbation is the maximum change of the minimizer that one record can produce. Chaudhuri et al. (2011) and Kifer et al. (2012) use the largest and the smallest eigenvalue (i.e. the smooth and strongly convex coefficient) of the objective’s Hessian matrix to upper bound such change.
|
| 191 |
+
|
| 192 |
+
In comparison, gradient perturbation is more flexible than output/objective perturbation. For example, to bound the sensitivity, gradient perturbation only requires Lipschitz coefficient which can be easily obtained by using the gradient clipping technique. However, both output and objective perturbation further need to compute the smooth coefficient, which is hard for some common objectives such as softmax regression.
|
| 193 |
+
|
| 194 |
+
More critically, output/objective perturbation cannot utilize the expected curvature condition because their training process does not contain perturbation noise. Moreover, they have to consider the worst performance of learning algorithm. That is because DP makes the worst case assumption on query function and output/objective perturbation treat the whole learning algorithm as a single query to private dataset. This explains why their utility guarantee depends on the worst curvature of the objective.
|
| 195 |
+
|
| 196 |
+
# 4 Experiment
|
| 197 |
+
|
| 198 |
+
In this section, we evaluate the performance of DP-GD and DP-SGD on multiple real world datasets. We use the benchmark datasets provided by Iyengar et al. (2019). Objective functions are logistic regression and softmax regression for binary and multi-class datasets, respectively.
|
| 199 |
+
|
| 200 |
+
Datasets. The benchmark datasets includes two multi-class datasets (MNIST, Covertype) and five binary datasets, and three of them are high dimensional (Gisette, Real-sim, RCV1).
|
| 201 |
+
|
| 202 |
+
Table 2: Algorithm validation accuracy (in $\%$ ) on various kinds of real world datasets. Privacy parameter $\epsilon$ is 0.1 for binary dataset and 1 for multi-classes datasets.
|
| 203 |
+
|
| 204 |
+
<table><tr><td></td><td>KDDCup99</td><td>Adult</td><td>MNIST</td><td>Covertype</td><td>Gisette</td><td>Real-sim</td><td>RCV1</td></tr><tr><td>Non private</td><td>99.1</td><td>84.8</td><td>91.9</td><td>71.2</td><td>96.6</td><td>93.3</td><td>93.5</td></tr><tr><td>AMP1</td><td>97.5</td><td>79.3</td><td>71.9</td><td>64.3</td><td>62.8</td><td>73.1</td><td>64.5</td></tr><tr><td>Out-SGD</td><td>98.1</td><td>77.4</td><td>69.4</td><td>62.4</td><td>62.3</td><td>73.2</td><td>66.7</td></tr><tr><td>DP-SGD</td><td>98.7</td><td>80.4</td><td>87.5</td><td>67.7</td><td>63.0</td><td>73.8</td><td>70.4</td></tr><tr><td>DP-GD</td><td>98.7</td><td>80.9</td><td>88.6</td><td>66.2</td><td>67.3</td><td>76.1</td><td>74.9</td></tr></table>
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 3: Algorithm validation accuracy (in $\%$ ) with varying . NP represents non-private baseline. Detailed description about evaluated datasets can be found in Table 3.
|
| 208 |
+
|
| 209 |
+
Following Iyengar et al. (2019), we use $8 0 \%$ data for training and the rest for testing. Detailed description of datasets can be found in Appendix B
|
| 210 |
+
|
| 211 |
+
Implementation details. We track Rényi differentialy privacy $( R D P )$ (Mironov, 2017) and convert it to $( \epsilon , \delta )$ -DP. Running step $T$ is chosen from $\{ 5 0 , 2 0 0 , 8 0 0 \}$ for both DP-GD and DP-SGD. For DP-SGD, we use moments accountant to track the privacy loss and the sampling ratio is set as 0.1. The standard deviation of the added noise $\sigma$ is set to be the smallest value such that the privacy budget is allowable to run desired steps. We ensure each loss function is Lipschitz by clipping individual gradient. The method in Goodfellow (2015) allows us to clip individual gradient efficiently. Clipping threshold is set as 1 (0.5 for high dimensional datasets because of the sparse gradient). For DP-GD, learning rate is chosen from $\{ 0 . 1 , 1 . 0 , 5 . 0 \}$ $( \{ 0 . 2 , 2 . 0 , 1 0 . 0 \}$ for high dimensional datasets). The learning rate of DP-SGD is twice as large as DP-GD and it is divided by 2 at the middle of training. Privacy parameter $\delta$ is set as $\textstyle { \frac { 1 } { n ^ { 2 } } }$ . The $l _ { 2 }$ regularization coefficient is set as $1 \times 1 0 ^ { - 4 }$ . All reported numbers are averaged over 20 runs.
|
| 212 |
+
|
| 213 |
+
Baseline algorithms. The baseline algorithms include state-of-the-art objective and output perturbation algorithms. For objective perturbation, we use Approximate Minima Perturbation (AMP) (Iyengar et al., 2019). For output perturbation, we use the algorithm in Wu et al. (2017) (Output perturbation SGD). We adopt the implementation and hyperparameters in Iyengar et al. (2019) for both algorithms. For multi-class classification tasks, Wu et al. (2017) and Iyengar et al. (2019) divide the privacy budget evenly and train multiple binary classifiers because their algorithms need to compute smooth coefficient before training and therefore are not directly applicable to softmax regression.
|
| 214 |
+
|
| 215 |
+
Experiment results. The validation accuracy results for all evaluated algorithms with $\epsilon = 0 . 1$ (1.0 for multi-class datasets) are presented in Table 2. We also plot the accuracy results with varying $\epsilon$ in Figure 3. These results confirm our theory in Section 3: gradient perturbation achieves better performance than other perturbation methods as it leverages the average curvature.
|
| 216 |
+
|
| 217 |
+
# 5 Conclusion
|
| 218 |
+
|
| 219 |
+
In this paper, we show the privacy noise actually helps optimization analysis, which can be used to improve the utility guarantee of both DP-GD and DP-SGD. Our result theoretically justifies the empirical superiority of gradient perturbation over other methods and advance the state of the art utility guarantee of DP-ERM algorithms. Experiments on real world datasets corroborate our theoretical findings nicely. In the future, it is interesting to consider how to utilize the expected curvature condition to improve the utility guarantee of other gradient perturbation based algorithms.
|
| 220 |
+
|
| 221 |
+
# References
|
| 222 |
+
|
| 223 |
+
Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In ACM SIGSAC Conference on Computer and Communications Security, 2016.
|
| 224 |
+
|
| 225 |
+
John M Abowd. The challenge of scientific reproducibility and privacy protection for statistical agencies. Census Scientific Advisory Committee, 2016.
|
| 226 |
+
|
| 227 |
+
Naman Agarwal, Ananda Theertha Suresh, Felix Xinnan X Yu, Sanjiv Kumar, and Brendan McMahan. cpsgd: Communication-efficient and differentially-private distributed sgd. In Advances in Neural Information Processing Systems, 2018.
|
| 228 |
+
|
| 229 |
+
Raef Bassily, Adam Smith, and Abhradeep Thakurta. Differentially private empirical risk minimization: Efficient algorithms and tight error bounds. Annual Symposium on Foundations of Computer Science, 2014.
|
| 230 |
+
|
| 231 |
+
Kamalika Chaudhuri and Claire Monteleoni. Privacy-preserving logistic regression. In Advances in Neural Information Processing Systems, 2009.
|
| 232 |
+
|
| 233 |
+
Kamalika Chaudhuri, Claire Monteleoni, and Anand D Sarwate. Differentially private empirical risk minimization. Journal of Machine Learning Research, 2011.
|
| 234 |
+
|
| 235 |
+
Bolin Ding, Janardhan Kulkarni, and Sergey Yekhanin. Collecting telemetry data privately. In Advances in Neural Information Processing Systems, 2017.
|
| 236 |
+
|
| 237 |
+
Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In Annual International Conference on the Theory and Applications of Cryptographic Techniques, 2006a.
|
| 238 |
+
|
| 239 |
+
Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of cryptography conference, 2006b.
|
| 240 |
+
|
| 241 |
+
Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends
|
| 242 |
+
|
| 243 |
+
Úlfar Erlingsson, Vasyl Pihur, and Aleksandra Korolova. Rappor: Randomized aggregatable privacypreserving ordinal response. In Proceedings of the 2014 ACM SIGSAC conference on computer and communications security, 2014.
|
| 244 |
+
|
| 245 |
+
Vitaly Feldman, Ilya Mironov, Kunal Talwar, and Abhradeep Thakurta. Privacy amplification by iteration. In 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS), 2018.
|
| 246 |
+
|
| 247 |
+
Matt Fredrikson, Somesh Jha, and Thomas Ristenpart. Model inversion attacks that exploit confidence information and basic countermeasures. In ACM SIGSAC Conference on Computer and Communications Security, 2015.
|
| 248 |
+
|
| 249 |
+
Ian Goodfellow. Efficient per-example gradient computations. arXiv preprint arXiv:1510.01799, 2015.
|
| 250 |
+
|
| 251 |
+
Briland Hitaj, Giuseppe Ateniese, and Fernando Pérez-Cruz. Deep models under the gan: information leakage from collaborative deep learning. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, 2017.
|
| 252 |
+
|
| 253 |
+
Roger Iyengar, Joseph P Near, Dawn Song, Om Thakkar, Abhradeep Thakurta, and Lun Wang. Towards practical differentially private convex optimization. In IEEE Symposium on Security and Privacy, 2019.
|
| 254 |
+
|
| 255 |
+
Bargav Jayaraman, Lingxiao Wang, David Evans, and Quanquan Gu. Distributed learning without distress: Privacy-preserving empirical risk minimization. In Advances in Neural Information Processing Systems, 2018.
|
| 256 |
+
|
| 257 |
+
Daniel Kifer, Adam Smith, and Abhradeep Thakurta. Private convex empirical risk minimization and high-dimensional regression. In Conference on Learning Theory, 2012.
|
| 258 |
+
|
| 259 |
+
Jaewoo Lee and Daniel Kifer. Concentrated differentially private gradient descent with adaptive per-iteration privacy budget. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2018.
|
| 260 |
+
|
| 261 |
+
Robert McMillan. Apple tries to peek at user habits without violating privacy. The Wall Street Journal, 2016.
|
| 262 |
+
|
| 263 |
+
Ilya Mironov. Rényi differential privacy. In IEEE 30th Computer Security Foundations Symposium (CSF), 2017.
|
| 264 |
+
|
| 265 |
+
Sahand N Negahban, Pradeep Ravikumar, Martin J Wainwright, Bin Yu, et al. A unified framework for high-dimensional analysis of $m$ -estimators with decomposable regularizers. Statistical Science, 27(4):538–557, 2012.
|
| 266 |
+
|
| 267 |
+
Md Atiqur Rahman, Tanzila Rahman, Robert Laganiere, Noman Mohammed, and Yang Wang. Membership inference attack against differentially private deep learning model. Transactions on Data Privacy, 2018.
|
| 268 |
+
|
| 269 |
+
Arun Rajkumar and Shivani Agarwal. A differentially private stochastic gradient descent algorithm for multiparty classification. In Artificial Intelligence and Statistics, 2012.
|
| 270 |
+
|
| 271 |
+
Ohad Shamir and Tong Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In International Conference on Machine Learning, 2013.
|
| 272 |
+
|
| 273 |
+
Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership inference attacks against machine learning models. In IEEE Symposium on Security and Privacy (SP), 2017.
|
| 274 |
+
|
| 275 |
+
Adam Smith, Abhradeep Thakurta, and Jalaj Upadhyay. Is interaction necessary for distributed private learning? In IEEE Symposium on Security and Privacy (SP). IEEE, 2017.
|
| 276 |
+
|
| 277 |
+
Shuang Song, Kamalika Chaudhuri, and Anand D Sarwate. Stochastic gradient descent with differentially private updates. In Global Conference on Signal and Information Processing (GlobalSIP), 2013 IEEE, 2013.
|
| 278 |
+
|
| 279 |
+
Kunal Talwar, Abhradeep Guha Thakurta, and Li Zhang. Nearly optimal private lasso. In Advances in Neural Information Processing Systems, 2015.
|
| 280 |
+
|
| 281 |
+
Di Wang, Minwei Ye, and Jinhui Xu. Differentially private empirical risk minimization revisited: Faster and more general. In Advances in Neural Information Processing Systems, 2017.
|
| 282 |
+
|
| 283 |
+
Lingxiao Wang and Quanquan Gu. Differentially private iterative gradient hard thresholding for sparse learning. In 28th International Joint Conference on Artificial Intelligence, 2019.
|
| 284 |
+
|
| 285 |
+
Xi Wu, Matthew Fredrikson, Somesh Jha, and Jeffrey F Naughton. A methodology for formalizing model-inversion attacks. In 2016 IEEE 29th Computer Security Foundations Symposium (CSF), 2016.
|
| 286 |
+
|
| 287 |
+
Xi Wu, Fengan Li, Arun Kumar, Kamalika Chaudhuri, Somesh Jha, and Jeffrey Naughton. Bolt-on differential privacy for scalable stochastic gradient descent-based analytics. In ACM International Conference on Management of Data, 2017.
|
| 288 |
+
|
| 289 |
+
Jiaqi Zhang, Kai Zheng, Wenlong Mou, and Liwei Wang. Efficient private erm for smooth objectives. In International Joint Conference on Artificial Intelligence, 2017.
|
| 290 |
+
|
| 291 |
+
# Appendix A Proofs Related to DP-GD and DP-SGD
|
| 292 |
+
|
| 293 |
+
Proof of Theorem 1. Let $\pmb { x } _ { 1 } , \ldots , \pmb { x } _ { t }$ be the path generated by optimization procedure. Since $\scriptstyle { \mathbf { x } } _ { t }$ contains Gaussian perturbation noise ${ z t - 1 }$ , Definition 3 gives us
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\begin{array} { r } { \mathbb { E } _ { z _ { t - 1 } } \big [ \langle { \pmb x } _ { t } - { \pmb x } _ { * } , \nabla F \left( { \pmb x } _ { t } \right) \rangle \big ] \geq \nu _ { t } \mathbb { E } _ { z _ { t - 1 } } \big [ \big \| { \pmb x } _ { t } - { \pmb x } _ { * } \big \| ^ { 2 } \big ] . } \end{array}
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
Since $F ^ { \prime }$ is $\beta$ -smooth, we have
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\langle { \pmb x } _ { t } - { \pmb x } _ { * } , \nabla F \left( { \pmb x } _ { t } \right) \rangle \geq \frac { 1 } { \beta } \left\| \nabla F \left( { \pmb x } _ { t } \right) \right\| ^ { 2 } .
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
Take linear combination of above inequalities,
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\begin{array} { r l r } & { } & { \mathbb { E } _ { z _ { t - 1 } } [ \langle x _ { t } - x _ { * } , \nabla F \left( { \pmb x } _ { t } \right) \rangle ] \ge \theta \nu _ { t } \mathbb { E } _ { z _ { t - 1 } } [ \| { \pmb x } _ { t } - { \pmb x } _ { * } \| ^ { 2 } ] + \frac { ( 1 - \theta ) } { \beta } \mathbb { E } _ { z _ { t - 1 } } [ \| \nabla F \left( { \pmb x } _ { t } \right) \| ^ { 2 } ] } \\ & { } & \\ & { } & { \ge \theta \nu \mathbb { E } _ { z _ { t - 1 } } [ \| { \pmb x } _ { t } - { \pmb x } _ { * } \| ^ { 2 } ] + \frac { ( 1 - \theta ) } { \beta } \mathbb { E } _ { z _ { t - 1 } } [ \| \nabla F \left( { \pmb x } _ { t } \right) \| ^ { 2 } ] . } \end{array}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
Let $r _ { t } = \| \pmb { x } _ { t } - \pmb { x } _ { * } \|$ be the solution error at step $t$ . We have the following inequalities between $r _ { t + 1 }$ and $r _ { t }$ .
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r l } & { r _ { t + 1 } ^ { 2 } = \left. x _ { t } - \eta \nabla F \left( { \pmb x } _ { t } \right) - \eta z _ { t } - { \pmb x } _ { * } \right. ^ { 2 } , } \\ & { \qquad = \left. { \pmb x } _ { t } - { \pmb x } _ { * } \right. ^ { 2 } - 2 \eta \langle \nabla F \left( { \pmb x } _ { t } \right) + z _ { t } , { \pmb x } _ { t } - { \pmb x } _ { * } \rangle + \eta ^ { 2 } \left. \nabla F \left( { \pmb x } _ { t } \right) + z _ { t } \right. ^ { 2 } . } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Take expectation with respect to $\scriptstyle { \mathcal { Z } } _ { t }$ , we have
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { r } { \mathbb { E } _ { z _ { t } } [ r _ { t + 1 } ^ { 2 } ] \le \| { \pmb x } _ { t } - { \pmb x } _ { * } \| ^ { 2 } - 2 \eta \langle \nabla F \left( { \pmb x } _ { t } \right) , { \pmb x } _ { t } - { \pmb x } _ { * } \rangle + \eta ^ { 2 } \| \nabla F \left( { \pmb x } _ { t } \right) \| ^ { 2 } + p \eta ^ { 2 } \sigma _ { t } ^ { 2 } . } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Further take expectation with respect to ${ \boldsymbol { \mathbf { \mathit { z } } } } _ { t - 1 }$ and use Eq 2, we have
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { r l } & { \mathfrak { L } _ { \mathfrak { z } _ { t } , \mathfrak { z } _ { t - 1 } } \big [ r _ { t + 1 } ^ { 2 } \big ] \leq \mathbb { E } _ { \mathfrak { z } _ { t - 1 } } \big [ \big \| x _ { t } - \mathfrak { x } _ { * } \big \| ^ { 2 } \big ] - 2 \eta \mathbb { E } _ { \mathfrak { z } _ { t - 1 } } \big [ \langle \nabla F \left( \mathfrak { x } _ { t } \right) , \mathfrak { x } _ { t } - \mathfrak { x } _ { * } \rangle \big ] + \eta ^ { 2 } \mathbb { E } _ { \mathfrak { z } _ { t - 1 } } \big [ \big \| \nabla F \left( \mathfrak { x } _ { t } \right) \big \| ^ { 2 } \big ] + p \eta ^ { 2 } \sigma _ { t } ^ { 2 } , } \\ & { \qquad \leq \left( 1 - 2 \left( 1 - \theta \right) \eta \nu \right) \mathbb { E } _ { \mathfrak { z } _ { t - 1 } } \big [ r _ { t } ^ { 2 } \big ] + \left( \eta ^ { 2 } - \frac { 2 \eta \theta } { \beta } \right) \mathbb { E } _ { \mathfrak { z } _ { t - 1 } } \big [ \big \| \nabla F \left( \mathfrak { x } _ { t } \right) \big \| ^ { 2 } \big ] + p \eta ^ { 2 } \sigma _ { t } ^ { 2 } . } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
Set $\textstyle \theta = { \frac { 1 } { 2 } }$ and $\begin{array} { r } { \eta \le { \frac { 1 } { \beta } } } \end{array}$ ,
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\begin{array} { r } { \mathbb { E } _ { z _ { t } , z _ { t - 1 } } [ r _ { t + 1 } ^ { 2 } ] \leq ( 1 - \eta \nu ) \mathbb { E } _ { z _ { t - 1 } } [ r _ { t } ^ { 2 } ] + p \eta ^ { 2 } \sigma _ { t } ^ { 2 } . } \end{array}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
Applying Eq (6) and taking expectation with respect to $z _ { t } , z _ { t - 1 } , \cdots , z _ { 1 }$ iteratively yields
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\mathbb { E } [ r _ { t + 1 } ^ { 2 } ] \le \left( 1 - \eta \nu \right) ^ { t } r _ { 1 } ^ { 2 } + { p \eta } ^ { 2 } \sum _ { i = 1 } ^ { t } { ( 1 - \eta \nu ) } ^ { t - i } \sigma _ { i } ^ { 2 } .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
Uniform privacy budget allocation scheme sets
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\sigma _ { t } ^ { 2 } = \Theta \left( \frac { T L ^ { 2 } \log ( 1 / \delta ) } { n ^ { 2 } \epsilon ^ { 2 } } \right) .
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
Therefore
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\mathbb { E } [ r _ { T + 1 } ^ { 2 } ] \le \left( 1 - \eta \nu \right) ^ { T } r _ { 1 } ^ { 2 } + \Theta \left( \frac { p \eta T L ^ { 2 } \log ( 1 / \delta ) } { \nu n ^ { 2 } \epsilon ^ { 2 } } \right) .
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
Set $\begin{array} { r } { T \ge \frac { 2 \log ( n ) } { \eta \nu } } \end{array}$ , we have
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\begin{array} { c } { \displaystyle \left( 1 - \eta \nu \right) ^ { T } r _ { 1 } ^ { 2 } = \exp \left( \frac { \log \left( 1 - \eta \nu \right) \log \left( n ^ { 2 } \right) } { \eta \nu } \right) r _ { 1 } ^ { 2 } = \exp \left( \log ( 1 / n ^ { 2 } ) \frac { 1 } { \eta \nu } \log ( 1 + \frac { \eta \nu } { 1 - \eta \nu } ) \right) r _ { 1 } ^ { 2 } , } \\ { \displaystyle \qquad \leq \left( \frac { 1 } { n ^ { 2 } } \right) ^ { \frac { 1 } { \eta \nu } \log ( 1 + \frac { \eta \nu } { 1 - \eta \nu } ) } r _ { 1 } ^ { 2 } < \frac { r _ { 1 } ^ { 2 } } { n ^ { 2 } } . } \end{array}
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
Last inequality holds because $\begin{array} { r } { \frac { 1 } { \eta \nu } \log ( 1 + \frac { \eta \nu } { 1 - \eta \nu } ) > 1 } \end{array}$ for $\begin{array} { r } { \frac { 1 } { \eta \nu } \geq \frac { \beta } { \nu } \geq 1 } \end{array}$
|
| 360 |
+
|
| 361 |
+
Therefore, for $\begin{array} { r } { T \geq \frac { 2 \log ( n ) } { \eta \nu } } \end{array}$ , we have the excepted solution error $\mathbb { E } [ r _ { T + 1 } ^ { 2 } ]$ satisfies
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\mathbb { E } [ r _ { T + 1 } ^ { 2 } ] = \mathcal { O } \left( \frac { p \eta T L ^ { 2 } \log ( 1 / \delta ) } { \nu n ^ { 2 } \epsilon ^ { 2 } } \right) .
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Since $F ( { \pmb x } )$ is $\beta$ -smooth, we have
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
F ( \pmb { x } ) - F ( \pmb { x } _ { \ast } ) \leq \frac { \beta } { 2 } \left. \pmb { x } - \pmb { x } _ { \ast } \right. ^ { 2 } .
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
Using Eq (10) and Eq (11), we have the excepted excess risk satisfies
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
\mathbb { E } [ F ( { \pmb x } _ { T + 1 } ) - F ( { \pmb x } _ { \ast } ) ] = { \mathcal O } \left( \frac { \beta p \eta T L ^ { 2 } \log ( 1 / \delta ) } { \nu n ^ { 2 } \epsilon ^ { 2 } } \right)
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
for $\begin{array} { r } { T \ge \frac { 2 \log ( n ) } { \eta \nu } } \end{array}$ . The utility bound is minimized when $\begin{array} { r } { T = \frac { 2 \log ( n ) } { \eta \nu } } \end{array}$
|
| 380 |
+
|
| 381 |
+
Proof of Theorem $\mathcal { L }$ . The smooth condition gives us,
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { l } { \displaystyle F ( { \pmb x } _ { t + 1 } ) \leq F ( { \pmb x } _ { t } ) + \langle \nabla F ( { \pmb x } _ { t } ) , { \pmb x } _ { t + 1 } - { \pmb x } _ { t } \rangle + \displaystyle \frac { \beta } { 2 } \left\| { \pmb x } _ { t + 1 } - { \pmb x } _ { t } \right\| ^ { 2 } } \\ { \displaystyle \qquad = F ( { \pmb x } _ { t } ) - \eta \langle \nabla F ( { \pmb x } _ { t } ) , \nabla F ( { \pmb x } _ { t } ) + { \pmb z } _ { t } \rangle + \displaystyle \frac { \beta \eta ^ { 2 } } { 2 } \left\| \nabla F ( { \pmb x } _ { t } ) + { \pmb z } _ { t } \right\| ^ { 2 } . } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Take expectation with respect to $\scriptstyle { \mathcal { Z } } _ { t }$ and substitute $\begin{array} { r } { \eta = { \frac { 1 } { \beta } } } \end{array}$
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\mathbb { E } _ { z _ { t } } [ F ( { \pmb x } _ { t + 1 } ) ] = F ( { \pmb x } _ { t } ) - \frac { 1 } { 2 \beta } \left\| \nabla F ( { \pmb x } _ { t } ) \right\| ^ { 2 } + \frac { 1 } { 2 \beta } p \sigma _ { t } ^ { 2 } .
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Subtract $F ( { \pmb x } _ { * } )$ on both sides and use convexity,
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { r l } { \displaystyle \mathbb { E } _ { z _ { t } } [ F ( { \boldsymbol x } _ { t + 1 } ) - F ( { \boldsymbol x } _ { * } ) ] = F ( { \boldsymbol x } _ { t } ) - F ( { \boldsymbol x } _ { * } ) - \frac { 1 } { 2 \beta } \| \nabla F ( { \boldsymbol x } _ { t } ) \| ^ { 2 } + \frac { 1 } { 2 \beta } p \sigma _ { t } ^ { 2 } } & { } \\ { \displaystyle \le \langle \nabla F ( { \boldsymbol x } _ { t } ) , { \boldsymbol x } _ { t } - { \boldsymbol x } _ { * } \rangle - \frac { 1 } { 2 \beta } \| \nabla F ( { \boldsymbol x } _ { t } ) \| ^ { 2 } + \frac { 1 } { 2 \beta } p \sigma _ { t } ^ { 2 } . } & { } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
Substitute $\nabla F ( { \pmb x } _ { t } ) = \beta ( { \pmb x } _ { t } - { \pmb x } _ { t + 1 } ) - { \pmb z } _ { t }$ ,
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { r l } { \mathbb { E } _ { \mathbf { z } _ { t } } [ F ( \mathbf { x } _ { t + 1 } ) - F ( \mathbf { x } _ { * } ) ] \leq \beta \langle \mathbf { x } _ { t } - \mathbf { x } _ { t + 1 } , \mathbf { x } _ { t } - \mathbf { x } _ { * } \rangle - \frac { 1 } { 2 \beta } \mathbb { E } _ { \mathbf { z } _ { t } } [ \left. \beta ( \mathbf { x } _ { t } - \mathbf { x } _ { t + 1 } ) - z _ { t } \right. ^ { 2 } ] + \frac { 1 } { 2 \beta } p \sigma _ { t } ^ { 2 } } & { } \\ { = \beta \langle \mathbf { x } _ { t } - \mathbf { x } _ { t + 1 } , \mathbf { x } _ { t } - \mathbf { x } _ { * } \rangle - \frac { \beta } { 2 } \left. \mathbf { x } _ { t } - \mathbf { x } _ { t + 1 } \right. ^ { 2 } - \mathbb { E } _ { \mathbf { z } _ { t } } \langle \mathbf { x } _ { t + 1 } , z _ { t } \rangle } & { } \\ { = \beta \langle \mathbf { x } _ { t } - \mathbf { x } _ { t + 1 } , \mathbf { x } _ { t } - \mathbf { x } _ { * } \rangle - \frac { \beta } { 2 } \left. \mathbf { x } _ { t } - \mathbf { x } _ { t + 1 } \right. ^ { 2 } - \mathbb { E } _ { \mathbf { z } _ { t } } \langle \mathbf { x } _ { t } - \boldsymbol { \eta } \nabla F ( \mathbf { x } _ { t } ) - \boldsymbol { \eta } z _ { t } , z _ { t } \rangle } & { } \\ { = \beta \langle \mathbf { x } _ { t } - \mathbf { x } _ { t + 1 } , \mathbf { x } _ { t } - \mathbf { x } _ { * } \rangle - \frac { \beta } { 2 } \left. \mathbf { x } _ { t } - \mathbf { x } _ { t + 1 } \right. ^ { 2 } + \frac { 1 } { \beta } p \sigma _ { t } ^ { 2 } } & { } \\ { } & { = \frac { \beta } { 2 } ( \Vert \mathbf { x } _ { t } - \mathbf { x } _ { * } \Vert ^ { 2 } - \Vert \mathbf { x } _ { t + 1 } - \mathbf { x } _ { * } \Vert ^ { 2 } ) + \frac { 1 } { \beta } p \sigma _ { t } ^ { 2 } . } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Summing over $t = 1 , \ldots , T ^ { \prime }$ and take expectation with respect to $z _ { 1 } , \dots , z _ { T }$ ,
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\sum _ { t = 1 } ^ { T } \mathbb { E } [ F ( \pmb { x } _ { t + 1 } ) - F ( \pmb { x } _ { * } ) ] \leq \frac { \beta } { 2 } \left. \pmb { x } _ { 1 } - \pmb { x } _ { * } \right. ^ { 2 } + \sum _ { t = 1 } ^ { T } \frac { 1 } { \beta } p \sigma _ { t } ^ { 2 } .
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Use convexity,
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\begin{array} { r l r } { { \mathbb { E } [ F ( \bar { \pmb { x } } ) - F ( { \pmb x } _ { * } ) ] \le \frac { \beta } { 2 T } \| { \pmb x } _ { 1 } - { \pmb x } _ { * } \| ^ { 2 } + \frac { 1 } { \beta } p \sigma ^ { 2 } } } \\ & { } & { \le \frac { \beta } { 2 T } \| { \pmb x } _ { 1 } - { \pmb x } _ { * } \| ^ { 2 } + \Theta ( \frac { L ^ { 2 } p T \log ( 1 / \delta ) } { \beta n ^ { 2 } \epsilon ^ { 2 } } ) } \end{array}
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
Choose T = nβ√ , √p, we have
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\mathbb { E } [ F ( \bar { \pmb x } ) - F ( { \pmb x } _ { \ast } ) ] = \mathcal { O } \left( \frac { \sqrt { p } L ^ { 2 } \log ( 1 / \delta ) } { n \epsilon } \right) .
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
Proof of Theorem 3 and 4. We start by giving a useful lemma.
|
| 424 |
+
|
| 425 |
+
Lemma 2. Choose $\begin{array} { r } { \eta _ { t } = \frac { 1 } { \nu t } } \end{array}$ , the expected solution error of $_ { x t }$ in Algorithm $\mathcal { Q }$ for any $t > 1$ satisfies
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
\mathbb { E } [ \| \pmb { x } _ { t } - \pmb { x } _ { * } \| ^ { 2 } ] \le \frac { 2 L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { t \nu ^ { 2 } } ,
|
| 429 |
+
$$
|
| 430 |
+
|
| 431 |
+
Proof of Lemma $\mathcal { Z }$ . We have
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\begin{array} { r l } & { \| x _ { t + 1 } - x _ { * } \| ^ { 2 } = \| x _ { t } - \eta _ { t } g _ { t } - \eta _ { t } z _ { t } - x _ { * } \| ^ { 2 } } \\ & { \qquad = \| x _ { t } - x _ { * } \| ^ { 2 } - 2 \eta _ { t } \langle x _ { t } - x _ { * } , g _ { t } + z _ { t } \rangle + \eta _ { t } ^ { 2 } \left\| g _ { t } \right\| ^ { 2 } - 2 \eta _ { t } ^ { 2 } \langle g _ { t } , z _ { t } \rangle + \eta _ { t } ^ { 2 } \left\| z _ { t } \right\| ^ { 2 } . } \end{array}
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
Take expectation with respect to perturbation noise $\scriptstyle { \mathcal { Z } } _ { t }$ and uniform sampling, we have
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\begin{array} { r l } & { \mathbb { E } _ { z _ { t } , i _ { t } } [ \| { \boldsymbol x } _ { t + 1 } - { \boldsymbol x } _ { * } \| ^ { 2 } ] = \mathbb { E } _ { z _ { t } , i _ { t } } [ \| { \boldsymbol x } _ { t } - \eta _ { t } { \boldsymbol g } _ { t } - \eta _ { t } z _ { t } - { \boldsymbol x } _ { * } \| ^ { 2 } ] } \\ & { \qquad \le \| { \boldsymbol x } _ { t } - { \boldsymbol x } _ { * } \| ^ { 2 } - 2 \eta _ { t } \langle { \boldsymbol x } _ { t } - { \boldsymbol x } _ { * } , \nabla F ( { \boldsymbol x } _ { t } ) \rangle + \eta _ { t } ^ { 2 } L ^ { 2 } + p \eta _ { t } ^ { 2 } L ^ { 2 } \sigma ^ { 2 } . } \end{array}
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
Further take expectation to ${ \boldsymbol { z } } _ { t - 1 }$ and apply Definition 3,
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\begin{array} { r } { \begin{array} { r } { \mathbb { E } _ { z _ { t } , z _ { t - 1 } , i _ { t } } [ \| { \boldsymbol x } _ { t + 1 } - { \boldsymbol x } _ { * } \| ^ { 2 } ] \leq \left( 1 - 2 \nu _ { t } \eta _ { t } \right) \mathbb { E } _ { z _ { t - 1 } } [ \| { \boldsymbol x } _ { t } - { \boldsymbol x } _ { * } \| ^ { 2 } ] + \eta _ { t } ^ { 2 } L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } \\ { \leq \left( 1 - 2 \nu \eta _ { t } \right) \mathbb { E } _ { z _ { t - 1 } } [ \| { \boldsymbol x } _ { t } - { \boldsymbol x } _ { * } \| ^ { 2 } ] + \eta _ { t } ^ { 2 } L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) . } \end{array} } \end{array}
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
Now we use induction to conduct the proof. Substitute $\begin{array} { r } { \eta _ { t } = \frac { 1 } { t \nu } } \end{array}$ into Eq 21, we have Lemma 2 hold for $t = 2$ .
|
| 450 |
+
|
| 451 |
+
Assume $\begin{array} { r } { \mathbb { E } [ \left\| \pmb { x } _ { t } - \pmb { x } _ { * } \right\| ^ { 2 } ] \leq \frac { 2 L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { t \nu ^ { 2 } } } \end{array}$ holds for $t > 2$ , then
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
\begin{array} { r l r } { { \mathbb { E } [ \| { \pmb x } _ { t + 1 } - { \pmb x } _ { * } \| ^ { 2 } ] \leq ( 1 - \frac { 2 } { t } ) \mathbb { E } [ \| { \pmb x } _ { t } - { \pmb x } _ { * } \| ^ { 2 } ] + \frac { L ^ { 2 } ( 1 + p \sigma ^ { 2 } ) } { \nu ^ { 2 } t ^ { 2 } } } } \\ & { } & { \leq ( \frac { 1 } { t } - \frac { 2 } { t ^ { 2 } } ) \frac { 2 L ^ { 2 } ( 1 + p \sigma ^ { 2 } ) } { \nu ^ { 2 } } + \frac { L ^ { 2 } ( 1 + p \sigma ^ { 2 } ) } { \nu ^ { 2 } t ^ { 2 } } } \\ & { } & { = ( \frac { 2 } { t } - \frac { 3 } { t ^ { 2 } } ) \frac { L ^ { 2 } ( 1 + p \sigma ^ { 2 } ) } { \nu ^ { 2 } } \leq \frac { 2 L ^ { 2 } ( 1 + p \sigma ^ { 2 } ) } { ( t + 1 ) \nu ^ { 2 } } . } \end{array}
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
It’s easy to check that Eq 20 holds for arbitrary $\textbf { \em x }$ rather than $^ { x \ast }$ . Rearrange Eq 20 and take expectation, we have
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\mathbb { E } [ \langle x _ { t } - x , \nabla F \left( x _ { t } \right) \rangle ] \leq \frac { \mathbb { E } [ \Vert x _ { t } - x \Vert ^ { 2 } ] - \mathbb { E } [ \Vert x _ { t + 1 } - x \Vert ^ { 2 } ] } { 2 \eta _ { t } } + \frac { \eta _ { t } L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { 2 } .
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
Let $k$ be arbitrarily chosen from $\{ 1 , \ldots , \lfloor { T / 2 } \rfloor \}$ . Summing over the last $k + 1$ iterations and use convexity to lower bound $\langle { \pmb x } _ { t } - { \pmb x } , \nabla F \left( { \pmb x } _ { t } \right) \rangle$ by $F \left( { \pmb x } _ { t } \right) - F \left( { \pmb x } \right)$ ,
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\begin{array} { r l } { \displaystyle \sum _ { t = T - k } ^ { T } \mathbb { E } [ F ( { \pmb x } _ { t } ) - F ( { \pmb x } ) ] \leq \frac { \mathbb { E } [ \| { \pmb x } _ { T - k } - { \pmb x } \| ^ { 2 } ] } { 2 \eta _ { T - k } } + \frac { 1 } { 2 } \displaystyle \sum _ { t = T - k + 1 } ^ { T } \mathbb { E } [ \| { \pmb x } _ { t } - { \pmb x } \| ^ { 2 } ] \left( \frac { 1 } { n _ { t } } - \frac { 1 } { n _ { t - 1 } } \right) } & { } \\ { - \frac { \mathbb { E } [ \| { \pmb x } _ { T + 1 } - { \pmb x } \| ^ { 2 } ] } { 2 \eta _ { T } } + \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { 2 } \displaystyle \sum _ { t = T - k } ^ { T } \eta _ { t } . } & { } \end{array}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
Substitute $\begin{array} { r } { \eta _ { t } = \frac { 1 } { \nu t } } \end{array}$ and follow the idea in Shamir & Zhang (2013) by choosing ${ \pmb x } = { \pmb x } _ { T - k }$ , we arrive at
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
\sum _ { t = T - k } ^ { T } \mathbb { E } [ F \left( \pmb { x } _ { t } \right) - F \left( \pmb { x } _ { T - k } \right) ] \leq \frac { \nu } { 2 } \sum _ { t = T - k + 1 } ^ { T } \mathbb { E } [ \left. \pmb { x } _ { t } - \pmb { x } _ { T - k } \right. ^ { 2 } ] + \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { 2 \nu } \sum _ { t = T - k } ^ { T } \frac { 1 } { t } .
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
Now we bound $\mathbb { E } [ \left. \pmb { x } _ { t } - \pmb { x } _ { T - k } \right. ^ { 2 } ]$ for $t \geq T ^ { \prime } - k$ ,
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\begin{array} { r l } & { \mathbb { E } [ \| { \pmb x } _ { t } - { \pmb x } _ { T - k } \| ^ { 2 } ] \le 2 \mathbb { E } [ \| { \pmb x } _ { t } - { \pmb x } _ { * } \| ^ { 2 } ] + 2 \mathbb { E } [ \| { \pmb x } _ { T - k } - { \pmb x } _ { * } \| ^ { 2 } ] } \\ & { \le \frac { 4 L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { \nu ^ { 2 } } \left( \frac { 1 } { t } + \frac { 1 } { T - k } \right) \le \frac { 8 L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { \nu ^ { 2 } } \left( \frac { 1 } { T - k } \right) } \\ & { \le \frac { 1 6 L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { T \nu ^ { 2 } } . } \end{array}
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
Substitute Eq 26 into Eq 25,
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\sum _ { t = T - k } ^ { T } \mathbb { E } [ F \left( \pmb { x } _ { t } \right) - F \left( \pmb { x } _ { T - k } \right) ] \leq \frac { 8 k L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { T \nu } + \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { 2 \nu } \sum _ { t = T - k } ^ { T } \frac { 1 } { t } .
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
Let $\begin{array} { r } { S _ { k } = \frac { 1 } { k + 1 } \sum _ { t = T - k } ^ { T } \mathbb { E } [ F \left( \pmb { x } _ { t } \right) ] } \end{array}$ be the averaged expected values of the last $k + 1$ iterations. We are interested in $S _ { 0 } - F \left( { \pmb x } _ { * } \right) = \mathbb { E } [ F \left( { \pmb x } _ { T } \right) ] - F \left( { \pmb x } _ { * } \right)$ . Now we derive an inequality between $S _ { k }$ and $S _ { k - 1 }$ . By definition,
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
k S _ { k - 1 } = \left( k + 1 \right) S _ { k } - \mathbb { E } [ \mathbf { x } _ { T - k } ] .
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
Rearrange Eq 27 to upper bound $- \mathbb { E } [ { \pmb x } _ { T - k } ]$ ,
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
\begin{array} { l } { S _ { k - 1 } = \displaystyle \frac { k + 1 } { k } S _ { k } - \frac { \mathbb { E } \left[ { \pmb x } _ { T - k } \right] } { k } } \\ { \leq \frac { k + 1 } { k } S _ { k } - \frac { S _ { k } } { k } + \frac { 8 L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { \left( k + 1 \right) T \nu } + \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { 2 k \left( k + 1 \right) \nu } \displaystyle \sum _ { t = T - k } ^ { T } \frac { 1 } { t } } \\ { \leq S _ { k } + \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { 2 \nu } \left( \frac { 1 6 } { k T } + \frac { 1 } { k \left( k + 1 \right) } \displaystyle \sum _ { t = T - k } ^ { T } \frac { 1 } { t } \right) . } \end{array}
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
Summing over $k = 1 , \dots , k = \lfloor T / 2 \rfloor$ ,
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
S _ { 0 } \leq S _ { \lfloor T / 2 \rfloor } + \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { 2 \nu } \left( \sum _ { k = 1 } ^ { \lfloor T / 2 \rfloor } \frac { 1 6 } { k T } + \sum _ { k = 1 } ^ { \lfloor T / 2 \rfloor } \sum _ { t = T - k } ^ { T } \frac { 1 } { k \left( k + 1 \right) t } \right) .
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
Now we bound $S _ { \lfloor T / 2 \rfloor } - F ( \pmb { x } _ { * } )$ . Choose ${ \boldsymbol { \mathbf { \mathit { x } } } } = { \boldsymbol { \mathbf { \mathit { x } } } } _ { \ast }$ and $\begin{array} { r } { \eta _ { t } = \frac { 1 } { t \nu } } \end{array}$ in Eq 24 ,
|
| 506 |
+
|
| 507 |
+
$$
|
| 508 |
+
\begin{array} { r l } & { \displaystyle \sum _ { t = \lfloor T / 2 \rfloor } ^ { T } \mathbb { E } [ F ( { \mathbf x } _ { t } ) - F ( { \mathbf x } _ { * } ) ] = \frac { \nu \left[ T / 2 \right] \mathbb { E } [ \left. { \mathbf x } _ { \lfloor T / 2 \rfloor } - \alpha _ { * } \right. ^ { 2 } ] } { 2 } + \frac { \nu } { 2 } \displaystyle \sum _ { t = \lfloor T / 2 \rfloor + 1 } ^ { T } \mathbb { E } [ \left. { \mathbf x } _ { t } - { \mathbf x } _ { * } \right. ^ { 2 } ] } \\ & { \qquad + \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { 2 } \displaystyle \sum _ { t = \lfloor T / 2 \rfloor } ^ { T } \frac { \nu } { 2 } } \\ & { \qquad \le \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { \nu } \displaystyle ( 1 + \sum _ { t = \lfloor T / 2 \rfloor + 1 } ^ { T } \frac { 1 } { t } + \sum _ { t = \lceil T / 2 \rfloor } ^ { T } \frac { 1 } { 2 t } ) } \\ & { \qquad \le \frac { L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { \nu } \displaystyle ( 1 + \frac { 3 } { 2 } \sum _ { t = \lfloor T / 2 \rfloor + 1 } ^ { T } \frac { 1 } { t } ) } \\ & { \qquad \le \frac { 4 L ^ { 2 } \left( 1 + p \sigma ^ { 2 } \right) } { \nu } . } \end{array}
|
| 509 |
+
$$
|
| 510 |
+
|
| 511 |
+
The second inequality uses Lemma 2. The last inequality holds because the fact that $\scriptstyle \sum _ { t = \lceil T / 2 \rceil } ^ { T ^ { \prime } } { \frac { 1 } { t } } \leq$ $\log ( 2 )$ . Dividing Eq 31 by $\lceil T / 2 \rceil$ ,
|
| 512 |
+
|
| 513 |
+
$$
|
| 514 |
+
S _ { \lfloor T / 2 \rfloor } - F ( \pmb { x } _ { \ast } ) \leq \frac { 8 L ^ { 2 } ( 1 + p \sigma ^ { 2 } ) } { T \nu } .
|
| 515 |
+
$$
|
| 516 |
+
|
| 517 |
+
We have $\begin{array} { r } { \sum _ { k = 1 } ^ { \lfloor T / 2 \rfloor } \frac { 1 6 } { k T } \leq \frac { 1 6 ( 1 + l o g ( T ) ) } { T } } \end{array}$ 16(1+log(T )) because it is harmonic sequence. Lastly,
|
| 518 |
+
|
| 519 |
+
$$
|
| 520 |
+
\begin{array} { r l r } { { \sum _ { k = 1 } ^ { \lfloor T / 2 \rfloor } \sum _ { t = T - k } ^ { T } \frac { 1 } { k ( k + 1 ) t } \le \sum _ { k = 1 } ^ { \lfloor T / 2 \rfloor } \frac { \log ( 2 ) } { k ( k + 1 ) } } } \\ & { } & { \le \sum _ { k = 1 } ^ { \lfloor T / 2 \rfloor } \frac { \log ( 2 ) } { k ^ { 2 } } \le 2 \log ( 2 ) . } \end{array}
|
| 521 |
+
$$
|
| 522 |
+
|
| 523 |
+
Plugging these bounds into Eq 30, we have
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
S _ { 0 } - F ( { \pmb x } _ { * } ) = \mathcal { O } \left( \frac { ( 1 + p \sigma ^ { 2 } ) L ^ { 2 } \log ( T ) } { T \nu } \right) .
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
Choose $\begin{array} { r } { \sigma ^ { 2 } = \Theta \left( \frac { T l o g ( 1 / \delta ) } { n ^ { 2 } \epsilon ^ { 2 } } \right) } \end{array}$ to guarantee $( \epsilon , \delta )$ -DP. Set $T = n ^ { 2 } \epsilon ^ { 2 }$ , we have
|
| 530 |
+
|
| 531 |
+
$$
|
| 532 |
+
S _ { 0 } - F ( { \pmb x } _ { * } ) = \mathcal { O } \left( \frac { p L ^ { 2 } \log ( n ) l o g \left( 1 / \delta \right) } { n ^ { 2 } \epsilon ^ { 2 } \nu } \right) .
|
| 533 |
+
$$
|
| 534 |
+
|
| 535 |
+
Set $\begin{array} { r } { T = \frac { \pi \epsilon } { \sqrt { p } } } \end{array}$ and assume $p < n ^ { 2 }$ , we have
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
S _ { 0 } - F ( \pmb { x } _ { * } ) = \mathcal { O } \left( \frac { \sqrt { p } L ^ { 2 } \log ( n ) } { n \epsilon \nu } \right) .
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
# Appendix B Detailed description on benchmark datasets
|
| 542 |
+
|
| 543 |
+
Table 3: Detailed description of seven real world datasets.
|
| 544 |
+
|
| 545 |
+
<table><tr><td rowspan=1 colspan=1>dataset</td><td rowspan=1 colspan=1>Adult</td><td rowspan=1 colspan=1>KDDCup99</td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>Covertype</td><td rowspan=1 colspan=1>Gisette</td><td rowspan=1 colspan=1>Real-sim</td><td rowspan=1 colspan=1>RCV1</td></tr><tr><td rowspan=1 colspan=1>#records</td><td rowspan=1 colspan=1>45220</td><td rowspan=1 colspan=1>70000</td><td rowspan=1 colspan=1>65000</td><td rowspan=1 colspan=1>581012</td><td rowspan=1 colspan=1>6000</td><td rowspan=1 colspan=1>72309</td><td rowspan=1 colspan=1>50000</td></tr><tr><td rowspan=1 colspan=1>#features</td><td rowspan=1 colspan=1>104</td><td rowspan=1 colspan=1>114</td><td rowspan=1 colspan=1>784</td><td rowspan=1 colspan=1>54</td><td rowspan=1 colspan=1>5000</td><td rowspan=1 colspan=1>20958</td><td rowspan=1 colspan=1>47236</td></tr><tr><td rowspan=1 colspan=1>#classes</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td></tr></table>
|
| 546 |
+
|
| 547 |
+
# Appendix C Comparison between Average and Minimum Curvatures on Different dataset
|
| 548 |
+
|
| 549 |
+
In this section we plot the average and minimum curvatures in Figure 4 for another dataset KDDCup99. The objective function is still regularized logistic regression.
|
| 550 |
+
|
| 551 |
+
As shown in Figure 4, the average curvature is still larger than the minimum curvature (especially when the regularization term is small). Despite this, the average curvature of KDDCup99 is smaller than Adult, this may be the reason why the improvement in Section 4 is larger for the Adult dataset.
|
| 552 |
+
|
| 553 |
+

|
| 554 |
+
Figure 4: Curvatures of regularized logistic regression on KDDCup99 dataset over training. Dot symbol represents average curvature and cross symbol represents minimum curvature.
|
md/train/rJg_NjCqtX/rJg_NjCqtX.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CHEMICAL NAMES STANDARDIZATION USING NEURAL SEQUENCE TO SEQUENCE MODEL
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Chemical information extraction is to convert chemical knowledge in text into true chemical database, which is a text processing task heavily relying on chemical compound name identification and standardization. Once a systematic name for a chemical compound is given, it will naturally and much simply convert the name into the eventually required molecular formula. However, for many chemical substances, they have been shown in many other names besides their systematic names which poses a great challenge for this task. In this paper, we propose a framework to do the auto standardization from the non-systematic names to the corresponding systematic names by using the spelling error correction, byte pair encoding tokenization and neural sequence to sequence model. Our framework is trained end to end and is fully data-driven. Our standardization accuracy on the test dataset achieves $5 4 . 0 4 \%$ which has a great improvement compared to previous state-of-the-art result.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
There are more than 100 million named chemical substances in the world. In order to uniquely identify every chemical substance, there are elaborate rules for assigning names to them on the basis of their structures. These names are called systematic names. The rules for these names are defined by International Union of Pure and Applied Chemistry (IUPAC) (Favre & Powell, 2013).
|
| 12 |
+
|
| 13 |
+
However, besides the systematic name, there can be also many other names for a chemical substance due to many reasons. Firstly, many chemical are so much a part of our life that we know them by their familiar names which we call them common names or trivial names for the sake of simplicity. For example, sucrose is a kind of sugar which we are very familiar with. Its systematic name is much more complicated, which is (2R,3R,4S,5S,6R)-2-[(2S,3S,4S,5R)-3,4-dihydroxy-2,5- bis(hydroxymethyl)oxolan-2-yl]oxy-6-(hydroxymethyl)oxane-3,4,5-triol.
|
| 14 |
+
|
| 15 |
+
Secondly, in chemistry industry, especially in pharmaceutical industry, many producers always generate new names to a chemical substance in order to distinguish their products from those of their competitors. We call these kind of names proprietary names. The most famous example is Aspirin. Its systematic name is 2-Acetoxybenzoic acid. So due to the history reasons and idiomatic usages, a chemical substance can have many other names.
|
| 16 |
+
|
| 17 |
+
Chemical information extraction is a research that extracts useful chemical knowledge in text and converts it into a database, which strongly relies on the unique standard chemical names. Nowadays, there are many chemical databases such as PubChem and SciFinder, which are designed to store chemical information including chemical names, chemical structures, molecular formulas and other relevant information. For these databases, it is still an ongoing work to extract chemical information from chemical papers to update the databases. If all the chemical substances are expressed by the systematic names, it is easy to generate other information. For example, we can nearly perfectly convert the systematic name to other representations such as Simplified Molecular-Input Line-Entry System (SMILES) (Weininger, 1988) and International Chemical Identifier (InCHI) (Mcnaught, 2006) and then generate the structural formulas. Some online systems are already well developed for converting automatically systematic names to SMILES string with a very high precision such as Open Parser for Systematic IUPAC Nomenclature (OPSIN) (Lowe et al., 2011) developed by
|
| 18 |
+
|
| 19 |
+
Table 1: Examples of different types of error
|
| 20 |
+
|
| 21 |
+
<table><tr><td>Error type</td><td>Non-systematic name</td><td>Systematic name</td></tr><tr><td>Spelling error</td><td>benzoil chloride 1,3-benzoxazoole</td><td>benzoyl chloride 1,3-benzoxazole</td></tr><tr><td>Ordering error</td><td>benzene,1,4-dibromo-2-methyl 4-pyrimidinecarbaldehyde</td><td>1,4-dibromo-2-methylbenzene pyrimidine-4-carbaldehyde</td></tr><tr><td>Common name error</td><td>adenine Aspirin</td><td>9H-purin-6-amine 2-Acetoxybenzoic acid</td></tr><tr><td>Synonym error</td><td>sodiumbutoxide 2-ethylfuroate</td><td>sodium;butan-l-olate ethyl furan-2-carboxylate</td></tr><tr><td>Mixed of synonym error and ordering error</td><td>2-hydroxy-8-iodonaphthalene 3-amino-l,2-benzisoxazole</td><td>8-iodonaphthalen-2-ol 1,2-benzoxazol-3-amine</td></tr></table>
|
| 22 |
+
|
| 23 |
+
University of Cambridge1. Unfortunately, nowadays a great number of the chemical substances are expressed by their non-systematic names in chemical papers, which increases significantly the difficulties for this task, so our work focuses on the standardization of non-systematic names. Examples of chemical information extraction are shown in Figure 1.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Examples of chemical information extraction (the parts in the same color means the same chemical constituent name)
|
| 27 |
+
|
| 28 |
+
In the following passage, we consider the differences between non-systematic names and systematic names as ”error”2. In view of natural language processing, the error types of non-systematic names can be summarized by four types: 1. Spelling error. It means that non-systematic names just have slightly differences from systematic names in spelling; 2. Ordering error. It means that the groups in a non-systematic name are in wrong order; 3. Common name error. As mentioned above, many chemical substances have common names or proprietary names which look totally different from their systematic names; 4. Synonym error. It means that the words in the nonsystematic names are different from those in the systematic names but they share the same root of word. In fact, it is the error type which happens most often. For example, 2-(Acetyloxy)benzoic Acid has synonyms Acetylsalicylic Acid and Acetysal and these three words share the same root of word ”Acety”. Some examples of different types of errors are shown in Table 1. What is worth mentioning is that several types of error can appear at the same time in a single non-systematic name, especially for the ordering error and synonym error. The mixed types of error make this task very challenging.
|
| 29 |
+
|
| 30 |
+
Based on these four error types, we propose a framework to convert automatically the non-systematic names to systematic names. Our framework is structured as followed: 1. Spelling error correction. It aims to correct the spelling errors; 2. Byte pair encoding (BPE) tokenization. It aims to split a name into small parts; 3. Sequence to sequence model. It aims to fix all the remaining ordering errors, common name errors and synonym errors.
|
| 31 |
+
|
| 32 |
+
Actually, due to its great challenge, few work has been done on the chemical name standardization. To our best knowledge, Golebiewski et al. (2009) is the only work deserving a citation which developed an online system ChemHits to do the standardization basing on several transformation rules and the queries to online chemical databases. The work of Golebiewski et al. (2009) severely depends on chemical knowledge, limiting its application potential and effectiveness to some extent.
|
| 33 |
+
|
| 34 |
+
Differently, we adopt sequence to sequence model that has been widely used on neural machine translation. The reason why we apply the sequence to sequence model is that our task has some similarities with the machine translation problem. In machine translation, there are source language and target language which correspond to the non-systematic names and the systematic names in our task. Two different languages can be different in: 1. Vocabularies, which corresponds to the common name error and synonym error; 2. Word order, which corresponds to the ordering error. Our framework is trained end-to-end, fully data-driven and without using external chemical knowledge. With this approach, we achieve an accuracy of $5 4 . 0 4 \%$ in our test data set.
|
| 35 |
+
|
| 36 |
+
Our work will be done on a corpus containing chemical names extracted from report of Chemical Journals with High Impact factors $( \mathrm { C J H I F } ) ^ { 3 }$ . The corpus is collected and checked by paid manual work. It is a parallel corpus which includes non-systematic names and systematic names of chemical substances. In the following passage, we call a non-systematic name and the corresponding systematic name of a chemical substance data pair. In our corpus, there are 384816 data pairs. In Figure 2, we give an overview of the distribution of the Levenshtein distance between the non-systematic names and the systematic names to show how different the non-systematic names and the systematic names are. In the experiment, we use $80 \%$ , $19 \%$ and $1 \%$ data as training set, test set and development set respectively.
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Distribution of the Levenshtein distance between non-systematic names and systematic names
|
| 40 |
+
|
| 41 |
+
# 2 PROPOSED FRAMEWORKS
|
| 42 |
+
|
| 43 |
+
Our framework consists of spelling error correction, byte pair encoding tokenization and sequence to sequence model which can be summarized in Figure 3.
|
| 44 |
+
|
| 45 |
+
# 2.1 SPELLING ERROR CORRECTION
|
| 46 |
+
|
| 47 |
+
In this part, we aim to correct the spelling errors. Given a name of a chemical substance, we can separate it into different elemental words by all the non-alphabet characters. For example, 2-(chlorofluoro-methyl)-benzooxazole can be separated into chloro, fluoro, methyl and benzooxazole. To correct the spelling error, firstly we set up two vocabularies from the dataset: vocabulary of the systematic elemental words and of the non-systematic elemental words. For the systematic elemental words, we just split all the systematic names to build the vocabulary. For the non-systematic elemental words, firstly we use all the non-systematic names to build an elemental vocabulary, and then we just keep the elemental words which appear many times in the non-systematic names but outside the vocabulary of systematic elemental words and remove the rest. By this way, the vocabulary we build from the non-systematic names is the set of common names or synonyms. We then combine these two vocabularies together to get a final elemental vocabulary.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 3: Illustration of the framework
|
| 51 |
+
|
| 52 |
+
To do the correction search efficiently enough, we use BK-Tree (Burkhard & Keller, 1973) to structure the elemental vocabulary. BK-Tree is a tree structure which is widely used in spelling error correction. BK-Tree is defined in the following way. An arbitrary vocabulary item $a$ is selected as root node. The root node may have zero or more subtrees. The $k { \mathord { - } } t h$ subtree is recursively built of all vocabulary items $b$ such that $d ( a , b ) = k$ where $d ( a , b )$ is the Levenshtein distance between $a$ and $b$ . Given a word and a threshold, BK-Tree can return rapidly, if possible, the vocabulary item which have the smallest Levenshtein distance with the given word and the Levenshtein distance is smaller than the threshold by using the triangle rules: $| \bar { d } ( a , b ) - d ( b , c ) | \leq d ( a , c ) \leq d ( a , b ) + d ( b , c )$ . By using the BK-Tree, we can correct the spelling error of non-systematic names. Another advantage of using BK-Tree is that it is easy to insert new training data which makes it scalable. An example of BK-Tree built from a part of our dataset is shown in Figure 4.
|
| 53 |
+
|
| 54 |
+
At this stage, given a name of a chemical substance, we firstly separate it into elemental words and then input the elemental words one by one to the BK-Tree. After the correction, we combine the elemental words to get the full name. In this step, a few non-systematic names can be directly corrected and some non-systematic names can be partially corrected. It is also helpful in the training of the sequence to sequence model because it can reduce the noise of elemental words.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 4: Example of BK-Tree built from a part of our dataset. Each node is an elemental word. The value on each edge is the Levenshtein distance between two nodes. All the nodes in the same subtree of a node have the same Levenshtein distance to this node. For instance, the Levenshtein distances from dimethyl, diethyl, methan to methyl are all 2.
|
| 58 |
+
|
| 59 |
+
Table 2: Examples of applying BPE to chemical names (subwords are separated by $@ \textcircled{ a }$ )
|
| 60 |
+
|
| 61 |
+
<table><tr><td>Original name</td><td>Split name</td></tr><tr><td>4-bromo-6-methoxyquinaldine</td><td>4-bromo@ @ -6-methoxy@ @ quinaldine</td></tr><tr><td>ethynyltris(propan-2-yl)silane methyltrioctylazaniumbromide</td><td>ethynyl@@ tris(propan-2-yl)@@ silane methyl@ @ trioctyl@ @ azanium bromide</td></tr></table>
|
| 62 |
+
|
| 63 |
+
# 2.2 TOKENIZATION BY BYTE PAIR ENCODING
|
| 64 |
+
|
| 65 |
+
To apply the sequence-to-sequence model, firstly we need to tokenize all the chemical names. In this paper, we use Byte Pair Encoding (BPE) (Sennrich et al., 2015) to do the tokenization. Firstly, we initialize a symbol set by split all the names into characters. At this moment, the symbol set contains only the single characters. Then we iteratively count all symbol pairs and replace each occurrence of the most frequent pair (X, Y) with a new symbol XY and add it to the symbol set. Each merge operation produces a new symbol. The size of final symbol set is equal to the size of initial character, plus the number of merge operations. We then use the trained symbol vocabulary set to do the tokenization.
|
| 66 |
+
|
| 67 |
+
The reasons why we choose BPE are as follow: Firstly, it can deal with out-of-vocabulary problem because the vocabulary set generated by BPE contains the vocabularies at character level. Secondly, it can separate a name into meaningful subwords because it can find the small molecules which appear frequently in the corpus and tokenize a chemical name into the names of the small molecules. Some examples of applying BPE to the chemical name are shown in Table 2. After the tokenization, we can use the split pairs to train the sequence to sequence model.
|
| 68 |
+
|
| 69 |
+
# 2.3 SEQUENCE TO SEQUENCE MODEL
|
| 70 |
+
|
| 71 |
+
Sequence to sequence model (Sutskever et al., 2014) is widely used in machine translation. In this work, we adapted an existing implementation OpenNMT (Klein et al., 2017) with a few modifications. The sequence to sequence model consists of two recurrent neural networks (RNN) working together: (1) an encoder that gets the source sequences (here are the non-systematic names separated by BPE) and generates a context vector $H$ , and (2) a decoder that uses this context vector to generate the target sequences (here are the corresponding systematic names). For the encoder, we use a multilayers bidirectional LSTM (BiLSTM) (Graves & Schmidhuber, 2005). BiLSTM consists of two LSTMs: one that processes the sequence forward and the other backward, with their forward and backward hidden states $\overrightarrow { h _ { t } }$ and $\left\{ { { \overline { { h _ { t } } } } } \right.$ at each time step. The hidden state at time step $t$ is just a concatenation of the two hidden states: $h _ { t } = \{ \overrightarrow { h _ { t } } ; \overleftarrow { h _ { t } } \}$ . At the final time step $T$ of the encoder, by combining all the hidden states, we get the context vector $H = \{ h _ { 1 } , . . . , h _ { T } \}$ . For the decoder, it gives the probability of an output sequence $\hat { y } = \left\{ \hat { y } _ { i } \right\}$ :
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
P ( \hat { y } ) = \prod _ { t = 1 } ^ { M } p ( \hat { y } _ { t } | \{ \hat { y } _ { i < t } \} )
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
and for a single token $\hat { y } _ { t }$ , the probability is calculated by
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { c } { \displaystyle s _ { t } = f \big ( s _ { t - 1 } , \hat { y } _ { t - 1 } \big ) } \\ { \displaystyle \alpha _ { j } = \frac { e x p \big ( s c o r e ( s _ { t } , h _ { j } ) \big ) } { \sum _ { j ^ { \prime } = 1 } ^ { T } e x p \big ( s c o r e ( s _ { t } , h _ { j ^ { \prime } } ) \big ) } } \\ { \displaystyle c _ { t } = \sum _ { j } \alpha _ { j } h _ { j } } \\ { \displaystyle a _ { t } = t a n h \big ( W _ { c } [ s _ { t } ; c _ { t } ] \big ) } \\ { \displaystyle p ( \hat { y } _ { t } \{ \hat { y } _ { i \le t } \} \big ) = s o f t m a x \big ( W _ { s } a _ { t } \big ) } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $f$ is a multilayer LSTM; $s _ { t }$ is the decoder’s hidden state at time step $t$ ; and $W _ { c }$ , $W _ { s }$ are learned weights. For the score function, we use the attention mechanism proposed by Luong et al. (2015):
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
s c o r e ( s _ { t } , h _ { j } ) = s _ { t } ^ { T } W _ { a } h _ { j }
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $W _ { a }$ are also learned weights.
|
| 90 |
+
|
| 91 |
+
# 3 EXPERIMENTS
|
| 92 |
+
|
| 93 |
+
# 3.1 TRAINING DETAILS
|
| 94 |
+
|
| 95 |
+
In our framework, at the spelling error correction stage, the only parameter is the threshold of the BK-Tree. In the experiment, we have tried several threshold values: 1, 2 and 3. At the BPE stage, the only parameter is the number of the merge operations. In the experiments, we have tried several values: 2500, 5000, 10000, 20000. For the sequence to sequence model, the dimensions of word embeddings and hidden states are both 500. The vocabulary size is equal to the number of basic characters plus the number of merge operations of BPE. The numbers of layers in encoder and decoder are both 2. Before training the sequence to sequence model, we also do the spelling error correction for the non-systematic names in the training data.
|
| 96 |
+
|
| 97 |
+
During training, all parameters of the sequence to sequence model are trained jointly using stochastic gradient descent (SGD). The loss function is a cross-entropy function, expressed as
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
L ( y , \hat { y } ) = - \sum _ { i } y _ { i } l o g ( \hat { y _ { i } } )
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
The loss was computed over an entire minibatch of the size 64 and then normalized. The weights are initialized using a random uniform distribution ranging from -0.1 to 0.1. The initial learning rate is 1.0 and the decay will be applied with the factor 0.5 every epoch after and including epoch 8 or when the perplexity does not decrease on the validation set. The drop out rate is 0.3 and we train the model for 15 epochs. We set the beam size to 5 for the decoding.
|
| 104 |
+
|
| 105 |
+
For comparison, we also do another experiment by replacing sequence to sequence model with Statistical Machine Translation (SMT) model. In this experiment, we use implemented Moses system Koehn et al. (2007). In the training, we limit the length of training sequences to 80 and apply the 3-grams language model by using KenLM (Heafield, 2011). The tokenization for the pairs we use is BPE with 5000 merge operations.
|
| 106 |
+
|
| 107 |
+
Besides the spelling error correction, data augmentation is another technique for the neural model learning to deal with the noisy data (in this case, the noise is the spelling error). For comparison, we also do the experiment of data augmentation. For every non-systematic name, we insert an error into it for the probability of 0.025. The error insertion has four types: we insert randomly a character in a random position; we randomly delete a character in a random position; we randomly exchange two characters; we randomly replace a character by another random character. The four insertion methods are applied in an equal probability.
|
| 108 |
+
|
| 109 |
+
# 3.2 RESULTS
|
| 110 |
+
|
| 111 |
+
In the experiment, we measure the standardization quality with accuracy and BLEU score (Papineni et al., 2002). Accuracy is calculated by the number of non-systematic names which are successfully standardized divided by the total number of non-systematic names. Note the accuracy that we adopt here is a very strong performance metric, as it equally means that the entire translated sentence is exactly matched for a machine translation task. The experiment results for different models on test dataset are shown in Table 3. We can see that the combination of spelling error correction, BPE tokenization and sequence to sequence model achieves the best performance. Our framework has a great improvement compared to the SMT model and the ChemHits system. The latter is slightly better than just applying spelling error correction. The results for different numbers of BPE merge operation are shown in Table 4. 5000 is the best value for this parameter. 0 means a characterlevel sequence to sequence model. The results show the usefulness of BPE. The results for different Levenshtein distance thresholds for the spelling error correction and the result of data augmentation are shown in Table 5. We can see that spelling error correction is indeed helpful for our framework.
|
| 112 |
+
|
| 113 |
+
Table 3: Results of different models on test dataset
|
| 114 |
+
|
| 115 |
+
<table><tr><td>Models</td><td>Accuracy (%)</td><td>BLEU (%)</td></tr><tr><td></td><td></td><td></td></tr><tr><td>ChemHits (Golebiewski et al.)</td><td>6.14</td><td></td></tr><tr><td>Spelling error correction Spelling error correction + SMT</td><td>2.89 26.25</td><td>1 53.90</td></tr><tr><td></td><td>54.04</td><td>69.74</td></tr><tr><td>Spelling error correction + sequence to sequence</td><td></td><td></td></tr></table>
|
| 116 |
+
|
| 117 |
+
Table 4: Results for different numbers of BPE merge operation.
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Number of merge operation</td><td>Accuracy (%)</td><td>BLEU (%)</td></tr><tr><td>20000</td><td>52.70</td><td>68.62</td></tr><tr><td>10000</td><td></td><td>69.22</td></tr><tr><td>5000</td><td>53.55 54.04</td><td>69.74</td></tr><tr><td>2500</td><td>53.90</td><td>70.19</td></tr><tr><td>0</td><td></td><td>64.25</td></tr><tr><td></td><td>23.60</td><td></td></tr></table>
|
| 120 |
+
|
| 121 |
+
Data augmentation also helps but does not perform as well as spelling error correction. Note that when the threshold is too large, the overcorrection might occur which reduces the standardization quality.
|
| 122 |
+
|
| 123 |
+
# 3.3 ANALYSIS
|
| 124 |
+
|
| 125 |
+
Some examples of the non-systematic names which are successfully standardized are shown in Table 6. These 4 examples show what the sequence to sequence model can do. In the first example, the parentheses in the non-systematic name are replaced by another parentheses and brackets. It means that the sequence to sequence model can fix also the non-alphabet spelling errors. The synonym error is also corrected: from 1-propanetriol to propane-1-thiol. In the second example, the wrong order ethane,1,2-dichloro is corrected to 1,2-dichloroethane. In the third example, the mixture of ordering error and synonym error are corrected. In the last example, $P$ -anise alcohol is a proprietary name which looks like totally different from its systematic name but it is also successfully standardized.
|
| 126 |
+
|
| 127 |
+
To better illustrate how the sequence to sequence model works, here we give the visualization of attentions of an example, which is shown in Figure 5. The non-systematic name is adenine,9- methyl- (7ci,8ci) and the corresponding systematic name is 9-methyl-9H-purin-6-amine. In the nonsystematic name, adenine itself is also a chemical substance whose systematic name is 9H-purin-6- amine. So it is a mixture of common name error and ordering error. From Figure 6, we can see that seq2seq model can find the relation between adenine and 9H-purin-6-amine and can find the right place for 9-methyl.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 5: Visualization of attentions
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 6: Accuracy for different lengths
|
| 134 |
+
|
| 135 |
+
Table 5: Results of different Levenshtein distance thresholds for the spelling error correction. For each threshold, the first line is the accuracy after just doing the spelling error correction. The second line is the accuracy after processing the non-systematic name by our whole framework. The numbers of BPE merge operation are all 5000.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Threshold</td><td>Accuracy (%)</td><td>BLEU (%)</td></tr><tr><td rowspan="3">Without spelling error correction</td><td></td><td></td></tr><tr><td>0</td><td></td></tr><tr><td>49.94 2.89</td><td>66.98</td></tr><tr><td>1</td><td>54.04</td><td>1 69.74</td></tr><tr><td>2</td><td>2.51 52.08</td><td>1 68.82</td></tr><tr><td>3</td><td>2.39 53.84</td><td>- 69.60</td></tr><tr><td>Data augmentation</td><td>52.95</td><td>69.00</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 6: Examples of the non-systematic names which are successfully standardized. For each example, the first line is the name before standardization and the second line is the name after standardization.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Example 1</td><td>3-(dimethoxymethylsilyl)-l-propanetriol 3-[dimethoxy(methyl)silyllpropane-1-thiol</td></tr><tr><td>Example 2</td><td>ethane,l,2-dichloro 1,2-dichloroethane</td></tr><tr><td>Example 3</td><td>1-phenyl-3-methyl-4-benzoyl-1h-pyrazol-5(4h)-one 4-benzoyl-3-methyl-1-phenyl-4,5-dihydro-1H-pyrazol-5-one</td></tr><tr><td>Example 4</td><td>P-anisealcohol (4-methoxyphenyl)methanol</td></tr></table>
|
| 142 |
+
|
| 143 |
+
# 3.4 ERROR ANALYSIS
|
| 144 |
+
|
| 145 |
+
In this section, we will analyze the fail standardization attempts of our system. Firstly, we randomly select 100 samples of failed attempts and label their error types manually and carefully. The distribution over error types is shown in Table 7. We can see that synonym error is the most confusing error type and our system performs well at spelling error. As for the common error, since it is very hard to find a rule between an unseen common name and its systematic name, our system also perform poorly at this error type.
|
| 146 |
+
|
| 147 |
+
Among these 100 samples, there are 10 samples which are nearly correct (only one or two characters different from the systematic name), 7 examples are totally incorrect (none of the subwords of prediction match the systematic name) and the rest are partially correct. Some samples of failed attempts are shown in Table 8.
|
| 148 |
+
|
| 149 |
+
# 3.5 LIMITATIONS
|
| 150 |
+
|
| 151 |
+
We noticed that there are still nearly a half of the non-systematic names which are not successfully standardized. The accuracy for systematic names of different lengths are shown in Figure 6. We can see that our framework achieves the best performances for the systematic names of length between 20 and 40 while performing poorly for the systematic names of length bigger than 60 which account for $37 \%$ of our test dataset. Another limitation of our model is that we do not take into account chemical rules in our model. For this reason, a few names generated by our model disobey the chemical rules and at the tokenization stage, some subwords generated by BPE are not explicable as well.
|
| 152 |
+
|
| 153 |
+
Table 7: Distribution over error types of 100 failed attempts.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Error types</td><td>Number of failed attempts</td></tr><tr><td>Synonym error</td><td>59</td></tr><tr><td>Common name error</td><td>33</td></tr><tr><td>Synonym error+ ordering error</td><td>7</td></tr><tr><td>Spelling error</td><td>1</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 8: Examples of failed attempts. For each example, the first line is the name before standardization and the second line is the systematic name and the third line is the prediction of our model.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Nearly correct</td><td>5-bromo-2-(chlorosulfanyl)toluene 4-bromo-2-methylbenzene-1-sulfonyl chloride</td></tr><tr><td>Totally incorrect</td><td>5-bromo-2-methylbenzene-l-sulfonylchloride cholinedicarbonate (2-hydroxyethyl)trimethylazanium hydrogen carbonate (carbamoylimino)urea</td></tr><tr><td>Partially correct</td><td>3,5-dichloro-4-nitrobenzotrifluoride 1,3-dichloro-2-iodo-5-(trifluoromethyl)benzene 4,5-dichloro-2-nitro-1-(trifluoromethyl)benzene</td></tr></table>
|
| 160 |
+
|
| 161 |
+
# 4 CONCLUSION
|
| 162 |
+
|
| 163 |
+
In this work, we propose a framework to automatically convert non-systematic names to systematic names . Our framework consists of spelling error correction, byte pair encoding tokenization and sequence to sequence model. Our framework achieves an accuracy of $5 4 . 0 4 \%$ on our dataset, which is far better than previous rule based system (nine times of accuracy) and thus enables the related chemical information extraction into more practical use stage. The advantage of our framework is that it is trained end to end, fully data-driven and independent of external chemical knowledge. This work starts a brand new research line for the related chemical information extraction as to our best knowledge.
|
| 164 |
+
|
| 165 |
+
# REFERENCES
|
| 166 |
+
|
| 167 |
+
W. A Burkhard and R. M Keller. Some approaches to best-match file searching. Communications of the Acm, 16(4):230–236, 1973.
|
| 168 |
+
Henry A. Favre and Warren H. Powell. Nomenclature of Organic Chemistry:IUPAC Recommendations and Preferred 224 Names 2013. Butterworths, 2013.
|
| 169 |
+
Martin Golebiewski, Jasmin Saric, Henriette Engelken, Meik Bittkowski, Ulrike Wittig, Wolfgang Mller, and Isabel Rojas. Normalization and matching of chemical compound names. Nature Precedings, 06 2009. doi: 10.1038/npre.2009.3322.1.
|
| 170 |
+
Alex Graves and Jrgen Schmidhuber. Framewise phoneme classification with bidirectional lstm and other neural network architectures. Neural Netw, 18(5):602–610, 2005.
|
| 171 |
+
Kenneth Heafield. Kenlm: faster and smaller language model queries. In The Workshop on Statistical Machine Translation, pp. 187–197, 2011.
|
| 172 |
+
Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M Rush. Opennmt: Open-source toolkit for neural machine translation. 2017.
|
| 173 |
+
Philipp Koehn, Hieu Hoang, Alexandra Birch, Nicola Bertoldi, Nicola Bertoldi, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, and Richard Zens. Moses: open source toolkit for statistical machine translation. In Meeting of the ACL on Interactive Poster and Demonstration Sessions, pp. 177–180, 2007.
|
| 174 |
+
D. M. Lowe, P. T. Corbett, P Murray-Rust, and R. C. Glen. Chemical name to structure: Opsin, an open source solution. Journal of Chemical Information Modeling, 51(3):739–53, 2011.
|
| 175 |
+
Minh Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attentionbased neural machine translation. Computer Science, 2015.
|
| 176 |
+
Alan Mcnaught. The iupac international chemical identifier: Inchi - a new standard for molecular informatics. Chemistry International, 2006.
|
| 177 |
+
K. Papineni, S. Roukos, T. Ward, and W. J. Zhu. Ibm research report bleu: a method for automatic evaluation of machine translation. Acl Proceedings of Annual Meeting of the Association for Computational Linguistics, 30(2):311–318, 2002.
|
| 178 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. Computer Science, 2015.
|
| 179 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. 4:3104–3112, 2014.
|
| 180 |
+
David Weininger. Smiles, a chemical language and information system. 1. introduction to methodology and encoding rules. Journal of Chemical Information Computer Sciences, 28(1):31–36, 1988.
|
md/train/rkGG6s0qKQ/rkGG6s0qKQ.md
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THE GAN LANDSCAPE: LOSSES, ARCHITECTURES, REGULARIZATION, AND NORMALIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Generative adversarial networks (GANs) are a class of deep generative models which aim to learn a target distribution in an unsupervised fashion. While they were successfully applied to many problems, training a GAN is a notoriously challenging task and requires a significant amount of hyperparameter tuning, neural architecture engineering, and a non-trivial amount of “tricks”. The success in many practical applications coupled with the lack of a measure to quantify the failure modes of GANs resulted in a plethora of proposed losses, regularization and normalization schemes, and neural architectures. In this work we take a sober view of the current state of GANs from a practical perspective. We reproduce the current state of the art and go beyond fairly exploring the GAN landscape. We discuss common pitfalls and reproducibility issues, open-source our code on Github, and provide pre-trained models on TensorFlow Hub.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep generative models are a powerful class of unsupervised machine learning models. The power of these models was recently harnessed in a variety of applications, including image generation, learned compression, and domain transfer (Isola et al., 2017; Radford et al., 2016; Agustsson et al., 2018; Tschannen et al., 2018). Generative adversarial networks (Goodfellow et al., 2014) are one of the main approaches to learning such models in a fully unsupervised fashion. The GAN framework can be viewed as a two-player game where the first player, the generator, is learning to transform some simple input distribution (usually a standard multivariate Normal or uniform) to a distribution on the space of images, such that the second player, the discriminator, cannot tell whether the samples belong to the true distribution or were synthesized. Both players aim to minimize their own loss and the solution to the game is the Nash equilibrium where neither player can improve their loss unilaterally. This powerful framework can also be derived by minimizing a divergence between the model distribution and the true distribution (Nowozin et al., 2016; Arjovsky et al., 2017).
|
| 12 |
+
|
| 13 |
+
Training GANs involves solving a minimax problem over the parameters of the generator and the discriminator which are usually parameterized as deep convolutional neural networks. Consequently, this minimax problem is notoriously hard to solve in practice. As a result, a plethora of loss functions, regularization and normalization schemes, coupled with neural architecture choices, have been proposed (Goodfellow et al., 2014; Salimans et al., 2016; Miyato et al., 2018; Gulrajani et al., 2017; Arjovsky et al., 2017; Mao et al., 2016).
|
| 14 |
+
|
| 15 |
+
Our contributions. In this work we provide a thorough empirical analysis of these competing approaches, and help the researchers and practitioners navigate this space. We first define the GAN landscape – the set of loss functions, normalization and regularization schemes, and the most commonly used architectures. We explore this search space on several modern large-scale data sets by means of hyperparameter optimization, considering both “good” sets of hyperparameters reported in the literature, as well as ones obtained by Gaussian Process regression. By analyzing the impact of the loss function, we conclude that the non-saturating loss is sufficiently stable across data sets, architectures and hyperparameters. We then proceed to decompose the effect of various normalization and regularization schemes, as well as varying architectures. We show that both gradient penalty (Gulrajani et al., 2017) as well as spectral normalization (Miyato et al., 2018) are useful in the context of high-capacity architectures. Finally, we discuss some common pitfalls, reproducibility issues, and practical considerations. We provide reference implementations, including training and evaluation code on Github1 and provide pre-trained models on TensorFlow Hub.2
|
| 16 |
+
|
| 17 |
+
# 2 THE GAN LANDSCAPE
|
| 18 |
+
|
| 19 |
+
# 2.1 LOSS FUNCTIONS
|
| 20 |
+
|
| 21 |
+
Let $P$ denote the target (true) distribution and $Q$ the model distribution. Goodfellow et al. (2014) suggest two loss functions: the minimax GAN and the non-saturating (NS) GAN. In the former the discriminator minimizes the negative log-likelihood for the binary classification task. In the latter the generator maximizes the probability of generated samples being real. In this work we consider the non-saturating loss as it is known to outperform the minimax variant. The corresponding loss functions are $\mathcal { L } _ { \mathrm { { D } } } = - \mathbb { E } _ { \boldsymbol { x } \sim P } [ \log ( D ( \boldsymbol { x } ) ) ] - \mathbb { E } _ { \hat { \boldsymbol { x } } \sim Q } [ \log ( 1 - D ( \boldsymbol { \hat { x } } ) ) ]$ and $\mathcal { L } _ { \mathrm { G } } = - \mathbb { E } _ { \hat { x } \sim Q } [ \bar { \log ( D ( \hat { x } ) ) } ]$ .
|
| 22 |
+
|
| 23 |
+
In Wasserstein GAN (WGAN) (Arjovsky et al., 2017) the authors propose to consider the Wasserstein divergence instead of the original Jensen-Shannon (JS). In particular, under the optimal discriminator, minimizing the proposed value function with respect to the generator minimizes the Wasserstein distance between $P$ and $Q$ . The drawback is that one has to ensure a 1-Lipschitz discriminator due to exploited Kantorovich-Rubenstein duality. The corresponding loss functions are $\mathcal { L } _ { \mathrm { D } } ~ =$ $- \mathbb { E } _ { x \sim P } [ D ( x ) ] + \mathbb { E } _ { \hat { x } \sim Q } [ D ( \hat { x } ) ]$ and $\mathcal { L } _ { \mathrm { G } } = - \mathbb { E } _ { \hat { x } \sim Q } [ D ( \hat { x } ) ]$ .
|
| 24 |
+
|
| 25 |
+
Finally, we consider the least-squares loss (LS) which corresponds to minimizing the Pearson $\chi ^ { 2 }$ divergence between $P$ and $Q$ (Mao et al., 2016). The intuition is that this loss function is smooth and saturates slower than the sigmoid cross-entropy loss of the JS formulation. The corresponding loss functions are $\mathcal { L } _ { \mathrm { D } } = - \mathbb { E } _ { x \sim P } \overline { { [ ( D ( x ) - 1 ) ^ { 2 } ] } } + \tilde { \mathbb { E } } _ { \hat { x } \sim Q } [ D ( \hat { x } ) ^ { 2 } ]$ and $\mathcal { L } _ { \mathrm { G } } = - \mathbb { E } _ { \hat { x } \sim Q } [ ( D ( \hat { x } ) { \bar { - } } 1 ) ^ { 2 } ]$ ].
|
| 26 |
+
|
| 27 |
+
# 2.2 REGULARIZATION AND NORMALIZATION OF THE DISCRIMINATOR
|
| 28 |
+
|
| 29 |
+
Gradient norm penalty. In the context of Wasserstein GANs this penalty can be interpreted as a soft penalty for the violation of 1-Lipschitzness (WGAN GP) (Gulrajani et al., 2017). Hereby, the gradient is evaluated on a linear interpolation between training points and generated samples as a proxy to the optimal coupling. The gradient penalty can also be evaluated around the data manifold which encourages the discriminator to be piece-wise linear in that region (Dragan) (Kodali et al., 2017). However, the gradient norm penalty can be considered purely as a regularizer for the discriminator and it was shown that it can improve the performance for other losses (Fedus et al., 2018). Furthermore, the penalty can be scaled by the “confidence” of the discriminator in the context of f-divergences (Roth et al., 2017). A drawback of gradient penalty (GP) regularization scheme is that it can depend on the model distribution $Q$ which changes during training. One drawback of Dragan is that it is unclear to which extent the Gaussian assumption for the manifold holds. Finally, computing the gradient norms implies a non-trivial running time penalty – essentially doubling the running time. We also investigate the impact of a regularizer ubiquitous in supervised learning – the $L _ { 2 }$ penalty on all the weights of the network.
|
| 30 |
+
|
| 31 |
+
Discriminator normalization. Normalizing the discriminator can be useful from both the optimization perspective (more efficient gradient flow, a more stable optimization), as well as from the representation perspective – the representation richness of the layers in a neural network depends on the spectral structure of the corresponding weight matrices (Miyato et al., 2018).
|
| 32 |
+
|
| 33 |
+
From the optimization point of view, several techniques have found their way into the GAN literature, namely batch normalization (BN) (Ioffe and Szegedy, 2015) and layer normalization (LN) (Ba et al., 2016). Batch normalization in the context of GANs was suggested by Denton et al. (2015) and further popularized by Radford et al. (2016). It normalizes the pre-activations of nodes in a layer to mean $\beta$ and standard deviation $\gamma$ , where both $\beta$ and $\gamma$ are parameters learned for each node in the layer. The normalization is done on the batch level and for each node separately. In contrast, with Layer normalization, all the hidden units in a layer share the same normalization terms $\beta$ and $\gamma$ , but different samples are normalized differently (Ba et al., 2016). Layer normalization was first applied in the context of GANs in Gulrajani et al. (2017).
|
| 34 |
+
|
| 35 |
+
From the representation point of view, one has to consider the neural network as a composition of (possibly non-linear) mappings and analyze their spectral properties. In particular, for the discriminator to be a bounded linear operator it suffices to control the maximum singular value. This approach is followed in Miyato et al. (2018) where the authors suggest dividing each weight matrix, including the matrices representing convolutional kernels, by their spectral norm. Furthermore, the authors argue that a key advantage of spectral normalization over competing approaches is that it results in discriminators of higher rank.
|
| 36 |
+
|
| 37 |
+
# 2.3 GENERATOR AND DISCRIMINATOR ARCHITECTURE
|
| 38 |
+
|
| 39 |
+
We explore two classes of architectures in this study: deep convolutional generative adversarial networks (DCGAN) (Radford et al., 2016) and residual networks (ResNet) (He et al., 2016), both of which are ubiquitous in GAN research. Recently, Miyato et al. (2018) defined a variation of DCGAN, so called SNDCGAN. Apart from minor updates (cf. Section 4) the main difference to DCGAN is the use of an eight-layer discriminator network. The details of both networks are summarized in Table 3. The other architecture, ResNet19, is an architecture with five ResNet blocks in the generator and six ResNet blocks in the discriminator, that can operate on $1 2 8 \times 1 2 8$ images. We follow the ResNet setup from Miyato et al. (2018), with the small difference that we simplified the design of the discriminator. The detailed parameters of discriminator and generator are summarized in Table 4a and Table 4b. With this setup we were able to reproduce the current state of the art results. An ablation study on various ResNet modifications is available in the Appendix.
|
| 40 |
+
|
| 41 |
+
# 2.4 EVALUATION METRICS
|
| 42 |
+
|
| 43 |
+
We focus on several recently proposed metrics well suited to the image domain. For an in-depth overview of quantitative metrics we refer the reader to (Borji, 2018).
|
| 44 |
+
|
| 45 |
+
Inception Score (IS). Proposed by Salimans et al. (2016), IS offers a way to quantitatively evaluate the quality of generated samples. Intuitively, the conditional label distribution of samples containing meaningful objects should have low entropy, and the variability of the samples should be high. which can be expressed as $\scriptstyle \mathtt { I S } = \exp ( \mathbb { E } _ { x \sim Q } [ d _ { K L } ^ { \sim } ( p ( y \mid x ) , p ( y ) ) ] )$ . The authors found that this score is well-correlated with scores from human annotators. Drawbacks include insensitivity to the prior distribution over labels and not being a proper distance.
|
| 46 |
+
|
| 47 |
+
As an alternative Heusel et al. (2017) proposed the Frechet Inception Distance (FID). Samples from $P$ and $Q$ are first embedded into a feature space (a specific layer of InceptionNet). Then, assuming that the embedded data follows a multivariate Gaussian distribution, the mean and covariance are estimated. Finally, the Frechet distance between these two Gaussians is computed, i.e. ´
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r } { \mathtt { F I D } = | | \mu _ { x } - \mu _ { y } | | _ { 2 } ^ { 2 } + \operatorname { T r } \big ( \Sigma _ { x } + \Sigma _ { y } - 2 \big ( \Sigma _ { x } \Sigma _ { y } \big ) ^ { \frac { 1 } { 2 } } \big ) , } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\left( \mu _ { x } , \Sigma _ { x } \right)$ , and $( \mu _ { y } , \Sigma _ { y } )$ are the mean and covariance of the embedded samples from $P$ and $Q$ , respectively. The authors argue that FID is consistent with human judgment and more robust to noise than IS. Furthermore, the score is sensitive to the visual quality of generated samples – introducing noise or artifacts in the generated samples will reduce the FID. In contrast to IS, FID can detect intra-class mode dropping, i.e. a model that generates only one image per class can score a perfect IS, but will suffer from have a high FID (Lucic et al., 2018). Binkowski et al. ´ (2018) argued that FID has no unbiased estimator and suggest Kernel Inception distance (KID) instead. In Appendix B we empirically compare KID to FID and observe that both metrics are very strongly correlated (Spearman rank-order correlation coefficient of 0.994 for LSUN-BEDROOM and 0.995 for CELEBA-HQ-128 datasets). As a result we focus on FID as it is likely to result in the same ranking.
|
| 54 |
+
|
| 55 |
+
Multi-scale Structural Similarity for Image Quality (MS-SSIM) and Diversity. A critical issue in GANs are mode collapse and mode-dropping – failing to capture a mode, or low-diversity of generated samples from a given mode. The MS-SSIM score (Wang et al., 2003) is used for measuring the similarity of two images where higher MS-SSIM score indicates more similar images. Several recent works suggest using the average pairwise MS-SSIM score within a given class as a proxy for the diversity of generated samples (Odena et al., 2017; Fedus et al., 2018). The drawback of this approach is that we do not know the class corresponding to the generated sample, so it is usually applied on one-class data sets, such as CELEBA-HQ-128. In this work we use the same setup as in Fedus et al. (2018). In particular, given a batch size $b$ , we compute the average pairwise MS-SSIM score on 5 batches, of $5 \times b \times ( b - 1 ) / 2$ image pairs in total. We stress that the diversity should only be taken into account together with the FID and $I S$ metrics.
|
| 56 |
+
|
| 57 |
+
Table 1: Hyperparameter ranges used in this study. The Cartesian product of the fixed values suffices to uncover the existing results. Gaussian Process optimization in the bandit setting (Srinivas et al., 2010) is used to select good hyperparameter settings from the specified ranges.
|
| 58 |
+
(a) Fixed values
|
| 59 |
+
|
| 60 |
+
<table><tr><td>PARAMETER</td><td>DISCRETE VALUE</td></tr><tr><td>Learning rate α</td><td>{0.0002,0.0001,0.001}</td></tr><tr><td>Reg. strength 入</td><td>{1,10}</td></tr><tr><td>(β1,β2,ndis)</td><td>{(0.5,0.900,5), (0.5,0.999,1), (0.5,0.999,5), (0.9,0.999,5)}</td></tr></table>
|
| 61 |
+
|
| 62 |
+
(b) Gaussian Process regression ranges
|
| 63 |
+
|
| 64 |
+
<table><tr><td>PARAMETER</td><td>RANGE</td><td>LOG</td></tr><tr><td>Learning rate α</td><td>[10-5,10-2]</td><td>Yes</td></tr><tr><td>入 for L2</td><td>[10-4,101]</td><td>Yes</td></tr><tr><td>入 for non-L2</td><td>[10-1,102]</td><td>Yes</td></tr><tr><td>β1×β</td><td>[0,1] × [0,1]</td><td>No</td></tr></table>
|
| 65 |
+
|
| 66 |
+
# 2.5 DATA SETS
|
| 67 |
+
|
| 68 |
+
We consider three data sets, namely CIFAR10, CELEBA-HQ-128, and LSUN-BEDROOM. The LSUN-BEDROOM data set (Yu et al., 2015) contains slightly more than 3 million images3. We randomly partition the images into a train and test set whereby we use 30588 images as the test set. Secondly, we use the CELEBA-HQ data set of 30k images (Karras et al., 2018). We use the $1 2 8 \times 1 2 8 \times 3$ version obtained by running the code provided by the authors.4 We use 3000 examples as the test set and the remaining examples as the training set. Finally, we also include the CIFAR10 data set which contains 70K images $\left( 3 2 \mathbf { x } 3 2 \mathbf { x } 3 \right)$ , partitioned into 60000 training instances and 10000 testing instances. The baseline FID scores are 12.6 for CELEBA-HQ-128, 3.8 for LSUN-BEDROOM, and 5.19 for CIFAR10. Details on FID computation are presented in Section 4.
|
| 69 |
+
|
| 70 |
+
# 2.6 EXPLORING THE GAN LANDSCAPE
|
| 71 |
+
|
| 72 |
+
The search space for GANs is prohibitively expensive: exploring all combinations of all losses, normalization and regularization schemes, and architectures is outside of the practical realm. Instead, in this study we analyze several slices of this tensor for each data set. In particular, to ensure that we can reproduce existing results, we perform a study over the subset of this tensor on CIFAR10. We then proceed to analyze the performance of these models across CELEBA-HQ-128 and LSUN-BEDROOM. In Section 3.1 we fix everything but the loss. In Section 3.2 we fix everything but the regularization and normalization scheme. Finally, in Section 3.3 we fix everything but the architecture. This allows us to decouple some of these design choices and provide some insight on what matters most.
|
| 73 |
+
|
| 74 |
+
As noted in Lucic et al. (2018), one major issue preventing further progress is the hyperparameter tuning – currently, the community has converged to a small set of parameter values which work on some data sets, and may completely fail on others. In this study we combine the best hyperparameter settings found in the literature (Miyato et al., 2018), and perform Gaussian Process regression in the bandit setting (Srinivas et al., 2010) to possibly uncover better hyperparameter settings. We then consider the top performing models and discuss the impact of the computational budget.
|
| 75 |
+
|
| 76 |
+
We summarize the fixed hyperparameter settings in Table 1a which contains the “good” parameters reported in recent publications (Fedus et al., 2018; Miyato et al., 2018; Gulrajani et al., 2017). In particular, we consider the cross product of these parameters to obtain 24 hyperparameter settings to reduce the bias. Finally, to provide a fair comparison, we perform Gaussian Process optimization in the bandit setting (Srinivas et al., 2010) on the parameter ranges provided in Table 1b. We run 12 rounds (i.e. we communicate with the oracle 12 times) of the optimization, each with a batch of 10 hyperparameter sets selected based on the FID scores from the results of the previous iterations.
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 1: Impact of the loss function: FID distribution for top $5 \%$ models. The non-saturating (NS) loss is stable over both data sets. Gradient penalty and spectral normalization improve the sample quality. From the computational budget perspective (i.e. how many models one needs to train to reach a certain FID), both spectral normalization and gradient penalty perform better than the baseline, but the former is more efficient.
|
| 80 |
+
|
| 81 |
+
As we explore the number of discriminator updates per generator update (1 or 5), this leads to an additional 240 hyperparameter settings which in some cases outperform the previously known hyperparameter settings. Batch size is set to 64 for all the experiments. We use a fixed the number of discriminator update steps of 100K for LSUN-BEDROOM data set and CELEBA-HQ-128 data set, and 200K for CIFAR10 data set. We apply the Adam optimizer (Kingma and Ba, 2015).
|
| 82 |
+
|
| 83 |
+
# 3 RESULTS AND DISCUSSION
|
| 84 |
+
|
| 85 |
+
Given that there are 4 major components (loss, architecture, regularization, normalization) to analyze for each data set, it is infeasible to explore the whole landscape. Hence, we opt for a more pragmatic solution – we keep some dimensions fixed, and vary the others. For each experiment we highlight three aspects: (1) FID distribution of the top $5 \%$ of the trained models, (2) the corresponding sample diversity score, and (3) the tradeoff between the computational budget (i.e. number of models to train) and model quality in terms of FID. Each model was retrained 5 times with a different random seed and we report the median score. The variance for models obtained by Gaussian Process regression is handled implicitly so we train each model once.
|
| 86 |
+
|
| 87 |
+
# 3.1 IMPACT OF THE LOSS FUNCTION
|
| 88 |
+
|
| 89 |
+
Here the loss is either the non-saturating loss (NS) (Goodfellow et al., 2014), the least-squares loss (LS) (Mao et al., 2016), or the Wasserstein loss (WGAN) (Arjovsky et al., 2017). We use the ResNet19 with generator and discriminator architectures detailed in Table 4a. We consider the most prominent normalization and regularization approaches: gradient penalty (Gulrajani et al., 2017), and spectral normalization (Miyato et al., 2018). Both studies were performed on CELEBA-HQ-128 and LSUN-BEDROOM with hyperparameter settings shown in Table 1a.
|
| 90 |
+
|
| 91 |
+
The results are presented in Figure 1. We observe that the non-saturating loss is stable over both data sets. Spectral normalization improves the quality of the model on both data sets. Similarly, the gradient penalty can help improve the quality of the model, but finding a good regularization tradeoff is non-trivial and requires a high computational budget. Models using the GP penalty benefit from 5:1 ratio of discriminator to generator updates as suggested by (Gulrajani et al., 2017). We also performed a study on hinge loss (Miyato et al., 2018) and present it in the Appendix.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 2: Impact of regularization and normalization: FID distribution for top $5 \%$ models. Both gradient penalty (GP) and spectral normalization (SN) outperform the baseline and should be considered, while former being more computationally expensive. Unfortunately none fully address the stability issues.
|
| 95 |
+
|
| 96 |
+
# 3.2 IMPACT OF REGULARIZATION AND NORMALIZATION
|
| 97 |
+
|
| 98 |
+
The goal of this study is to compare the relative performance of various regularization and normalization methods presented in the literature. To this end, and based on the loss study, we fix the loss to non-saturating loss (Goodfellow et al., 2014). We use the ResNet19 with generator and discriminator architectures described in Table 4a. Finally, we consider batch normalization (BN) (Ioffe and Szegedy, 2015), layer normalization (LN) (Ba et al., 2016), spectral normalization (SN), gradient penalty (GP) (Gulrajani et al., 2017), dragan penalty (DR) (Kodali et al., 2017), or $L _ { 2 }$ regularization. We consider both CELEBA-HQ-128 and LSUN-BEDROOM with the hyperparameter settings shown in Table 1a and Table 1b.
|
| 99 |
+
|
| 100 |
+
The results are presented in Figure 2. We observe that adding batch norm to the discriminator hurts the performance. Secondly, gradient penalty can help, but it doesn’t stabilize the training. In fact, it is non-trivial to strike a balance of the loss and regularization strength. Spectral normalization helps improve the model quality and is more computationally efficient than gradient penalty. This is consistent with recent results in Zhang et al. (2018). Similarly to the loss study, models using GP penalty benefit from 5:1 ratio of discriminator to generator updates. Furthermore, in a separate ablation study we observed that running the optimization procedure for an additional 100K steps is likely to increase the performance of the models with GP penalty.
|
| 101 |
+
|
| 102 |
+
Impact of Simultaneous Regularization and Normalization. Given the folklore that the Lipschitz constant of the discriminator is critical for the performance, one may expect simultaneous regularization and normalization could improve model quality. To quantify this effect, we fix the loss to non-saturating loss (Goodfellow et al., 2014), use the Resnet19 architecture (as above), and combine several normalization and regularization schemes, with hyperparameter settings shown in Table 1a coupled with 24 randomly selected parameters. The results are presented in Figure 3. We observe that one may benefit from additional regularization and normalization. However, a lot of computational effort has to be invested for somewhat marginal gains in FID. Nevertheless, given enough computational budget we advocate simultaneous regularization and normalization – spectral normalization and layer normalization seem to perform well in practice.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 3: Impact of simultaneous normalization and regularization: FID distribution for top $5 \%$ models. Gradient penalty coupled with spectral normalization (SN) or layer normalization (LN) strongly improves the performance over the baseline.
|
| 106 |
+
|
| 107 |
+
# 3.3 IMPACT OF GENERATOR AND DISCRIMINATOR ARCHITECTURES
|
| 108 |
+
|
| 109 |
+
An interesting practical question is whether our findings also hold for a different model capacity. To this end, we also perform a study on SNDCGAN from Miyato et al. (2018). We consider the non-saturating GAN loss, gradient penalty and spectral normalization. While for smaller architectures regularization is not essential (Lucic et al., 2018), the regularization and normalization effects might become more relevant due to deeper architectures and optimization considerations.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 4: Impact of the neural architectures: FID distribution for top $5 \%$ models. Both spectral normalization and gradient penalty can help improve upon the non-regularized baseline.
|
| 113 |
+
|
| 114 |
+
The results are presented in Figure 4. We observe that both architectures achieve comparable results and benefit from regularization and normalization. Spectral normalization strongly outperforms the baseline for both architectures.
|
| 115 |
+
|
| 116 |
+
# 4 COMMON PITFALLS
|
| 117 |
+
|
| 118 |
+
In this section we focus on several pitfalls we encountered while trying to reproduce existing results and provide a fairly and accurate comparison.
|
| 119 |
+
|
| 120 |
+
Metrics. There already seems to be a divergence in how the FID score is computed: (1) Some authors report the score on training data, yielding a FID between 50k training and $5 0 \mathrm { k }$ generated samples (Unterthiner et al., 2018). Some opt to report the FID based on 10k test samples and $5 \mathrm { k }$ generated samples and use a custom implementation (Miyato et al., 2018). Finally, Lucic et al. (2018) report the score with respect to the test data, in particular FID between 10k test samples, and 10k generated samples. The subtle differences will result in a mismatch between the reported FIDs, in some cases of more than $1 0 \%$ . We argue that FID should be computed with respect to the test data set as and use 10k test samples and 10k generated samples on CIFAR10 and LSUN-BEDROOM, and 3k vs 3k on CELEBA-HQ-128 as in in Lucic et al. (2018). Similarly, there are several ways to compute a diversity score using MS-SSIM and we follow the approach from Fedus et al. (2018). We provide the implementation details in Section G of the Appendix.
|
| 121 |
+
|
| 122 |
+
Details of neural architectures. Even in popular architectures, like ResNet, there is still a number of design decision one needs to make, that are often omitted from the reported results. Those include the exact design of the ResNet cell (order of layers, when is ReLu applied, when to upsample and downsample, how many filters to use). Some of these differences might lead to potentially unfair comparison. As a result, we suggest to use the architectures presented within this work as a solid baseline. An ablation study on various ResNet modifications is available in the Appendix.
|
| 123 |
+
|
| 124 |
+
Data sets. A common issue is related to data set processing – does LSUN-BEDROOM always correspond to the same data set? In most cases the precise algorithm for upscaling or cropping is not clear which introduces inconsistencies between results on the “same” data set.
|
| 125 |
+
|
| 126 |
+
Implementation details and non-determinism. One major issue is the mismatch between the algorithm presented in a paper and the code provided online. We are aware that there is an embarrassingly large gap between a good implementation and a bad implementation of a given model. Hence, when no code is available, one is forced to guess which modifications were done. Another particularly tricky issue is removing randomness from the training process. After one fixes the data ordering and the initial weights, obtaining the same score by training the same model twice is non-trivial due to randomness present in certain GPU operations (Chetlur et al., 2014). Disabling the optimizations causing the non-determinism often results in an order of magnitude running time penalty.
|
| 127 |
+
|
| 128 |
+
While each of these issues taken in isolation seems minor, they compound to create a mist which introduces friction in practical applications and the research process (Sculley et al., 2018).
|
| 129 |
+
|
| 130 |
+
# 5 RELATED WORK
|
| 131 |
+
|
| 132 |
+
A recent large-scale study on GANs and Variational Autoencoders was presented in Lucic et al. (2018). The authors consider several loss functions and regularizers, and study the effect of the loss function on the FID score, with low-to-medium complexity data sets (MNIST, CIFAR10, CELEBA), and a single (InfoGAN style) architecture. In this limited setting, the authors found that there is no statistically significant difference between recently introduced models and the original non-saturating GAN. A study of the effects of gradient-norm regularization in GANs was recently presented in Fedus et al. (2018). The authors posit that the gradient penalty can also be applied to the non-saturating GAN, and that, to a limited extent, it reduces the sensitivity to hyperparameter selection. In a recent work on spectral normalization, the authors perform a small study of the competing regularization and normalization approaches (Miyato et al., 2018). We are happy to report that we could reproduce these results and we present them in the Appendix.
|
| 133 |
+
|
| 134 |
+
Inspired by these works and building on the available open-source code from Lucic et al. (2018), we take one additional step in all dimensions considered therein: more complex neural architectures, more complex data sets, and more involved regularization and normalization schemes.
|
| 135 |
+
|
| 136 |
+
# 6 CONCLUSION
|
| 137 |
+
|
| 138 |
+
In this work we study the GAN landscape: losses, regularization and normalization schemes, and neural architectures, and their impact on the on the quality of generated samples which we assess by recently introduced quantitative metrics. Our fair and thorough empirical evaluation suggests that one should consider non-saturating GAN loss and spectral normalization as default choices when applying GANs to a new data set. Given additional computational budget, we suggest adding the gradient penalty from Gulrajani et al. (2017) and train the model until convergence. Furthermore, additional marginal gains can be obtained by combining normalization and regularization empirically confirming the importance of the Lipschitz constant of the discriminator. Furthermore, both types of architectures proposed up-to this point perform reasonably well. A separate ablation study uncovered that most of the tricks applied in the ResNet style architectures lead to marginal changes in the quality and should be avoided due to the high computational cost. As a result of this large-scale study we identify the common pitfalls standing in the way of accurate and fair comparison and propose concrete actions to demystify the future results – issues with metrics, data set preprocessing, non-determinism, and missing implementation details are particularly striking. We hope that this work, together with the open-sourced reference implementations and trained models, will serve as a solid baseline for future GAN research.
|
| 139 |
+
|
| 140 |
+
# REFERENCES
|
| 141 |
+
|
| 142 |
+
Eirikur Agustsson, Michael Tschannen, Fabian Mentzer, Radu Timofte, and Luc Van Gool. Generative adversarial networks for extreme learned image compression. CoRR, abs/1804.02958, 2018.
|
| 143 |
+
|
| 144 |
+
Mart´ın Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. In ´ International Conference on Machine Learning (ICML), 2017.
|
| 145 |
+
|
| 146 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 147 |
+
|
| 148 |
+
Mikołaj Binkowski, Dougal J. Sutherland, Michael Arbel, and Arthur Gretton. Demystifying MMD GANs. In ´ International Conference on Learning Representations (ICLR), 2018.
|
| 149 |
+
|
| 150 |
+
Ali Borji. Pros and cons of GAN evaluation measures. arXiv preprint arXiv:1802.03446, 2018.
|
| 151 |
+
|
| 152 |
+
Sharan Chetlur, Cliff Woolley, Philippe Vandermersch, Jonathan Cohen, John Tran, Bryan Catanzaro, and Evan Shelhamer. cudnn: Efficient primitives for deep learning. arXiv preprint arXiv:1410.0759, 2014.
|
| 153 |
+
|
| 154 |
+
Emily L Denton, Soumith Chintala, Rob Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In Advances in Neural Information Processing Systems (NIPS), 2015.
|
| 155 |
+
|
| 156 |
+
William Fedus, Mihaela Rosca, Balaji Lakshminarayanan, Andrew M Dai, Shakir Mohamed, and Ian Goodfellow. Many paths to equilibrium: Gans do not need to decrease a divergence at every step. In International Conference on Learning Representations (ICLR), 2018.
|
| 157 |
+
|
| 158 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems (NIPS), 2014.
|
| 159 |
+
|
| 160 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of Wasserstein GANs. Advances in Neural Information Processing Systems (NIPS), 2017.
|
| 161 |
+
|
| 162 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 163 |
+
|
| 164 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Gunter Klambauer, and Sepp Hochre-¨ iter. GANs trained by a two time-scale update rule converge to a Nash equilibrium. Advances in Neural Information Processing Systems (NIPS), 2017.
|
| 165 |
+
|
| 166 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 167 |
+
|
| 168 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 169 |
+
|
| 170 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. International Conference on Learning Representations (ICLR), 2018.
|
| 171 |
+
|
| 172 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2015.
|
| 173 |
+
|
| 174 |
+
Naveen Kodali, Jacob Abernethy, James Hays, and Zsolt Kira. On convergence and stability of GANs. arXiv preprint arXiv:1705.07215, 2017.
|
| 175 |
+
|
| 176 |
+
Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are GANs created equal? A large-scale study. Advances in Neural Information Processing Systems (NIPS), 2018.
|
| 177 |
+
|
| 178 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. arXiv preprint ArXiv:1611.04076, 2016.
|
| 179 |
+
|
| 180 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. International Conference on Learning Representations (ICLR), 2018.
|
| 181 |
+
|
| 182 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems (NIPS), 2016.
|
| 183 |
+
|
| 184 |
+
Augustus Odena, Christopher Olah, and Jonathon Shlens. Conditional image synthesis with auxiliary classifier GANs. In International Conference on Machine Learning (ICML), 2017.
|
| 185 |
+
|
| 186 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. International Conference on Learning Representations (ICLR), 2016.
|
| 187 |
+
|
| 188 |
+
Kevin Roth, Aurelien Lucchi, Sebastian Nowozin, and Thomas Hofmann. Stabilizing training of generative adversarial networks through regularization. In Advances in Neural Information Processing Systems, 2017.
|
| 189 |
+
|
| 190 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems (NIPS), 2016.
|
| 191 |
+
|
| 192 |
+
D. Sculley, Jasper Snoek, Alex Wiltschko, and Ali Rahimi. Winner’s curse? On pace, progress, and empirical rigor, 2018.
|
| 193 |
+
|
| 194 |
+
Niranjan Srinivas, Andreas Krause, Sham Kakade, and Matthias W. Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. In International Conference on Machine Learning (ICML), 2010.
|
| 195 |
+
|
| 196 |
+
Michael Tschannen, Eirikur Agustsson, and Mario Lucic. Deep generative models for distribution-preserving lossy compression. Advances in Neural Information Processing Systems (NIPS), 2018.
|
| 197 |
+
|
| 198 |
+
Thomas Unterthiner, Bernhard Nessler, Calvin Seward, Gnter Klambauer, Martin Heusel, Hubert Ramsauer, and Sepp Hochreiter. Coulomb GANs: Provably optimal nash equilibria via potential fields. In International Conference on Learning Representations (ICLR), 2018.
|
| 199 |
+
|
| 200 |
+
Zhou Wang, Eero P Simoncelli, and Alan C Bovik. Multiscale structural similarity for image quality assessment. In Asilomar Conference on Signals, Systems and Computers, 2003.
|
| 201 |
+
|
| 202 |
+
Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
|
| 203 |
+
|
| 204 |
+
Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. arXiv preprint arXiv:1805.08318, 2018.
|
| 205 |
+
|
| 206 |
+
# A FID AND INCEPTION SCORES ON CIFAR10
|
| 207 |
+
|
| 208 |
+
We present an empirical study with SNDCGAN and ResNet CIFAR architectures on CIFAR10 in figure 5 and figure 6. In addition to Section 3.1, we evaluate one more kind of loss on CIFAR10. Here HG, NS and WGAN stand for hinge loss, non saturating loss and Wasserstein loss respectively. We observe that hinge loss performs very similar to non-saturating loss.
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 5: An empirical study with SNDCGAN and ResNet cifar architectures on CIFAR10. We recover the state of the art results recently reported in Miyato et al. (2018).
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 6: We show the Inception Score for each model within our study which corresponds to recently reported results (Miyato et al., 2018).
|
| 215 |
+
|
| 216 |
+
# B COMPARISON OF FID AND KID METRICS
|
| 217 |
+
|
| 218 |
+
The KID metric introduced by Binkowski et al. ´ (2018) is an alternative to FID. We use models from our Regularization and Normalization study (see Section 3.2) to compare both metrics. Here, by model we denote everything that needs to be specified for the training – including all hyper-parameters, like learning rate, $\lambda$ , Adam’s $\beta$ , etc. The Spearman rank-order correlation coefficient between KID and FID scores is approximately 0.994 for LSUN-BEDROOM and 0.995 for CELEBA-HQ-128 datasets.
|
| 219 |
+
|
| 220 |
+
To evaluate a practical setting of selecting several best models, we compare the intersection between the set of “best $K$ models by FID” and the set of “best $K$ models by KID” for $\bar { K } \in { 5 , 1 0 , 2 0 , 5 0 , 1 0 0 }$ . The results are summarized in Table 2.
|
| 221 |
+
|
| 222 |
+
This experiment suggests that FID and KID metrics are very strongly correlated, and for the practical applications one can choose either of them. Also, the conclusions from our studies based on FID should transfer to studies based on KID.
|
| 223 |
+
|
| 224 |
+
Table 2: Intersection between set of top $K$ experiments selected by FID and KID metrics.
|
| 225 |
+
|
| 226 |
+
<table><tr><td></td><td>LSUN-BEDROOM CELEBA-HQ-128</td></tr><tr><td>K=5 4/5</td><td>2/5</td></tr><tr><td>K=10</td><td>9/10 8/10</td></tr><tr><td>K=20</td><td>18/20 15/20</td></tr><tr><td>K=50 49/50</td><td>46/50</td></tr><tr><td>K=100</td><td>95/100 98/100</td></tr></table>
|
| 227 |
+
|
| 228 |
+
# C ARCHITECTURES
|
| 229 |
+
|
| 230 |
+
# C.1 SNDCGAN
|
| 231 |
+
|
| 232 |
+
We used the same architecture as Miyato et al. (2018), with the parameters copied from the GitHub page5. In Table 3a and Table 3b, we describe the operations in layer column with order. Kernel size is described in format [f ilter h, f ilter $_ - w$ , stride], input shape is $h \times w$ and output shape is $h \times w \times c h a n n e l s$ . The slopes of all lReLU functions are set to 0.1. The input shape $h \times w$ is $1 2 8 \times 1 2 8$ for CELEBA-HQ-128 and LSUN-BEDROOM, $3 2 \times 3 2$ for CIFAR10.
|
| 233 |
+
|
| 234 |
+
Table 3: SNDCGAN architecture.
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
<table><tr><td colspan="2">(a) SNDCGANdiscriminator</td></tr><tr><td>LAYER KERNEL</td><td>OUTPUT</td></tr><tr><td>Conv, IReLU [3,3,1]</td><td>h×w×64</td></tr><tr><td>Conv, IReLU [4,4,2]</td><td>h/2 × w/2 × 128</td></tr><tr><td>Conv, IReLU [3,3,1]</td><td>h/2 × w/2 × 128</td></tr><tr><td>Conv, lReLU [4,4,2]</td><td>h/4 × w/4× 256</td></tr><tr><td>Conv, IReLU [3,3,1]</td><td>h/4 × w/4 × 256</td></tr><tr><td>Conv, IReLU [4,4,2]</td><td>h/8×w/8× 512</td></tr><tr><td>Conv, IReLU [3,3,1]</td><td>h/8×w/8× 512</td></tr><tr><td>Linear 1</td><td>1</td></tr></table>
|
| 238 |
+
|
| 239 |
+
(b) SNDCGAN generator
|
| 240 |
+
|
| 241 |
+
<table><tr><td>LAYER</td><td>KERNEL OUTPUT</td></tr><tr><td>2 1</td><td>128</td></tr><tr><td>Linear, BN, ReLU</td><td>h/8×w/8× 512 1</td></tr><tr><td>Deconv, BN, ReLU [4,4,2]</td><td>h/4 ×w/4 × 256</td></tr><tr><td>Deconv,BN,ReLU</td><td>[4,4,2] h/2 × w/2 × 128</td></tr><tr><td>Deconv, BN, ReLU</td><td>[4,4,2] h×w×64</td></tr><tr><td>Deconv, Tanh [3,3,1]</td><td>h×w×3</td></tr></table>
|
| 242 |
+
|
| 243 |
+
# C.2 RESNET ARCHITECTURE
|
| 244 |
+
|
| 245 |
+
The ResNet19 architecture is described in Table 4. RS column stands for the resample of the residual block, with downscale(D)/upscale(U)/none(-) setting. MP stands for mean pooling and BN for batch normalization. ResBlock is defined in Table 5. The addition layer merges two paths by adding them. The first path is a shortcut layer with exactly one convolution operation, while the second path consists of two convolution operations. The downscale layer and upscale layer are marked in Table 5. We used average pool with kernel [2, 2, 2] for downscale, after the convolution operation. We used unpool from https://github.com/tensorflow/ tensorflow/issues/2169 for upscale, before convolution operation. $h$ and $w$ are the input shape to the ResNet block, output shape depends on the RS parameter. $c _ { i }$ and $c _ { o }$ are the input channels and output channels for a ResNet block. Table 6 described the ResNet CIFAR architecture we used in Figure 5 for reproducing the existing results. Note that RS is set to none for third ResBlock and fourth ResBlock in discriminator. In this case, we used the same ResNet block defined in Table 5 without resampling.
|
| 246 |
+
|
| 247 |
+
Table 4: ResNet 19 architecture corresponding to “resnet small” in https://github.com/ pfnet-research/sngan_projection.
|
| 248 |
+
(a) ResNet19 discriminator
|
| 249 |
+
|
| 250 |
+
<table><tr><td>LAYER</td><td>KERNEL</td><td>RS OUTPUT</td></tr><tr><td>ResBlock</td><td>[3,3,1] D</td><td>64 × 64× 64</td></tr><tr><td>ResBlock</td><td>[3,3,1] D</td><td>32 × 32 ×128</td></tr><tr><td>ResBlock</td><td>[3,3,1] D</td><td>16 ×16× 256</td></tr><tr><td>ResBlock</td><td>[3,3,1] D</td><td>8×8× 256</td></tr><tr><td>ResBlock</td><td>[3,3,1] D</td><td>4 ×4 × 512</td></tr><tr><td>ResBlock</td><td>[3,3,1] D</td><td>2 ×2× 512</td></tr><tr><td>ReLU, MP</td><td>-</td><td>512</td></tr><tr><td>Linear</td><td>- -</td><td>1</td></tr></table>
|
| 251 |
+
|
| 252 |
+
(b) ResNet19 generator
|
| 253 |
+
Table 5: ResNet block definition.
|
| 254 |
+
|
| 255 |
+
<table><tr><td>LAYER</td><td>KERNEL</td><td>RS</td><td>OUTPUT</td></tr><tr><td>2</td><td></td><td>1</td><td>128</td></tr><tr><td>Linear</td><td>-</td><td>1</td><td>4×4× 512</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>U</td><td>8×8×512</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>U</td><td>16 × 16× 256</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>U</td><td>32 × 32 × 256</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>U</td><td>64 × 64 × 128</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>U</td><td>128 × 128 × 64</td></tr><tr><td>BN,ReLU</td><td>1</td><td>1</td><td>128 × 128 × 64</td></tr><tr><td>Conv</td><td>[3,3,1]</td><td>1</td><td>128 × 128× 3</td></tr><tr><td>Sigmoid</td><td>-</td><td>-</td><td>128 × 128 × 3</td></tr></table>
|
| 256 |
+
|
| 257 |
+
(a) ResBlock discriminator
|
| 258 |
+
Table 6: ResNet CIFAR architecture.
|
| 259 |
+
|
| 260 |
+
<table><tr><td>LAYER</td><td>KERNEL</td><td>RS</td><td>OUTPUT</td></tr><tr><td>Shortcut</td><td>[3,3,1]</td><td>D</td><td>h/2 × w/2 × Co</td></tr><tr><td>BN,ReLU</td><td>1</td><td>1</td><td>hxwXCi</td></tr><tr><td>Conv</td><td>[3,3,1]</td><td>-</td><td>h×w×co</td></tr><tr><td>BN,ReLU</td><td>=</td><td>=</td><td>h×w×co</td></tr><tr><td>Conv</td><td>[3,3,1]</td><td>D</td><td>h/2 × w/2 ×Co</td></tr><tr><td>Addition</td><td>-</td><td>-</td><td>h/2 × w/2 × Co</td></tr></table>
|
| 261 |
+
|
| 262 |
+
(b) ResBlock generator
|
| 263 |
+
|
| 264 |
+
<table><tr><td>LAYER</td><td>KERNEL</td><td>RS</td><td>OUTPUT</td></tr><tr><td>Shortcut</td><td>[3,3,1]</td><td>U</td><td>2h× 2w XCo</td></tr><tr><td>BN, ReLU</td><td>1</td><td>-</td><td>h×wXCi</td></tr><tr><td rowspan="3">Conv BN, ReLU</td><td>[3,3,1]</td><td>U</td><td>2h ×2w×Co</td></tr><tr><td>-</td><td>1</td><td>2h × 2w ×Co</td></tr><tr><td>[3,3,1]</td><td>1</td><td>2h ×2w×Co</td></tr><tr><td>Conv Addition</td><td>-</td><td>-</td><td>2h × 2w X Co</td></tr></table>
|
| 265 |
+
|
| 266 |
+
(a) ResNet CIFAR discriminator
|
| 267 |
+
|
| 268 |
+
<table><tr><td>LAYER</td><td>KERNEL</td><td>RS OUTPUT</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>D 16 × 16 × 128</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>D 8×8×128</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>8×8×128 -</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>- 8×8×128</td></tr><tr><td>ReLU, MP</td><td></td><td>128 -</td></tr><tr><td>Linear</td><td>-</td><td>- 1</td></tr></table>
|
| 269 |
+
|
| 270 |
+
(b) ResNet CIFAR generator
|
| 271 |
+
|
| 272 |
+
<table><tr><td>LAYER</td><td>KERNEL</td><td>RS</td><td>OUTPUT</td></tr><tr><td>2</td><td></td><td>-</td><td>128</td></tr><tr><td>Linear</td><td>-</td><td>-</td><td>4×4×256</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>U</td><td>8×8× 256</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>U</td><td>16 × 16 × 256</td></tr><tr><td>ResBlock</td><td>[3,3,1]</td><td>U</td><td>32 × 32 × 256</td></tr><tr><td>BN, ReLU</td><td>1</td><td>1</td><td>32 × 32× 256</td></tr><tr><td>Conv</td><td>[3,3,1]</td><td>-</td><td>32 × 32 × 3</td></tr><tr><td>Sigmoid</td><td>1</td><td>-</td><td>32 × 32 × 3</td></tr></table>
|
| 273 |
+
|
| 274 |
+
# D RESNET ARCHITECTURE ABLATION STUDY
|
| 275 |
+
|
| 276 |
+
We have noticed six minor differences on Resnet architecture comparing to implementation from https: //github.com/pfnet-research/chainer-gan-lib/blob/master/common/net.py (Miyato et al., 2018). We did ablation study to verify the impact of these differences. Figure 7 shows the impact of the ablation study, with details described as following.
|
| 277 |
+
|
| 278 |
+
• DEFAULT: ResNet CIFAR architecture with spectral normalization and non-saturating GAN loss.
|
| 279 |
+
• SKIP: Use input as output for the shortcut connection in the discriminator ResBlock. By default it was a conv layer with 3x3 kernel.
|
| 280 |
+
CIN: Use $c _ { i }$ for the discriminator ResBlock hidden layer output channels. By default it was $c _ { o }$ in our setup, while Miyato et al. (2018) used $c _ { o }$ for first ResBlock and $c _ { i }$ for the rest. OPT: Use an optimized setup for the first discriminator ResBlock, which includes: (1) no ReLU, (2) a conv layer for the shortcut connections, (3) use $c _ { o }$ instead of $c _ { i }$ in ResBlock.
|
| 281 |
+
CIN OPT: Use CIN and OPT together. It means the first ResBlock is optimized while the remaining ResBlocks use $c _ { i }$ for the hidden output channels.
|
| 282 |
+
• SUM: Use reduce sum for the discriminator output. By default it was reduce mean.
|
| 283 |
+
• TAN: Use tanh for the generator output, as well as range [-1, 1] for discriminator input. By default it was sigmoid and discriminator input range [0, 1].
|
| 284 |
+
EPS: Use a bigger epsilon $\mathrm { 2 e - 5 }$ for generator batch normalization. By default it was 1e − 5 in TensorFlow.
|
| 285 |
+
• ALL: Apply all the above differences together.
|
| 286 |
+
|
| 287 |
+
In the ablation study, the CIN experiment obtained the worst FID score. Combining with OPT, the CIN results were improved to the same level as the others which is reasonable because the first block has three input channels, which becomes a bottleneck for the optimization. Hence, using OPT and CIN together performs as well as the others. Overall, the impact of these differences are minor according to the study on CIFAR10.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 7: Ablation study of ResNet architecture differences. The experiment codes are described in Section D.
|
| 291 |
+
|
| 292 |
+
# E RECOMMENDED HYPERPARAMETER SETTINGS
|
| 293 |
+
|
| 294 |
+
To make the future GAN training simpler, we propose a set of best parameters for three setups: (1) Best parameters without any regularizer. (2) Best parameters with only one regularizer. (3) Best parameters with at most two regularizers. Table 7, Table 8 and Table 9 summarize the top 2 parameters for SNDCGAN architecture, ResNet19 architecture and ResNet CIFAR architecture, respectively. Models are ranked according to the median FID score of five different random seeds with fixed hyper-parameters in Table 1a. Note that ranking models according to the best FID score of different seeds will achieve better but unstable result. Gaussian Process optimization hyper-parameters are not included in this table. For ResNet19 architecture with at most two regularizers, we have run it only once due to computational overhead. To show the model stability, we listed the best FID score out of five seeds from the same parameters in column best. Spectral normalization is clearly outperforms the other normalizers on SNDCGAN and ResNet CIFAR architectures, while on ResNet19 both layer normalization and spectral normalization work well.
|
| 295 |
+
|
| 296 |
+
To visualize the FID score on each data set, Figure 8, Figure 9 and Figure 10 show the generated examples by GANs. We select the examples from the best FID run, and then increase the FID score for two more plots.
|
| 297 |
+
|
| 298 |
+
Table 7: SNDCGAN parameters
|
| 299 |
+
|
| 300 |
+
<table><tr><td>DATA SET</td><td>MEDIAN</td><td>BEST</td><td>LR(×10-3)</td><td>β1</td><td>β</td><td>ndisc</td><td>入</td><td>NORM</td></tr><tr><td>CIFAR10</td><td>29.75</td><td>28.66</td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td>1</td><td>1</td></tr><tr><td>CIFAR10</td><td>36.12</td><td>33.23</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>=</td><td>=</td></tr><tr><td>CELEBA-HQ-128</td><td>66.42</td><td>63.13</td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td></td><td>1</td></tr><tr><td>CELEBA-HQ-128</td><td>67.39</td><td>64.59</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>=</td><td>=</td></tr><tr><td>LSUN-BEDROOM</td><td>180.36</td><td>160.12</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td></td><td>1</td></tr><tr><td>LSUN-BEDROOM</td><td>188.99</td><td>162.00</td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td></td><td>1</td></tr><tr><td>CIFAR10</td><td>26.66</td><td>25.27</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td></td><td>SN</td></tr><tr><td>CIFAR10</td><td>27.32</td><td>26.97</td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td></td><td>SN</td></tr><tr><td>CELEBA-HQ-128</td><td>31.14</td><td>29.05</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>=</td><td>SN</td></tr><tr><td>CELEBA-HQ-128</td><td>33.52</td><td>31.92</td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td></td><td>SN</td></tr><tr><td>LSUN-BEDROOM</td><td>63.46</td><td>58.13</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td></td><td>SN</td></tr><tr><td>LSUN-BEDROOM</td><td>74.66</td><td>59.94</td><td>1.000</td><td>0.500</td><td>0.999</td><td>1</td><td>-</td><td>SN</td></tr><tr><td>CIFAR10</td><td>26.23</td><td>26.01</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>1</td><td>SN+GP</td></tr><tr><td>CIFAR10</td><td>26.66</td><td>25.27</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>1</td><td>SN</td></tr><tr><td>CELEBA-HQ-128</td><td>31.13</td><td>30.80</td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td>10</td><td>GP</td></tr><tr><td>CELEBA-HQ-128</td><td>31.14</td><td>29.05</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>1</td><td>SN</td></tr><tr><td>LSUN-BEDROOM</td><td>63.46</td><td>58.13</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>=</td><td>SN</td></tr><tr><td>LSUN-BEDROOM</td><td>66.58</td><td>65.75</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>10</td><td>GP</td></tr></table>
|
| 301 |
+
|
| 302 |
+
Table 8: ResNet19 parameters
|
| 303 |
+
|
| 304 |
+
<table><tr><td>DATA SET</td><td>MEDIAN</td><td>BEST</td><td>LR(×10-3)</td><td>β</td><td>阳</td><td>ndisc</td><td>入</td><td>NORM</td></tr><tr><td>CELEBA-HQ-128</td><td>43.73</td><td>39.10</td><td>0.100</td><td>0.500</td><td>0.999</td><td>5</td><td></td><td></td></tr><tr><td>CELEBA-HQ-128</td><td>43.77</td><td>39.60</td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td>=</td><td>-</td></tr><tr><td>LSUN-BEDROOM</td><td>160.97</td><td>119.58</td><td>0.100</td><td>0.500</td><td>0.900</td><td>5</td><td></td><td></td></tr><tr><td>LSUN-BEDROOM</td><td>161.70</td><td>125.55</td><td>0.100</td><td>0.500</td><td>0.900</td><td>5</td><td>=</td><td>1</td></tr><tr><td>CELEBA-HQ-128</td><td>32.46</td><td>28.52</td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td>=</td><td>LN</td></tr><tr><td>CELEBA-HQ-128</td><td>40.58</td><td>36.37</td><td>0.200</td><td>0.500</td><td>0.900</td><td>1</td><td></td><td>LN</td></tr><tr><td>LSUN-BEDROOM</td><td>70.30</td><td>48.88</td><td>1.000</td><td>0.500</td><td>0.999</td><td>1</td><td></td><td>SN</td></tr><tr><td>LSUN-BEDROOM</td><td>73.84</td><td>60.54</td><td>0.100</td><td>0.500</td><td>0.900</td><td>5</td><td>-</td><td>SN</td></tr><tr><td>CELEBA-HQ-128</td><td>29.13</td><td>=</td><td>0.100</td><td>0.500</td><td>0.900</td><td>5</td><td>1</td><td>LN+DR</td></tr><tr><td>CELEBA-HQ-128</td><td>29.65</td><td></td><td>0.200</td><td>0.500</td><td>0.900</td><td>5</td><td>1</td><td>GP</td></tr><tr><td>LSUN-BEDROOM</td><td>55.72</td><td></td><td>0.200</td><td>0.500</td><td>0.900</td><td>5</td><td>1</td><td>LN+GP</td></tr><tr><td>LSUN-BEDROOM</td><td>57.81</td><td></td><td>0.100</td><td>0.500</td><td>0.999</td><td>1</td><td>10</td><td>SN+GP</td></tr></table>
|
| 305 |
+
|
| 306 |
+
# F WHICH PARAMETERS REALLY MATTER?
|
| 307 |
+
|
| 308 |
+
For each architecture and hyper-parameter we estimate its impact on the final FID. Figure 11 presents heatmaps for hyperparameters, namely the learning rate, $\beta _ { 1 }$ , $\beta _ { 2 }$ , $n _ { d i s c }$ , and $\lambda$ for each combination of neural architecture and data set.
|
| 309 |
+
|
| 310 |
+
# G VARIATIONS OF MS-SSIM
|
| 311 |
+
|
| 312 |
+
We used the MS-SSIM scorer from TensorFlow with default power factors (Wang et al., 2003). Note that the default filter size for each scale layer is 11, the minimum image edge is $1 1 \times 2 ^ { 4 } = 1 7 6$ . To adapt it to CELEBA-HQ-128 data set with size $1 2 8 \times 1 2 8$ , we used the minimum of filter size 11 and image size in last scale layer to allow the computation followed the previous work (Fedus et al., 2018).
|
| 313 |
+
|
| 314 |
+
Table 9: ResNet CIFAR parameters
|
| 315 |
+
|
| 316 |
+
<table><tr><td>DATA SET</td><td>MEDIAN</td><td>BEST</td><td>LR(×10-3)</td><td>β1</td><td>阳</td><td>ndisc</td><td>入</td><td>NORM</td></tr><tr><td>CIFAR10</td><td>31.40</td><td>28.12</td><td>0.200</td><td>0.500</td><td>0.999</td><td>5</td><td>=</td><td>=</td></tr><tr><td>CIFAR10</td><td>33.79</td><td>30.08</td><td>0.100</td><td>0.500</td><td>0.999</td><td>5</td><td>=</td><td>1</td></tr><tr><td>CIFAR10</td><td>23.57</td><td>22.91</td><td>0.200</td><td>0.500</td><td>0.999</td><td>5</td><td>=</td><td>SN</td></tr><tr><td>CIFAR10</td><td>25.50</td><td>24.21</td><td>0.100</td><td>0.500</td><td>0.999</td><td>5</td><td>1</td><td>SN</td></tr><tr><td>CIFAR10</td><td>22.98</td><td>22.73</td><td>0.200</td><td>0.500</td><td>0.999</td><td>1</td><td>1</td><td>SN+GP</td></tr><tr><td>CIFAR10</td><td>23.57</td><td>22.91</td><td>0.200</td><td>0.500</td><td>0.999</td><td>5</td><td>-</td><td>SN</td></tr></table>
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure 8: Examples generated by GANs on CELEBA-HQ-128 data set.
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 9: Examples generated by GANs on LSUN-BEDROOM data set.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 10: Examples generated by GANs on CIFAR10 data set.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
(a) FID score of SNDCGAN on CIFAR10
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
(b) FID score of SNDCGAN on CELEBA-HQ-128
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
(c) FID score of SNDCGAN on LSUN-BEDROOM
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
(d) FID score of ResNet CIFAR on CIFAR10
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
(e) FID score of ResNet19 on CELEBA-HQ-128
|
| 343 |
+
Figure 11: Heat plots for hyper-parameters on each architecture and dataset combination.
|
md/train/rkeT8iR9Y7/rkeT8iR9Y7.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/rkgt0REKwS/rkgt0REKwS.md
ADDED
|
@@ -0,0 +1,564 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CURRICULUM LOSS: ROBUST LEARNING AND GEN-ERALIZATION AGAINST LABEL CORRUPTION
|
| 2 |
+
|
| 3 |
+
Yueming Lyu & Ivor W. Tsang Centre for Artificial Intelligence, University of Technology Sydney yueminglyu@gmail.com, Ivor.Tsang@uts.edu.au
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep neural networks (DNNs) have great expressive power, which can even memorize samples with wrong labels. It is vitally important to reiterate robustness and generalization in DNNs against label corruption. To this end, this paper studies the 0-1 loss, which has a monotonic relationship with empirical adversary (reweighted) risk (Hu et al., 2018). Although the 0-1 loss has some robust properties, it is difficult to optimize. To efficiently optimize the 0-1 loss while keeping its robust properties, we propose a very simple and efficient loss, i.e. curriculum loss (CL). Our CL is a tighter upper bound of the 0-1 loss compared with conventional summation based surrogate losses. Moreover, CL can adaptively select samples for model training. As a result, our loss can be deemed as a novel perspective of curriculum sample selection strategy, which bridges a connection between curriculum learning and robust learning. Experimental results on benchmark datasets validate the robustness of the proposed loss.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Noise corruption is a common phenomenon in our daily life. For instance, noisy corrupted (wrong) labels may be resulted from annotating for similar objects (Su et al., 2012; Yuan et al., 2019), crawling images and labels from websites (Hu et al., 2017; Tanaka et al., 2018) and creating training sets by program (Ratner et al., 2016; Khetan et al., 2018). Learning with noisy labels is thus an promising area.
|
| 12 |
+
|
| 13 |
+
Deep neural networks (DNNs) have great expressive power (model complexity) to learn challenging tasks. However, DNNs also undertake a higher risk of overfitting to the data. Although many regularization techniques, such as adding regularization terms, data augmentation, weight decay, dropout and batch normalization, have been proposed, generalization is still vitally important for deep learning to fully exploit the super-expressive power. Zhang et al. (2017) show that DNNs can even fully memorize samples with incorrectly corrupted labels. Such label corruption significantly degenerates the generalization performance of deep models. This calls a lot of attention on robustness in deep learning with noisy labels.
|
| 14 |
+
|
| 15 |
+
Robustness of 0-1 loss: The problem resulted from data corruption or label corruption is that test distribution is different from training distribution. Hu et al. (2018) analyzed the adversarial risk that the test distribution density is adversarially changed within a limited $f$ -divergence (e.g. KLdivergence) from the training distribution density. They show that there is a monotonic relationship between the (empirical) risk and the (empirical) adversarial risk when the 0-1 loss function is used. This suggests that minimizing the empirical risk with the 0-1 loss function is equivalent to minimize the empirical adversarial risk (worst-case risk). When we train a model based on the corrupted training distribution, we want our model to perform well on the clean distribution. Since we do not know the clean distribution, we want our model to perform well for the worst case estimate of the clean distribution in some constrained set. It is thus natural to employ the worst-case classification risk of the estimated clean distribution as the objective. Note that the worst-case classification risk is an upper bound of the classification risk of the true clean distribution, minimizing the worst-case risk can usually decrease the true risk. When we employ the 0-1 loss, because of the equivalence between the classification risk and the worst-case classification risk, we can directly minimize the classification risk under the corrupted training distribution instead of minimizing the worst-case classification risk.
|
| 16 |
+
|
| 17 |
+
From the learning perspective, the 0-1 loss is more robust to outliers compared with an unbounded (convex) loss (e.g. hinge loss) (Masnadi-Shirazi & Vasconcelos, 2009). This is due to unbounded convex losses putting much weight on the outliers (with a large loss value) when minimizing the losses (Masnadi-Shirazi & Vasconcelos, 2009). If the unbounded (convex) loss is employed in deep network models, this becomes more prominent. Since training loss of deep networks can often be minimized to zero, outlier with a large loss has a large impact on the model. On the other hand, the 0-1 loss treats each training sample equally. Thus, each sample does not have too much influence on the model. Therefore, the model is tolerant of a small number of outliers.
|
| 18 |
+
|
| 19 |
+
Although the 0-1 loss has many robust properties, its non-differentiability and zero gradients make it difficult to optimize. One possible way to alleviate this problem is to seek an upper bound of the 0-1 loss that is still efficient to optimize but tighter than conventional (convex) losses. Such a tighter upper bound of the 0-1 loss can reduce the influence of the noisy outliers compared with conventional (convex) losses. At the same time, it is easier to optimize compared with the 0-1 loss. When minimizing the upper bound surrogate, we expect that the 0-1 loss objective is also minimized.
|
| 20 |
+
|
| 21 |
+
Learnability under large noise rate: The 0-1 loss cannot deal with large noise rate. When the noise rate becomes large, the systematic error (due to label corruption) grows up and becomes not negligible. As a result, the model’s generalization performance will degenerate due to this systematic error. To reduce the systematic error produced by training with noisy labels, several methods have been proposed. They can be categorized into three kinds: transition matrix based method (Sukhbaatar et al., 2014; Patrini et al., 2017; Goldberger & Ben-Reuven, 2017), regularization based method (Miyato et al., 2016) and sample selection based method (Jiang et al., 2018; Han et al., 2018b). Among them, sample selection based method is one promising direction that selects samples to reduce noisy ratio for training. These methods are based on the idea of curriculum learning (Bengio et al., 2009) which is one successful method that trains the model gradually with samples ordered in a meaningful sequence. Although they achieve success to some extents, most of these methods are heuristic based.
|
| 22 |
+
|
| 23 |
+
To efficiently minimize the 0-1 loss while keeping the robust properties, we propose a novel loss that is a tighter upper bound of the 0-1 loss compared with conventional surrogate losses. Specifically, giving any base loss function $l ( u ) ~ \geq ~ \mathbf { 1 } \big ( u < 0 \big ) , u ~ \in ~ \mathbb { R }$ , our loss $Q ( \mathbf { u } )$ satisfies $\begin{array} { r } { \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \le Q ( \mathbf { u } ) \le \sum _ { i = 1 } ^ { n } l \big ( u _ { i } \big ) } \end{array}$ , where $\mathbf { u } = [ u _ { 1 } , \cdots , u _ { n } ]$ with $u _ { i }$ being the classification margin of $i ^ { t h }$ sample, and $\mathbf { 1 } ( \cdot )$ is an indicator function. We name it as Curriculum Loss (CL) because our loss automatically and adaptively selects samples for training, which can be deemed as a curriculum learning paradigm.
|
| 24 |
+
|
| 25 |
+
Our contributions are listed as follows:
|
| 26 |
+
|
| 27 |
+
• We propose a novel loss (i.e. curriculum loss) for robust learning against label corruption. We prove that our CL is a tighter upper bound of 0-1 loss compared with conventional summation based surrogate loss. Moreover, CL can adaptively select samples for stagewise training, which bridges a connection between curriculum learning and robust learning.
|
| 28 |
+
• We prove that CL can be performed by a simple and fast selection algorithm with $\mathcal { O } ( n \bar { \log { n } } )$ time complexity. Moreover, our CL supports mini-batch update, which is convenient to be used as a plug-in in many deep models.
|
| 29 |
+
• We further propose a Noise Pruned Curriculum Loss (NPCL) to address label corruption problem by extending CL to a more general form. Our NPCL automatically prune the estimated noisy samples during training. Moreover, NPCL is also very simple and efficient, which can be used as a plug-in in deep models as well.
|
| 30 |
+
|
| 31 |
+
# 2 CURRICULUM LOSS
|
| 32 |
+
|
| 33 |
+
In this section, we present the framework of our proposed Curriculum Loss (CL). We begin with discussion about robustness of the 0-1 loss in Section 2.1. We then show that our CL is a tighter upper bound of the 0-1 loss compared with conventional summation based surrogate losses in Section 2.2. A tighter bound of the 0-1 loss means that it is less sensitive to the noisy outliers, and it better preserves the robustness of the 0-1 loss with a small rate of label corruption. For a large rate of label corruption, we extend our CL to a Noise Pruned Curriculum Loss (NPCL) to address this issue in Section 2.3. A simple multi-class extension and a novel soft multi-hinge loss are included in the Appendix. All the detailed proofs can be found in the Appendix as well.
|
| 34 |
+
|
| 35 |
+
# 2.1 ROBUSTNESS OF 0-1 LOSS AGAINST LABEL CORRUPTION
|
| 36 |
+
|
| 37 |
+
We rephrase Theorem 1 in (Hu et al., 2018) from a different perspective, which motivates us to employ the 0-1 loss for training against label corruption.
|
| 38 |
+
|
| 39 |
+
Theorem 1. (Monotonic Relationship) $H u$ et al. (Hu et al., 2018)) Let $p ( x , y )$ and $q ( x , y )$ be the training and test density,respectively. Define $r ( x , y ) = q ( x , y ) / p ( x , y )$ and $r _ { i } = r ( x _ { i } , y _ { i } )$ . Let $l ( \widehat { y } , y ) = \mathbf { 1 } { \big ( } s i g n ( \widehat { y } ) \neq y { \big ) }$ and $l ( \widehat { y } , y ) = \mathbf { 1 } \big ( a r g m a x _ { k } ( \widehat { y } _ { k } ) \neq y \big )$ be 0-1 loss for binary classification and multi-class classification, respectively. Let $f ( \cdot )$ be convex with $f ( 1 ) = 0$ . Define risk ${ \mathcal { R } } ( \theta )$ , empirical risk $\widehat { \mathcal { R } } ( \theta )$ , adversarial risk $\mathcal { R } _ { a d v } ( \theta )$ and empirical adversarial risk $\widehat { \mathcal { R } } _ { a d v } ( \theta )$ as
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\begin{array} { r l } & { \mathcal { R } ( \theta ) = \mathbb { E } _ { p ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right] } \\ & { \mathcal { \widehat { R } } ( \theta ) = \displaystyle \frac { 1 } { n } \sum _ { i = 1 } ^ { n } l ( g _ { \theta } ( x _ { i } ) , y _ { i } ) } \\ & { \mathcal { R } _ { a d v } ( \theta ) = \displaystyle \operatorname* { s u p } _ { r \in \mathcal { U } _ { f } } \mathbb { E } _ { p ( x , y ) } \left[ r ( x , y ) l ( g _ { \theta } ( x ) , y ) \right] } \\ & { \mathcal { \widehat { R } } _ { a d v } ( \theta ) = \displaystyle \operatorname* { s u p } _ { { \mathbf { r } \in \widehat { \mathcal { U } } _ { f } } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } r _ { i } l ( g _ { \theta } ( x _ { i } ) , y _ { i } ) , } \end{array}
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
wher $\begin{array} { r } { \mathcal { U } _ { f } = \{ r ( x , y ) | \mathbb { E } _ { p ( x , y ) } [ f ( r ( x , y ) ) ] \leq \delta , \mathbb { E } _ { p ( x , y ) } [ r ( x , y ) ] = 1 , r ( x , y ) \geq 0 , \forall ( x , y ) \in \mathcal { X } \times \mathcal { Y } \} } \end{array}$ and $\begin{array} { r } { \widehat { \mathcal { U } } _ { f } = \big \{ { \bf r } \big | \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f ( r _ { i } ) \leq \delta , \frac { 1 } { n } \sum _ { i = 1 } ^ { n } r _ { i } = 1 , { \bf r } \geq 0 \big \} . } \end{array}$ Then we have that
|
| 46 |
+
|
| 47 |
+
The same monotonic relationship holds between their empirical approximation: $\widehat { \mathcal { R } } ( \theta )$ and $\widehat { \mathcal { R } } _ { a d v }$
|
| 48 |
+
|
| 49 |
+
Theorem 1 (Hu et al., 2018) shows that the monotonic relationship between the (empirical) risk and the (empirical) adversarial risk (worst-case risk) when 0-1 loss function is used. It means that minimizing (empirical) risk is equivalent to minimize the (empirical) adversarial risk (worst-case risk) for 0-1 loss. When we train a model based on the corrupted training distribution $p ( x , y )$ , we want our model to perform well on the clean distribution $q ( x , y )$ . Since we do not know the clean distribution $q$ , we want our model to perform well for the worst-case estimate of the clean distribution, with the assumption that the $f$ -divergence between the corrupted distribution $p$ and the clean distribution $q$ is bounded by $\delta$ . Note that the underlying clean distribution is fixed but unknown, given the corrupted training distribution, the smallest $\delta$ that bounds the divergence between the corrupted distribution and clean distribution measures the intrinsic difficulty of the corruption, and it is also fixed and unknown. The corresponding worst-case distribution w.r.t the smallest $\delta$ is an estimate of the true clean distribution, and this worst-case risk upper bounds the risk of the true clean distribution. In addition, this bound is tighter than the other worst-case risks w.r.t larger $\delta$ . It is natural to use this upper bound as the objective for robust learning. When we use 0-1 loss (that is commonly employed for evaluation), because of the equivalence of the risk and the worst-case risk, we can directly minimize risk under training distribution $p$ instead of directly minimizing the worst-case risk (i.e., the upper bound). Moreover, this enables us to minimize the upper bound without knowing the true $\delta$ beforehand. When the true $\delta$ is small, i.e., the corruption of the training data is not heavy, the upper bound is not too pessimistic. Usually, minimizing the upper bound can decrease the true risk under clean distribution. Particularly, when the clean distribution coincides with the worst-case estimate w.r.t the smallest $\delta$ , minimizing the risk under the corrupted training distribution leads to the same minimizer as minimizing the risk under the clean distribution.
|
| 50 |
+
|
| 51 |
+
# 2.2 TIGHTER UPPER BOUNDS OF THE 0-1 LOSS
|
| 52 |
+
|
| 53 |
+
Unlike commonly used loss functions in machine learning, the non-differentiability and zero gradients of the 0-1 loss make it difficult to optimize. We thus propose a tighter upper bound surrogate loss. We use the classification margin to define the 0-1 loss. For binary classification, classification margin is $u = { \widehat { y } } y$ , where $\widehat { y }$ and $y \in \{ + 1 , - 1 \}$ denotes the prediction and ground truth, respectively. b b(A simple multi-class extension is discussed in the Appendix.) Let $u _ { i } \in \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample for $i \in \{ 1 , . . . , n \}$ . Denote $\mathbf { u } = [ u _ { 1 } , . . . , u _ { n } ]$ . The 0-1 loss objective can be defined as follows:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r } { J ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) . } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Given a base upper bound function $l ( u ) \geq \mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ , the conventional surrogate of the 0-1 loss can be defined as
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { \widehat { J } ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } l ( u _ { i } ) . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Our curriculum loss $Q ( \mathbf { u } )$ can be defined as Eq.(9). $Q ( \mathbf { u } )$ is a tighter upper bound of 0-1 loss $J ( \mathbf { u } )$ compared with the conventional surrogate loss $\widehat { J } ( { \mathbf { u } } )$ , which is summarized in Theorem 2:
|
| 66 |
+
|
| 67 |
+
Theorem 2. (Tighter Bound) Suppose that base loss function $l ( u ) \ \geq \ \mathbf { 1 } ( u < 0 ) , u \ \in \ \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $u _ { i } \in \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample for $i \in \{ 1 , . . . , n \}$ . Denote $\operatorname* { m a x } ( \cdot , \cdot )$ as the maximum between two inputs. Let $\mathbf { u } = [ u _ { 1 } , . . . , u _ { n } ]$ . Define $Q \left( \mathbf { u } \right)$ as follows:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
Q \left( \mathbf { u } \right) = \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , n - \sum _ { i = 1 } ^ { n } v _ { i } + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \big ) .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
Then $J ( \mathbf { u } ) \leq Q \left( \mathbf { u } \right) \leq \widehat { \mathbf { J } } \left( \mathbf { u } \right)$ holds true.
|
| 74 |
+
|
| 75 |
+
Remark: For any fixed $\mathbf { u }$ , we can obtain an optimum solution $\mathbf { v } ^ { * }$ of the partial optimization. The index indicator $\mathbf { v } ^ { * }$ can naturally select samples as a curriculum paradigm for training models. The partial optimization w.r.t index indicator $\mathbf { v }$ can be solved by a very simple and efficient algorithm (Algorithm 1) in ${ \mathcal { O } } ( n \log n )$ . Thus, the loss is very efficient to compute. Moreover, since $\bar { Q } \left( \mathbf { u } \right)$ is tighter than conventional surrogate loss $\widehat { J } ( { \mathbf { u } } )$ , it is less sensitive to outliers compared with $\widehat { J } ( { \mathbf { u } } )$ . Furthermore, it better preserves the robust property of the 0-1 loss against label corruption.
|
| 76 |
+
|
| 77 |
+
The difficulty of optimizing the 0-1 loss is that the 0-1 loss has zero gradients in almost everywhere (except at the breaking point). This issue prevents us from using first-order methods to optimize the 0-1 loss. Eq.(9) provides a surrogate of the 0-1 loss with non-zero subgradient for optimization, while preserving robust properties of the 0-1 loss. Note that our goal is to construct a tight upper bound of the 0-1 loss while maintaining informative (sub)gradients. Eq.(9) balances the 0-1 loss and conventional surrogate by selecting (the trust) samples (index) for training progressively.
|
| 78 |
+
|
| 79 |
+
Updating with all the samples at once is not efficient for deep models, while training with mini-batch is more efficient and well supported for many deep learning tools. We thus propose a batch based curriculum loss $\widehat { Q } ( { \mathbf { u } } )$ given as Eq.(10). We show that $\widehat { Q } ( { \mathbf { u } } )$ is also a tighter upper bound of 0-1 loss objective $J ( \mathbf { u } )$ compared with conventional loss $\widehat { J } ( { \bf u } )$ . This property is summarized in Corollary 1.
|
| 80 |
+
|
| 81 |
+
Corollary 1. (Mini-batch Update) Suppose that base loss function $l ( u ) \geq \mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $b$ , m be the number of batches and batch size, respectively. Let $u _ { i j } \in \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample in batch $j$ for $i \in \{ 1 , . . . , m \}$ and $j \in$ $\{ 1 , . . . , b \}$ . Denote $\mathbf { u } = [ u _ { 1 1 } , . . . , u _ { m b } ]$ . Let $n = m b$ . Define $\widehat { Q } \left( \mathbf { u } \right)$ as follows:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\widehat { Q } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } \operatorname* { m a x } \Big ( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \Big ) .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Then $J ( \mathbf { u } ) \leq Q \left( \mathbf { u } \right) \leq \widehat { Q } \left( \mathbf { u } \right) \leq \widehat { \mathrm { J } } \left( \mathbf { u } \right)$ holds true.
|
| 88 |
+
|
| 89 |
+
Remark: Corollary 1 shows that a batch-based curriculum loss is also a tighter upper bound of 0-1 loss $J ( \mathbf { u } )$ compared with the conventional surrogate loss $\widehat { J } ( { \bf u } )$ . This enables us to train deep models with mini-batch update. Note that random shuffle in different epoch results in a different batch-based curriculum loss. Nevertheless, we at least know that all the induced losses are upper bounds of 0-1 loss objective and are tighter than $\widehat { J } ( { \mathbf { u } } )$ . Moreover, all these losses are induced by the same base loss function $l ( \cdot )$ . Note that, our goal is to minimize the 0-1 loss. Random shuffle leads to a multiple surrogate training scheme. In addition, training deep models without shuffle does not have this issue.
|
| 90 |
+
|
| 91 |
+
We now present another curriculum loss $E \left( \mathbf { u } \right)$ which is tighter than $Q ( \mathbf { u } )$ . $E \left( \mathbf { u } \right)$ is an (scaled) upper bound of 0-1 loss. This property is summarized as Theorem 3.
|
| 92 |
+
|
| 93 |
+
# Algorithm 1 Partial Optimization
|
| 94 |
+
|
| 95 |
+
<table><tr><td>Input: ui for i ∈ {1,..,n}, the selection threshold C; Output: Index set v = (U1, U2,..., Un); Compute the losses li = l(ui) for i= i,., n;</td><td colspan="3"></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Sort samples (index) w.r.t. the losses {i}=1 in a non-decreasing order;</td><td></td><td></td><td>;//Get𝑙≤··≤ln</td></tr><tr><td>Initialize Lo = O; fori=1 to n do</td><td></td><td></td><td></td></tr><tr><td>Li=Li-1+l;</td><td></td><td></td><td></td></tr><tr><td>ifLi≤(C+1-i) then</td><td></td><td></td><td></td></tr><tr><td>Set Ui = 1;</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>else</td><td></td><td></td><td></td></tr><tr><td>Set Ui = O;</td><td></td><td></td><td></td></tr><tr><td>end if</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>end for</td><td></td><td></td><td></td></tr></table>
|
| 96 |
+
|
| 97 |
+
Theorem 3. (Scaled Bound) Suppose that base loss function $l ( u ) \geq \mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $u _ { i } ~ \in ~ \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample for $i \in \{ 1 , . . . , n \}$ . Denote $\mathbf { u } = [ u _ { 1 } , . . . , u _ { n } ]$ . Define $E \left( \mathbf { u } \right)$ as follows:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
E \left( \mathbf { u } \right) = \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , n - \sum _ { i = 1 } ^ { n } v _ { i } \big ) .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Then $J ( \mathbf { u } ) \leq 2 E \left( \mathbf { u } \right) \leq 2 \widehat { \mathbf { J } } \left( \mathbf { u } \right)$ holds true.
|
| 104 |
+
|
| 105 |
+
Remark: $E ( \mathbf { u } )$ has similar properties to $Q ( \mathbf { u } )$ discussed above. Moreover, it is tighter than $Q ( \mathbf { u } )$ , i.e. $E ( \mathbf { u } ) \leq Q ( \mathbf { u } )$ . Thus, it is less sensitive to outliers compared with $Q ( \mathbf { u } )$ . However, $Q ( \mathbf { u } )$ can construct more adaptive curriculum by taking 0-1 loss into consideration during the training process.
|
| 106 |
+
|
| 107 |
+
Directly optimizing $E ( \mathbf { u } )$ is not as efficient as that optimizing $Q ( \mathbf { u } )$ . We now present a batch loss objective $\widehat { E } ( { \bf u } )$ given as Eq.(12). $\widehat { E } ( { \bf u } )$ is also a tighter upper bound of 0-1 loss objective $J ( \mathbf { u } )$ compared with conventional surrogate loss $\widehat { J } ( { \bf u } )$ .
|
| 108 |
+
|
| 109 |
+
Corollary 2. (Mini-batch Update for Scaled Bound) Suppose that base loss function $l ( u ) \geq$ $\mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $b$ , m be the number of batches and batch size, respectively. Let $u _ { i j } \in \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample in batch $j$ for $i \in \{ 1 , . . . , m \}$ and $j \in \{ 1 , . . . , b \}$ . Denote $\mathbf { u } = [ u _ { 1 1 } , . . . , u _ { m b } ]$ . Let $n = m b$ . Define $\widehat { E } ( { \bf u } )$ as follows:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\widehat { E } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } \big ) .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Then $J ( \mathbf { u } ) \leq 2 E \left( \mathbf { u } \right) \leq 2 \widehat { E } \left( \mathbf { u } \right) \leq 2 \widehat { \mathbf { J } } \left( \mathbf { u } \right)$ holds true.
|
| 116 |
+
|
| 117 |
+
All the curriculum losses defined above rely on minimizing a partial optimization problem (Eq.(13)) to find the selection index set $\mathbf { v } ^ { * }$ . We now show that the optimization of $\mathbf { v }$ with given classification margin $u _ { i } \in \mathbb { R } , i \in \{ 1 , . . . , n \}$ can be done in ${ \mathcal { O } } ( n \log n )$ .
|
| 118 |
+
|
| 119 |
+
Theorem 4. (Partial Optimization) Suppose that base loss function $l ( u ) \geq \mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. For fixed $u _ { i } \in \mathbb { R } ,$ , $i \in \{ 1 , . . . , n \}$ , an minimum solution $\mathbf { v } ^ { * }$ of the minimization problem in Eq. (13) can be achieved by Algorithm $^ { l }$ :
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r } { \underset { { \mathbf { v } } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) , } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $C$ is the threshold parameter such that $0 \leq C \leq 2 n$ .
|
| 126 |
+
|
| 127 |
+
Remark: The time complexity of Algorithm 1 is ${ \mathcal { O } } ( n \log n )$ . Moreover, it does not involve complex operations, and is very simple and efficient to compute.
|
| 128 |
+
|
| 129 |
+
Algorithm 1 can adaptively select samples for training. It has some useful properties to help us better understand the objective after partial minimization, we present them in Proposition 1.
|
| 130 |
+
|
| 131 |
+
Proposition 1. (Optimum of Partial Optimization) Suppose that base loss function $l ( u ) \ \geq$ $\mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $u _ { i } \in \mathbb { R }$ for $i \in \{ 1 , . . . , n \}$ be fixed values. Without loss of generality, assume $l ( u _ { 1 } ) \le l ( u _ { 2 } ) \cdot \cdot \cdot \le l ( u _ { n } )$ . Let $\mathbf { v } ^ { * }$ be an optimum solution of the partial optimization problem in Eq.(13). Let $\begin{array} { r } { T ^ { * } = \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } } \end{array}$ and $\begin{array} { r } { L _ { T ^ { * } } = \sum _ { i = 1 } ^ { T ^ { * } } l ( u _ { i } ) } \end{array}$ . Then we have
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { r l } & { L _ { T ^ { * } } \leq C + 1 - T ^ { * } } \\ & { L _ { T ^ { * } + 1 } > C - T ^ { * } } \\ & { L _ { T ^ { * } + 1 } > \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } ) } \\ & { \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \underset { 0 } { \operatorname* { m a x } } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) = \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } ) . } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Remark: When $\begin{array} { r } { C \leq n + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ , Eq.(17) is tighter than the conventional loss $\widehat { J } ( { \mathbf { u } } )$ . When $C \geq n$ , Eq. (17) is a scaled upper bound of 0-1 loss $J ( \mathbf { u } )$ . From Eq.(17) , we know the optimum of the partial optimization problem (13) (i.e. our objective) is $\operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } )$ . When $L _ { T ^ { * } } \geq C - T ^ { * }$ , we can directly optimize $L _ { T ^ { * } }$ with the selected samples for training. When $L _ { T ^ { * } } <$ $C - T ^ { * }$ , note that $L _ { T ^ { * } + 1 } > \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } )$ from Eq.(16), we can optimize $L _ { T ^ { * } + 1 }$ for training. Note that when $T ^ { * } < n$ , we have that $\begin{array} { r } { L _ { T ^ { * } + 1 } \leq L _ { n } = \bar { \sum _ { i = 1 } ^ { n } l ( u _ { i } ) } } \end{array}$ , which is still tighter than the conventional loss $\widehat { J } ( { \bf u } )$ . When $T ^ { * } = n$ , for the parameter $\begin{array} { r } { C \le n + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ , we have that $L _ { T ^ { * } } = { \widehat { J } } ( \mathbf { u } ) \geq J ( \mathbf { u } ) \geq C - n = C - T ^ { * }$ . Thus we can optimize $\operatorname* { m a x } ( L _ { T ^ { * } } , C - \dot { T } ^ { * } ) = \widehat { J } ( \mathbf { u } )$ . In practice, when training with random mini-batch, we find that optimizing $L _ { T ^ { * } }$ in both cases instead of $L _ { T ^ { * } + 1 }$ does not make much influence.
|
| 138 |
+
|
| 139 |
+
# 2.3 NOISE PRUNED CURRICULUM LOSS
|
| 140 |
+
|
| 141 |
+
The curriculum loss in Eq.(9) and Eq.(11) expect to minimize the upper bound of the 0-1 loss for all the training samples. When model capability (complexity) is high, (deep network) model will still attain small (zero) training loss and overfit to the noisy samples.
|
| 142 |
+
|
| 143 |
+
The ideal model is that it correctly classifies the clean training samples and misclassifies the noisy samples with wrong labels. Suppose that the rate of noisy samples (by label corruption) is $\epsilon \in [ 0 , 1 ]$ . The ideal model is to correctly classify the $( 1 - \epsilon ) n$ clean training samples, and misclassify the $\epsilon n$ noisy training samples. This is because the label is corrupted. Correctly classify the training samples with corrupted (wrong) label means that the model has already overfitted to noisy samples. This will harm the generalization to the unseen data.
|
| 144 |
+
|
| 145 |
+
Considering all the above reasons, we thus propose the Noise Pruned Curriculum Loss (NPCL) as
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\mathcal { L } \left( \mathbf { u } \right) = \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) ,
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where $C = ( 1 - \epsilon ) n$ or $\begin{array} { r } { C = ( 1 - \epsilon ) ^ { 2 } n + ( 1 - \epsilon ) \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$
|
| 152 |
+
|
| 153 |
+
When we know there are $\epsilon n$ noisy samples in the training set, we can leverage this as our prior. (The impact of misspecification of the prior is included in the supplement.) When $C = ( 1 - \epsilon ) n$ (assume $C , \epsilon n$ are integers for simplicity), from the selection procedure in Algorithm 1, we know $\boldsymbol { \epsilon } n ^ { 1 }$ $\textstyle \sum _ { i = 1 } ^ { n } v _ { i } \geq ( 1 - \epsilon ) n + 1$ samples with largest losses . Without loss of generality, assume $l ( u )$ will be pruned. This is because $l ( u _ { 1 } ) \le l ( u _ { 2 } ) \cdot \cdot \cdot \le l ( u _ { n } )$ $\begin{array} { r } { C - \sum _ { i = 1 } ^ { n ^ { - } } v _ { i } + 1 \le 0 } \end{array}$ . After when pruning, we have $v _ { ( 1 - \epsilon ) n + 1 } = \cdot \cdot \cdot = v _ { n } = 0$ , the pruned loss becomes
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\widetilde { \mathcal { L } } \left( \mathbf { u } \right) = \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { ( 1 - \epsilon ) n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { ( 1 - \epsilon ) n } v _ { i } l ( u _ { i } ) , ( 1 - \epsilon ) n - \sum _ { i = 1 } ^ { ( 1 - \epsilon ) n } v _ { i } \big ) .
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
It is the basic CL for $( 1 - \epsilon ) n$ samples and it is the upper bound of $\begin{array} { r } { \sum _ { i = 1 } ^ { ( 1 - \epsilon ) n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ . If we prune more noisy samples than clean samples, it will reduce the noise ratio. Then the basic CL can handle. Fortunately, this assumption is supported by the "memorization" effect in deep networks (Arpit et al., 2017), i.e. deep networks tend to learn clean and easy pattern first. Thus, the loss of noisy or hard data tend to remain high for a period (before being overfitted). Therefore, the pruned samples with largest loss are more likely to be the noisy samples. After the rough pruning, the problem becomes optimizing basic CL for the remaining samples as in Eq.(19). Note that our CL is a tight upper bound approximation to the 0-1 loss, it preserves the robust property to some extent. Thus, it can handle case with small noise rate. Specifically, our CL(Eq.19) further select samples from the remaining samples for training adaptively according to the state of training process. This generally will further reduce the noise ratio. Thus, we may expect our NPCL to be robust to noisy samples. Note that, all the above can be done by the simple and efficient Algorithm 1 without explicit pruning samples in a separated step. Namely, our loss can do all these automatically under a unified objective form in Eq.(18).
|
| 160 |
+
|
| 161 |
+
Algorithm 2 Training with Batch Noise Pruned Curriculum Loss
|
| 162 |
+
|
| 163 |
+
<table><tr><td>Input:Number of epochs N,batch size m, noise ratio ∈; Output: The model parameter w; Initialize model parameter w. fork=1 toN do Shuffle training set D;</td></tr><tr><td>while Not fetch all the data from D do</td></tr><tr><td>Fetch a mini-batch D from D;</td></tr><tr><td>Compute losses {i}m1 for data in D; Compute the selection threshold C according to Eq.(21).</td></tr><tr><td>Compute selection index v* by Algorithm 1;</td></tr><tr><td>Update w = w - aVl (Dv-) w.r.t the subset Dv* ofD selected by v*;</td></tr><tr><td>end while end for</td></tr></table>
|
| 164 |
+
|
| 165 |
+
When $C = ( 1 - \epsilon ) n$ , the NPCL in Eq.(18) reduces to basic CL $E ( \mathbf { u } )$ in Eq.(11) with $\epsilon = 0$ . When $\begin{array} { r } { C = ( 1 - \epsilon ) ^ { 2 } n + ( 1 - \epsilon ) \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ , for an ideal target model (that misclassifies noisy samples only), we know that $\begin{array} { r } { \mathbb { E } [ C ] = ( 1 - \epsilon ) ^ { 2 } n + ( 1 - \epsilon ) \mathbb { E } [ \sum _ { i = 1 } ^ { n } { \bf 1 } \big ( u _ { i } < 0 \big ) ] = ( 1 - \epsilon ) ^ { 2 } n + ( 1 - \epsilon ) \epsilon n = } \end{array}$ $( 1 - \epsilon ) n$ . It has similar properties as choosing $C = ( 1 - \epsilon ) n$ . Moreover, it is more adaptive by considering 0-1 loss during training at different stages. In this case, the NPCL in Eq.(18) reduces to the CL $Q ( \mathbf { u } )$ in Eq.(9) when $\epsilon = 0$ . Note that $C$ is a prior, users can defined it based on their domain knowledge.
|
| 166 |
+
|
| 167 |
+
To leverage the benefit of deep learning, we present the batched NPCL as
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\widehat { \mathcal { L } } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , \widehat { C } _ { j } - \sum _ { i = 1 } ^ { m } v _ { i j } \big ) ,
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
where $\widehat { C } _ { j } = ( 1 - \epsilon ) m$ or as in Eq.(21):
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\widehat C _ { j } = ( 1 - \epsilon ) ^ { 2 } m + ( 1 - \epsilon ) \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
Similar to Corollary 1, we know that $\mathcal { L } \left( \mathbf { u } \right) \leq \widehat { \mathcal { L } } \left( \mathbf { u } \right)$ . Thus, optimizing the batched NPCL is indeed minimizing the upper bound of NPCL. This enables us to train the model with mini-batch update, which is very efficient for modern deep learning tools. The training procedure is summarized in Algorithm 2. It uses Algorithm 1 to select a subset of samples from every mini-batch. Then, it uses the selected samples to perform gradient update.
|
| 180 |
+
|
| 181 |
+
# 3 EMPIRICAL STUDY
|
| 182 |
+
|
| 183 |
+
# 3.1 EVALUATION OF ROBUSTNESS AGAINST LABEL CORRUPTION
|
| 184 |
+
|
| 185 |
+
We evaluate our NPCL by comparing Generalized Cross-Entropy (GCE) loss (Zhang & Sabuncu, 2018), Co-teaching (Han et al., 2018b), Co-teaching+ (Yu et al., 2019), MentorNet (Jiang et al., 2018) and standard network training on MNIST, CIFAR10 and CIFAR100 dataset as in (Han et al., 2018b; Patrini et al., 2017; Goldberger & Ben-Reuven, 2017). Two types of random label corruption, i.e. Symmetry flipping (Van Rooyen et al., 2015) and Pair flipping (Han et al., 2018a), are considered in this work. Symmetry flipping is that the corrupted label is uniformly assign to one of $K - 1$ incorrect classes. Pair flipping is that the corrupted label is assign to one specific class similar to the ground truth. The noise rate $\epsilon$ of label flipping is chosen from $\{ 2 0 \% , 5 0 \% , 3 5 \% \}$ as a representative. As a robust loss function, we further compare NPCL with GCE loss in detail with noise rate in $\{ 0 \% , 1 0 \%$ , $2 0 \%$ , $3 0 \%$ , $4 0 \%$ , $5 0 \% \}$ . We employ same network architecture and network hyperparameters as in Co-teaching (Han et al., 2018b) for all the methods in comparison. Specifically, the batch size and the number of epochs is set to $m = 1 2 8$ and $N = 2 0 0$ , respectively. The Adam optimizer with the same parameter as (Han et al., 2018b) is employed. The architecture of neural network is presented in Appendix L. For NPCL, we employ hinge loss as the base upper bound function of 0-1 loss. In the first few epochs, we train model using full batch with soft hinge loss (in the supplement) as a burn-in period suggested in (Jiang et al., 2018). Specifically, we start NPCL at $5 ^ { t h }$ epoch on MNIST and $1 \dot { 0 } ^ { t h }$ epoch on CIFAR10 and CIFAR100, respectively. For Coteaching (Han et al., 2018b) and MentorNet in (Jiang et al., 2018), we employ the open sourced code of $\mathrm { C o }$ -teaching (Han et al., 2018b). For Co-teaching $^ +$ (Yu et al., 2019), we employ the code provided by the authors. We implement NPCL by Pytorch. For NPCL, Co-teaching and Co-teaching+, we employ the true noise rate as parameter. Experiments are performed five independent runs. The error bar for STD is shaded.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 1: Test accuracy and label precision vs. number of epochs on MNIST dataset.
|
| 189 |
+
|
| 190 |
+
For performance measurements, we employ both test accuracy and label precision as in (Han et al., 2018b). Label precision is defined as $:$ number of clean samples / number of selected samples, which measures the selection accuracy for sample selection based methods. A higher label precision in the mini-batch after sample selection can lead to a update with less noisy samples, which means that model suffers less influence of noisy samples and thus preforms more robustly to label corruption.
|
| 191 |
+
|
| 192 |
+
The pictures of test accuracy and label precision vs. number of epochs on MNIST are presented in Figure 1. The results on CIFAR10 and CIFAR100 are shown in Figure 5 and Figure 6 in Appendix, respectively. It shows that NCPL achieves superior performance compared with GCE loss in terms of test accuracy. Particularly, NPCL obtains significant better performance compared with GCE loss in hard cases: Symmetry- $50 \%$ and Pair-flip- $35 \%$ , which shows that NPCL is more robust to label corruption compared with GCE loss. Moreover, NPCL obtains better performance on MNIST, and competitive performance on CIFAR10 and CIFAR100 compared with Co-teaching. Furthermore, NPCL achieves better performance than Co-teaching+ on CIFAR10 and two cases on MNIST. In addition, we find that Co-teaching $^ +$ is not stable on CIFAR100 with $50 \%$ symmetric noise. Note that NPCL is a simple plug-in for a single network, while Co-teaching/Co-teaching+ employs two networks to train the model concurrently. Thus, both the space complexity and time complexity of Co-teaching/Co-teaching+ is doubled compared with our NPCL.
|
| 193 |
+
|
| 194 |
+
Both our NPCL and Generalized Cross Entropy (GCE) loss are robust loss functions as plug-in for single network. Thus, we provide a more detailed comparison between our NPCL and GCE loss with noise rate in $\{ 0 \%$ , $1 0 \%$ , $2 0 \%$ , $3 0 \%$ , $4 0 \%$ , $5 0 \% \}$ . The experimental results on CIFAR10 are presented in Figure 3. The experimental results on CIFAR100 and MNIST are provided in Figure 8 and Figure 7 in Appendix.From Figure 3, Figure 8 and Figure 7, we can observe that NPCL obtains similar and higher test accuracy in all the cases. Moreover, from Figure 3 and Figure 7, we can see that NPCL achieves similar test accuracy compared with the GCE loss when the noise rate is small. The improvement increases with the increase of the noise rate. Particularly, NPCL obtains remarkable improvement compared with the GCE loss on CIFAR10 with noise rate $50 \%$ . It shows that NPCL is more robust compared with GCE loss against label corruption. GCE loss employs all samples for training, while NPCL prunes the noisy samples adaptively. As a result, GCE loss still employs samples with wrong labels for training, which misleads the model. Thus, NPCL obtains better performance when the noise rate becomes large.
|
| 195 |
+
|
| 196 |
+
# 3.2 MORE EXPERIMENTS WITH DIFFERENT NETWORK ARCHITECTURES
|
| 197 |
+
|
| 198 |
+
We follow the experiments setup in (Lee et al., 2019). We use the online code of (Lee et al., 2019) , and only change the loss for comparison. We cite the numbers of Softmax, RoG and D2L (Ma et al., 2018) in (Lee et al., 2019) for comparison.
|
| 199 |
+
|
| 200 |
+
The test accuracy results on uniform noise, semantic noise and open-set noise are shown in Table 1, Table 2 and Table 3, respectively. From Table 1, we can observe that both NPCL and CL outperforms Softmax (cross-entropy) and RoG (cross-entropy) on five cases for uniform noise. Note that RoG is an ensemble method, while CL/NPCL is a single loss for network training, one can combine them to boost the performance. From Table 2, we can see that CL obtains consistently better performance than cross-entropy and D2L (Ma et al., 2018) for the semantic noise. Table 3 shows that NPCL achieves competitive performance compared with RoG for open-set noise.
|
| 201 |
+
|
| 202 |
+
Table 1: Test accuracy $\% )$ of DenseNet on CIFAR10 and CIFAR100.
|
| 203 |
+
|
| 204 |
+
<table><tr><td rowspan=2 colspan=1>Noise type</td><td rowspan=1 colspan=4>CIFAR10</td><td rowspan=1 colspan=4>CIFAR100</td></tr><tr><td rowspan=1 colspan=1>NPCL</td><td rowspan=1 colspan=1>CL</td><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=1>RoG</td><td rowspan=1 colspan=1>NPCL</td><td rowspan=1 colspan=1>CL</td><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=1>RoG</td></tr><tr><td rowspan=1 colspan=1>uniform (20%)</td><td rowspan=1 colspan=1>89.49</td><td rowspan=1 colspan=1>89.32</td><td rowspan=1 colspan=1>81.01</td><td rowspan=1 colspan=1>87.41</td><td rowspan=1 colspan=1>64.88</td><td rowspan=1 colspan=1>67.92</td><td rowspan=1 colspan=1>61.72</td><td rowspan=1 colspan=1>64.29</td></tr><tr><td rowspan=1 colspan=1>uniform (40%)</td><td rowspan=1 colspan=1>83.24</td><td rowspan=1 colspan=1>85.57</td><td rowspan=1 colspan=1>72.34</td><td rowspan=1 colspan=1>81.83</td><td rowspan=1 colspan=1>56.34</td><td rowspan=1 colspan=1>58.63</td><td rowspan=1 colspan=1>50.89</td><td rowspan=1 colspan=1>55.68</td></tr><tr><td rowspan=1 colspan=1>uniform (60%)</td><td rowspan=1 colspan=1>66.2</td><td rowspan=1 colspan=1>68.52</td><td rowspan=1 colspan=1>55.42</td><td rowspan=1 colspan=1>75.45</td><td rowspan=1 colspan=1>44.49</td><td rowspan=1 colspan=1>46.65</td><td rowspan=1 colspan=1>38.33</td><td rowspan=1 colspan=1>44.12</td></tr></table>
|
| 205 |
+
|
| 206 |
+
Table 2: Test accuracy $\left( \% \right)$ of DenseNet on CIFAR10 and CIFAR100 with semantic noise.
|
| 207 |
+
|
| 208 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Label generator (noise rate)</td><td rowspan=1 colspan=1>NPCL</td><td rowspan=1 colspan=1>CL</td><td rowspan=1 colspan=1>Cross-entropy</td><td rowspan=1 colspan=1>D2L</td></tr><tr><td rowspan=3 colspan=1>CIFAR10</td><td rowspan=1 colspan=1>DenseNet(32%)</td><td rowspan=1 colspan=1>66.5</td><td rowspan=1 colspan=1>67.45</td><td rowspan=1 colspan=1>67.24</td><td rowspan=1 colspan=1>66.91</td></tr><tr><td rowspan=1 colspan=1>ResNet(38%)</td><td rowspan=1 colspan=1>61.88</td><td rowspan=1 colspan=1>62.88</td><td rowspan=1 colspan=1>62.26</td><td rowspan=1 colspan=1>59.10</td></tr><tr><td rowspan=1 colspan=1>VGG(34%)</td><td rowspan=1 colspan=1>68.37</td><td rowspan=1 colspan=1>69.61</td><td rowspan=1 colspan=1>68.77</td><td rowspan=1 colspan=1>57.97</td></tr><tr><td rowspan=3 colspan=1>CIFAR100</td><td rowspan=1 colspan=1>DenseNet(34%)</td><td rowspan=1 colspan=1>57.59</td><td rowspan=1 colspan=1>55.14</td><td rowspan=1 colspan=1>50.72</td><td rowspan=1 colspan=1>5.00</td></tr><tr><td rowspan=1 colspan=1>ResNet(37%)</td><td rowspan=1 colspan=1>54.49</td><td rowspan=1 colspan=1>53.20</td><td rowspan=1 colspan=1>50.68</td><td rowspan=1 colspan=1>23.71</td></tr><tr><td rowspan=1 colspan=1>VGG(37%)</td><td rowspan=1 colspan=1>55.41</td><td rowspan=1 colspan=1>52.71</td><td rowspan=1 colspan=1>51.08</td><td rowspan=1 colspan=1>40.97</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 3: Test accuracy $( \% )$ of DenseNet on CIFAR10 with open-set noise.
|
| 211 |
+
|
| 212 |
+
<table><tr><td rowspan=1 colspan=1>Open-set Data</td><td rowspan=1 colspan=1>NPCL</td><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=1>RoG</td></tr><tr><td rowspan=1 colspan=1>CIFAR100</td><td rowspan=1 colspan=1>82.85</td><td rowspan=1 colspan=1>79.01</td><td rowspan=1 colspan=1>83.37</td></tr><tr><td rowspan=1 colspan=1>ImageNet</td><td rowspan=1 colspan=1>87.95</td><td rowspan=1 colspan=1>86.88</td><td rowspan=1 colspan=1>87.05</td></tr><tr><td rowspan=1 colspan=1>CIFAR100-ImageNet</td><td rowspan=1 colspan=1>84.28</td><td rowspan=1 colspan=1>81.58</td><td rowspan=1 colspan=1>84.35</td></tr></table>
|
| 213 |
+
|
| 214 |
+
We further evaluate the performance of CL/NPCL on the Tiny-ImageNet dataset. We use the ResNet18 network as the test-bed. For GCE loss, we employ the default hyper-parameter $q = 0 . 7$ in all cases. All the methods are performed five runs with seeds $\{ 1 , 2 , 3 , 4 , 5 \}$ . The curve of mean test accuracy (shaded in std) are provided in Figure 2. We can see that NPCL and CL obtain higher test accuracy than generalized cross-entropy loss and stand cross-entropy loss on both cases. Note that CL does not have parameters, it is much convenient to use.
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 2: Test accuracy $( \% )$ on Tiny-ImageNet dataset with symmetric noise
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure 3: Test accuracy vs. number of epochs on CIFAR10 dataset.
|
| 221 |
+
|
| 222 |
+
# 4 CONCLUSION AND FURTHER WORK
|
| 223 |
+
|
| 224 |
+
In this work, we proposed a curriculum loss (CL) for robust learning. Theoretically, we analyzed the properties of CL and proved that it is tighter upper bound of the 0-1 loss compared with conventional summation based surrogate losses. We extended our CL to a more general form (NPCL) to handle large rate of label corruption. Empirically, experimental results on benchmark datasets show the robustness of the proposed loss. As a further work, we may improve our CL to handle imbalanced distribution by considering diversity for each class. Moreover, it is interesting to investigate the influence of different base loss functions in CL and NPCL.
|
| 225 |
+
|
| 226 |
+
# ACKNOWLEDGEMENT
|
| 227 |
+
|
| 228 |
+
We sincerely thank the reviewers for their insightful comments and suggestions. This paper was supported by Australian Research Council grants DP180100106 and DP200101328.
|
| 229 |
+
|
| 230 |
+
# REFERENCES
|
| 231 |
+
|
| 232 |
+
Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In ICML, pp. 233–242, 2017.
|
| 233 |
+
|
| 234 |
+
Peter L Bartlett, Michael I Jordan, and Jon D McAuliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138–156, 2006.
|
| 235 |
+
|
| 236 |
+
Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML, pp. 41–48. ACM, 2009.
|
| 237 |
+
|
| 238 |
+
Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. In ICLR, 2017.
|
| 239 |
+
|
| 240 |
+
Bo Han, Jiangchao Yao, Gang Niu, Mingyuan Zhou, Ivor Tsang, Ya Zhang, and Masashi Sugiyama. Masking: A new perspective of noisy supervision. In Advances in Neural Information Processing Systems, pp. 5836–5846, 2018a.
|
| 241 |
+
|
| 242 |
+
Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in Neural Information Processing Systems, pp. 8527–8537, 2018b.
|
| 243 |
+
|
| 244 |
+
Mengqiu Hu, Yang Yang, Fumin Shen, Luming Zhang, Heng Tao Shen, and Xuelong Li. Robust web image annotation via exploring multi-facet and structural knowledge. IEEE Transactions on Image Processing, 26(10):4871–4884, 2017.
|
| 245 |
+
|
| 246 |
+
Weihua Hu, Gang Niu, Issei Sato, and Masashi Sugiyama. Does distributionally robust supervised learning give robust classifiers? 2018.
|
| 247 |
+
|
| 248 |
+
Lu Jiang, Deyu Meng, Shoou-I Yu, Zhenzhong Lan, Shiguang Shan, and Alexander Hauptmann. Self-paced learning with diversity. In Advances in Neural Information Processing Systems, pp. 2078–2086, 2014.
|
| 249 |
+
|
| 250 |
+
Lu Jiang, Deyu Meng, Qian Zhao, Shiguang Shan, and Alexander G Hauptmann. Self-paced curriculum learning. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015.
|
| 251 |
+
|
| 252 |
+
Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning datadriven curriculum for very deep neural networks on corrupted labels. 2018.
|
| 253 |
+
|
| 254 |
+
Ashish Khetan, Zachary C Lipton, and Anima Anandkumar. Learning from noisy singly-labeled data. ICLR, 2018.
|
| 255 |
+
|
| 256 |
+
M Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In Advances in Neural Information Processing Systems, pp. 1189–1197, 2010.
|
| 257 |
+
|
| 258 |
+
Kimin Lee, Sukmin Yun, Kibok Lee, Honglak Lee, Bo Li, and Jinwoo Shin. Robust inference via generative classifiers for handling noisy labels. In International Conference on Machine Learning, 2019.
|
| 259 |
+
|
| 260 |
+
Xingjun Ma, Yisen Wang, Michael E Houle, Shuo Zhou, Sarah M Erfani, Shu-Tao Xia, Sudanthi Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. In International Conference on Machine Learning, 2018.
|
| 261 |
+
|
| 262 |
+
Hamed Masnadi-Shirazi and Nuno Vasconcelos. On the design of loss functions for classification: theory, robustness to outliers, and savageboost. In Advances in neural information processing systems, pp. 1049–1056, 2009.
|
| 263 |
+
|
| 264 |
+
Takeru Miyato, Andrew M Dai, and Ian Goodfellow. Virtual adversarial training for semi-supervised text classification. In ICLR, 2016.
|
| 265 |
+
|
| 266 |
+
Robert Moore and John DeNero. L1 and l2 regularization for multiclass hinge loss models. In Symposium on Machine Learning in Speech and Language Processing, 2011.
|
| 267 |
+
|
| 268 |
+
Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1944–1952, 2017.
|
| 269 |
+
|
| 270 |
+
Alexander J Ratner, Christopher M De Sa, Sen Wu, Daniel Selsam, and Christopher Ré. Data programming: Creating large training sets, quickly. In Advances in neural information processing systems, pp. 3567–3575, 2016.
|
| 271 |
+
|
| 272 |
+
Hao Su, Jia Deng, and Li Fei-Fei. Crowdsourcing annotations for visual object detection. In Workshops at the Twenty-Sixth AAAI Conference on Artificial Intelligence, 2012.
|
| 273 |
+
|
| 274 |
+
Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. arXiv preprint arXiv:1406.2080, 2014.
|
| 275 |
+
|
| 276 |
+
Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5552–5560, 2018.
|
| 277 |
+
|
| 278 |
+
Brendan Van Rooyen, Aditya Menon, and Robert C Williamson. Learning with symmetric label noise: The importance of being unhinged. In Advances in Neural Information Processing Systems, pp. 10–18, 2015.
|
| 279 |
+
|
| 280 |
+
Yichao Wu and Yufeng Liu. Robust truncated hinge loss support vector machines. Journal of the American Statistical Association, 102(479):974–983, 2007.
|
| 281 |
+
|
| 282 |
+
Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? In International Conference on Machine Learning, pp. 7164–7173, 2019.
|
| 283 |
+
|
| 284 |
+
Yuan Yuan, Yueming Lyu, Xi Shen, Ivor W. Tsang, and Dit-Yan Yeung. Marginalized average attentional network for weakly-supervised learning. In ICLR, 2019.
|
| 285 |
+
|
| 286 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. ICLR, 2017.
|
| 287 |
+
|
| 288 |
+
Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in neural information processing systems, pp. 8778–8788, 2018.
|
| 289 |
+
|
| 290 |
+
# A EXPLANATION OF THEOREM 1 FOR ROBUST LEARNING
|
| 291 |
+
|
| 292 |
+
Theorem. (Monotonic Relationship) ( $_ { H u }$ et al., 2018) Let $p ( x , y )$ and $q ( x , y )$ be the training and test density,respectively. Define $r ( x , y ) ~ = ~ q ( x , y ) / p ( x , y )$ and $r _ { i } ~ = ~ r ( x _ { i } , y _ { i } )$ . Let $l ( \widehat { y } , y ) = 1 \big ( s i g n ( \widehat { y } ) \ne y \big )$ and $l ( \widehat { y } , y ) \ = \ \mathbf { 1 } \big ( a r g m a x _ { k } ( \widehat { y } _ { k } ) \neq y \big )$ be 0-1 loss for binary classifib b bcation and multi-class classification, respectively. Let $f ( \cdot )$ be convex with $f ( 1 ) = 0$ . Define risk ${ \mathcal { R } } ( \theta )$ , empirical risk $\widehat { \mathcal { R } } ( \theta )$ , adversarial risk $\mathcal { R } _ { a d v } ( \theta )$ and empirical adversarial risk $\widehat { \mathcal { R } } _ { a d v } ( \theta )$ as
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\begin{array} { r l } & { \mathcal { R } ( \theta ) = \mathbb { E } _ { p ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right] } \\ & { \mathcal { \widehat { R } } ( \theta ) = \displaystyle \frac { 1 } { n } \sum _ { i = 1 } ^ { n } l ( g _ { \theta } ( x _ { i } ) , y _ { i } ) } \\ & { \mathcal { R } _ { a d v } ( \theta ) = \displaystyle \operatorname* { s u p } _ { r \in \mathcal { U } _ { f } } \mathbb { E } _ { p ( x , y ) } \left[ r ( x , y ) l ( g _ { \theta } ( x ) , y ) \right] } \\ & { \mathcal { \widehat { R } } _ { a d v } ( \theta ) = \displaystyle \operatorname* { s u p } _ { { \mathbf { r } \in \widehat { \mathcal { U } } _ { f } } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } r _ { i } l ( g _ { \theta } ( x _ { i } ) , y _ { i } ) , } \end{array}
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
wher $\begin{array} { r } { \mathcal { U } _ { f } = \{ r ( x , y ) | \mathbb { E } _ { p ( x , y ) } [ f ( r ( x , y ) ) ] \leq \delta , \mathbb { E } _ { p ( x , y ) } [ r ( x , y ) ] = 1 , r ( x , y ) \geq 0 , \forall ( x , y ) \in \mathcal { X } \times \mathcal { Y } \} } \end{array}$ and $\begin{array} { r } { \widehat { \mathcal { U } } _ { f } = \big \{ { \bf r } \big | \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f ( r _ { i } ) \leq \delta , \frac { 1 } { n } \sum _ { i = 1 } ^ { n } r _ { i } = 1 , { \bf r } \geq 0 \big \} . } \end{array}$ Then we have that
|
| 299 |
+
|
| 300 |
+
The same monotonic relationship holds between their empirical approximation: $\widehat { \mathcal { R } } ( \theta )$ and $\widehat { \mathcal { R } } _ { a d v }$
|
| 301 |
+
|
| 302 |
+
Hu et al. (2018) show that minimizing (empirical) risk is equivalent to minimize the (empirical) adversarial risk (worst-case risk) for 0-1 loss. Thus, we can directly optimize the risk instead of the worst-case risk. Specifically, suppose we have an observable training distribution $p ( x , y )$ . The observable distribution $p ( x , y )$ may be corrupted from an underlying clean distribution $q ( x , y )$ . We train a model based on the training distribution $p ( x , y )$ , and we want our model to perform well on the clean distribution $q ( x , y )$ . Since we do not know the clean distribution $q ( x , y )$ , we want our model to perform well for the worst-case estimate of the clean distribution, with the assumption that the $f$ -divergence between the corrupted distribution $p$ and the clean distribution $q$ is bounded by $\delta$ . Note that the underlying clean distribution is fixed but unknown, given the corrupted training distribution, the smallest $\delta$ that bounds the divergence between the corrupted distribution and clean distribution measures the intrinsic difficulty of the corruption, and it is also fixed and unknown. The corresponding worst-case distribution w.r.t the smallest $\delta$ is an estimate of the true clean distribution, and this worst-case risk upper bounds the risk of the true clean distribution. In addition, this bound is tighter than the other worst-case risks w.r.t larger $\delta$ . Formally, the upper bound w.r.t the smallest $\delta$ is given as
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
G ( \theta ) : = \operatorname* { s u p } _ { q \in \widetilde { \mathcal { U } } _ { f } } \mathbb { E } _ { q ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right]
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
where $\widetilde { \mathcal { U } } _ { f }$ is an equivalent constrainted set w.r.t $\mathcal { U } _ { f }$ for $q ( x , y )$ . Then, we have
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
G ( \theta ) : = \operatorname* { s u p } _ { q \in \tilde { \mathcal { M } } _ { f } } \mathbb { E } _ { q ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right] = \operatorname* { s u p } _ { r \in \mathcal { U } _ { f } } \mathbb { E } _ { p ( x , y ) } \left[ r ( x , y ) l ( g _ { \theta } ( x ) , y ) \right]
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
When $l ( \cdot )$ is 0-1 loss, from Theorem 1, we know that minimize $G ( \theta )$ is equivalent to minimize $\widetilde G ( \theta )$ .
|
| 315 |
+
Thus, we can minimize $\widetilde G ( \boldsymbol { \theta } )$ instead of $G ( \theta )$ .
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\widetilde G ( \theta ) : = \mathbb { E } _ { p ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right]
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
Minimize the Eq.(30) enables us to minimize the Eq.(28) without knowing the true divergence parameter $\delta$ beforehand. Usually, minimizing the upper bound can decrease the true risk under clean distribution. Particularly, when the clean distribution coincides with the worst-case estimate w.r.t the smallest $\delta$ , minimizing the risk under the corrupted training distribution leads to the same minimizer as minimizing the risk under the clean distribution.
|
| 322 |
+
|
| 323 |
+
# Relationship between label corruption and general corruption
|
| 324 |
+
|
| 325 |
+
Label corruption is a special case of general corruption. Label corruption restricts the corruption in the space $\mathcal { V }$ instead of the space $\mathcal { X } \times \mathcal { V }$ . That is to say, the training distribution $p ( x )$ is same as the clean distribution $q ( x )$ over $\mathcal { X }$ . Then, we have the robust risk for label corruption as
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
G _ { y } ( \theta ) : = \operatorname* { s u p } _ { q \in \widetilde { \mathcal { U } } _ { f } \cap H } \mathbb { E } _ { q ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right]
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
where $H : = \{ q ( x , y ) | q ( x ) = p ( x ) , \forall ( x , y ) \in \mathcal { X } \times \mathcal { Y } \}$ . The supremum in $G _ { y } ( \theta )$ is taken over $\widetilde { \mathcal { U } } _ { f } \cap H$ , while the supremum in $G ( \theta )$ is taken over $\widetilde { \mathcal { U } } _ { f }$ . Due to the additional constrain $q ( x ) =$ $p \bar { ( \boldsymbol { x } ) } , \forall ( \boldsymbol { x } , \boldsymbol { y } ) \in \mathcal { X } \times \mathcal { Y }$ , we thus know that the robust risk $G _ { y } ( \theta )$ is bounded by $G ( \theta )$ , i.e., $G _ { y } ( \theta ) \leq$ $G ( \theta )$ . Moreover, it is more piratical and important to be robust for both label corruption and feature corruption.
|
| 332 |
+
|
| 333 |
+
# B PROOF OF THEOREM 2
|
| 334 |
+
|
| 335 |
+
Proof. Because $\mathbf { 1 } ( u < 0 ) \leq l ( u )$ , we have $\textstyle \sum _ { i = 1 } ^ { n } l ( u _ { i } ) \geq \sum _ { i = 1 } ^ { n } \mathbf { 1 } { \big ( } u _ { i } < 0 { \big ) }$ . Then
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\begin{array} { r l } & { Q \left( \mathbf { u } \right) = \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { n } { v _ { i } l ( u _ { i } ) } , n - \sum _ { i = 1 } ^ { n } { v _ { i } } + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \right) } \\ & { \quad \le \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { n } l ( u _ { i } ) , n - \sum _ { i = 1 } ^ { n } 1 + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \right) } \\ & { \quad = \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { n } l ( u _ { i } ) , \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \right) } \\ & { \quad = \sum _ { i = 1 } ^ { n } l ( u _ { i } ) } \end{array}
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
Since loss $\begin{array} { r } { \widehat { J } ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } l ( u _ { i } ) } \end{array}$ , we obtain $Q \left( \mathbf { u } \right) \leq \widehat { J } \left( \mathbf { u } \right)$ .
|
| 342 |
+
|
| 343 |
+
On the other hand, we have that
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\begin{array} { r l } & { Q \left( \mathbf { u } \right) = \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { n } { v _ { i } l ( u _ { i } ) } , n - \sum _ { i = 1 } ^ { n } { v _ { i } } + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \right) } \\ & { \qquad \quad \geq _ { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } n - \sum _ { i = 1 } ^ { n } v _ { i } + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \\ & { \qquad = \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
Since $\begin{array} { r } { J ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ , we obtain $Q \left( \mathbf { u } \right) \geq J \left( \mathbf { u } \right)$
|
| 350 |
+
|
| 351 |
+
# C PROOF OF COROLLARY 1
|
| 352 |
+
|
| 353 |
+
Proof. Since $n = m b$ , similar to the proof of $Q \left( \mathbf { u } \right) \leq \widehat { J } \left( \mathbf { u } \right)$ , we have
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\begin{array} { r l } & { \widehat { Q } \left( \mathbf { u } \right) = \mathop { \sum } _ { j = 1 } ^ { b } \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } { \operatorname* { m i n } } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ & { \qquad \leq \mathop { \sum } _ { j = 1 } ^ { b } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } 1 + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ & { = \mathop { \sum } _ { j = 1 } ^ { b } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) , \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ & { = \mathop { \sum } _ { j = 1 } ^ { b } \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) = \widehat { J } \left( \mathbf { u } \right) } \end{array}
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
On the other hand, since the group (batch) separable sum structure, we have that
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\begin{array} { l } { \displaystyle \widehat { Q } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } { \mathrm { m i n } } \underset { \mathbf { \omega } } { \mathrm { m a x } } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ { \displaystyle = \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \sum _ { j = 1 } ^ { b } \underset { \mathbf { \omega } } { \mathrm { m a x } } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ { \displaystyle \geq \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \underset { \mathbf { \omega } } { \mathrm { m a x } } \left( \underset { j = 1 } { \overset { b } { \sum } } \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , n - \underset { j = 1 } { \overset { b } { \sum } } \underset { i = 1 } { \overset { m } { \sum } } v _ { i j } + \sum _ { j = 1 } ^ { b } \underset { i = 1 } { \overset { m } { \sum } } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ { \displaystyle = Q \left( \mathbf { u } \right) \geq J \left( \mathbf { u } \right) } \end{array}
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
# D PROOF OF PARTIAL OPTIMIZATION THEOREM (THEOREM 4)
|
| 366 |
+
|
| 367 |
+
Proof. For simplicity, let $l _ { i } = l ( u _ { i } ) , i \in \{ 1 , . . . , n \}$ . Without loss of generality, assume $l _ { 1 } \leq l _ { 2 } \dotsm \leq$ $l _ { n }$ . Let $\mathbf { v } ^ { * }$ be the solution obtained by Algorithm 1. Assume there exits a $\mathbf { v }$ such that
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l _ { i } , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) < \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) .
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
Let $T = \sum _ { i = 1 } ^ { n } v _ { i }$ and $T ^ { * } = \sum _ { i = 1 } ^ { n } v _ { i } ^ { * }$
|
| 374 |
+
|
| 375 |
+
Case 1: If $T = T ^ { * }$ , then there exists an $v _ { k } = 1$ and $v _ { k } ^ { * } = 0$ . From Algorithm 1, we know $k > T ^ { * }$ $( v _ { k } ^ { * } = 0 \Rightarrow k > T ^ { * } )$ and $l _ { k } \ge l _ { j } , j \in \{ 1 , . . . , T ^ { * } \}$ . Then we know $\sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } \leq \sum _ { i = 1 } ^ { n } v _ { i } l _ { i }$ . Thus, we can achieve that
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\begin{array} { r } { \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) = \operatorname* { m a x } \bigl ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } \big ) } \\ { \leq \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } \big ) . } \end{array}
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
This contradicts the assumption in Eq.(44)
|
| 382 |
+
|
| 383 |
+
Case 2: If $T > T ^ { * }$ , then there exists an $v _ { k } = 1$ and $v _ { k } ^ { * } = 0$ . Let $\mathrm { L } _ { T ^ { * } } = \sum _ { i = 1 } ^ { T ^ { * } } l _ { i }$ . Since $l _ { k } \geq 0$ , we have $\mathrm { L } _ { T ^ { * } } + l _ { k } \geq \mathrm { L } _ { T ^ { * } }$ . From Algorithm 1, we know that $\mathrm { L } _ { \mathrm { T } ^ { * } } + l _ { k } > C - T ^ { * }$ . Thus we obtain that
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r l } { \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } \big ) \geq \mathrm { L } _ { T ^ { * } } + l _ { k } } & { } \\ { \geq \operatorname* { m a x } \big ( \mathrm { L } _ { T ^ { * } } , C - T ^ { * } \big ) } & { } \\ { = \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
This contradicts the assumption in Eq.(44)
|
| 390 |
+
|
| 391 |
+
Case 3: If $T < T ^ { * }$ , we obtain $C - T \geq C - T ^ { * } + 1$ . Then we can achieve that
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\begin{array} { l } { \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) = \operatorname* { m a x } \big ( \mathrm { L } _ { T ^ { * } } , C - T ^ { * } \big ) } \\ { \leq C + 1 - T ^ { * } } \\ { \leq C - T } \\ { = C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } } \\ { \leq \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } \big ) . } \end{array}
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
This contradicts the assumption in Eq.(44).
|
| 398 |
+
|
| 399 |
+
Finally, we conclude that $\mathbf { v } ^ { * }$ obtained by Algorithm 1 is the minimum of the optimization problem given in (13). □
|
| 400 |
+
|
| 401 |
+
# E PROOF OF PROPOSITION 1
|
| 402 |
+
|
| 403 |
+
Proof. Note that $T ^ { * } = \sum _ { i = 1 } ^ { n } v _ { i } ^ { * }$ , from the condition of $v _ { i } ^ { * } = 1$ in Algorithm 1, we know that $L _ { T ^ { * } } \leq$ $C + 1 - T ^ { * }$ . From the condition of $v _ { k } ^ { * } = 0$ in Algorithm 1, we know that $L _ { T ^ { * } + 1 } > C - T ^ { * }$ . Because $l ( u _ { i } ) \geq \mathbf { 1 } ( u _ { i } < 0 ) \geq 0$ for $i \in \{ 1 , . . . , n \}$ , we have $L _ { T ^ { * } + 1 } = L _ { T ^ { * } } + l ( u _ { T ^ { * } + 1 } ) \ge L _ { T ^ { * } }$ . Thus, we obtain $L _ { T ^ { * } + 1 } > \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } )$ . By substitute the optimum $\mathbf { v } ^ { * }$ into the optimization function, we obtain that
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\begin{array} { r l } & { \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \underset { i = 1 } { \operatorname* { m a x } } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) } \\ & { = \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) } \\ & { = \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } ) } \end{array}
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
# F PROOF OF THEOREM 3
|
| 410 |
+
|
| 411 |
+
Proof. We first prove that objective (11) is tighter than the loss objective $\widehat { J } ( { \mathbf { u } } )$ in Eq.(8). After this, we prove that objective (11) is an upper bound of the $_ { 0 / 1 }$ loss defined in equation (7).
|
| 412 |
+
|
| 413 |
+
For simplicity, let $l _ { i } = l ( u _ { i } )$ , we obtain that
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\begin{array} { l } { { \displaystyle E \left( { \bf u } \right) = \operatorname* { m i n } _ { { \bf v } \in \{ 0 , 1 \} ^ { n } } \operatorname* { m a x } ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , n - \sum _ { i = 1 } ^ { n } v _ { i } ) } \ ~ } \\ { { \displaystyle \quad \leq \operatorname* { m a x } ( \sum _ { i = 1 } ^ { n } l ( u _ { i } ) , ( n - \sum _ { i = 1 } ^ { n } 1 ) ) } \ ~ } \\ { { \displaystyle \quad = \sum _ { i = 1 } ^ { n } l ( u _ { i } ) . } } \end{array}
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
Note that ${ \widehat { J } } \left( { \bf u } \right) = \sum _ { i = 1 } ^ { n } l ( u _ { i } )$ , thus, we have $E \left( \mathbf { u } \right) \leq \widehat { J } \left( \mathbf { u } \right)$ .
|
| 420 |
+
|
| 421 |
+
Without loss of generality, assume $l _ { 1 } ~ \le ~ l _ { 2 } \dots ~ \le ~ l _ { n }$ . Let $\mathrm { L } _ { i } ~ = ~ \sum _ { j = 1 } ^ { i } l _ { j }$ , $\mathrm { ~ T ~ } = \sum _ { i = 1 } ^ { n } v _ { i } ^ { * }$ , where $\mathbf { v } ^ { * } { = } [ v _ { 1 } ^ { * } , v _ { 2 } ^ { * } \cdot \cdot \cdot v _ { n } ^ { * } ] ^ { T }$ is the optimum of $v$ for fixed $\mathbf { u }$ . Let $k = \sum _ { i = 1 } ^ { n } \mathbf { 1 } ( u _ { i } \geq 0 )$ . Then we achieve that the $_ { 0 / 1 }$ loss $J ( \mathbf { u } )$ is as follows:
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
J ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } \mathbf { 1 } ( u _ { i } < 0 ) { = } n - k .
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
From Algorithm 1 with $C = n$ , we achieve that $\mathrm { L } _ { \mathrm { T } } \leq n - T + 1$ and $\operatorname { L } _ { \mathrm { T } + 1 } > n - T$ .
|
| 428 |
+
|
| 429 |
+
Case 1: If $k \geq T$ , we can achieve that
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\begin{array} { r l } & { 2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) = 2 \operatorname* { m a x } ( \mathrm { L } _ { T } , n - T ) - \left( n - k \right) } \\ & { \qquad \geq 2 ( n - T ) - ( n - k ) } \\ & { \qquad = n + k - 2 T \geq 0 . } \end{array}
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
Case 2: If $k < T , n - T \geq \mathrm { L } _ { T }$ , we can obtain that
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) = 2 ( n - T ) - ( n - k ) = n + k - 2 T .
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
Since $k < T$ , if follows that
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { l } { { \displaystyle \mathrm { L } _ { \mathrm { T } } = \mathrm { L } _ { k } + \sum _ { j = k + 1 } ^ { T } l _ { j } \geq \mathrm { L } _ { k } + \sum _ { j = k + 1 } ^ { T } 1 } } \\ { ~ = \mathrm { L } _ { k } + T - k } \\ { ~ \geq T - k . } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
Together with $n - T \geq \mathrm { L } _ { T }$ , we can obtain that
|
| 448 |
+
|
| 449 |
+
$$
|
| 450 |
+
n - T \geq \mathrm { L } _ { T } \geq T - k \Rightarrow n + k - 2 T \geq 0 .
|
| 451 |
+
$$
|
| 452 |
+
|
| 453 |
+
Thus, we can achieve that
|
| 454 |
+
|
| 455 |
+
$$
|
| 456 |
+
2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) = n + k - 2 T \geq 0 .
|
| 457 |
+
$$
|
| 458 |
+
|
| 459 |
+
Case 3: If $k < T , n - T < \mathrm { L } _ { T }$ , we can obtain that
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\begin{array} { r l } & { 2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) = 2 \operatorname* { m a x } ( \mathrm { L } _ { T } , n - T ) - \left( n - k \right) } \\ & { \qquad = 2 \mathrm { L } _ { T } - \left( n - k \right) } \\ & { \qquad > \left( n - T \right) + \mathrm { L } _ { T } - n + k . } \end{array}
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
From (67), we have $\mathrm { L } _ { \mathrm { T } } \geq T - k$ . Together with (72), it follows that
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) > \left( n - T \right) + \left( T - k \right) - n + k \geq 0 .
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
Finally, we can achieve that $J ( \mathbf { u } ) \leq 2 E \left( \mathbf { u } \right) \leq 2 \widehat { J } \left( \mathbf { u } \right)$ .
|
| 472 |
+
|
| 473 |
+
# G PROOF OF COROLLARY 2
|
| 474 |
+
|
| 475 |
+
Proof. Since $n = m b$ , similar to the proof of $\widehat { Q } \left( \mathbf { u } \right) \leq \widehat { J } \left( \mathbf { u } \right)$ , we have
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\begin{array} { r l } & { \widehat { E } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } { \operatorname* { m i n } } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } \right) } \\ & { \qquad \leq \sum _ { j = 1 } ^ { b } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } 1 \right) } \\ & { \qquad = \sum _ { j = 1 } ^ { b } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) , 0 \right) } \\ & { \qquad = \sum _ { j = 1 } ^ { b } \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) = \widehat { J } \left( \mathbf { u } \right) } \end{array}
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
On the other hand, since the group (batch) separable sum structure, we have that
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\begin{array} { l } { { \displaystyle { \widehat E } \left( { \bf u } \right) = \sum _ { j = 1 } ^ { b } \underset { { \bf v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \mathrm { m a x } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } \right) } } \\ { { \displaystyle \qquad = \underset { { \bf v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \sum _ { j = 1 } ^ { b } \mathrm { m a x } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } \right) } } \\ { { \displaystyle \qquad \geq \underset { { \bf v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \mathrm { m a x } \left( \sum _ { j = 1 } ^ { b } \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , n - \sum _ { j = 1 } ^ { b } \sum _ { i = 1 } ^ { m } v _ { i j } \right) } } \\ { { \displaystyle \qquad = E \left( { \bf u } \right) } } \end{array}
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
Together with Theorem 3, we obtain that $J ( \mathbf { u } ) \leq 2 E \left( \mathbf { u } \right) \leq 2 \widehat { E } \left( \mathbf { u } \right) \leq 2 \widehat { \mathbf { J } } \left( \mathbf { u } \right)$
|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
Figure 4: Training/Test accuracy for soft and hard hinge loss with different optimizer on CIFAR100
|
| 491 |
+
|
| 492 |
+
# H MULTI-CLASS EXTENSION
|
| 493 |
+
|
| 494 |
+
For multi-class classification, denote the groudtruth label as $y \in \{ 1 , . . . , K \}$ . Denote the classification prediction (the last layer output of networks before loss function) as $i _ { i } , i \in \{ 1 , . . . , K \}$ . Then, the classification margin for multi-class classification can be defined as follows
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
u = t _ { y } - \operatorname* { m a x } _ { i \neq y } t _ { i } .
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
We can see that $\mathbf { 1 } { \left( u < 0 \right) } = \mathbf { 1 } { \left( t _ { y } - \operatorname* { m a x } _ { i \neq y } { t _ { i } } < 0 \right) }$ is indeed the 0-1 loss for multi-class classification.
|
| 501 |
+
|
| 502 |
+
With the classification margin $u$ , we can compute the base loss $l ( u ) \ge \mathbf { 1 } ( u < 0 )$ . In this work, we employ the hinge loss. As we need the upper bound of 0-1 loss, the multi-class hard hinge loss function Moore & DeNero (2011) can be defined as
|
| 503 |
+
|
| 504 |
+
$$
|
| 505 |
+
H ( \mathbf { t } , y ) = \operatorname* { m a x } ( 1 - u , 0 ) = \operatorname* { m a x } ( 1 - t _ { y } + \operatorname* { m a x } _ { i \neq y } { t _ { i } , 0 } ) .
|
| 506 |
+
$$
|
| 507 |
+
|
| 508 |
+
The multi-class hard hinge loss in Eq.(81) is not easy to optimize for deep networks. We propose a novel soft multi-class hinge loss function as follows:
|
| 509 |
+
|
| 510 |
+
$$
|
| 511 |
+
S ( \mathbf { t } , y ) = \left\{ \begin{array} { l l } { \operatorname* { m a x } ( 1 - t _ { y } + \operatorname* { m a x } _ { i \neq y } t _ { i } , 0 ) } & { , \ t _ { y } - \operatorname* { m a x } _ { i \neq y } t _ { i } \geq 0 } \\ { \operatorname* { m a x } ( 1 - t _ { y } + \mathrm { L o g } \mathrm { S u m E x p } ( \mathbf { t } ) , 0 ) } & { , \ t _ { y } - \operatorname* { m a x } _ { i \neq y } t _ { i } < 0 . } \end{array} \right.
|
| 512 |
+
$$
|
| 513 |
+
|
| 514 |
+
The soft hinge loss employs the LogSumExp function to approximate the max function when the classification margin is less than zero, i.e., misclassification case. Intuitively, when the sample is misclassified, it is far away from being correctly separate by a positive margin (e.g. margin $u \geq 1 \mathrm { ~ , ~ }$ ). In this situation, a smooth loss function can help speed up gradient update. Because $\mathrm { L o g S u m E x p ( t ) } > \mathrm { m a x } _ { i \in \{ 1 , \cdots K \} } t _ { i }$ we know that the soft hinge loss is an upper bound of the hard hinge loss, i.e., $S ( \mathbf { t } , y ) \ge H ( \mathbf { t } , y )$ . Moreover, we can obtain a new weighted loss $F ( \mathbf { t } , y ; \beta ) =$ $\beta S ( \mathbf { t } , y ) + ( 1 - \beta ) H ( \mathbf { t } , y ) , \beta \in [ 0 , 1 ]$ that is also an upper bound of 0-1 loss.
|
| 515 |
+
|
| 516 |
+
# I EVALUATION OF EFFICIENCY OF THE PROPOSED SOFT-HINGE LOSS
|
| 517 |
+
|
| 518 |
+
We compare our soft multi-class hinge loss with hard multi-class hinge loss Moore & DeNero (2011) on CIFAR100 dataset training with Adam and SGD optimizer, respectively. We keep both the network architecture and hyperparameters same. We employ the default learning rate and momentums of Adam optimizer in PyTorch toolbox, i.e. $l r = 1 0 ^ { - 3 } , \bar { \beta } _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 \bar { 9 }$ . For SGD optimizer, the learning rate $( l r )$ and momentum $( \rho )$ are set to $l r = 1 0 ^ { - 2 }$ and $\rho = 0 . 9$ respectively.
|
| 519 |
+
|
| 520 |
+
The pictures of training/test accuracy v.s number of epochs are presented in Figure 4. We can observe that both the training accuracy and the test accuracy of our soft hinge loss increase greatly fast as the number of epochs increase. In contrast, the training and test accuracy of hard hinge loss grow very slowly. The training accuracy of soft hinge loss can arrive $1 0 0 \%$ trained with both optimizers. Both training and test accuracy of soft hinge loss are consistently better than hard hinge loss. In addition, training accuracy of hard hinge loss can also reach $1 0 0 \%$ when SGD optimizer is used. However, its test accuracy is lowever than that of soft hinge loss.
|
| 521 |
+
|
| 522 |
+
# J IMPACT OF MISSPECIFIED ESTIMATION OF NOISE RATE $\epsilon$
|
| 523 |
+
|
| 524 |
+
We empirically analyze the impact of misspecified prior for the noise rate $\epsilon$ . The average test accuracy over last ten epochs on MNIST for different priors are reported in Table 4. We can observe that NPCL is robust to misspecified prior for small noise cases (Symmetry- $20 \%$ ). Moreover, it becomes a bit more sensitive on large noise case (Symmetry- $50 \%$ ) and on the pair flipping case (Pair- $3 5 \%$ ).
|
| 525 |
+
|
| 526 |
+
Table 4: Average test accuracy of NPCL with different $\epsilon$ on MNIST over last ten epochs
|
| 527 |
+
|
| 528 |
+
<table><tr><td rowspan=1 colspan=1>FlippingRate</td><td rowspan=1 colspan=1>0.5€</td><td rowspan=1 colspan=1>0.75€</td><td rowspan=1 colspan=1>E</td><td rowspan=1 colspan=1>1.25€</td><td rowspan=1 colspan=1>1.5€</td></tr><tr><td rowspan=1 colspan=1>Symmetry-20%</td><td rowspan=1 colspan=1>96.31% ± 0.17%</td><td rowspan=1 colspan=1>97.72%± 0.09%</td><td rowspan=1 colspan=1>99.41% ± 0.01%</td><td rowspan=1 colspan=1>99.55% ± 0.02%</td><td rowspan=1 colspan=1>99.10% ± 0.04%</td></tr><tr><td rowspan=1 colspan=1>Symmetry-50%</td><td rowspan=1 colspan=1>78.67% ± 0.36%</td><td rowspan=1 colspan=1>87.36%±0.29%</td><td rowspan=1 colspan=1>98.53% ±0.02%</td><td rowspan=1 colspan=1>97.92% ±0.06%</td><td rowspan=1 colspan=1>67.61% ± 0.06%</td></tr><tr><td rowspan=1 colspan=1>Pair-35%</td><td rowspan=1 colspan=1>80.59%± 0.40%</td><td rowspan=1 colspan=1>87.86%± 0.48%</td><td rowspan=1 colspan=1>97.90% ± 0.04%</td><td rowspan=1 colspan=1>99.33% ± 0.02%</td><td rowspan=1 colspan=1>86.66% ± 0.08%</td></tr></table>
|
| 529 |
+
|
| 530 |
+
Table 5: Average test accuracy on MNIST over the last ten epochs.
|
| 531 |
+
|
| 532 |
+
<table><tr><td rowspan=1 colspan=1>Flipping-Rate</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>MentorNet</td><td rowspan=1 colspan=1>Co-teaching</td><td rowspan=1 colspan=1>Co-teaching+</td><td rowspan=1 colspan=1>GCE</td><td rowspan=1 colspan=1>NPCL</td></tr><tr><td rowspan=1 colspan=1>Symmetry-20%</td><td rowspan=1 colspan=1>93.78% ±0.04%</td><td rowspan=1 colspan=1>96.68% ±0.05%</td><td rowspan=1 colspan=1>97.14% ±0.03%</td><td rowspan=1 colspan=1>99.41% ± 0.01%</td><td rowspan=1 colspan=1>99.40±0.01%</td><td rowspan=1 colspan=1>99.41% ±0.01%</td></tr><tr><td rowspan=1 colspan=1>Symmetry-50%</td><td rowspan=1 colspan=1>65.81% ± 0.14%</td><td rowspan=1 colspan=1>90.53% ±0.07%</td><td rowspan=1 colspan=1>91.35% ±0.09%</td><td rowspan=1 colspan=1>97.79% ± 0.03%</td><td rowspan=1 colspan=1>92.48±0.13%</td><td rowspan=1 colspan=1>98.53%±0.02%</td></tr><tr><td rowspan=1 colspan=1>Pair-35%</td><td rowspan=1 colspan=1>70.50% ±0.16%</td><td rowspan=1 colspan=1>89.62% ±0.15%</td><td rowspan=1 colspan=1>90.96%±0.18%</td><td rowspan=1 colspan=1>93.81% ± 0.20%</td><td rowspan=1 colspan=1>72.26 ± 0.06%</td><td rowspan=1 colspan=1>97.90% ± 0.04%</td></tr></table>
|
| 533 |
+
|
| 534 |
+
Table 6: Average test accuracy on CIFAR10 over the last ten epochs.
|
| 535 |
+
|
| 536 |
+
<table><tr><td rowspan=1 colspan=1>Flipping-Rate</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>MentorNet</td><td rowspan=1 colspan=1>Co-teaching</td><td rowspan=1 colspan=1>Co-teaching+</td><td rowspan=1 colspan=1>GCE</td><td rowspan=1 colspan=1>NPCL</td></tr><tr><td rowspan=1 colspan=1>Symmetry-20%</td><td rowspan=1 colspan=1>76.62% ± 0.07%</td><td rowspan=1 colspan=1>81.20% ±0.09%</td><td rowspan=1 colspan=1>82.13% ±0.08%</td><td rowspan=1 colspan=1>80.64% ±0.15%</td><td rowspan=1 colspan=1>84.68% ±0.05%</td><td rowspan=1 colspan=1>84.30% ±0.07%</td></tr><tr><td rowspan=1 colspan=1>Symmetry-50%</td><td rowspan=1 colspan=1>49.92% ±0.09%</td><td rowspan=1 colspan=1>72.09% ±0.06%</td><td rowspan=1 colspan=1>74.28% ±0.11%</td><td rowspan=1 colspan=1>58.43% ±0.30 %</td><td rowspan=1 colspan=1>61.80% ±0.11%</td><td rowspan=1 colspan=1>77.66% ± 0.09%</td></tr><tr><td rowspan=1 colspan=1>Pair-35%</td><td rowspan=1 colspan=1>62.26%± 0.09%</td><td rowspan=1 colspan=1>71.52% ±0.06%</td><td rowspan=1 colspan=1>77.77%±0.14%</td><td rowspan=1 colspan=1>62.72%± 0.23%</td><td rowspan=1 colspan=1>60.86% ±0.05%</td><td rowspan=1 colspan=1>76.52% ± 0.11%</td></tr></table>
|
| 537 |
+
|
| 538 |
+
# K RELATED LITERATURE
|
| 539 |
+
|
| 540 |
+
Curriculum Learning: Curriculum learning is a general learning methodology that achieves success in many area. The very beginning work of curriculum learning (Bengio et al., 2009) trains a model gradually with samples ordered in a meaningful sequence, which has improved performance on many problems. Since the curriculum in (Bengio et al., 2009) is predetermined by prior knowledge and remained fixed later, which ignores the feedback of learners, Kumar et al. (Kumar et al., 2010) further propose Self-paced learning that selects samples by alternative minimization of an augmented objective. Jiang et al. (Jiang et al., 2014) propose a self-paced learning method to select samples with diversity. After that, Jiang et al. (Jiang et al., 2015) propose a self-paced curriculum strategy that takes different priors into consideration. Although these methods achieve success, the relation between the augmented objective of self-paced learning and the original objective (e.g. cross entropy loss for classification) is not clear. In addition, as stated in (Jiang et al., 2018), the alternative update in self-paced learning is not efficient for training deep networks.
|
| 541 |
+
|
| 542 |
+
Learning with Noisy Labels: The most related works are the sample selection based methods for robust learning. This kind of works are inspired by curriculum learning (Bengio et al., 2009). Among them, Jiang et al. (Jiang et al., 2018) propose to learn the curriculum from data by a mentor net. They use the mentor net to select samples for training with noisy labels. Co-teaching (Han et al., 2018b) employs two networks to select samples to train each other and achieve good generalization performance against large rate of label corruption. Co-teaching $^ +$ (Yu et al., 2019) extends Coteaching by selecting samples with disagreement of prediction of two networks. Compared with Co-teaching/Co-teaching+, our CL is a simple plugin for a single network. Thus both space and time complexity of CL are half of Co-teaching’s. Recently, Zhang & Sabuncu (2018) propose a generalized Cross-entropy loss for robust learning.
|
| 543 |
+
|
| 544 |
+
Construction of tighter bounds of 0-1 loss: Along the line of construction of tighter bounds of the 0-1 loss, many methods have been proposed. To name a few, Masnadi-Shirazi et al. (MasnadiShirazi & Vasconcelos, 2009) propose Savage loss, which is a non-convex upper bound of the 0-1 loss function. Bartlett et al. (Bartlett et al., 2006) analyze the properties of the truncated loss for conventional convex loss. Wu et al. (Wu & Liu, 2007) study the truncated hinge loss for SVM. Although the results are fruitful, these works are mainly focus on loss function at individual data point, they do not have sample selection property. In contrast, our curriculum loss can automatically select samples for training. Moreover, it can be constructed in a tighter way than these individual losses by employing them as the base loss function.
|
| 545 |
+
|
| 546 |
+
Table 7: Average test accuracy on CIFAR100 over the last ten epochs.
|
| 547 |
+
|
| 548 |
+
<table><tr><td rowspan=1 colspan=1>Flipping-Rate</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>MentorNet</td><td rowspan=1 colspan=1>Co-teaching</td><td rowspan=1 colspan=1>Co-teaching+</td><td rowspan=1 colspan=1>GCE</td><td rowspan=1 colspan=1>NPCL</td></tr><tr><td rowspan=1 colspan=1>Symmetry-20%</td><td rowspan=1 colspan=1>47.05% ±0.11%</td><td rowspan=1 colspan=1>51.58%±0.15%</td><td rowspan=1 colspan=1>53.89%± 0.09%</td><td rowspan=1 colspan=1>56.15% ± 0.09%</td><td rowspan=1 colspan=1>51.86% ± 0.09%</td><td rowspan=1 colspan=1>55.30%± 0.09%</td></tr><tr><td rowspan=1 colspan=1>Symmetry-50%</td><td rowspan=1 colspan=1>25.47% ± 0.07%</td><td rowspan=1 colspan=1>39.65%± 0.10%</td><td rowspan=1 colspan=1>41.08% ± 0.07%</td><td rowspan=1 colspan=1>37.88% ±0.06%</td><td rowspan=1 colspan=1>37.60%±0.08%</td><td rowspan=1 colspan=1>42.56% ± 0.06%</td></tr><tr><td rowspan=1 colspan=1>Pair-35%</td><td rowspan=1 colspan=1>39.91% ± 0.11%</td><td rowspan=1 colspan=1>40.42%±0.07%</td><td rowspan=1 colspan=1>43.36%±0.08%</td><td rowspan=1 colspan=1>40.88%±0.16%</td><td rowspan=1 colspan=1>36.64% ±0.07%</td><td rowspan=1 colspan=1>44.43% ±0.15%</td></tr></table>
|
| 549 |
+
|
| 550 |
+

|
| 551 |
+
Figure 5: Test accuracy and label precision vs. number of epochs on CIFAR10 dataset.
|
| 552 |
+
|
| 553 |
+
# L ARCHITECTURE OF NEURAL NETWORKS
|
| 554 |
+
|
| 555 |
+
<table><tr><td rowspan=1 colspan=1>CNN on MNIST</td><td rowspan=1 colspan=1>CNN on CIFAR-10</td><td rowspan=1 colspan=1>CNN on CIFAR-100</td></tr><tr><td rowspan=1 colspan=1>28×28 Gray Image</td><td rowspan=1 colspan=1>32×32 RGB Image</td><td rowspan=1 colspan=1>32×32 RGB Image</td></tr><tr><td rowspan=1 colspan=3>3×3 conv, 128 LReLU3 ×3 conv, 128 LReLU3×3 conv, 128 LReLU</td></tr><tr><td rowspan=1 colspan=3>2×2 max-pool, stride 2dropout, p = 0.25</td></tr><tr><td rowspan=1 colspan=3>3 ×3 conv, 256 LReLU3 ×3 conv, 256 LReLU3 ×3 conv, 256 LReLU</td></tr><tr><td rowspan=1 colspan=3>2×2 max-pool, stride 2dropout, p = 0.25</td></tr><tr><td rowspan=1 colspan=3>3×3 conv, 512LReLU3 ×3 conv, 256 LReLU3 ×3 conv, 128 LReLU</td></tr><tr><td rowspan=1 colspan=3>avg-pool</td></tr><tr><td rowspan=1 colspan=1>dense 128-→10</td><td rowspan=1 colspan=1>dense 128-→10</td><td rowspan=1 colspan=1>dense 128-→100</td></tr></table>
|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
Figure 6: Test accuracy and label precision vs. number of epochs on CIFAR100 dataset.
|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
Figure 7: Test accuracy vs. number of epochs on MNIST dataset.
|
| 562 |
+
|
| 563 |
+

|
| 564 |
+
Figure 8: Test accuracy vs. number of epochs on CIFAR100 dataset.
|
md/train/rkllGyBFPH/rkllGyBFPH.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/rylztAEYvr/rylztAEYvr.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ITERATIVE TARGET AUGMENTATION FOR EFFECTIVE CONDITIONAL GENERATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Many challenging prediction problems, from molecular optimization to program synthesis, involve creating complex structured objects as outputs. However, available training data may not be sufficient for a generative model to learn all possible complex transformations. By leveraging the idea that evaluation is easier than generation, we show how a simple, broadly applicable, iterative target augmentation scheme can be surprisingly effective in guiding the training and use of such models. Our scheme views the generative model as a prior distribution, and employs a separately trained filter as the likelihood. In each augmentation step, we filter the model’s outputs to obtain additional prediction targets for the next training epoch. Our method is applicable in the supervised as well as semi-supervised settings. We demonstrate that our approach yields significant gains over strong baselines both in molecular optimization and program synthesis. In particular, our augmented model outperforms the previous state-of-the-art in molecular optimization by over $10 \%$ in absolute gain.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep architectures are becoming increasingly adept at generating complex objects such as images, text, molecules, or programs. Many useful generation problems can be seen as translation tasks, where the goal is to take a source (precursor) object such as a molecule and turn it into a target satisfying given design characteristics. Indeed, molecular optimization of this kind is a key step in drug development, though the adoption of automated tools remains limited due to accuracy concerns. We propose here a simple, broadly applicable meta-algorithm to improve translation quality.
|
| 12 |
+
|
| 13 |
+
Translation is a challenging task for many reasons. Objects are complex and the available training data pairs do not fully exemplify the intricate ways in which valid targets can be created from the precursors. Moreover, precursors provided at test time may differ substantially from those available during training — a scenario common in drug development. While data augmentation and semisupervised methods have been used to address some of these challenges, the focus has been on either simple prediction tasks (e.g., classification) or augmenting data primarily on the source side. We show, in contrast, that iteratively augmenting translation targets significantly improves performance on complex generation tasks in which each precursor corresponds to multiple possible outputs.
|
| 14 |
+
|
| 15 |
+
Our iterative target augmentation approach builds on the idea that it is easier to evaluate candidate objects than to generate them. Thus a learned predictor of target object quality (a filter) can be used to effectively guide the generation process. To this end, we construct an external filter and apply it to the complex generative model’s sampled translations of training set precursors. Candidate translations that pass the filter criteria become part of the training data for the next training epoch. The translation model is therefore iteratively guided to generate candidates that pass the filter. The generative model can be viewed as an adaptively tuned prior distribution over complex objects, with the filter as the likelihood. For this reason, it is helpful to apply the filter at test time as well, or to use the approach transductively1 to adapt the generation process to novel test cases. The approach is reminiscent of self-training or reranking approaches employed with some success for parsing (McClosky et al., 2006; Charniak et al., 2016). However, in our case, it is the candidate generator that is complex while the filter is relatively simple and remains fixed during the iterative process.
|
| 16 |
+
|
| 17 |
+
We demonstrate that our meta-algorithm is quite effective and consistent in its ability to improve translation quality in the supervised setting. On a program synthesis task (Bunel et al., 2018), under the same neural architecture, our augmented model outperforms their MLE baseline by $8 \%$ and their RL model by $3 \%$ in top-1 generalization accuracy (in absolute measure). On molecular optimization (Jin et al., 2019a), their sequence to sequence translation baseline, when combined with our target data augmentation, achieves a new state-of-the-art result and outperforms their graph based approach by over $10 \%$ in success rate. Their graph based methods are also improved by iterative target augmentation with more than $10 \%$ absolute gain. The results reflect the difficulty of generation in comparison to evaluation; indeed, the gains persist even if the filter quality is reduced somewhat. Source side augmentation with unlabeled precursors (the semi-supervised setting) can further improve results, but only when combined with the filter in the target data augmentation framework. We provide ablation experiments to empirically highlight the effect of our method and also offer some theoretical insights for why it is effective.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Molecular Optimization The goal of molecular optimization is to learn to modify compounds so as to improve their chemical properties. Jaques et al. (2017); You et al. (2018); Popova et al. (2018) used reinforcement learning approaches, while Jin et al. (2019a;b) formulated this problem as graphto-graph translation and significantly outperformed previous methods. However, their performance remains imperfect due to the limited size of given training sets. Our work uses property prediction models to check whether generated molecules have desired chemical properties. Recent advances in graph convolutional networks (Duvenaud et al., 2015; Gilmer et al., 2017) have provided effective solutions to predict those properties in silico. In this work, we use an off-the-shelf property prediction model (Yang et al., 2019) to filter proposed translation pairs during data augmentation.
|
| 22 |
+
|
| 23 |
+
Program Synthesis Program synthesis is the task of generating a program (using domain-specific language) based on given input-output specifications (Bunel et al., 2018; Gulwani, 2011; Devlin et al., 2017). One can check a generated program’s correctness by simply executing it on each input and verifying its output. Indeed, Zhang et al. (2018); Chen et al. (2019) leverage this idea in their respective decoding procedures, while also using structural constraints on valid programs.
|
| 24 |
+
|
| 25 |
+
Semi-supervised Learning Our method is related to various approaches in semi-supervised learning. In image and text classification, data augmentation and label guessing (Berthelot et al., 2019; Xie et al., 2019) are commonly applied to obtain artificial labels for unlabeled data. In machine translation, Norouzi et al. (2016) sample new targets from a stationary distribution in order to match the model distribution to the exponentiated payoff distribution centered at a single target sentence. Back-translation (Sennrich et al., 2015; Edunov et al., 2018) creates extra translation pairs by using a backward translation system to translate unlabeled sentences from a target language into a source language. In contrast, our method works in the forward direction because many translation tasks are not symmetric. Moreover, our data augmentation is carried out over multiple iterations, in which we use the augmented model to generate new data for the next iteration.
|
| 26 |
+
|
| 27 |
+
In syntactic parsing, our method is closely related to self-training (McClosky et al., 2006). They generate new parse trees from unlabeled sentences by applying an existing parser followed by a reranker, and then treat the resulting parse trees as new training targets. However, their method is not iterative, and their reranker is explicitly trained to operate over the top $k$ outputs of the parser; in contrast, our filter is independent of the generative model. In addition we show that our approach, which can be viewed as iteratively combining reranking and self-training, is theoretically motivated and can improve the performance of highly complex neural models in multiple domains. Co-training (Blum & Mitchell, 1998) and tri-training (Zhou & Li, 2005; Charniak et al., 2016) also augment a parsing dataset by adding targets on which multiple baseline models agree. Instead of using multiple learners, our method uses task-specific constraints to select correct outputs.
|
| 28 |
+
|
| 29 |
+
# 3 ITERATIVE TARGET AUGMENTATION
|
| 30 |
+
|
| 31 |
+
Our iterative target augmentation framework can be applied to any conditional generation task with task-specific constraints. For example, molecular optimization (Jin et al., 2019a;b) is the task of transforming a given molecule $X$ into another compound $Y$ with improved chemical properties, while constraining $Y$ to remain similar to $X$ . Program synthesis (Bunel et al., 2018; Chen et al., 2019) is the task of generating a program $Y$ satisfying input specification $X$ ; for example, $X$ may be a set of input-output test cases which $Y$ must pass.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: Illustration of our data generation process in the program synthesis setting. Given an input-output specification, we first use our generation model to generate candidate programs, and then select correct programs using our external filter. Images of input-output specification and the program A are from Bunel et al. (2018).
|
| 35 |
+
|
| 36 |
+
<table><tr><td>Algorithm1 Augmentation by iterative target augmentation</td><td></td></tr><tr><td colspan="3">Input: Original training set D = [(X1, Yi),...,(Xn,Yn)]</td></tr><tr><td></td><td>1:procedure AUGMENTDATASET(D,Mt)</td><td></td></tr><tr><td>2:</td><td>Dt+1=D</td><td>> Initialize augmented dataset.</td></tr><tr><td>3:</td><td>for (Xi,Yi) in D do</td><td></td></tr><tr><td>4:</td><td>for attempt in 1,.., C do</td><td></td></tr><tr><td>5:</td><td>Apply model Mt to Xi to sample candidate Y'</td><td></td></tr><tr><td>6:</td><td>if Y' passes external filter then</td><td></td></tr><tr><td>7:</td><td>Add (Xi,Y') to Dt+1</td><td></td></tr><tr><td>8:</td><td>if K successful translations added then</td><td></td></tr><tr><td>9:</td><td>break from loop</td><td></td></tr><tr><td>10:</td><td>return augmented dataset Dt+1</td><td></td></tr><tr><td colspan="2">11: procedure TRAIN(D)</td><td></td></tr><tr><td>12:</td><td>for epoch in 1,..., n1 do</td><td> Regular training</td></tr><tr><td>13:</td><td>Train model on D.</td><td></td></tr><tr><td>14:</td><td>for epoch in 1,..., n2 do</td><td>> Iterative target augmentation</td></tr><tr><td>15:</td><td>Dt+1 = AUGMENTDATASET(D,Mt)</td><td></td></tr><tr><td>16:</td><td>Mt+1 ← Train model Mt on Dt+1·</td><td></td></tr></table>
|
| 37 |
+
|
| 38 |
+
Without loss of generality, we formulate the generation task as a translation problem. For a given input $X$ , the model learns to generate an output $Y$ satisfying the constraint $^ c$ . The proposed augmentation framework can be applied to any translation model $\mathcal { M }$ trained on an existing dataset $\boldsymbol { \mathcal { D } } = \{ ( X _ { i } , Y _ { i } ) \}$ . As illustrated in Figure 1, our method is an iterative procedure in which each iteration consists of the following two steps:
|
| 39 |
+
|
| 40 |
+
• Augmentation Step: Let $\mathcal { D } _ { t }$ be the training set at iteration $t$ . To construct each next training set $\mathcal { D } _ { t + 1 }$ , we feed each input $X _ { i } \in \mathcal { D }$ (the original training set, not $\mathcal { D } _ { t }$ ) into the translation model up to $C$ times to sample $C$ candidate translations $Y _ { i } ^ { 1 } \ldots Y _ { i } ^ { \overline { { C } } }$ .2 We take the first $K$ distinct translations for each $X _ { i }$ satisfying the constraint $^ c$ and add them to $\mathcal { D } _ { t + 1 }$ . When we do not find $K$ distinct valid translations, we simply add the original translation $Y _ { i }$ to $\mathcal { D } _ { t + 1 }$ .
|
| 41 |
+
|
| 42 |
+
• Training Step: We continue to train the model $\mathcal { M } _ { t }$ over the new training set $\mathcal { D } _ { t + 1 }$ for one epoch.
|
| 43 |
+
|
| 44 |
+
The above training procedure is summarized in Algorithm 1. As the constraint $^ c$ is known a priori, we can construct an external filter to remove generated outputs that violate $^ c$ during the augmentation step. At test time, we also use this filter to screen predicted outputs. To propose the final translation of a given input $X$ , we have the model generate up to $L$ outputs until we find one satisfying the constraint $^ c$ . If all $L$ attempts fail for a particular input, we just output the first of the failed attempts.
|
| 45 |
+
|
| 46 |
+
Finally, as an additional improvement, we observe that the augmentation step can be carried out for unlabeled inputs $X$ that have no corresponding $Y$ . Thus we can further augment our training dataset in the transductive setting by including test set inputs during the augmentation step, or in the semi-supervised setting by simply including unlabeled inputs.
|
| 47 |
+
|
| 48 |
+
# 4 MOTIVATION FOR ITERATIVE TARGET AUGMENTATION
|
| 49 |
+
|
| 50 |
+
We provide here some theoretical motivation for our iterative target augmentation framework. For simplicity, we consider an external filter $_ { c _ { X , Y } }$ that is a binary indicator function representing whether output $Y$ satisfies the desired constraint in relation to input $X$ . In other words, we would like to generate $Y$ such that $Y \in B ( X ) = \{ Y ^ { \prime } | c _ { X , Y ^ { \prime } } = 1 \}$ . If the initial translation model $P ^ { ( 0 ) } ( Y | X )$ serves as a reasonable prior distribution over outputs, we could simply “invert” the filter and use
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
P ^ { ( * ) } ( Y | X ) \propto P ^ { ( 0 ) } ( Y | X ) \cdot c _ { X , Y }
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
as the ideal translation model. While this posterior calculation is typically not feasible but could be approximated through samples, it relies heavily on the appropriateness of the prior (model prior to augmentation). Instead, we go a step further and iteratively optimize our parametrically defined prior translation model $P _ { \theta } ( Y | X )$ . Note that the resulting prior can become much more concentrated around acceptable translations.
|
| 57 |
+
|
| 58 |
+
We maximize the log-likelihood that candidate translations satisfy the constraints implicitly encoded in the filter
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathbb { E } _ { X } \left[ \log P _ { \theta } ( \pmb { c } _ { X , Y } = 1 \mid X ) \right]
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
In many cases there are multiple viable outputs for any given input $X$ . The training data may provide only one (or none) of them. Therefore, we treat the output structure $Y$ as a latent variable, and expand the inner term of Eq.(2) as
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { l l l } { \log P _ { \theta } ( \boldsymbol { c } _ { X , Y } = 1 \mid X ) } & { = } & { \displaystyle \log \sum _ { Y } P _ { \theta } ( Y , \boldsymbol { c } _ { X , Y } = 1 \mid X ) } \\ & { = } & { \displaystyle \log \sum _ { Y } P ( \boldsymbol { c } _ { X , Y } = 1 \mid Y , X ) P _ { \theta } ( Y \mid X ) } \\ & { = } & { \displaystyle \log \sum _ { Y } \boldsymbol { c } _ { X , Y } \cdot P _ { \theta } ( Y \mid X ) } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Since the above objective involves discrete latent variables $Y$ , we propose to maximize Eq.(5) using the standard EM algorithm (Dempster et al., 1977), especially its incremental, approximate variant. The target augmentation step in our approach is a sampled version of the $\mathrm { E }$ -step where the posterior samples are drawn with rejection sampling guided by the filter. The number of samples $K$ controls the quality of approximation to the posterior.3 The additional training step based on the augmented targets corresponds to a generalized M-step. More precisely, let $P _ { \theta } ^ { ( t ) } ( Y | X )$ be the current translation model after epochs of augmentation training. In epoch , the augmentation step first samples $C$ different candidates for each input $X$ using the old model $P ^ { ( t ) }$ parameterized by $\theta ^ { ( t ) }$ , and then removes those which violate the constraint $^ c$ , interpretable as samples from the current posterior $Q ^ { ( t ) } ( Y | X ) \propto P _ { \theta ^ { ( t ) } } ( Y | X ) c _ { X , Y }$ . As a result, the training step maximizes the EM auxiliary objective via stochastic gradient descent:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
J ( \theta \mid \theta ^ { ( t ) } ) = \mathbb { E } _ { X } \left[ \sum _ { Y } Q ^ { ( t ) } ( Y | X ) \log P _ { \theta } ( Y | X ) \right]
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
We train the model with multiple iterations and show empirically that model performance indeed keeps improving as we add more iterations. The EM approach is likely to converge to a different and better-performing translation model than the initial posterior calculation discussed above.
|
| 77 |
+
|
| 78 |
+
# 5 EXPERIMENTS
|
| 79 |
+
|
| 80 |
+
We demonstrate the broad applicability of iterative target augmentation by applying it to two tasks of different domains: molecular optimization and program synthesis.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 2: Illustration of molecular optimization. Molecules can be modeled as graphs, with atoms as nodes and bonds as edges. Here, the task is to train a translation model to modify a given input molecule into a target molecule with higher drug-likeness (QED) score. The constraint has two components: the output $Y$ must be highly drug-like, and must be sufficiently similar to the input $X$ .
|
| 84 |
+
|
| 85 |
+
# 5.1 MOLECULAR OPTIMIZATION
|
| 86 |
+
|
| 87 |
+
The goal of molecular optimization is to learn to modify molecules so as to improve their chemical properties. As illustrated in Figure 2, this task is formulated as a graph-to-graph translation problem. Similar to machine translation, the training set is a set of molecular pairs $\{ ( X , Y ) \}$ . $X$ is the input molecule (precursor) and $Y$ is a similar molecule with improved chemical properties. Each molecule in the training set $\mathcal { D }$ is further labeled with its property score. Our method is well-suited to this task because the target molecule is not unique: each precursor molecule can be modified in many different ways to optimize its properties.
|
| 88 |
+
|
| 89 |
+
External Filter The constraint for this task contains two parts: 1) the chemical property of $Y$ must exceed a certain threshold $\beta$ , and 2) the molecular similarity between $X$ and $Y$ must exceed a certain threshold $\delta$ . The molecular similarity $\sin ( X , Y )$ is defined as Tanimoto similarity on Morgan fingerprints (Rogers & Hahn, 2010), which measures structural overlap between two molecules.
|
| 90 |
+
|
| 91 |
+
In real world settings, ground truth values of chemical properties are often evaluated through experimental assays, which are too expensive and time-consuming to run for iterative target augmentation. Therefore, we construct an in silico property predictor $F _ { 1 }$ to approximate the true property evaluator $F _ { 0 }$ . To train this property prediction model, we use the molecules in the training set and their labeled property values. The predictor $F _ { 1 }$ is parameterized as a graph convolutional network and trained using the Chemprop package (Yang et al., 2019). During data augmentation, we use $F _ { 1 }$ to filter out molecules whose predicted property is under the threshold $\beta$ .
|
| 92 |
+
|
| 93 |
+
# 5.1.1 EXPERIMENTAL SETUP
|
| 94 |
+
|
| 95 |
+
We follow the evaluation setup of Jin et al. (2019b) for two molecular optimization tasks:
|
| 96 |
+
|
| 97 |
+
1. QED Optimization: The task is to improve the drug-likeness (QED) of a given compound $X$ . The similarity constraint is $\sin ( X , Y ) \bar { \geq } 0 . 4$ and the property constraint is $\bar { \mathrm { Q E D } } ( Y ) \stackrel { - } { = } 0 . 9$ , with $\mathrm { Q E D } ( Y ) \in \left[ 0 , 1 \right]$ defined by the system of Bickerton et al. (2012).
|
| 98 |
+
|
| 99 |
+
2. DRD2 Optimization: The task is to optimize biological activity against the dopamine type 2 receptor (DRD2). The similarity constraint is $\sin ( \bar { X } , Y ) \ge 0 . 4 $ and the property constraint is $\mathrm { D R D 2 } ( Y ) \ge 0 . 5$ , where $\mathrm { D R D 2 } ( Y ) \in [ 0 , 1 ]$ is the predicted probability of biological activity given by the model from Olivecrona et al. (2017).
|
| 100 |
+
|
| 101 |
+
We treat the output of the in silico evaluators from Bickerton et al. (2012) and Olivecrona et al. (2017) as ground truth, and we use them only during test-time evaluation.4
|
| 102 |
+
|
| 103 |
+
Evaluation Metrics. During evaluation, we are interested both in the probability that the model will find a successful modification for a given molecule, as well as the diversity of the successful modifications when there are multiple. We translate each molecule in the test set $Z = 2 0$ times, resulting in candidate modifications $Y _ { 1 } \ldots Y _ { Z }$ (not necessarily distinct). We use the following two evaluation metrics:
|
| 104 |
+
|
| 105 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>QED Succ.</td><td rowspan=1 colspan=1>QED Div.</td><td rowspan=1 colspan=1>DRD2 Succ.</td><td rowspan=1 colspan=1>DRD2 Div.</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq</td><td rowspan=1 colspan=1>58.5</td><td rowspan=1 colspan=1>0.331</td><td rowspan=1 colspan=1>75.9</td><td rowspan=1 colspan=1>0.176</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+ (Ours)</td><td rowspan=1 colspan=1>89.0</td><td rowspan=1 colspan=1>0.470</td><td rowspan=1 colspan=1>97.2</td><td rowspan=1 colspan=1>0.361</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+, semi-supervised (Ours)</td><td rowspan=1 colspan=1>95.0</td><td rowspan=1 colspan=1>0.471</td><td rowspan=1 colspan=1>99.6</td><td rowspan=1 colspan=1>0.408</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+,transductive (Ours)</td><td rowspan=1 colspan=1>92.6</td><td rowspan=1 colspan=1>0.451</td><td rowspan=1 colspan=1>97.9</td><td rowspan=1 colspan=1>0.358</td></tr><tr><td rowspan=1 colspan=1>HierGNN</td><td rowspan=1 colspan=1>76.6</td><td rowspan=1 colspan=1>0.477</td><td rowspan=1 colspan=1>85.9</td><td rowspan=1 colspan=1>0.192</td></tr><tr><td rowspan=1 colspan=1>HierGNN+ (Ours)</td><td rowspan=1 colspan=1>93.1</td><td rowspan=1 colspan=1>0.514</td><td rowspan=1 colspan=1>97.6</td><td rowspan=1 colspan=1>0.418</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Table 1: Performance of different models on QED and DRD2 optimization tasks. Italicized models with $^ +$ are augmented with iterative target augmentation. We emphasize that iterative target augmentation remains critical to performance in the semi-supervised and transductive settings; data augmentation without an external filter instead decreases performance.
|
| 108 |
+
|
| 109 |
+
1. Success: The fraction of molecules $X$ for which any of the outputs $Y _ { 1 } \ldots Y _ { Z }$ meet the required similarity and property constraints (specified previously for each task). This is our main metric.
|
| 110 |
+
|
| 111 |
+
2. Diversity: For each molecule $X$ , we measure the average Tanimoto distance (defined as $1 -$ $\mathrm { s i m } ( Y _ { i } , Y _ { j } ) ,$ ) between pairs within the set of successfully translated compounds among $Y _ { 1 } \ldots Y _ { Z }$ . If there are one or fewer successful translations then the diversity is 0. We average this quantity across all test molecules.
|
| 112 |
+
|
| 113 |
+
Models and Baselines. We consider the following two model architectures from Jin et al. (2019a) to show that our augmentation scheme is not tied to specific neural architectures.
|
| 114 |
+
|
| 115 |
+
1. VSeq2Seq, a sequence-to-sequence translation model generating molecules by their SMILES string (Weininger, 1988). 2. HierGNN, a hierarchical graph-to-graph architecture that achieves state-of-the-art performance on the QED and DRD2 tasks, outperforming VSeq2Seq by a wide margin.
|
| 116 |
+
|
| 117 |
+
We apply our iterative augmentation procedure to the above two models, generating up to $K = 4$ new targets per precursor during each epoch of iterative target augmentation. Additionally, we evaluate our augmentation of VSeq2Seq in a transductive setting, as well as in a semi-supervised setting where we provide 100K additional source-side precursors from the ZINC database (Sterling & Irwin, 2015). Full hyperparameters are in Appendix A.
|
| 118 |
+
|
| 119 |
+
# 5.1.2 RESULTS
|
| 120 |
+
|
| 121 |
+
As shown in Table 1, our iterative augmentation paradigm significantly improves the performance of VSeq2Seq and HierGNN. On both datasets, the translation success rate increases by over $10 \%$ in absolute terms for both models. In fact, ${ \tt V S e q 2 S e q + }$ , our augmentation of the simple VSeq2Seq model, outperforms the non-augmented version of HierGNN. This result strongly confirms our hypothesis about the inherent challenge of learning translation models in data sparse scenarios. Moreover, we find that adding more precursors during data augmentation further improves the VSeq2Seq model. On the QED dataset, the translation success rate improves from $8 9 . 0 \%$ to $9 2 . 6 \%$ by just adding test set molecules as precursors $( \mathrm { V S e q 2 S e q + }$ , transductive). When instead adding 100K presursors from the external ZINC database, the performance further increases to $9 5 . 0 \%$ $( \mathrm { V S e q 2 S e q + }$ , semisupervised). We observe similar improvements for the DRD2 task as well. Beyond accuracy gain, our augmentation strategy also improves the diversity of generated molecules. For instance, on the DRD2 dataset, our approach yields $100 \%$ relative gain in terms of output diversity.
|
| 122 |
+
|
| 123 |
+
Importance of Property Predictor Although the property predictor used in data augmentation is different from the ground truth property evaluator used at test time, the difference in evaluators does not derail the overall training process. Here we analyze the influence of the quality of the property predictor used in data augmentation. Specifically, we rerun our experiments using less accurate predictors in the property-predicting component of our external filter. We obtain these less accurate predictors by undertraining Chemprop and decreasing its hidden dimension. For comparison, we also report results with the oracle property predictor which is the ground truth property evaluator.
|
| 124 |
+
|
| 125 |
+
As shown in Figure 3, on the DRD2 dataset, we are able to maintain strong performance despite using predictors that deviate significantly from the ground truth. This implies that our framework can potentially be applied to other properties that are harder to predict. On the QED dataset, our
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: Left: QED success rate vs. Chemprop predictor’s RMSE with respect to ground truth on test set. The red line shows the performance of the (unaugmented) VSeq2Seq baseline. Right: Same plot for DRD2. In each plot, the far left point with zero RMSE is obtained by reusing the ground truth predictor, while the second-from-left point is the Chemprop predictor we use to obtain our main results. Points further to the right are weaker predictors trained for fewer epochs and with less capacity, simulating a scenario where the property is more difficult to model.
|
| 129 |
+
|
| 130 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Train</td><td rowspan=1 colspan=1>Test</td><td rowspan=1 colspan=1>QED Succ.</td><td rowspan=1 colspan=1>QED Div.</td><td rowspan=1 colspan=1>DRD2 Succ.</td><td rowspan=1 colspan=1>DRD2 Div.</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=1>58.5</td><td rowspan=1 colspan=1>0.331</td><td rowspan=1 colspan=1>75.9</td><td rowspan=1 colspan=1>0.176</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq(test)</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>77.4</td><td rowspan=1 colspan=1>0.471</td><td rowspan=1 colspan=1>87.2</td><td rowspan=1 colspan=1>0.200</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq(train)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>81.8</td><td rowspan=1 colspan=1>0.430</td><td rowspan=1 colspan=1>92.2</td><td rowspan=1 colspan=1>0.321</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+</td><td rowspan=1 colspan=1>了</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>89.0</td><td rowspan=1 colspan=1>0.470</td><td rowspan=1 colspan=1>97.2</td><td rowspan=1 colspan=1>0.361</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq(no-filter)</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=1>×</td><td rowspan=1 colspan=1>47.5</td><td rowspan=1 colspan=1>0.297</td><td rowspan=1 colspan=1>51.0</td><td rowspan=1 colspan=1>0.185</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Table 2: Ablation analysis of filtering at training and test time. “Train” indicates a model whose training process uses data augmentation according to our framework. “Test” indicates a model that uses the external filter at prediction time to discard candidate outputs which fail to pass the filter. The evaluation for VSeq2Seq(no-filter) is conducted after 10 augmentation epochs, as the best validation set performance only decreases over the course of training.
|
| 133 |
+
|
| 134 |
+
method is less tolerant to inaccurate property prediction because the property constraint is much tighter — it requires the QED score of an output $Y$ to be in the range [0.9, 1.0].
|
| 135 |
+
|
| 136 |
+
Importance of External Filtering Our full model $( { \mathrm { V S e q } } 2 { \mathrm { S e q } } +$ ) uses the external filter during both training and testing. We further experiment with Vseq2seq(test), a version of our model trained without data augmentation but which uses the external filter to remove invalid outputs at test time. As shown in Table 2, VSeq2Seq(test) performs significantly worse than our full model trained under data augmentation. Similarly, a model VSeq2Seq(train) trained with the data augmentation but without the prediction time filtering also performs much worse than the full model.
|
| 137 |
+
|
| 138 |
+
In addition, we run an augmentation-only version of the model without an external filter. This model (referred to as VSeq2Seq(no-filter) in Table 2) augments the data in each epoch by simply using the first $K$ distinct candidate translations for each precursor $X$ in the training set, without using the external filter at all. In addition, we provide this model with the 100K unlabeled precursors from the semi-supervised setting. Nevertheless, we find that the performance of this model steadily declines from that of the bootstrapped starting point with each data augmentation epoch. Thus the external filter is necessary to prevent poor targets from leading the model training astray.
|
| 139 |
+
|
| 140 |
+
# 5.2 PROGRAM SYNTHESIS
|
| 141 |
+
|
| 142 |
+
In program synthesis, the source is a set of input-output specifications for the program, and the target is a program that passes all test cases. Our method is suitable for this task because the target program is not unique. Multiple programs may be consistent with the given input-output specifications. The external filter is straightforward for this task: we simply check whether the generated output passes all test cases. Note that at evaluation time, each instance contains extra held-out input-output test cases; the program must pass these in addition to the given test cases in order to be considered correct. When we perform prediction time filtering, we do not use held-out test cases in our filter.
|
| 143 |
+
|
| 144 |
+
Table 3: Model performance on Karel program synthesis task. $\mathrm { M L E + }$ is our augmented version of the MLE model (Bunel et al., 2018).
|
| 145 |
+
|
| 146 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Top-1Generalization</td></tr><tr><td rowspan=1 colspan=1>MLE (Bunel et al.,2018)</td><td rowspan=1 colspan=1>71.91</td></tr><tr><td rowspan=1 colspan=1>MLE+RL+BeamSearch(Bunel et al., 2018)</td><td rowspan=1 colspan=1>77.12</td></tr><tr><td rowspan=1 colspan=1>MLE+ (Ours)</td><td rowspan=1 colspan=1>80.17</td></tr></table>
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 4: Top-1 generalization accuracy of $\mathrm { M L E + }$ model on validation set of Karel task across different epochs.
|
| 150 |
+
|
| 151 |
+
# 5.2.1 EXPERIMENTAL SETUP
|
| 152 |
+
|
| 153 |
+
Our task is based on the educational Karel programming language (Pattis, 1981) used for evaluation in Bunel et al. (2018) and Chen et al. (2019). Commands in the Karel language guide a robot’s actions in a 2D grid, and may include for loops, while loops, and conditionals. Figure 1 contains an example. We follow the experiment setup of Bunel et al. (2018).
|
| 154 |
+
|
| 155 |
+
Evaluation Metrics. The evaluation metric is top-1 generalization. This metric measures how often the model can generate a program that passes the input-output test cases on the test set. At test time, we use our model to generate up to $L$ candidate programs and select the first one to pass the input-output specifications (not including held-out test cases).
|
| 156 |
+
|
| 157 |
+
Models and Baselines. Our main baseline is the MLE baseline from Bunel et al. (2018). This model consists of a CNN encoder for the input-output grids and a LSTM decoder along with a handcoded syntax checker. It is trained to maximize the likelihood of the provided target program. Our model is the augmentation of this MLE baseline by our iterative target augmentation framework. As with molecular optimization, we generate up to $K = 4$ new targets per precursor during each augmentation step. Additionally, we compare against the best model from Bunel et al. (2018), which finetunes the same MLE architecture using an RL method with beam search to estimate gradients.5 We use the same hyperparameters as the original MLE baseline; see Appendix A for details.
|
| 158 |
+
|
| 159 |
+
# 5.2.2 RESULTS
|
| 160 |
+
|
| 161 |
+
Table 3 shows the performance of our model in comparison to previous work. Our model (MLE+) outperforms the base MLE model in Bunel et al. (2018) model by a wide margin. Moreover, our model outperforms the best reinforcement learning model (RL $^ +$ Beam Search) in Bunel et al. (2018), which was trained to directly maximize the generalization metric. This demonstrates the efficacy of our approach in the program synthesis domain. Since our augmentation framework is complementary to architectural improvements, we hypothesize that other techniques, such as execution based synthesis (Chen et al., 2019), can benefit from our approach as well.
|
| 162 |
+
|
| 163 |
+
# 6 CONCLUSION
|
| 164 |
+
|
| 165 |
+
In this work, we have presented an iterative target augmentation framework for generation tasks with multiple possible outputs. Our approach is theoretically motivated, and we demonstrate strong empirical results on both the molecular optimization and program synthesis tasks, significantly outperforming baseline models on each task. Moreover, we find that iterative target augmentation is complementary to architectural improvements, and that its effect can be quite robust to the quality of the external filter. Finally, in principle our approach is applicable to other domains as well.
|
| 166 |
+
|
| 167 |
+
# REFERENCES
|
| 168 |
+
|
| 169 |
+
David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. arXiv preprint arXiv:1905.02249, 2019.
|
| 170 |
+
|
| 171 |
+
G Richard Bickerton, Gaia V Paolini, Jer´ emy Besnard, Sorel Muresan, and Andrew L Hopkins.´ Quantifying the chemical beauty of drugs. Nature chemistry, 4(2):90, 2012.
|
| 172 |
+
|
| 173 |
+
Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In Proceedings of the eleventh annual conference on Computational learning theory, pp. 92–100. Citeseer, 1998.
|
| 174 |
+
|
| 175 |
+
Rudy Bunel, Matthew Hausknecht, Jacob Devlin, Rishabh Singh, and Pushmeet Kohli. Leveraging grammar and reinforcement learning for neural program synthesis. arXiv preprint arXiv:1805.04276, 2018.
|
| 176 |
+
|
| 177 |
+
Eugene Charniak et al. Parsing as language modeling. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 2331–2336, 2016.
|
| 178 |
+
|
| 179 |
+
Xinyun Chen, Chang Liu, and Dawn Song. Execution-guided neural program synthesis. International Conference on Learning Representations, 2019.
|
| 180 |
+
|
| 181 |
+
Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society: Series B (Methodological), 39(1): 1–22, 1977.
|
| 182 |
+
|
| 183 |
+
Jacob Devlin, Rudy R Bunel, Rishabh Singh, Matthew Hausknecht, and Pushmeet Kohli. Neural program meta-induction. In Advances in Neural Information Processing Systems, pp. 2080–2088, 2017.
|
| 184 |
+
|
| 185 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan´ Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. Advances in Neural Information Processing Systems, pp. 2224–2232, 2015.
|
| 186 |
+
|
| 187 |
+
Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. Understanding back-translation at scale. arXiv preprint arXiv:1808.09381, 2018.
|
| 188 |
+
|
| 189 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. Proceedings of the 34th International Conference on Machine Learning, 2017.
|
| 190 |
+
|
| 191 |
+
Sumit Gulwani. Automating string processing in spreadsheets using input-output examples. In ACM Sigplan Notices, volume 46, pp. 317–330. ACM, 2011.
|
| 192 |
+
|
| 193 |
+
Natasha Jaques, Shixiang Gu, Dzmitry Bahdanau, Jose Miguel Hern ´ andez-Lobato, Richard E ´ Turner, and Douglas Eck. Sequence tutor: Conservative fine-tuning of sequence generation models with kl-control. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 1645–1654. JMLR. org, 2017.
|
| 194 |
+
|
| 195 |
+
Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Multi-resolution autoregressive graph-to-graph translation for molecules. arXiv preprint arXiv:1907.11223, 2019a.
|
| 196 |
+
|
| 197 |
+
Wengong Jin, Kevin Yang, Regina Barzilay, and Tommi Jaakkola. Learning multimodal graph-tograph translation for molecular optimization. International Conference on Learning Representation, 2019b.
|
| 198 |
+
|
| 199 |
+
David McClosky, Eugene Charniak, and Mark Johnson. Effective self-training for parsing. In Proceedings of the main conference on human language technology conference of the North American Chapter of the Association of Computational Linguistics, pp. 152–159. Association for Computational Linguistics, 2006.
|
| 200 |
+
|
| 201 |
+
Mohammad Norouzi, Samy Bengio, Navdeep Jaitly, Mike Schuster, Yonghui Wu, Dale Schuurmans, et al. Reward augmented maximum likelihood for neural structured prediction. In Advances In Neural Information Processing Systems, pp. 1723–1731, 2016.
|
| 202 |
+
|
| 203 |
+
Marcus Olivecrona, Thomas Blaschke, Ola Engkvist, and Hongming Chen. Molecular de-novo design through deep reinforcement learning. Journal of cheminformatics, 9(1):48, 2017.
|
| 204 |
+
Richard E. Pattis. Karel the Robot: A Gentle Introduction to the Art of Programming. John Wiley & Sons, Inc., New York, NY, USA, 1st edition, 1981. ISBN 0471089281.
|
| 205 |
+
Mariya Popova, Olexandr Isayev, and Alexander Tropsha. Deep reinforcement learning for de novo drug design. Science advances, 4(7):eaap7885, 2018.
|
| 206 |
+
David Rogers and Mathew Hahn. Extended-connectivity fingerprints. J. Chem. Inf. Model., 50(5): 742–754, 2010.
|
| 207 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Improving neural machine translation models with monolingual data. arXiv preprint arXiv:1511.06709, 2015.
|
| 208 |
+
Teague Sterling and John J Irwin. Zinc 15–ligand discovery for everyone. Journal of chemical information and modeling, 55(11):2324–2337, 2015.
|
| 209 |
+
David Weininger. Smiles, a chemical language and information system. 1. introduction to methodology and encoding rules. J. Chem. Inf. Model., 28(1):31–36, 1988.
|
| 210 |
+
Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V Le. Unsupervised data augmentation. arXiv preprint arXiv:1904.12848, 2019.
|
| 211 |
+
Kevin Yang, Kyle Swanson, Wengong Jin, Connor W Coley, Philipp Eiden, Hua Gao, Angel Guzman-Perez, Tim Hopper, Brian Kelley, Miriam Mathea, et al. Analyzing learned molecular representations for property prediction. Journal of chemical information and modeling, 2019.
|
| 212 |
+
Jiaxuan You, Bowen Liu, Zhitao Ying, Vijay Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In Advances in Neural Information Processing Systems, pp. 6410–6421, 2018.
|
| 213 |
+
Lisa Zhang, Gregory Rosenblatt, Ethan Fetaya, Renjie Liao, William E Byrd, Raquel Urtasun, and Richard Zemel. Leveraging constraint logic programming for neural guided program synthesis. 2018.
|
| 214 |
+
Zhi-Hua Zhou and Ming Li. Tri-training: Exploiting unlabeled data using three classifiers. IEEE Transactions on Knowledge & Data Engineering, (11):1529–1541, 2005.
|
| 215 |
+
|
| 216 |
+
# A MODEL HYPERPARAMETERS
|
| 217 |
+
|
| 218 |
+
Our augmented models share the same hyperparameters as their baseline counterparts in all cases.
|
| 219 |
+
|
| 220 |
+
# A.1 MOLECULAR OPTIMIZATION
|
| 221 |
+
|
| 222 |
+
For the VSeq2Seq model we use batch size 64, embedding and hidden dimension 300, VAE latent dimension 30, and an LSTM with depth 1 (bidirectional in the encoder, unidirectional in the decoder). For models using iterative target augmentation, $n _ { 1 }$ is set to 5 and $n _ { 2 }$ is set to 10, while for the baseline models we train for 20 epochs (corresponding to $n _ { 1 } = 2 0 , n _ { 2 } = 0 \rangle$ ). The HierGNN model shares the same hyperparameters as in Jin et al. (2019a).
|
| 223 |
+
|
| 224 |
+
For the training time and prediction time filtering parameters, we set $K = 4$ , $C = 2 0 0$ , and $L = 1 0$ for both the QED and DRD2 tasks.
|
| 225 |
+
|
| 226 |
+
# A.2 PROGRAM SYNTHESIS
|
| 227 |
+
|
| 228 |
+
For the Karel program synthesis task, we use the same hyperparameters as the MLE baseline model in Bunel et al. (2018). We use a beam size of 64 at test time, the same as the MLE baseline, but simply sample programs from the decoder distribution when running iterative target augmentation during training. The baseline model is trained for 100 epochs, while for the model employing iterative target augmentation we train as normal for $n _ { 1 } = 1 5$ epochs followed by $n _ { 2 } = 5 0$ epochs of iterative target augmentation. Due to the large size of the full training dataset, in each epoch of iterative augmentation we use $\textstyle { \frac { 1 } { 1 0 } }$ of the dataset, so in total we make 5 passes over the entire dataset.
|
| 229 |
+
|
| 230 |
+
For the training time and prediction time filtering parameters, we set $K = 4$ , $C = 5 0$ , and $L = 1 0$ .
|
| 231 |
+
|
| 232 |
+
# B ADDITIONAL EXPERIMENTAL DETAILS
|
| 233 |
+
|
| 234 |
+
# B.1 DATASET SIZES
|
| 235 |
+
|
| 236 |
+
In Table 4 we provide the training, validation, and test set sizes for all of our tasks. For each task we use the same splits as our baselines.
|
| 237 |
+
|
| 238 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>Training Set</td><td rowspan=1 colspan=1>Validation Set</td><td rowspan=1 colspan=1>Test Set</td></tr><tr><td rowspan=1 colspan=1>QED</td><td rowspan=1 colspan=1>88306</td><td rowspan=1 colspan=1>360</td><td rowspan=1 colspan=1>800</td></tr><tr><td rowspan=1 colspan=1>DRD2</td><td rowspan=1 colspan=1>34404</td><td rowspan=1 colspan=1>500</td><td rowspan=1 colspan=1>1000</td></tr><tr><td rowspan=1 colspan=1>Karel</td><td rowspan=1 colspan=1>1116854</td><td rowspan=1 colspan=1>2500</td><td rowspan=1 colspan=1>2500</td></tr></table>
|
| 239 |
+
|
| 240 |
+
Table 4: Number of source-target pairs in training, validation, and test sets for each task.
|
| 241 |
+
|
| 242 |
+
# B.2 MOLECULAR OPTIMIZATION LEARNING CURVES
|
| 243 |
+
|
| 244 |
+
In Figure 5, we provide the validation set performance per iterative target augmentation epoch for our ${ \tt V S e q 2 S e q + }$ model on both the QED and DRD2 tasks. The corresponding figure for the $\mathrm { M L E + }$ model on the Karel task is in the main text in Figure 4.
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure 5: Left: QED success rate for ${ \tt V S e q 2 S e q + }$ on validation set for each epoch of iterative target augmentation. Right: Same plot for DRD2. For each plot, the far left point indicates the performance of the bootstrapped model.
|
| 248 |
+
|
| 249 |
+
# B.3 FURTHER MOLECULAR OPTIMIZATION EXPERIMENTS
|
| 250 |
+
|
| 251 |
+
In our molecular optimization tasks, we experiment with the effect of modifying $K$ , the number of new targets added per precursor during each training epoch. In all other experiments we have used $K = 4$ . Since taking $K = 0$ corresponds to the base non-augmented model, it is unsurprising that performance may suffer when $K$ is too small. However, as shown in Table 5, at least in molecular optimization there is relatively little change in performance for $K$ much larger than 4.
|
| 252 |
+
|
| 253 |
+
Table 5: Performance of our model ${ \tt V S e q 2 S e q + }$ with different values of $K$ . All other experiments use $K = 4$ .
|
| 254 |
+
|
| 255 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>QED Succ.</td><td rowspan=1 colspan=1>QED Div.</td><td rowspan=1 colspan=1>DRD2 Succ.</td><td rowspan=1 colspan=1>DRD2 Div.</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+,K=2</td><td rowspan=1 colspan=1>85.1</td><td rowspan=1 colspan=1>0.453</td><td rowspan=1 colspan=1>95.9</td><td rowspan=1 colspan=1>0.327</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+, K=4</td><td rowspan=1 colspan=1>89.0</td><td rowspan=1 colspan=1>0.470</td><td rowspan=1 colspan=1>97.2</td><td rowspan=1 colspan=1>0.361</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+, K=8</td><td rowspan=1 colspan=1>88.4</td><td rowspan=1 colspan=1>0.480</td><td rowspan=1 colspan=1>97.6</td><td rowspan=1 colspan=1>0.373</td></tr></table>
|
| 256 |
+
|
| 257 |
+
We also experiment with a version of our method which continually grows the training dataset by keeping all augmented targets, instead of discarding new targets at the end of each epoch. We chose the latter version for our main experiments due to its closer alignment to our EM motivation. However, we demonstrate in Table 6 that performance gains from continually growing the dataset are small to insignificant in our molecular optimization tasks.
|
| 258 |
+
|
| 259 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>QEDSucc.</td><td rowspan=1 colspan=1>QED Div.</td><td rowspan=1 colspan=1>DRD2 Succ.</td><td rowspan=1 colspan=1>DRD2 Div.</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+</td><td rowspan=1 colspan=1>89.0</td><td rowspan=1 colspan=1>0.470</td><td rowspan=1 colspan=1>97.2</td><td rowspan=1 colspan=1>0.361</td></tr><tr><td rowspan=1 colspan=1>VSeq2Seq+,keep-targets</td><td rowspan=1 colspan=1>89.8</td><td rowspan=1 colspan=1>0.465</td><td rowspan=1 colspan=1>97.6</td><td rowspan=1 colspan=1>0.363</td></tr></table>
|
| 260 |
+
|
| 261 |
+
Table 6: Performance of our proposed augmentation scheme, ${ \tt V S e q 2 S e q + }$ , compared to an alternative version $( \mathrm { V S e q 2 S e q + }$ , keep-targets) which keeps all generated targets and continually grows the training dataset.
|
| 262 |
+
|
| 263 |
+
# B.4 PROGRAM SYNTHESIS ABLATIONS
|
| 264 |
+
|
| 265 |
+
In Table 7 we provide the same ablation analysis that we provided in the main text for molecular optimization, demonstrating that both training time iterative target augmentation as well as prediction time filtering are beneficial to model performance. However, we note that even MLE(train), our model without prediction time filtering, outperforms the best RL method from Bunel et al. (2018).
|
| 266 |
+
|
| 267 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Train</td><td rowspan=1 colspan=1>Test</td><td rowspan=1 colspan=1>Top-1 Generalization</td></tr><tr><td rowspan=1 colspan=1>MLE*</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>70.91</td></tr><tr><td rowspan=1 colspan=1>MLE(test)*</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>74.12</td></tr><tr><td rowspan=1 colspan=1>MLE(train)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>77.92</td></tr><tr><td rowspan=1 colspan=1>MLE+</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>【</td><td rowspan=1 colspan=1>80.17</td></tr></table>
|
| 268 |
+
|
| 269 |
+
Table 7: Ablation analysis of filtering at training and test time. “Train” indicates a model whose training process uses data augmentation according to our framework. “Test” indicates a model that uses the external filter at prediction time to discard candidate outputs which fail to pass the filter. Note that MLE and MLE(test) are based on an MLE checkpoint which underperforms the published result from Bunel et al. (2018) by 1 point, due to training for fewer epochs.
|