Datasets:
Add files using upload-large-folder tool
Browse files- md/dev/89ia77nZ8u/89ia77nZ8u.md +0 -0
- md/dev/Loek7hfb46P/Loek7hfb46P.md +0 -0
- md/dev/T8wHz4rnuGL/T8wHz4rnuGL.md +0 -0
- md/dev/Uuf2q9TfXGA/Uuf2q9TfXGA.md +355 -0
- md/dev/VYYf6S67pQc/VYYf6S67pQc.md +335 -0
- md/dev/VpYBxaPLaj-/VpYBxaPLaj-.md +537 -0
- md/dev/jQgsZDspz5h/jQgsZDspz5h.md +378 -0
- md/train/-xEk43f_EO6/-xEk43f_EO6.md +277 -0
- md/train/2-0wS9-cSL/2-0wS9-cSL.md +424 -0
- md/train/3Aoft6NWFej/3Aoft6NWFej.md +274 -0
- md/train/B1M8JF9xx/B1M8JF9xx.md +324 -0
- md/train/BJfOXnActQ/BJfOXnActQ.md +284 -0
- md/train/CO87OIEOGU8/CO87OIEOGU8.md +229 -0
- md/train/ErivP29kYnx/ErivP29kYnx.md +258 -0
- md/train/H1eSS3CcKX/H1eSS3CcKX.md +704 -0
- md/train/H1ecDoR5Y7/H1ecDoR5Y7.md +515 -0
- md/train/HJWLfGWRb/HJWLfGWRb.md +264 -0
- md/train/HkSZyinVG/HkSZyinVG.md +250 -0
- md/train/HkeuD34KPH/HkeuD34KPH.md +303 -0
- md/train/HkxjYoCqKX/HkxjYoCqKX.md +306 -0
- md/train/HyAddcLge/HyAddcLge.md +265 -0
- md/train/HylsTT4FvB/HylsTT4FvB.md +418 -0
- md/train/HyxfGCVYDr/HyxfGCVYDr.md +263 -0
- md/train/Hyxu6oAqYX/Hyxu6oAqYX.md +478 -0
- md/train/LKUfuWxajHc/LKUfuWxajHc.md +274 -0
- md/train/LKoMTwTuQnC/LKoMTwTuQnC.md +304 -0
- md/train/MBH29cOeohr/MBH29cOeohr.md +484 -0
- md/train/S1Bb3D5gg/S1Bb3D5gg.md +258 -0
- md/train/S1sRrN-CW/S1sRrN-CW.md +262 -0
- md/train/SJxSOJStPr/SJxSOJStPr.md +555 -0
- md/train/SklD9yrFPS/SklD9yrFPS.md +433 -0
- md/train/SyProzZAW/SyProzZAW.md +427 -0
- md/train/SyevYxHtDB/SyevYxHtDB.md +369 -0
- md/train/T6AxtOaWydQ/T6AxtOaWydQ.md +527 -0
- md/train/Xb8xvrtB8Ce/Xb8xvrtB8Ce.md +472 -0
- md/train/dx11_7vm5_r/dx11_7vm5_r.md +0 -0
- md/train/fSTD6NFIW_b/fSTD6NFIW_b.md +0 -0
- md/train/hl3v8io3ZYt/hl3v8io3ZYt.md +268 -0
- md/train/hw2VfWAr6t6/hw2VfWAr6t6.md +288 -0
- md/train/ioyq7NsR1KJ/ioyq7NsR1KJ.md +321 -0
- md/train/jnRqf0CzBK/jnRqf0CzBK.md +281 -0
- md/train/lE1AB4stmX/lE1AB4stmX.md +326 -0
- md/train/luGQiBeRMxd/luGQiBeRMxd.md +543 -0
- md/train/r1CE9GWR-/r1CE9GWR-.md +391 -0
- md/train/r1fYuytex/r1fYuytex.md +283 -0
- md/train/rkRwGg-0Z/rkRwGg-0Z.md +306 -0
- md/train/rkeMHjR9Ym/rkeMHjR9Ym.md +0 -0
- md/train/rkmtTJZCb/rkmtTJZCb.md +314 -0
- md/train/rylnK6VtDH/rylnK6VtDH.md +341 -0
- md/train/tHgJoMfy6nI/tHgJoMfy6nI.md +290 -0
md/dev/89ia77nZ8u/89ia77nZ8u.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/Loek7hfb46P/Loek7hfb46P.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/T8wHz4rnuGL/T8wHz4rnuGL.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/Uuf2q9TfXGA/Uuf2q9TfXGA.md
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS UNDERSTANDING ENSEMBLE, KNOWLEDGE DISTILLATION AND SELF-DISTILLATION IN DEEP LEARNING
|
| 2 |
+
|
| 3 |
+
Zeyuan Allen-Zhu
|
| 4 |
+
Meta FAIR Labs
|
| 5 |
+
zeyuanallenzhu@meta.com
|
| 6 |
+
|
| 7 |
+
Yuanzhi Li Mohamed bin Zayed University of AI Yuanzhi.Li@mbzuai.ac.ae
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We formally study how ensemble of deep learning models can improve test accuracy, and how the superior performance of ensemble can be distilled into a single model using knowledge distillation. We consider the challenging case where the ensemble is simply an average of the outputs of a few independently trained neural networks with the same architecture, trained using the same algorithm on the same data set, and they only differ by the random seeds used in the initialization.
|
| 12 |
+
|
| 13 |
+
We show that ensemble/knowledge distillation in deep learning works very differently from traditional learning theory (such as boosting or NTKs). We develop a theory showing that when data has a structure we refer to as “multi-view”, then ensemble of independently trained neural networks can provably improve test accuracy, and such superior test accuracy can also be provably distilled into a single model. Our result sheds light on how ensemble works in deep learning in a way that is completely different from traditional theorems, and how the “dark knowledge” is hidden in the outputs of the ensemble and can be used in distillation.1
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Ensemble (Dietterich, 2000; Hansen & Salamon, 1990; Polikar, 2006) is one of the most powerful techniques in practice to improve the performance of deep learning. By simply averaging the outputs of merely a few (like 3 or 10) independently-trained neural networks of the same architecture, using the same training method over the same training data, it can significantly boost the prediction accuracy over the test set comparing to individual models. The only difference is the randomness used to initialize these networks and/or the randomness during training. Moreover, it is discovered by Hinton et al. (2015) that such superior performance of the ensemble can be transferred into a single model (of the same size as the individual models) using a technique called knowledge distillation: that is, simply train a single model to match the output of the ensemble (such as ${ \mathfrak { s o o } } \%$ cat $^ +$ $10 \%$ car”, also known as soft labels) as opposite to the true data labels, over the same training data.
|
| 18 |
+
|
| 19 |
+
On the theory side, there are lots of works studying the superior performance of ensemble from principled perspectives (see full version for citations). However, most of these works only apply to: (1). Boosting: where the coefficients associated with the combinations of the single models are actually trained, instead of simply taking average; (2). Bootstrapping/Bagging: the training data are different for each single model; (3). Ensemble of models of different types and architectures; or (4). Ensemble of random features or decision trees. To the best of our knowledge, none of these cited works apply to the particular type of ensemble that is widely used in deep learning: simply take a uniform average of the output of the learners, which are neural networks with the same architecture and are trained by stochastic gradient descent (SGD) over the same training set. In fact, very critically, for deep learning models:
|
| 20 |
+
|
| 21 |
+
• TRAINING AVERAGE DOES NOT WORK: if one directly trains to learn an average of individual neural networks initialized by different seeds, the performance is much worse than ensemble. • KNOWLEDGE DISTILLATION WORKS: the superior performance of ensemble in deep learning can be distilled into a single model (Hinton et al., 2015).
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Ensemble in deep learning is very different from ensemble in random feature mappings. Details in Figure 6.
|
| 25 |
+
|
| 26 |
+
• SELF-DISTILLATION WORKS: even distilling a single model into another of the same size, there is performance boost. (Furlanello et al., 2018; Mobahi et al., 2020; Zhang et al., 2019)
|
| 27 |
+
|
| 28 |
+
We are unaware of any satisfactory theoretical explanation for the phenomena above. For instance, as we shall argue, some traditional view for why ensemble works, such as ‘ensemble can enlarge the feature space in random feature mappings’, even give contradictory explanations to the above phenomena, thus cannot explain knowledge distillation or ensemble in deep learning. Motivated by this gap between theory and practice we study the following question for multi-class classification:
|
| 29 |
+
|
| 30 |
+
# Our theoretical questions:
|
| 31 |
+
|
| 32 |
+
How does ensemble improve the test-time performance in deep learning when we simply (unweightedly) average over a few independently trained neural networks? – Especially when all the neural networks have the same architecture, are trained over the same data set using the same standard training algorithm and only differ by the random seeds, and even when all single models already have $1 0 0 \%$ training accuracy? How can such superior test-time performance of ensemble be later “distilled” into a single neural network of the same architecture, simply by training the single model to match the output of the ensemble over the same training data set?
|
| 33 |
+
|
| 34 |
+
Our results. We prove for certain multi-class classification tasks with a special structure we refer to as multi-view, with a training set $\mathcal { Z }$ consisting of $N$ i.i.d. samples from some unknown distribution $\mathcal { D }$ , for certain two-layer convolutional network $f$ with (smoothed-)ReLU activation as learner:
|
| 35 |
+
|
| 36 |
+
• (Single model has bad test accuracy): there is a value $\mu > 0$ such that when a single model $f$ is trained over $\mathcal { Z }$ using the cross-entropy loss, via gradient descent (GD) starting from random Gaussian initialization, the model can reach zero training error efficiently. However, w.h.p. the prediction (classification) error of $f$ over $\mathcal { D }$ is between $0 . 4 9 \mu$ and $0 . 5 1 \mu$ .
|
| 37 |
+
|
| 38 |
+
• (Ensemble provably improves test accuracy): let $f _ { 1 } , f _ { 2 } , \cdots , f _ { L }$ be $L = \widetilde { \Omega } ( 1 )$ independently trained single models as above, then w.h.p. $\begin{array} { r } { \overline { { G } } = \frac { 1 } { L } \sum _ { \ell } f _ { \ell } } \end{array}$ has prediction error $\le 0 . 0 1 \mu$ over $\mathcal { D }$ .
|
| 39 |
+
|
| 40 |
+
• (Ensemble can be distilled into a single model): if we further train (using GD from random initialization) another single model $f _ { 0 }$ (same architecture as each $f _ { \ell } )$ to match the output of $\begin{array} { r } { G = \frac { 1 } { L } \sum _ { \ell } \bar { f } _ { \ell } } \end{array}$ merely over the same training data set $\mathcal { Z }$ , then $f _ { 0 }$ can be trained efficiently and w.h.p. $f _ { 0 }$ will have prediction error $\le 0 . 0 1 \mu$ over $\mathcal { D }$ as well.
|
| 41 |
+
|
| 42 |
+
• (Self-distillation also improves test accuracy): if we further train (using GD from random initialization) another single model $f ^ { \prime }$ (same architecture as $f _ { 1 } )$ ) to match the output of the single model $f _ { 1 }$ merely over the same training data set $\mathcal { Z }$ , then $f ^ { \prime }$ can be trained efficiently and w.h.p. has prediction error at most $\leq 0 . 2 6 \mu$ over $\mathcal { D }$ . The main idea is that self-distillation is performing “implicit ensemble $^ +$ knowledge distillation”, as we shall argue in Section 4.2.
|
| 43 |
+
|
| 44 |
+
We defer discussions of our empirical results to Section 5. However, we highlight some of the empirical findings, as they shall confirm and justify our theoretical approach studying ensemble and knowledge distillation in deep learning. Specifically, we give empirical evidences showing that:
|
| 45 |
+
|
| 46 |
+
• Knowledge distillation does not work for random feature mappings; and ensemble in deep learning is very different from ensemble in random feature mappings (see Figure 1). • Special structures in data (such as the “multi-view” structure we shall introduce) is needed for ensemble of neural networks to work. • The variance due to label noise or the non-convex landscape of training, in the independentlytrained models, may not be connected to the superior performance of ensemble in deep learning.
|
| 47 |
+
|
| 48 |
+
# 2 OUR METHODOLOGY AND INTUITION
|
| 49 |
+
|
| 50 |
+
# 2.1 A FAILURE ATTEMPT USING RANDOM FEATURE MAPPINGS
|
| 51 |
+
|
| 52 |
+
The recent advance in deep learning theory shows that under certain circumstances, neural networks can be treated as a linear function over random feature mappings — see (Allen-Zhu et al., 2019b; Arora et al., 2019b; Daniely et al., 2016; Du et al., $2 0 1 8 \mathrm { b }$ ; Jacot et al., 2018; Zou et al., 2018) and the references therein. In particular, the theory shows when $f : \mathbb { R } ^ { D + d } \mathbb { R }$ is a neural network with inputs $x \in \mathbb { R } ^ { d }$ and weights $W \in \mathbb { R } ^ { D }$ , in some cases, $f ( W , x )$ can be approximated by:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
f ( W , x ) \approx f ( W _ { 0 } , x ) + \left. W - W _ { 0 } , \nabla _ { W } f ( W _ { 0 } , x ) \right.
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $W _ { 0 }$ is the random initialization of the neural network, and $\Phi _ { W _ { 0 } } ( x ) : = \nabla _ { W } f ( W _ { 0 } , x )$ is the neural tangent kernel (NTK) feature mapping. This is known as the NTK approach. If this approximation holds, then training a neural network can be approximated by learning a linear function over random features $\Phi _ { W _ { 0 } } ( x )$ , which is very theory-friendly.
|
| 59 |
+
|
| 60 |
+
Ensemble works for random features / NTK. Traditional theorems (Alhamdoosh & Wang, 2014; Brown et al., 2005a; Bryll et al., 2003; Tsymbal et al., 2005) suggest that the ensemble of independently trained random feature models can indeed significantly improve test-time performance, as it enlarges the feature space from $\Phi _ { W _ { 0 } } ( x )$ to $\{ \Phi _ { W _ { 0 } ^ { ( i ) } } ( x ) \} _ { i \in [ L ] }$ for $L$ many independently sampled W (i)0 . This can be viewed as a feature selection process (Alvarez et al., 2012; Cai et al., 2018; Oliveira et al., 2003; Opitz, 1999; Rokach, 2010), and we have confirmed it for NTK in practice, see Figure 1. However, can we understand ensemble and knowledge distillation in $D L$ as feature selections using NTK? Unfortunately, our empirical results provide many counter examples towards those arguments, see discussions below and Figure 1.
|
| 61 |
+
|
| 62 |
+
Contradiction 1: training average works even better. Although ensemble of linear functions over NTK features with different random seeds: $f _ { i } ( x ) = \langle W ^ { ( i ) } , \Phi _ { W _ { 0 } ^ { ( i ) } } ( x ) \rangle$ does improve test accuracy, however, such improvement is mainly due to the use of a larger set of random features, whose combinations contain functions that generalize better. To see this, we observe that an even superior performance (than the ensemble) can simply be obtained by directly training $F ( x ) = { \textstyle { \frac { 1 } { L } } } \left( f _ { 1 } + \dot { f } _ { 2 } + \cdot \cdot \cdot + f _ { L } \right)$ from random initialization. In contrast, recall if $f _ { i } ( x )$ ’s are multi-layer neural networks with different random seeds, then training their average barely gives any better performance comparing to individual networks $f _ { i }$ , as now all the $f _ { i }$ ’s are capable of learning the same set of features.
|
| 63 |
+
|
| 64 |
+
Contradiction 2: knowledge distillation does not work. For NTK feature mappings, we observe that the result obtained by ensemble cannot be distilled at all into individual models, indicating the features selected by ensemble is not contained in the feature $\Phi _ { W _ { 0 } ^ { ( i ) } } ( x )$ of any individual model. In contrast, in actual deep learning, ensemble does not enlarge feature space: so an individual neural network is capable of learning the features of the ensemble model.
|
| 65 |
+
|
| 66 |
+
In sum, ensemble in deep learning may be very different from ensemble in random features. It may be more accurate to study ensemble / knowledge distillation in deep learning as a feature learning process, instead of a feature selection process. But still, we point out a fundamental difficulty:
|
| 67 |
+
|
| 68 |
+
# Key challenge:
|
| 69 |
+
|
| 70 |
+
If a single deep learning model is capable of — through knowledge distillation — learning the features of the ensemble model and achieving better test accuracy comparing to training the single model directly (and the same training accuracy, typically at global optimal of $1 0 0 \%$ ), then why the single model cannot learn these features directly when we train the model to match the true data labels? What is the dark knowledge hidden in the output of ensemble (a.k.a. soft label)2 comparing to the original hard label?
|
| 71 |
+
|
| 72 |
+
# 2.2 ENSEMBLE IN DEEP LEARNING: A FEATURE LEARNING PROCESS
|
| 73 |
+
|
| 74 |
+
Before addressing the key challenge, we point out that prior works are very limited with respect to studying neural network training as a feature learning process. Most of the existing works proving that neural networks can learn features only focus on the case when the input is Gaussian or
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 2: Illustration of images with multiple views (features) in the ImageNet dataset.
|
| 78 |
+
|
| 79 |
+
Gaussian-like — see for instance (Kawaguchi, 2016; Soudry & Carmon, 2016; Xie et al., 2016) and many others. However, as we demonstrate in Figure 7 in the full version,
|
| 80 |
+
|
| 81 |
+
# Ensemble in DL might not improve test accuracy when inputs are Gaussian-like:
|
| 82 |
+
|
| 83 |
+
Empirically, ensemble does not improve test accuracy in deep learning, in certain scenarios when the distribution of the input data is Gaussian or even mixture of Gaussians. This is true over various learner network structures (fully-connected, residual, convolution neural networks) and various labeling functions (when the labels are generated by linear functions, fully-connected, residual, convolutional networks, with/without label noise, with/without classification margin).
|
| 84 |
+
|
| 85 |
+
Bias variance view of ensemble: Some prior works also try to attribute the benefit of ensemble as reducing the variance of individual solutions due to label noise or non-convex landscape of the training objective. However, reducing such variance can reduce a convex test loss (typically crossentropy), but not necessarily the test classification error. Concretely, the synthetic experiments in Figure 7 show that, after applying ensemble over Gaussian-like inputs, the variance of the model outputs is reduced but the test accuracy is not improved. We give many more empirical evidences to show that the variance (either from label noise or from the non-convex landscape) is usually not the cause for why ensemble works in deep learning, see Section 5.
|
| 86 |
+
|
| 87 |
+
Hence, to understand the true benefit of ensemble in deep learning in theory, we would like to study a setting that can approximate practical deep learning, where:
|
| 88 |
+
|
| 89 |
+
• The input distribution is more structured than standard Gaussian and there is no label noise. (From above discussions, ensemble cannot work for deep learning distribution-freely). • The individual neural networks all are well-trained, in the sense that the training accuracy in the end is $1 0 0 \%$ , and there is nearly no variance in the test accuracy for individual models. (So training never fails.)
|
| 90 |
+
|
| 91 |
+
In this work, we propose to study a setting of data that we refer to as multi-view, where the above two conditions both hold when we train a two-layer neural networks with (smoothed-)ReLU activations. We also argue that the multi-view structure we consider is fairly common in the data sets used in practice, in particular for vision tasks. We give more details below.
|
| 92 |
+
|
| 93 |
+
# 2.3 OUR APPROACH: LEARNING MULTI-VIEW DATA
|
| 94 |
+
|
| 95 |
+
Let us first give a thought experiment to illustrate our approach, and we present the precise mathematical definition of the “multi-view” structure in Section 3. Consider a binary classification problem and four “features” $v _ { 1 } , v _ { 2 } , v _ { 3 } , v _ { 4 }$ . The first two features correspond to the first class label, and the next two features correspond to the second class label. In the data distribution:
|
| 96 |
+
|
| 97 |
+
• When the label is class 1, then:3
|
| 98 |
+
|
| 99 |
+
both $v _ { 1 } , v _ { 2 }$ appears with weight 1, one of $v _ { 3 } , v _ { 4 }$ appears with weight 0.1 w.p. $8 0 \%$
|
| 100 |
+
only $v _ { 1 }$ appears with weight 1, one of $v _ { 3 } , v _ { 4 }$ appears with weight 0.1 w.p. $1 0 \%$
|
| 101 |
+
only $v _ { 2 }$ appears with weight 1, one of $v _ { 3 } , v _ { 4 }$ appears with weight 0.1 w.p. $1 0 \%$
|
| 102 |
+
|
| 103 |
+
• When the label is class 2, then
|
| 104 |
+
|
| 105 |
+
both $v _ { 3 } , v _ { 4 }$ appears with weight 1, one of $v _ { 1 } , v _ { 2 }$ appears with weight 0.1 w.p. $8 0 \%$
|
| 106 |
+
only $v _ { 3 }$ appears with weight 1, one of $v _ { 1 } , v _ { 2 }$ appears with weight 0.1 w.p. $1 0 \%$
|
| 107 |
+
only $v _ { 4 }$ appears with weight 1, one of $v _ { 1 } , v _ { 2 }$ appears with weight 0.1 w.p. $1 0 \%$
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 3: Visualization of the channels in layer-23 of a ResNet-34 trained on CIFAR-10.
|
| 111 |
+
|
| 112 |
+
We call the $8 0 \%$ of the data multi-view data: these are the data where multiple features exist and can be used to classify them correctly. We call the rest $2 0 \%$ of the data single-view data: some features for the correct labels are missing. 4
|
| 113 |
+
|
| 114 |
+
How individual neural networks learn. Under the multi-view data defined above, if we train a neural network using the cross-entropy loss via gradient descent (GD) from random initialization, during the training process of the individual networks, we show that:
|
| 115 |
+
|
| 116 |
+
• The network will quickly pick up one of the feature $v \in \{ v _ { 1 } , v _ { 2 } \}$ for the first label, and one of the features $v ^ { \prime } \in \bar { \{ v _ { 3 } , v _ { 4 } \} }$ for the second label. So, $9 0 \%$ of the training examples, consisting of all the multi-view data and half of the single-view data (those with feature $v$ or $v ^ { \prime }$ ), are classified correctly. Once classified correctly (with a large margin), these data begin to contribute negligible to gradient by the nature of the cross-entropy loss. • Next, the network will memorize (using e.g. the noise in the data) the remaining $1 0 \%$ of the training examples without learning any new features, due to insufficient amount of left-over samples after the first phase, thus achieving training accuracy $1 0 0 \%$ but test accuracy $9 0 \%$ .
|
| 117 |
+
|
| 118 |
+
How ensemble improves test accuracy. It is simple why ensemble works. Depending on the randomness of initialization, each individual network will pick up $v _ { 1 }$ or $v _ { 2 }$ each w.p. $5 0 \%$ . Hence, as long as we ensemble ${ \widetilde { O } } ( 1 )$ many independently trained models, w.h.p. their ensemble will pick up both features $\{ v _ { 1 } , v _ { 2 } \}$ and both features $\{ v _ { 3 } , v _ { 4 } \}$ . Thus, all the data will be classified correctly.
|
| 119 |
+
|
| 120 |
+
How knowledge distillation works. Perhaps less obvious is how knowledge distillation works. Since ensemble learns all the features $v _ { 1 } , v _ { 2 } , v _ { 3 } , v _ { 4 }$ , given a multi-view data with label 1, the ensemble will actually output $\propto ( 2 , 0 . 1 )$ , where the 2 comes from features $v _ { 1 } , v _ { 2 }$ and 0.1 comes from one of $v _ { 3 } , v _ { 4 }$ . On the other hand, an individual model learning only one of $v _ { 3 } , v _ { 4 }$ will actually output $\propto ( 2 , 0 )$ when the feature $v _ { 3 }$ or $v _ { 4 }$ in the data does not match the one learned by the model. Hence, by training the individual model to match the output of the ensemble, the individual model is forced to learn both features $v _ { 3 } , v _ { 4 }$ , even though it has already perfectly classified the training data. This is the “dark knowledge” hidden in the output of the ensemble model. (This theoretical finding is consistent with practice: Figure 8 in the full paper suggests that models trained from knowledge distillation should have learned most of the features, and further computing their ensemble does not give much performance boost.)
|
| 121 |
+
|
| 122 |
+
Significance of our technique. Our work belongs to the generic framework of feature learning in DL where one proves that certain aspects of the algorithm (e.g. the randomness) affects the order where features are learned. This is fundamentally different from convex optimization, such as kernel method, where (with $\ell _ { 2 }$ regularization) there is an unique global minimum so the choice of the random seed does not matter (thus, ensemble does not help). There are other works that consider other aspects, such as the choice of learning rate, that can affect the order where the features are learned (Li et al., 2019). Our work is fundamentally different: they only focus on the NTK setting where the features are not learned; we study a feature learning process. Recall, the NTK setting cannot be used to explain ensemble and distillation in DL. Our work extends the reach of traditional machine learning theory, where typically the “generalization” is separated from “optimization.” Such “separate” treatment might not be enough to understand how deep learning works.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 4: Illustration of a multi-view and a single-view data point; the feature vectors can also be combined with feature noise and random noise, see Def. 3.1.
|
| 126 |
+
|
| 127 |
+
# 3 PROBLEM SETUP
|
| 128 |
+
|
| 129 |
+
The “multi-view” data distribution is a straight-forward generalization of the intuitive setting in Section 2.3. For simplicity, in the main body, we use example choices of the parameters mainly a function of $k$ (such as $P = k ^ { 2 }$ , $\begin{array} { r } { \gamma = \frac { 1 } { k ^ { 1 . 5 } } } \end{array}$ , $\textstyle \mu = { \frac { k ^ { 1 . 2 } } { N } }$ , $\rho = k ^ { - 0 . 0 1 }$ , $\sigma _ { 0 } = 1 / \sqrt { k }$ as we shall see), and we consider the case when $k$ is sufficiently large. In our full version, we shall give a much larger range of parameters for the theorems to hold.
|
| 130 |
+
|
| 131 |
+
# 3.1 DATA DISTRIBUTION AND NOTATIONS
|
| 132 |
+
|
| 133 |
+
We consider learning a $k$ -class classification problem over $P$ -patch inputs, where each patch has dimension $d$ . In symbols, each labelled data is represented by $( X , y )$ where $X = ( x _ { 1 } , x _ { 2 } , \cdot \cdot \cdot , x _ { P } ) \in$ $( \mathbb { R } ^ { d } ) ^ { P }$ is the data vector and $y \in [ k ]$ is the data label. For simplicity, we focus on the case when ${ \dot { P } } = k ^ { 2 }$ , and $d = { \mathsf { p o l y } } ( k )$ for a large polynomial.
|
| 134 |
+
|
| 135 |
+
We consider the setting when $k$ is sufficiently large.5 We use “w.h.p.” to denote with probability at least $1 - e ^ { - \Omega ( \log ^ { 2 } k ) }$ , and use $\widetilde { O } , \widetilde { \Theta } , \widetilde { \Omega }$ notions to hide polylogarithmic factors in $k$ .
|
| 136 |
+
|
| 137 |
+
We first assume that each label class $j \in [ k ]$ has multiple associated features, say two features for the simplicity of math, represented by unit feature vectors $v _ { j , 1 } , v _ { j , 2 } \in \mathbb { R } ^ { d }$ . For notation simplicity, we assume that all the features are orthogonal, namely,
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array} { r } { \forall j , j ^ { \prime } \in [ k ] , \forall \ell , \ell ^ { \prime } \in [ 2 ] , \| v _ { j , \ell } \| _ { 2 } = 1 \quad \mathrm { a n d } v _ { j , \ell } \bot v _ { j ^ { \prime } , \ell ^ { \prime } } \mathrm { w h e n } ( j , \ell ) \ne ( j ^ { \prime } , \ell ^ { \prime } ) } \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
although our work also extends to the “incoherent” case trivially. We denote by
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\mathcal { V } : = \{ v _ { j , 1 } , v _ { j , 2 } \} _ { j \in [ k ] }
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
We consider the following data and label distribution. Let $C _ { p }$ be a global constant, $s \in [ 1 , k ^ { 0 . 2 } ]$ be a sparsity parameter. To be concise, we define the multi-view distribution $\mathcal { D } _ { m }$ and single-view distribution $\mathcal { D } _ { s }$ together. Due to space limitation, here we hide the specification of the random “noise” and defer it to the full version.6
|
| 150 |
+
|
| 151 |
+
Definition 3.1 (data distributions $\mathcal { D } _ { m }$ and $\mathcal { D } _ { s }$ ). Given $\mathcal { D } \in \{ \mathcal { D } _ { m } , \mathcal { D } _ { s } \}$ , we define $( X , y ) \sim \mathcal { D }$ as follows. First choose the label $y \in [ k ]$ uniformly at random. Then, the data vector $X$ is generated
|
| 152 |
+
|
| 153 |
+
as follows (also illustrated in Figure 4).
|
| 154 |
+
|
| 155 |
+
1. Denote $\mathcal { V } ( X ) = \{ v _ { y , 1 } , v _ { y , 2 } \} \cup \mathcal { V } ^ { \prime }$ as the set of feature vectors used in this data vector $X$ , where $\mathcal { V } ^ { \prime }$ is a set of features uniformly sampled from $\left\{ v _ { j ^ { \prime } , 1 } , v _ { j ^ { \prime } , 2 } \right\} _ { j ^ { \prime } \in [ k ] \backslash \{ y \} }$ , each with probability $\frac { s } { k }$ .
|
| 156 |
+
|
| 157 |
+
2. For each $v \in \mathcal { V } ( X )$ , pick $C _ { p }$ many disjoint patches in $[ P ]$ and denote it as $\mathcal { P } _ { v } ( X ) \subset [ P ]$ (the distribution of these patches can be arbitrary). We denote $\mathcal { P } ( X ) = \cup _ { v \in \mathcal { V } ( X ) } \mathcal { P } _ { v } ( X )$ .
|
| 158 |
+
|
| 159 |
+
3. If $\mathcal { D } = \mathcal { D } _ { s }$ is the single-view distribution, pick a value ${ \widehat { \ell } } = { \widehat { \ell } } ( X ) \in$ [2] uniformly at random.
|
| 160 |
+
|
| 161 |
+
4. For each $v \in \mathcal { V } ( X )$ and $p \in { \mathcal { P } } _ { v } ( X )$ , we set $x _ { p } = z _ { p } v + \mathbf { \zeta } ^ { \cdot } n o i s e ^ { , \cdot } \in \mathbb { R } ^ { d }$ , where, the random coefficients $z _ { p } \geq 0$ satisfy that:
|
| 162 |
+
|
| 163 |
+
In the case of multi-view distribution $\mathcal { D } = \mathcal { D } _ { m }$ ,
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\begin{array} { r l } & { \sum _ { p \in \mathcal { P } _ { v } ( X ) } z _ { p } \in [ 1 , O ( 1 ) ] ~ w h e n ~ v \in \{ v _ { y , 1 } , v _ { y , 2 } \} , \quad ^ { 7 } } \\ & { \sum _ { p \in \mathcal { P } _ { v } ( X ) } z _ { p } \in [ \Omega ( 1 ) , 0 . 4 ] ~ w h e n ~ v \in \mathcal { V } ( X ) \setminus \{ v _ { y , 1 } , v _ { y , 2 } \} , } \end{array}
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
In the case of single-view distribution $\mathcal { D } = \mathcal { D } _ { s }$ ,
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\begin{array} { r l } & { \sum _ { p \in \mathcal { P } _ { v } ( X ) } z _ { p } \in [ 1 , O ( 1 ) ] ~ w h e n ~ v = v _ { y , \widehat { \ell } } , } \\ & { \sum _ { p \in \mathcal { P } _ { v } ( X ) } z _ { p } \in [ \rho , O ( \rho ) ] ~ w h e n ~ v = v _ { y , 3 - \widehat { \ell } } , } \\ & { \sum _ { p \in \mathcal { P } _ { v } ( X ) } z _ { p } \in [ \Omega ( \Gamma ) , \Gamma ] ~ w h e n ~ v \in \mathcal { V } ( X ) \setminus \{ v _ { y , 1 } , v _ { y , 2 } \} . } \end{array}
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
5. For each $p \in [ P ] \setminus { \mathcal { P } } ( X )$ , we set $x _ { p }$ to consist only of “noise”.
|
| 176 |
+
|
| 177 |
+
Remark 3.2. The distribution of how to pick ${ \mathcal { P } } ( X )$ and assign $\sum _ { p \in \mathcal { P } _ { v } ( X ) } z _ { p }$ to each patch in $p \in$ ${ \mathcal { P } } _ { v } ( X )$ can be arbitrary (and can depend on other randomness in the data as well). In particular, we have allowed different features $v _ { j , 1 } , v _ { j , 2 }$ to show up with different weights in the data (for example, for multi-view data, some view $v _ { y , 1 }$ can consistently have larger $z _ { p }$ comparing to $v _ { y , 2 }$ ). Yet, we shall prove that the order to learn these features by the learner network can still be flipped depending on the randomness of network initialization.
|
| 178 |
+
|
| 179 |
+
Interpretation of our data distribution. As we argue more in the full paper, our setting can be tied to a down-sized version of convolutional networks applied to image classification data. With a small kernel size, good features in an image typically appear only at a few patches, and most other patches are random noise or low-magnitude feature noises. More importantly, our noise parameters shall ensure that, the concept class is not learnable by linear classifiers or constant degree polynomials. We believe a (convolutional) neural network with ReLU-like activation is somewhat necessary.
|
| 180 |
+
|
| 181 |
+
Our final data distribution $\mathcal { D }$ , and the training data set $\mathcal { Z }$ are formally given as follows.
|
| 182 |
+
|
| 183 |
+
Definition 3.3 ( $\mathcal { D }$ and $\mathcal { Z }$ ). The distribution $\mathcal { D }$ consists of data from $\mathcal { D } _ { m }$ w.p. $1 - \mu$ and from $\mathcal { D } _ { s }$ w.p. $\mu$ . We are given $N$ training samples from $\mathcal { D }$ , and denote the training data set as $\mathcal { Z } = \mathcal { Z } _ { m } \cup \mathcal { Z } _ { s }$ where ${ \mathcal { Z } } _ { m }$ and $\mathcal { Z } _ { s }$ respectively represent multi-view and single-view training data. We write $( X , y ) \sim { \mathcal { Z } }$ as $( X , y )$ sampled uniformly at random from the empirical data set, and denote $N _ { s } = | \mathcal { Z } _ { s } |$ . $W e$ again for simplicity focus on the setting when $\begin{array} { r } { \mu = \frac { \bar { 1 } } { \mathsf { p o l y } ( k ) } } \end{array}$ and we are given samples $N = { \dot { k } } ^ { 1 . 2 } / \mu .$ so each label i appears at least $\widetilde \Omega ( 1 )$ in $\mathcal { Z } _ { s }$ . Our result trivially applies to many other choices of $N$ .
|
| 184 |
+
|
| 185 |
+
# 3.2 LEARNER NETWORK
|
| 186 |
+
|
| 187 |
+
We consider a learner network using the following smoothed ReLU activation function $\widetilde { \sf R e L U }$ :
|
| 188 |
+
|
| 189 |
+
Definition 3.4. For integer $q \geq 2$ and threshold $\varrho = \frac { 1 } { \mathsf { p o l y l o g } ( k ) }$ , the smoothed function $\widetilde { \mathsf { R e L U } } ( z ) : = 0$ for $z \le 0$ ; $\begin{array} { r } { \widetilde { \mathsf { R e L U } } ( z ) : = \frac { z ^ { q } } { q \varrho ^ { q - 1 } } } \end{array}$ for $z \in [ 0 , \varrho ]$ ; and $\begin{array} { r } { \widetilde { \mathsf { R e L U } } ( z ) : = z - ( 1 - \frac { 1 } { q } ) \varrho } \end{array}$ for $z \geq \varrho$ .
|
| 190 |
+
|
| 191 |
+
Since $\widetilde { \sf R e L U }$ is smooth we denote its gradient as $\widetilde { \mathsf { R e L U } } ^ { \prime } ( z )$ . We focus on $q = 4$ while our result applies to other constants $q \geq 3$ (see full version) or most other forms of smoothing.
|
| 192 |
+
|
| 193 |
+
The learner network $F ( X ) _ { \cdot } = ( F _ { 1 } ( X ) , \dots , F _ { k } ( X ) ) \in \mathbb { R } ^ { k }$ is a two-layer convolutional network parameterized by $w _ { i , r } \in \mathbb { R } ^ { d }$ for $i \in [ k ] , r \in [ m ]$ , satisfying
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\begin{array} { r l } { \forall i \in [ k ] \colon } & { { } F _ { i } ( X ) = \sum _ { r \in [ m ] } \sum _ { p \in [ P ] } \widetilde { \mathsf { R e L U } } ( \langle w _ { i , r } , x _ { p } \rangle ) } \end{array}
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
Although there exists network with $m = 2$ that can classify the data correctly (e.g. $w _ { i , r } = v _ { i , r }$ for $r \in [ 2 ] )$ ), in this paper, for efficient optimization purpose it is convenient to work on a moderate level of over-parameterization: $m \in [ { \mathsf { p o l y l o g } } ( k ) , k ]$ . Our lower bounds hold for any $m$ in this range and upper bounds hold even for small over-parameterization $m = { \mathsf { p o l y l o g } } ( k )$ .
|
| 200 |
+
|
| 201 |
+
Training a single model. We learn the concept class (namely, the labeled data distribution) using gradient descent with learning rate $\eta > 0$ , over the cross-entropy loss function $L$ using $N$ training data points $\mathcal { Z } = \{ ( X _ { i } , y _ { i } ) \} _ { i \in [ N ] }$ . We denote the empirical loss as:
|
| 202 |
+
|
| 203 |
+
$$
|
| 204 |
+
\begin{array} { r } { L ( F ) = \frac { 1 } { N } \sum _ { i \in [ N ] } L ( F ; X _ { i } , y _ { i } ) = \mathbb { E } _ { ( X , y ) \sim \mathcal { Z } } [ L ( F ; X , y ) ] } \end{array}
|
| 205 |
+
$$
|
| 206 |
+
|
| 207 |
+
where $\begin{array} { r } { L ( F ; X , y ) = - \log { \frac { e ^ { F _ { y } ( X ) } } { \sum _ { j \in [ k ] } e ^ { F _ { j } ( X ) } } } } \end{array}$ g eFy(X)Pj∈[k] eFj (X) . We randomly initialize the network F by letting each $w _ { i , r } ^ { ( 0 ) } \sim \mathcal { N } ( 0 , \sigma _ { 0 } ^ { 2 } I )$ for $\sigma _ { 0 } ^ { 2 } = 1 / k$ , which is the most standard initialization people use in practice.
|
| 208 |
+
|
| 209 |
+
To train a single model, at each iteration $t$ we update using gradient descent (GD):9
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
w _ { i , r } ^ { ( t + 1 ) } \gets w _ { i , r } ^ { ( t ) } - \eta \mathbb { E } _ { ( X , y ) \sim \mathcal { Z } } \nabla _ { w _ { i , r } } L ( F ^ { ( t ) } ; X , y )
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
We run the algorithm for $T = { \mathsf { p o l y } } ( k ) / \eta$ iterations. We use $F ^ { ( t ) }$ to denote the model $F$ with hidden weights $\{ w _ { i , r } ^ { ( t ) } \}$ at iteration $t$ .
|
| 216 |
+
|
| 217 |
+
Notations. We denote by $\begin{array} { r } { \mathbf { l o g i t } _ { i } ( F , X ) : = \frac { e ^ { F _ { i } ( X ) } } { \sum _ { j \in [ k ] } e ^ { F _ { j } ( X ) } } , } \end{array}$ = eFi(X)Pj∈[k] eFj (X) . Using this, we can write down
|
| 218 |
+
|
| 219 |
+
$$
|
| 220 |
+
\forall i \in [ k ] , r \in [ m ] \colon \quad - \nabla _ { w _ { i , r } } L ( F ; X , y ) = ( \mathbb { 1 } _ { i \neq y } - \log \operatorname { i } \mathbf { t } _ { i } ( F , X ) ) \nabla _ { w _ { i , r } } F _ { i } ( X ) ~ .
|
| 221 |
+
$$
|
| 222 |
+
|
| 223 |
+
# 4 MAIN THEOREMS AND EXPLANATIONS
|
| 224 |
+
|
| 225 |
+
We now state the main theorems (and the one for self-distillation is in the full paper).10
|
| 226 |
+
|
| 227 |
+
Theorem 1 (single model). For every sufficiently large $k > 0$ , every $m \in [ { \mathsf { p o l y l o g } } ( k ) , k ] ,$ , every $\eta \leq$ 1poly(k) , suppose we train a single model using the gradient descent update (3.1) starting from the random initialization defined in Section 3.2, then after T = poly(k) many iterations, with probability $\geq 1 - e ^ { - \Omega ( \log ^ { 2 } k ) }$ , the model $F ^ { ( T ) }$ satisfies:
|
| 228 |
+
|
| 229 |
+
• (training is perfect): meaning for all $( X , y ) \in { \mathcal { Z } }$ , all $i \in [ k ] \setminus \{ y \}$ : ${ \cal F } _ { y } ^ { ( T ) } ( X ) > { \cal F } _ { i } ^ { ( T ) } ( X ) .$
|
| 230 |
+
|
| 231 |
+
• (test accuracy is consistently bad): meaning that:
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
{ \bf P r } _ { ( X , y ) \sim \mathcal { D } } [ \exists i \in [ k ] \setminus \{ y \} : F _ { y } ^ { ( T ) } ( X ) < F _ { i } ^ { ( T ) } ( X ) ] \in [ 0 . 4 9 \mu , 0 . 5 1 \mu ] \ .
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
We shall give technical intuitions about why Theorem 1 holds in the full version. But, at a high-level, we shall construct a “lottery winning” set $\mathcal { M } \subseteq [ k ] \times [ 2 ]$ of cardinality $| \mathcal { M } | \in [ k ( 1 - o ( 1 ) ) , k ]$ . It only depends on the random initialization of $F$ . Then, with some effort we can prove that, for every $( i , \ell ) \in \mathcal { M }$ , at the end of the training $F ^ { ( T ) }$ will learn feature $v _ { i , \ell }$ but not learn feature $v _ { i , 3 - \ell }$ . This means for those single-view data $( X , y )$ with $y = i$ and ${ \widehat { \ell } } ( X ) = 3 - \ell$ , the final network $F ^ { ( T ) }$ will predict its label wrong. This is why the final test accuracy is around $0 . 5 \mu$ .
|
| 238 |
+
|
| 239 |
+
Note the property that test accuracy consistently belongs to the range $[ 0 . 4 9 \mu , 0 . 5 1 \mu ]$ should be reminiscent of message $\textcircled{5}$ in Figure 6, where multiple single models, although starting from different random initialization, in practice does have a relatively small variance in test accuracies.
|
| 240 |
+
|
| 241 |
+
Ensemble. Suppose $\{ F ^ { [ \ell ] } \} _ { \ell \in [ K ] }$ are $K = \widetilde \Omega ( 1 )$ independently trained models of $F$ with $m =$ polylog $( k )$ for $\begin{array} { r } { T = O \big ( \frac { \mathsf { p o l y } ( k ) } { \eta } \big ) } \end{array}$ iterations (i.e., the same setting as Theorem 1 except we only need a small over-parameterization $m = { \mathsf { p o l y l o g } } ( k ) .$ ). Let us define their ensemble
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
\begin{array} { r } { G ( X ) = \frac { \widetilde { \Theta } ( 1 ) } { K } \sum _ { \ell } F ^ { [ \ell ] } ( X ) } \end{array}
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
Theorem 2 (ensemble). In the same setting as Theorem $I$ except now we only need a small $m =$ polylog $( k )$ , we have for the ensemble model $G$ in (4.1), with probability at least $1 - e ^ { - \Omega ( \log ^ { 2 } k ) }$ :
|
| 248 |
+
|
| 249 |
+
• (training is perfect): meaning for all $( X , y ) \in { \mathcal { Z } }$ , for all $i \in [ k ] \setminus \{ y \}$ : $G _ { y } ( X ) > G _ { i } ( X )$ .
|
| 250 |
+
|
| 251 |
+
• (test accuracy is almost perfect): meaning that:
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
{ \bf P r } _ { ( X , y ) \sim { \mathcal D } } [ \exists i \in [ k ] \setminus \{ y \} : G _ { y } ( X ) < G _ { i } ( X ) ] \le 0 . 0 0 1 \mu ~ .
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
As we discussed in Section 2.3, the reason Theorem 2 holds attributes to the fact that those lottery winning sets $\mathcal { M }$ depend on the random initialization of the networks; and therefore, when multiple models are put together, their “union” of $\mathcal { M }$ shall cover all possible features $\{ v _ { i , \ell } \} _ { ( i , \ell ) \in [ k ] \times [ 2 ] }$ . Moreover, our theorem only requires individual $K = \widetilde \Omega ( 1 )$ models for ensemble, which is indeed “averaging the output of a few independently trained models”.
|
| 258 |
+
|
| 259 |
+
# 4.1 KNOWLEDGE DISTILLATION FOR ENSEMBLE
|
| 260 |
+
|
| 261 |
+
We consider a knowledge distillation algorithm given the existing ensemble model $G$ (see (4.1)) as follows. For every label $i \in [ k ]$ , let us define the truncated scaled logit as (for $\begin{array} { r } { \tau = \frac { 1 } { \log ^ { 2 } k } ) } \end{array}$
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\begin{array} { r } { \mathbf { l o g i t } _ { i } ^ { \tau } ( F , X ) = \frac { e ^ { \operatorname* { m i n } \{ \tau ^ { 2 } F _ { i } ( X ) , 1 \} / \tau } } { \sum _ { j \in [ k ] } e ^ { \operatorname* { m i n } \{ \tau ^ { 2 } F _ { j } ( X ) , 1 \} / \tau } } } \end{array}
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
(This should be reminiscent of the logit function with temperature used by the original knowledge distillation work (Hinton et al., 2015); we use truncation instead which is easier to analyze.)
|
| 268 |
+
|
| 269 |
+
Now, we train a new network $F$ from random initialization (where the randomness is independent of all of those used in $F ^ { [ \ell ] }$ ). At every iteration $t$ , we update each weight $w _ { i , r }$ by:
|
| 270 |
+
|
| 271 |
+
$$
|
| 272 |
+
\begin{array} { r } { v _ { i , r } ^ { ( t + 1 ) } = w _ { i , r } ^ { ( t ) } - \eta \nabla _ { w _ { i , r } } L ( F ^ { ( t ) } ) - \eta ^ { \prime } \mathbb { E } _ { ( X , y ) \sim \mathcal { Z } } \left[ \left( \mathbf { l o g } \mathbf { i t } _ { i } ^ { \tau } ( F ^ { ( t ) } , X ) - \mathbf { l o g } \mathbf { i t } _ { i } ^ { \tau } ( G , X ) \right) ^ { - } \nabla _ { w _ { i , r } } F _ { i } ^ { ( t ) } ( X - Y ) \right] , } \end{array}
|
| 273 |
+
$$
|
| 274 |
+
|
| 275 |
+
Notation. Throughout the paper we denote by $[ a ] ^ { + } = \operatorname* { m a x } \{ 0 , a \}$ and $[ a ] ^ { - } = \operatorname* { m i n } \{ 0 , a \}$ .
|
| 276 |
+
|
| 277 |
+
This knowledge distillation method (4.3) is almost identical to the one used in the original work (Hinton et al., 2015), except we use a truncation during the training to make it more (theoretically) stable. Moreover, we update the distillation objective using a larger learning rate $\eta ^ { \prime }$ comparing to $\eta$ of the cross-entropy objective. This is also consistent with the training schedule used in (Hinton et al., 2015).
|
| 278 |
+
|
| 279 |
+
Let $F ^ { ( t ) }$ be the resulting network obtained by (4.3) at iteration $t$ . We have the following theorem:
|
| 280 |
+
|
| 281 |
+
Theorem 3 (ensemble distillation). Consider the distillation algorithm (4.3) in which $G$ is the ensemble model defined in (4.1). For every k > 0, for m = polylog(k), for every η ≤ 1poly(k) , setting η′ = ηpoly(k), after T = poly(k) many iterations with probability at least $1 - e ^ { - \Omega ( \log ^ { 2 } k ) }$ , for at least $90 \%$ of the iterations $t \leq \dot { T }$ :
|
| 282 |
+
|
| 283 |
+
• (test accuracy is almost perfect): meaning that:
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
\operatorname { \bf P r } _ { ( X , y ) \sim \mathcal { D } } [ \exists i \in [ k ] \setminus \{ y \} : F _ { y } ^ { ( t ) } ( X ) < F _ { i } ^ { ( t ) } ( X ) ] \le 0 . 0 0 1 \mu .
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
Remark. Theorem 3 necessarily means that the distilled model $F$ has learned all the features $\underline { { \{ v _ { i , \ell } \} } } _ { ( i , \ell ) \in \lbrack k \rbrack \times \lbrack 2 \rbrack }$ from the ensemble model $G$ . This is consistent with our empirical findings in Figure 8: if one trains multiple individual models using knowledge distillation with different random seeds, then their ensemble gives no further performance boost.
|
| 290 |
+
|
| 291 |
+
REFERENCES
|
| 292 |
+
Monther Alhamdoosh and Dianhui Wang. Fast decorrelated neural network ensembles with random weights. Information Sciences, 264:104–117, 2014.
|
| 293 |
+
Zeyuan Allen-Zhu and Yuanzhi Li. What Can ResNet Learn Efficiently, Going Beyond Kernels? In NeurIPS, 2019a. Full version available at http://arxiv.org/abs/1905.10337.
|
| 294 |
+
Zeyuan Allen-Zhu and Yuanzhi Li. Can SGD Learn Recurrent Neural Networks with Provable Generalization? In NeurIPS, 2019b. Full version available at http://arxiv.org/abs/ 1902.01028.
|
| 295 |
+
Zeyuan Allen-Zhu and Yuanzhi Li. Backward feature correction: How deep learning performs deep learning. arXiv preprint arXiv:2001.04413, 2020.
|
| 296 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. On the convergence rate of training recurrent neural networks. In NeurIPS, 2019a. Full version available at http://arxiv.org/abs/1810. 12065.
|
| 297 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In ICML, 2019b. Full version available at http://arxiv.org/abs/ 1811.03962.
|
| 298 |
+
Jose M Alvarez, Yann LeCun, Theo Gevers, and Antonio M Lopez. Semantic road segmentation via multi-scale ensembles of learned features. In European Conference on Computer Vision, pp. 586–595. Springer, 2012.
|
| 299 |
+
Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Ruslan Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. arXiv preprint arXiv:1904.11955, 2019a.
|
| 300 |
+
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. CoRR, abs/1901.08584, 2019b. URL http://arxiv.org/abs/1901.08584.
|
| 301 |
+
Veronica Bol ´ on-Canedo and Amparo Alonso-Betanzos. Ensembles for feature selection: A review ´ and future trends. Information Fusion, 52:1–12, 2019.
|
| 302 |
+
Leo Breiman. Bagging predictors. Machine learning, 24(2):123–140, 1996.
|
| 303 |
+
Gavin Brown, Jeremy Wyatt, Rachel Harris, and Xin Yao. Diversity creation methods: a survey and categorisation. Information Fusion, 6(1):5–20, 2005a.
|
| 304 |
+
Gavin Brown, Jeremy L Wyatt, and Peter Tino. Managing diversity in regression ensembles. ˇ Journal of machine learning research, 6(Sep):1621–1650, 2005b.
|
| 305 |
+
Robert Bryll, Ricardo Gutierrez-Osuna, and Francis Quek. Attribute bagging: improving accuracy of classifier ensembles by using random feature subsets. Pattern recognition, 36(6):1291–1302, 2003.
|
| 306 |
+
Jie Cai, Jiawei Luo, Shulin Wang, and Sheng Yang. Feature selection in machine learning: A new perspective. Neurocomputing, 300:70–79, 2018.
|
| 307 |
+
Yuan Cao and Quanquan Gu. Generalization bounds of stochastic gradient descent for wide and deep neural networks. In Advances in Neural Information Processing Systems, pp. 10835–10845, 2019.
|
| 308 |
+
Victor Chernozhukov, Denis Chetverikov, and Kengo Kato. Comparison and anti-concentration bounds for maxima of gaussian random vectors. Probability Theory and Related Fields, 162(1): 47–70, 2015.
|
| 309 |
+
Amit Daniely. Sgd learns the conjugate kernel class of the network. In Advances in Neural Information Processing Systems, pp. 2422–2430, 2017.
|
| 310 |
+
Amit Daniely, Roy Frostig, and Yoram Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. In Advances in Neural Information Processing Systems (NIPS), pp. 2253–2261, 2016.
|
| 311 |
+
Thomas G Dietterich. Ensemble methods in machine learning. In International workshop on multiple classifier systems, pp. 1–15. Springer, 2000.
|
| 312 |
+
Simon S Du, Jason D Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. arXiv preprint arXiv:1811.03804, November 2018a.
|
| 313 |
+
Simon S Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. arXiv preprint arXiv:1810.02054, 2018b.
|
| 314 |
+
David A Freedman et al. Bootstrapping regression models. The Annals of Statistics, 9(6):1218– 1228, 1981.
|
| 315 |
+
Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences, 55(1):119–139, 1997.
|
| 316 |
+
Yoav Freund, Robert Schapire, and Naoki Abe. A short introduction to boosting. Journal-Japanese Society For Artificial Intelligence, 14(771-780):1612, 1999.
|
| 317 |
+
Jerome Friedman, Trevor Hastie, Robert Tibshirani, et al. Additive logistic regression: a statistical view of boosting (with discussion and a rejoinder by the authors). The annals of statistics, 28(2): 337–407, 2000.
|
| 318 |
+
Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, pp. 1189–1232, 2001.
|
| 319 |
+
Tommaso Furlanello, Zachary C Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born again neural networks. arXiv preprint arXiv:1805.04770, 2018.
|
| 320 |
+
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, 2011.
|
| 321 |
+
Behrooz Ghorbani, Song Mei, Theodor Misiakiewicz, and Andrea Montanari. Linearized two-layers neural networks in high dimension. arXiv preprint arXiv:1904.12191, 2019.
|
| 322 |
+
Boris Hanin and Mihai Nica. Finite depth and width corrections to the neural tangent kernel. arXiv preprint arXiv:1909.05989, 2019.
|
| 323 |
+
Lars Kai Hansen and Peter Salamon. Neural network ensembles. IEEE transactions on pattern analysis and machine intelligence, 12(10):993–1001, 1990.
|
| 324 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 325 |
+
Tin Kam Ho. The random subspace method for constructing decision forests. IEEE transactions on pattern analysis and machine intelligence, 20(8):832–844, 1998.
|
| 326 |
+
Arthur Jacot, Franck Gabriel, and Clement Hongler. Neural tangent kernel: Convergence and gen- ´ eralization in neural networks. In Advances in neural information processing systems, pp. 8571– 8580, 2018.
|
| 327 |
+
Kenji Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems, pp. 586–594, 2016.
|
| 328 |
+
Josef Kittler, Mohamad Hatef, Robert PW Duin, and Jiri Matas. On combining classifiers. IEEE transactions on pattern analysis and machine intelligence, 20(3):226–239, 1998.
|
| 329 |
+
Ron Kohavi, George H John, et al. Wrappers for feature subset selection. Artificial intelligence, 97 (1-2):273–324, 1997.
|
| 330 |
+
J Zico Kolter and Marcus A Maloof. Dynamic weighted majority: An ensemble method for drifting concepts. Journal of Machine Learning Research, 8(Dec):2755–2790, 2007.
|
| 331 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 332 |
+
Ludmila I Kuncheva. Combining pattern classifiers: methods and algorithms. John Wiley & Sons, 2014.
|
| 333 |
+
Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. In Advances in Neural Information Processing Systems, 2018.
|
| 334 |
+
Yuanzhi Li, Colin Wei, and Tengyu Ma. Towards explaining the regularization effect of initial large learning rate in training neural networks. arXiv preprint arXiv:1907.04595, 2019.
|
| 335 |
+
Pankaj Mehta, Marin Bukov, Ching-Hao Wang, Alexandre GR Day, Clint Richardson, Charles K Fisher, and David J Schwab. A high-bias, low-variance introduction to machine learning for physicists. Physics reports, 810:1–124, 2019.
|
| 336 |
+
Hossein Mobahi, Mehrdad Farajtabar, and Peter L Bartlett. Self-distillation amplifies regularization in hilbert space. arXiv preprint arXiv:2002.05715, 2020.
|
| 337 |
+
M Arthur Munson and Rich Caruana. On feature selection, bias-variance, and bagging. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 144– 159. Springer, 2009.
|
| 338 |
+
Chris Olah, Alexander Mordvintsev, and Ludwig Schubert. Feature visualization. Distill, 2(11):e7, 2017. doi: 10.23915/distill.00007. https://distill.pub/2017/feature-visualization.
|
| 339 |
+
Luiz S Oliveira, Robert Sabourin, Flavio Bortolozzi, and Ching Y Suen. Feature selection for ´ ensembles: A hierarchical multi-objective genetic algorithm approach. In Seventh International Conference on Document Analysis and Recognition, 2003. Proceedings., pp. 676–680. Citeseer, 2003.
|
| 340 |
+
David W Opitz. Feature selection for ensembles. In AAAI, pp. 379–384, 1999.
|
| 341 |
+
Robi Polikar. Ensemble based systems in decision making. IEEE Circuits and systems magazine, 6 (3):21–45, 2006.
|
| 342 |
+
Juan Jose Rodriguez, Ludmila I Kuncheva, and Carlos J Alonso. Rotation forest: A new classifier ´ ensemble method. IEEE transactions on pattern analysis and machine intelligence, 28(10):1619– 1630, 2006.
|
| 343 |
+
Lior Rokach. Pattern classification using ensemble methods, volume 75. World Scientific, 2010.
|
| 344 |
+
Lior Rokach and Oded Z Maimon. Data mining with decision trees: theory and applications, volume 69. World scientific, 2008.
|
| 345 |
+
Robert E Schapire, Yoav Freund, Peter Bartlett, Wee Sun Lee, et al. Boosting the margin: A new explanation for the effectiveness of voting methods. The annals of statistics, 26(5):1651–1686, 1998.
|
| 346 |
+
Vaishaal Shankar, Alex Fang, Wenshuo Guo, Sara Fridovich-Keil, Ludwig Schmidt, Jonathan Ragan-Kelley, and Benjamin Recht. Neural kernels without tangents. arXiv preprint arXiv:2003.02237, 2020.
|
| 347 |
+
Daniel Soudry and Yair Carmon. No bad local minima: Data independent training error guarantees for multilayer neural networks. arXiv preprint arXiv:1605.08361, 2016.
|
| 348 |
+
Alexey Tsymbal, Mykola Pechenizkiy, and Padraig Cunningham. Diversity in search strategies for ´ ensemble feature selection. Information fusion, 6(1):83–98, 2005.
|
| 349 |
+
Giorgio Valentini. An experimental bias-variance analysis of svm ensembles based on resampling techniques. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 35(6): 1252–1271, 2005.
|
| 350 |
+
Giorgio Valentini and Thomas G Dietterich. Bias-variance analysis of support vector machines for the development of svm-based ensemble methods. Journal of Machine Learning Research, 5(Jul): 725–775, 2004.
|
| 351 |
+
Bo Xie, Yingyu Liang, and Le Song. Diversity leads to generalization in neural networks. arXiv preprint Arxiv:1611.03131, 2016.
|
| 352 |
+
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, 2019.
|
| 353 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 354 |
+
Linfeng Zhang, Jiebo Song, Anni Gao, Jingwei Chen, Chenglong Bao, and Kaisheng Ma. Be your own teacher: Improve the performance of convolutional neural networks via self distillation. In ICCV, pp. 3713–3722, 2019.
|
| 355 |
+
Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Stochastic gradient descent optimizes over-parameterized deep relu networks. arXiv preprint arXiv:1811.08888, 2018.
|
md/dev/VYYf6S67pQc/VYYf6S67pQc.md
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Mildly Conservative $Q$ -Learning for Offline Reinforcement Learning
|
| 2 |
+
|
| 3 |
+
Jiafei Lyu1∗, Xiaoteng $\mathbf { M } \mathbf { a } ^ { 2 * }$ , Xiu Li1†, Zongqing $\mathbf { L u ^ { 3 \dag } }$ 1Tsinghua Shenzhen International Graduate School, Tsinghua University 2Department of Automation, Tsinghua Unversity 3School of Computer Science, Peking University {lvjf20,ma-xt17}@mails.tsinghua.edu.cn, li.xiu@sz.tsinghua.edu.cn, zongqing.lu@pku.edu.cn
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Offline reinforcement learning (RL) defines the task of learning from a static logged dataset without continually interacting with the environment. The distribution shift between the learned policy and the behavior policy makes it necessary for the value function to stay conservative such that out-of-distribution (OOD) actions will not be severely overestimated. However, existing approaches, penalizing the unseen actions or regularizing with the behavior policy, are too pessimistic, which suppresses the generalization of the value function and hinders the performance improvement. This paper explores mild but enough conservatism for offline learning while not harming generalization. We propose Mildly Conservative $Q$ -learning (MCQ), where OOD actions are actively trained by assigning them proper pseudo $Q$ values. We theoretically show that MCQ induces a policy that behaves at least as well as the behavior policy and no erroneous overestimation will occur for OOD actions. Experimental results on the D4RL benchmarks demonstrate that MCQ achieves remarkable performance compared with prior work. Furthermore, MCQ shows superior generalization ability when transferring from offline to online, and significantly outperforms baselines. Our code is publicly available at https://github.com/dmksjfl/MCQ.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Continually interacting with the environment of online reinforcement learning (RL) is often infeasible and unrealistic, since the data collection process of the agent may be expensive, difficult, or even dangerous, especially in real-world applications. Offline RL, instead, aims at learning from a static dataset that was previously collected by some unknown process [36], hence eliminating the need for environmental interactions during training.
|
| 12 |
+
|
| 13 |
+
The main challenge of offline RL is the distribution shift of state-action visitation frequency between the learned policy and the behavior policy. The evaluation of out-of-distribution (OOD) actions causes extrapolation error [14], which can be exacerbated through bootstrapping [34] and result in severe overestimation errors. Thus, keeping conservatism in value estimation is necessary in offline RL [24, 50, 60]. Previous methods achieve the conservatism by compelling the learned policy to be close to the behavior policy [14, 58, 34, 13, 57], by penalizing the learned value functions from being over-optimistic upon out-of-distribution (OOD) actions [35, 33, 59], or by learning without querying OOD samples [56, 8, 62, 32, 40].
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Comparison of prior methods against mild conservatism. The red spots represent the dataset samples. The left figure shows that penalizing OOD actions makes the value function drop sharply at the boundary of the dataset’s support, which barriers policy learning. The central figure depicts that policy regularization keeps the policy near behavior policy, leading to undesired performance if the behavior policy is unsatisfying. On the right side, we illustrate the basic idea of mild conservatism. The estimated values for OOD actions are allowed to be high as long as it does not affect the learning for the optimal policy supported by the dataset, i.e., $Q ( s , \bar { a } ^ { \mathrm { o o d } } ) < \bar { \operatorname * { m a x } } _ { a \in \mathrm { S u p p o r t } ( \mu ) } Q ( s , a ) .$
|
| 17 |
+
|
| 18 |
+
In practice, we rely on neural networks to extract knowledge from the dataset and generalize it to the nearby unseen states and actions when facing continuous state and action spaces. In other words, we need the networks to “stitch” the suboptimal trajectories to generate the best possible trajectory supported by the dataset. Unfortunately, there is no free lunch. Conservatism, which offline RL celebrates, often limits the generalization and impedes the performance of the agent. Existing approaches are still inadequate in balancing conservatism and generalization. As illustrated in Figure 1, policy regularization is unreliable for offline RL when the data-collecting policy is poor, and value penalization methods often induce unnecessary pessimism in both the in-dataset region and OOD region. We argue that the proper conservatism should be as mild as possible. As depicted in Figure 1, we aim at well estimating the value function in the support of the dataset, and allowing value estimates upon OOD actions to be high (even higher than their optimal values) as long as $Q ( s , a ^ { \mathrm { o o d } } ) < \operatorname* { m a x } _ { a \in \mathrm { S u p p o r t } ( \mu ) } Q ( s , a )$ is satisfied. The mild conservatism benefits generalization since value estimates upon OOD actions are slightly optimistic instead of being overly conservative.
|
| 19 |
+
|
| 20 |
+
To fulfill that, we propose a novel Mildly Conservative Bellman (MCB) operator for offline RL, where we actively train OOD actions and query their $Q$ values. We theoretically analyze the convergence property of the MCB operator under the tabular MDP setting. We show that the policy induced by the MCB operator is guaranteed to behave better than the behavior policy, and can consistently improve the policy with a tighter lower bound compared with policy constraint methods or value penalization methods like CQL [35]. For practical usage, we propose the practical MCB operator and illustrate its advantages by theoretically showing that erroneous overestimation error will not occur with it. We then estimate the behavior policy with a conditional variational autoencoder (CVAE) [29, 51], and integrate the practical MCB operator with the Soft Actor-Critic (SAC) [20] algorithm. To this end, we propose our novel offline RL algorithm, Mildly Conservative $Q$ -learning (MCQ).
|
| 21 |
+
|
| 22 |
+
Experimental results on the D4RL MuJoCo locomotion tasks demonstrate that MCQ surpasses recent strong baseline methods on most of the tasks, especially on non-expert datasets. Meanwhile, MCQ shows superior generalization capability when transferring from offline to online, validating our claims that mild pessimism is of importance to offline learning.
|
| 23 |
+
|
| 24 |
+
# 2 Preliminaries
|
| 25 |
+
|
| 26 |
+
We consider a Markov Decision Process (MDP) specified by a tuple $\langle S , \mathcal { A } , r , \rho _ { 0 } , p , \gamma \rangle$ , where $s$ is the state space, $\mathcal { A }$ is the action space, $r ( s , a ) : S \times \mathcal { A } \mapsto \mathbb { R }$ is the reward function, $\rho _ { 0 } ( s )$ is the initial state distribution, $p ( s ^ { \prime } | s , a ) : \bar { \mathcal { S } } \check { \times } \bar { \mathcal { A } } \times \bar { \mathcal { S } } \mapsto [ 0 , 1 ]$ is the transition probability, $\gamma \in [ 0 , 1 )$ is the discount factor. Reinforcement learning (RL) aims at finding a policy $\pi ( \cdot | s )$ such that the expected cumulative long-term rewards $J ( \pi ) = \mathbb { E } _ { s _ { 0 } \sim \rho _ { 0 } ( \cdot ) , a _ { t } \sim \pi ( \cdot \vert s _ { t } ) , s _ { t + 1 } \sim p ( \cdot \vert s _ { t } , a _ { t } ) } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) ]$ are maximized. The state-action function $Q ( s , a )$ measures the discounted return starting from state $s$ and action $a$ , and following the policy $\pi$ . We assume that the reward function $r ( s , a )$ is bounded, i.e., $| r ( s , a ) | \leq r _ { \operatorname* { m a x } }$ . Given a policy $\pi ( \cdot | s )$ , the Bellman backup for obtaining the corresponding $Q$ function gives:
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
\begin{array} { r } { \mathcal T ^ { \pi } Q ( s , a ) : = r ( s , a ) + \gamma \mathbb E _ { s ^ { \prime } } \mathbb E _ { a ^ { \prime } \sim \pi ( \cdot \vert s ^ { \prime } ) } [ Q ( s ^ { \prime } , a ^ { \prime } ) ] . } \end{array}
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
The $Q$ function of the optimal policy satisfies the following Bellman optimal operator:
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\mathcal { T } Q ( s , a ) : = r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } } \left[ \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } Q ( s ^ { \prime } , a ^ { \prime } ) \right] .
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
In offline RL setting, the online interaction is infeasible, and we can only have access to previously collected datasets $\bar { \mathcal { D } } = \{ ( s _ { i } , a _ { i } , r _ { i } , s _ { i + 1 } ^ { \prime } , d _ { i } ) \} _ { i = 1 } ^ { N }$ , where $d$ is the done flag. We denote the behavior policy as $\mu ( \cdot | s )$ . The Bellman backup relies on actions sampled from the learned policy, $a ^ { \prime } \sim \pi ( \cdot | s ^ { \prime } )$ . However, $a ^ { \prime }$ can lie outside of the support of $\mu$ due to the distribution shift between $\pi$ and $\mu$ . The value estimates upon $a ^ { \prime }$ can then be arbitrarily wrong, resulting in bad policy training. Unlike prior work, we actively train OOD actions by constructing them pseudo target values. In this way, we retain pessimism while enjoying better generalization.
|
| 39 |
+
|
| 40 |
+
# 3 Mildly Conservative $Q$ -Learning
|
| 41 |
+
|
| 42 |
+
In this section, we first formally define the MCB operator and characterize its dynamic programming properties in the tabular MDP setting. We further give a practical version of the MCB operator. We show that no erroneous overestimation will occur with the MCB operator. Finally, we incorporate the MCB operator with SAC [20] and present our novel offline RL algorithm.
|
| 43 |
+
|
| 44 |
+
# 3.1 Mildly Conservative Bellman (MCB) Operator
|
| 45 |
+
|
| 46 |
+
Definition 1. The Mildly Conservative Bellman (MCB) operator is defined as
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { r } { \mathcal { T } _ { \mathrm { M C B } } Q ( s , a ) = ( \mathcal { T } _ { 1 } \mathcal { T } _ { 2 } ) Q ( s , a ) , } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\begin{array} { r l } & { { \mathcal T } _ { 1 } Q ( s , a ) = \left\{ \begin{array} { l l } { Q ( s , a ) , } & { \mu ( a | s ) > 0 . } \\ { \operatorname* { m a x } _ { a ^ { \prime } \sim \mathrm { S u p p o r t } ( \mu ( \cdot | s ) ) } Q ( s , a ^ { \prime } ) - \delta , } & { e l s e . } \end{array} \right. } \\ & { { \mathcal T } _ { 2 } Q ( s , a ) = \left\{ \begin{array} { l l } { r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } } \left[ \operatorname* { m a x } _ { a ^ { \prime } \in A } Q ( s ^ { \prime } , a ^ { \prime } ) \right] , } & { \mu ( a | s ) > 0 , } \\ { Q ( s , a ) , } & { e l s e . } \end{array} \right. } \end{array}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
The basic idea behind this novel operator is that if the learned policy outputs actions that lie in the support region of $\mu$ , then we go for backup; while if OOD actions are generated, we deliberately replace their value estimates with $\begin{array} { r } { \operatorname* { m a x } _ { a ^ { \prime } \sim \operatorname { S u p p o r t } ( \mu ( \cdot | s ) ) } Q ( s , a ^ { \prime } ) - \delta } \end{array}$ , where $\delta > 0$ can be arbitrarily small. That is, different from standard Bellman backup, we set up a checking procedure (i.e., $\mathcal { T } _ { 1 , }$ ) of whether the previous backup (i.e., $\mathcal { T } _ { 2 }$ ) involves OOD actions for the update. Intrinsically, we construct pseudo target values for OOD actions. We subtract a small positive $\delta$ such that OOD actions will not be chosen when executing policy via arg $\operatorname* { m a x } _ { a \in \mathcal { A } } Q ( s , a )$ .
|
| 59 |
+
|
| 60 |
+
For a better understanding of the MCB operator, we theoretically analyze its dynamic programming properties in the tabular MDP setting. All proofs are deferred to Appendix A.
|
| 61 |
+
|
| 62 |
+
Proposition 1. In the support region of the behavior policy, i.e., Support $( \mu )$ , the MCB operator is a $\gamma$ -contraction operator in the $\mathcal { L } _ { \infty }$ norm, and any initial $Q$ function can converge to a unique fixed point by repeatedly applying $\mathcal { T } _ { \mathrm { M C B } }$ .
|
| 63 |
+
|
| 64 |
+
Proposition 2 (Behave at least as well as behavior policy). Denote $Q _ { \mathrm { M C B } }$ as the unique fixed point acquired by the MCB operator, then in $\operatorname { S u p p o r t } ( \mu )$ we have: $Q _ { \mu } \leq Q _ { \mathrm { M C B } } \leq Q _ { \mu ^ { * } }$ , where $Q _ { \mu }$ is the $Q$ function of the behavior policy and $Q _ { \mu ^ { * } }$ is the $Q$ function of the optimal policy in the batch.
|
| 65 |
+
|
| 66 |
+
Proposition 2 indicates that the policy induced by the MCB operator can behave at least as well as the behavior policy, and can approximate the optimal batch-constraint policy. Apart from this advantage, we further show that the MCB operator results in milder conservatism. We start by observing that value penalization method, like CQL [35], guarantees that the learned value function $\hat { Q } ^ { \pi } ( s , a )$ is a lower bound of its true value $Q ^ { \pi } ( s , a )$ . It is also ensured that following such conservative update leads to a safe policy improvement, i.e., $\begin{array} { r } { J ( \pi _ { \mathrm { C Q L } } ) \ge J ( \mu ) - \mathcal { O } ( \frac { 1 } { ( 1 - \gamma ) ^ { 2 } } ) } \end{array}$ (Theorem 3.6 in [35]). For explicit policy constraint methods, e.g., $\mathrm { T D } 3 { + } \mathrm { B C }$ [13], the learned policy $\pi _ { p }$ mimics the behavior policy $\mu$ , and can hardly behave significantly better than $\mu$ . We show in Proposition 3 that explicit policy constraint methods also exhibit a safe policy improvement, $\begin{array} { r } { J ( \pi _ { p } ) \geq J ( \dot { \mu } ) - \mathcal { O } ( \frac { 1 } { ( 1 - \gamma ) ^ { 2 } } ) } \end{array}$ ( 1(1−γ)2 ), while the MCB operator can consistently improve the policy with a tighter lower bound.
|
| 67 |
+
|
| 68 |
+
Proposition 3 (Milder Pessimism). Suppose there exists an explicit policy constraint offline reinforcement learning algorithm such that the $K L$ -divergence of the learned policy $\pi _ { p } ( \cdot | s )$ and the behavior policy $\mu ( \cdot | s )$ is optimized to guarantee max $( \mathrm { K L } ( \mu , \pi _ { p } ) , \mathrm { K L } ( \pi _ { p } , \mu ) ) \leq \dot { \epsilon }$ , ∀s. Denote $\begin{array} { r } { \epsilon _ { \mu } ^ { \pi _ { p } } = \operatorname* { m a x } _ { s } | \mathbb { E } _ { a \sim \pi _ { p } } A ^ { \mu } ( s , a ) | . } \end{array}$ , where $A ^ { \mu } ( s , a )$ is the advantage function. Then
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
J ( \pi _ { p } ) \geq J ( \mu ) - \frac { \sqrt { 2 } \gamma \epsilon _ { \mu } ^ { \pi _ { p } } } { ( 1 - \gamma ) ^ { 2 } } \sqrt { \epsilon } ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
while for the policy $\pi _ { \mathrm { M C B } }$ learned by applying the MCB operator, we have
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
J ( \pi _ { \mathrm { M C B } } ) \geq J ( \mu ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
In summary, the MCB operator benefits the offline learning in two aspects: (1) the operator is a contraction, and any initial $Q$ functions are guaranteed to converge to a unique fixed point; (2) the learned policy of the MCB operator is ensured to be better than the behavior policy, and reserve milder pessimism compared with policy constraint methods or CQL.
|
| 81 |
+
|
| 82 |
+
# 3.2 Practical MCB Operator
|
| 83 |
+
|
| 84 |
+
In practice, it is intractable to acquire $\begin{array} { r } { \operatorname* { m a x } _ { a ^ { \prime } \sim \operatorname { S u p p o r t } ( \mu ( \cdot | s ) ) } Q ( s , a ^ { \prime } ) } \end{array}$ in $\mathcal { T } _ { 1 }$ of Eq. (4) in continuous control domains, and the behavior policy is often unknown. Thus, we fit an empirical behavior policy $\hat { \mu }$ with supervised learning based on the static dataset. The pseudo target values for the OOD actions are then computed by sampling $N$ actions from $\hat { \mu }$ , and taking maximum over their value evaluation. Formally, we define the practical MCB operator below, accompanied by the theoretical analysis.
|
| 85 |
+
|
| 86 |
+
Definition 2. The practical Mildly Conservative Bellman (MCB) operator is defined as
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\hat { \mathcal { T } } _ { \mathrm { M C B } } Q ( s , a ) = ( \hat { \mathcal { T } } _ { 1 } \mathcal { T } _ { 2 } ) Q ( s , a ) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { \hat { \mathcal { T } } _ { 1 } Q ( s , a ) = \left\{ \begin{array} { l l } { Q ( s , a ) , \qquad ~ } & { \mu ( a | s ) > 0 . } \\ { \mathbb { E } _ { \{ a _ { i } ^ { \prime } \} ^ { N } \sim \hat { \mu } ( \cdot | s ) } \left[ \operatorname* { m a x } _ { a ^ { \prime } \sim \{ a _ { i } ^ { \prime } \} ^ { N } } Q ( s , a ^ { \prime } ) \right] , } & { e l s e . } \end{array} \right. } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Compared with Eq. (4), we make a small modification of $\mathcal { T } _ { 1 }$ , and keep $\mathcal { T } _ { 2 }$ unchanged. There is no need to subtract $\delta$ here as generally $\begin{array} { r } { { \mathbb E } _ { \{ a _ { i } ^ { \prime } \} ^ { N } \sim \hat { \mu } ( \cdot | s ) } \left[ \operatorname* { m a x } _ { a ^ { \prime } \sim \{ a _ { i } ^ { \prime } \} ^ { N } } Q ( s , a ^ { \prime } ) \right] \leq \operatorname* { m a x } _ { a ^ { \prime } \sim \mathrm { S u p p o r t } ( \mu ) } Q ( s , a ^ { \prime } ) . } \end{array}$ . The practical MCB operator is much easier to implement in practice. We show that the practical MCB operator is still a $\gamma$ -contraction in the support region of the behavior policy $\mu$ .
|
| 99 |
+
|
| 100 |
+
Proposition 4. Proposition 1 still holds for the practical MCB operator.
|
| 101 |
+
|
| 102 |
+
Since we fit the empirical distribution $\hat { \mu }$ of the behavior policy $\mu$ , there may exist a shift between $\hat { \mu }$ and $\mu$ , especially when we represent the policy via neural networks. That suggests that OOD actions $a ^ { \prime }$ can still be sampled from $\hat { \mu }$ such that $a ^ { \prime } \overset { \cdot } { \notin } \operatorname { S u p p o r t } ( \mu ( \cdot | s ) )$ . Our last main result reveals that erroneous overestimation issue will not occur with the aid of the practical MCB operator.
|
| 103 |
+
|
| 104 |
+
Proposition 5 (No erroneous overestimation will occur). Assuming that $\operatorname* { s u p } _ { s } D _ { \mathrm { T V } } ( \hat { \mu } ( \cdot | s ) \quad | |$ $\begin{array} { r } { \mu ( \cdot | \bar { s } ) ) \leq \epsilon < \frac { 1 } { 2 } } \end{array}$ , we have
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\mathbb { E } _ { \{ a _ { i } ^ { \prime } \} ^ { N } \sim \hat { \mu } ( \cdot | s ) } \left[ \operatorname* { m a x } _ { a ^ { \prime } \in \{ a _ { i } ^ { \prime } \} ^ { N } } Q ( s , a ^ { \prime } ) \right] \leq \operatorname* { m a x } _ { a ^ { \prime } \in \mathrm { S u p p o r t } ( \mu ( \cdot | s ) ) } Q ( s , a ^ { \prime } ) + ( 1 - ( 1 - 2 \epsilon ) ^ { N } ) \frac { r _ { \operatorname* { m a x } } } { 1 - \gamma } .
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Remark: This proposition generally requires a comparatively well-fitted empirical behavior policy $\hat { \mu }$ . In practice, we model $\hat { \mu }$ with a CVAE. In most cases, CVAE can already fit the dataset well and guarantee a good performance. Whereas there may exist some situations, e.g., the dataset is highly multi-modal, then one can replace the CVAE as the conditional GAN (CGAN) to better capture the different modes in the dataset as depicted in [61]. We believe generative models like CGAN will be a good choice by then.
|
| 111 |
+
|
| 112 |
+
Intuitively, the above conclusion says that if the empirical behavior policy $\hat { \mu }$ well fits $\mu$ , i.e., $\epsilon$ is small enough, then regardless of how $\{ a _ { i } ^ { \prime } \} ^ { N }$ are sampled, the pseudo target value will approximate the maximum $Q$ -value within the dataset’s support with high probability. The extrapolation error is under the scale of $\begin{array} { r } { ( 1 - ( 1 - 2 \epsilon ) ^ { N } ) \frac { r _ { \operatorname* { m a x } } } { 1 - \gamma } } \end{array}$ . We expect a good empirical behavior policy such that most of the actions sampled from it will be in-distribution. However, if $\epsilon$ is large, $N$ can act as a trade-off parameter. The smaller $N$ we use, the more conservative we are. Fortunately, we find empirically that our method performs well in a large interval of $N$ over different tasks (see Section 4.2). Hence, it is safe to fix a $N$ in practice.
|
| 113 |
+
|
| 114 |
+
# 3.3 Algorithm
|
| 115 |
+
|
| 116 |
+
As aforementioned, we often cannot get prior information about the behavior policy $\mu$ . Thus, we need to empirically fit a behavior policy $\hat { \mu }$ with supervised learning for applying the practical MCB operator. Our algorithm, Mildly Conservative $Q$ -learning (MCQ), trains an additional generative model, which is also adopted by many prior work [14, 17, 33, 67]. We build our novel offline algorithm upon an off-the-shelf off-policy online RL algorithm, Soft Actor-Critic (SAC) [20].
|
| 117 |
+
|
| 118 |
+
Modelling the behavior policy with the CVAE. We utilize a conditional variational autoencoder (CVAE) [29, 51, 14] to model the behavior policy $\mu$ . Given a fixed logged dataset, the goal of the CVAE is to reconstruct actions conditioned on the states such that the reconstructed actions come from the same distribution as the actions in the dataset, i.e., $\mu ( \cdot | s )$ . That generally satisfies the assumption we make in Proposition 5. As concerned by [32], training a generative model like CVAE still may produce out-of-dataset actions, which leads to extrapolation error since undefined $Q$ values can be possibly queried. Prior methods, like BCQ [14], do not well address such issue. While for our algorithm, such concern is mitigated because overestimation error is actually under control as is guaranteed by Proposition 5.
|
| 119 |
+
|
| 120 |
+
The CVAE $G _ { \omega } ( s )$ parameterized by $\omega$ is made up of an encoder $E _ { \xi } ( s , a )$ and a decoder $D _ { \psi } ( s , z )$ parameterized by $\xi$ , $\psi$ respectively, $\omega = \{ \xi , \psi \}$ . The CVAE is optimized by maximizing its variational lower bound, which is equivalent to minimizing the following objective function.
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\mathcal { L } _ { \mathrm { C V A E } } = \mathbb { E } _ { ( s , a ) \sim \mathcal { D } , z \sim E _ { \xi } ( s , a ) } \left[ ( a - D _ { \psi } ( s , z ) ) ^ { 2 } + \mathrm { K L } \left( E _ { \xi } ( s , a ) , \mathcal { N } ( 0 , { \bf I } ) \right) \right] ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\operatorname { K L } ( p , q )$ denotes the KL-divergence between probability distribution $p ( \cdot )$ and $q ( \cdot )$ , and $\mathbf { I }$ is the identity matrix. When sampling actions from the CVAE, we first sample a latent variable $z$ from the prior distribution, which is set to be multivariate normal distribution $\mathcal { N } ( 0 , \bf { I } )$ , and then pass it in conjunction with the state $s$ into the decoder $D _ { \psi } ( s , z )$ to get the desired decoded action.
|
| 127 |
+
|
| 128 |
+
It is also worth noting that we do not choose GAN [19] as the generative model because it is known to suffer from training instability and mode collapse [52, 6, 5]. Also, GAN consumes much more time and memories to train compared with the CVAE.
|
| 129 |
+
|
| 130 |
+
Loss functions. In deep RL, the $Q$ function is represented with a neural network parameterized by $\theta$ and is updated via minimizing the temporal difference (TD) loss $\mathbb { E } _ { s , a , r , s ^ { \prime } } [ ( Q _ { \theta } ( s , a ) - \mathcal { T } Q ( s , a ) ) ^ { 2 } ]$ . We actually are performing the regression task $( s , a ) \mapsto \mathcal { T } Q ( s , a )$ to train the $Q$ function. The target value ${ \mathcal { T } } Q ( s , a )$ is usually computed by utilizing a lagging target network parameterized by $\theta ^ { \prime }$ without gradient backpropagation. As a typical actor-critic [30, 31, 53] algorithm, SAC uses its critic networks to perform value estimation and uses a separate actor network for policy improvement. In order to incorporate the MCB operator with the off-the-shelf SAC algorithm, we need to check whether the sampled action $a ^ { \prime } \sim \bar { \pi } ( \cdot | s )$ lies outside of the behavior policy’s support, i.e., whether $\mu ( a ^ { \prime } | s ) > 0$ . However, such a criterion is not reliable, because the true behavior policy $\mu$ is unknown and it is difficult to examine whether $\mu ( a ^ { \prime } | s ) > 0$ in practice. It is also problematic if we rely on the empirical behavior policy $\hat { \mu }$ to check whether $a ^ { \prime }$ is OOD as $\hat { \mu }$ itself can produce OOD actions.
|
| 131 |
+
|
| 132 |
+
We then resort to constructing an auxiliary loss for OOD actions and integrating it with the standard Bellman error. Specifically, we sample $a ^ { \mathrm { o o d } }$ from the learned policy $\pi ( \cdot | _ { s } \mathrm { i n } )$ based on the sampled state $s ^ { \mathrm { i n } } \sim \mathcal { D }$ from the dataset and assign them pseudo target values based on the practical MCB operator. Note that the superscript ood is used to distinguish from the in-dataset real actions, and $a ^ { \mathrm { { \bar { o } o d } } }$ is not necessarily an OOD action. We remark that if $a ^ { \mathrm { o o d } } \in \operatorname { S u p p o r t } ( \mu ( \cdot | s ) )$ , the pseudo $Q$
|
| 133 |
+
|
| 134 |
+
# Algorithm 1 Mildly Conservative $Q$ -learning (MCQ)
|
| 135 |
+
|
| 136 |
+
1: Initialize CVAE $G _ { \omega }$ , critic networks $Q _ { \theta _ { 1 } } , Q _ { \theta _ { 2 } }$ and actor network $\pi _ { \phi }$ with random parameters
|
| 137 |
+
2: Initialize target networks $\theta _ { 1 } ^ { \prime } \theta _ { 1 } , \theta _ { 2 } ^ { \prime } \theta _ { 2 }$ and offline replay buffer $\mathcal { D }$ .
|
| 138 |
+
3: for $t = 1$ to $T$ do
|
| 139 |
+
4: Sample a mini-batch $B = \{ ( s , a , r , s ^ { \prime } , d ) \}$ from $\mathcal { D }$ , where $d$ is the done flag
|
| 140 |
+
5: Train CVAE via minimizing Eq. (10)
|
| 141 |
+
6: Get target value: $\begin{array} { r } { y = r ( s , \bar { a } ) + \gamma \left[ \operatorname* { m i n } _ { i = 1 , 2 } Q _ { \theta _ { i } ^ { \prime } } ( s ^ { \prime } , a ^ { \prime } ) - \alpha \log \pi _ { \phi } ( a ^ { \prime } | s ^ { \prime } ) \right] , a ^ { \prime } \sim \pi _ { \phi } ( \cdot | s ^ { \prime } ) } \end{array}$
|
| 142 |
+
7: Sample $N$ actions from $\pi$ based on each $s$ and $s ^ { \prime }$ , set $s ^ { \mathrm { i n } } = \{ s , s ^ { \prime } \}$
|
| 143 |
+
8: Compute the target value for the OOD actions via Eq. (13)
|
| 144 |
+
9: Update critic $\theta _ { i }$ with gradient descent via minimizing Eq. (11)
|
| 145 |
+
10: Update actor $\phi$ with gradient ascent via Eq. (14)
|
| 146 |
+
11: Update target networks: $\theta _ { i } ^ { \prime } \tau \theta _ { i } + ( 1 - \tau ) \theta _ { i } ^ { \prime } , i = 1 , 2$
|
| 147 |
+
12: end for
|
| 148 |
+
|
| 149 |
+
value will not negatively affect the evaluation upon it, because in-distribution actions are still trained to approximate the optimal batch-constraint $Q$ value. In this way, we actively train both possible OOD actions and in-distribution actions simultaneously via $o o D$ sampling. The resulting objective function for the critic networks is presented in Eq. (11).
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\mathcal { L } _ { \mathrm { c r i t i c } } = \lambda \mathbb { E } _ { ( s , a , r , s ^ { \prime } ) \sim \mathcal { D } } \left[ ( Q _ { \theta _ { i } } ( s , a ) - y ) ^ { 2 } \right] + ( 1 - \lambda ) \mathbb { E } _ { s ^ { \mathrm { i n } } \sim \mathcal { D } , a ^ { \mathrm { o o d } } \sim \pi } \left[ ( Q _ { \theta _ { i } } ( s ^ { \mathrm { i n } } , a ^ { \mathrm { o o d } } ) - y ^ { \prime } ) ^ { 2 } \right] ,
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
where the target value for the in-distribution actions gives
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
y = r ( s , a ) + \gamma \left[ \operatorname* { m i n } _ { i = 1 , 2 } Q _ { \theta _ { i } ^ { \prime } } ( s ^ { \prime } , a ^ { \prime } ) - \alpha \log \pi _ { \phi } ( a ^ { \prime } | s ^ { \prime } ) \right] , \alpha \in \mathbb { R } _ { + } ,
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
which follows the standard target value of vanilla SAC. The hyperparameter $\lambda$ balances the indistribution data training and OOD action training. Following the formulas of the practical MCB operator in Eq. (9), the pseudo target value for the OOD action is computed by:
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
y ^ { \prime } = \operatorname* { m i n } _ { j = 1 , 2 } \mathbb { E } _ { \{ a _ { i } ^ { \prime } \} ^ { N } \sim \hat { \mu } } \left[ \operatorname* { m a x } _ { a ^ { \prime } \sim \{ a _ { i } ^ { \prime } \} ^ { N } } Q _ { \theta _ { j } } ( s ^ { \mathrm { i n } } , a ^ { \prime } ) \right] .
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
Note that we experimentally find that replacing the min operator with a mean operator does not raise much difference in performance. We hence take advantage of the min operator to fulfill the pseudo clipped double $Q$ -learning for OOD actions.
|
| 168 |
+
|
| 169 |
+
The policy is then optimized by solving the following optimization problem:
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\pi _ { \phi } : = \operatorname* { m a x } _ { \phi } \mathbb { E } _ { s \sim \mathcal { D } , a \sim \pi _ { \phi } ( \cdot | s ) } \left[ \operatorname* { m i n } _ { i = 1 , 2 } Q _ { \theta _ { i } } ( s , a ) - \alpha \log \pi _ { \phi } ( \cdot | s ) \right] .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
We detail the learning procedure of our MCQ in Algorithm 1. Different from [13], our method does not require normalization over states or value functions. The only change we make to the vanilla SAC algorithm is an extra auxiliary loss term (blue term in Eq. (11)) such that OOD actions are actively and properly trained. The additional critic loss term can also be plugged into other off-policy online RL algorithms directly. As an evidence, we combine the MCB operator with TD3 [15], yielding a deterministic version of MCQ. Please refer to Appendix B for more details.
|
| 176 |
+
|
| 177 |
+
# 4 Experiments
|
| 178 |
+
|
| 179 |
+
In this section, we first empirically demonstrate the effectiveness and advantages of our proposed MCQ algorithm on D4RL benchmarks [12]. We then conduct a detailed parameter study to show the hyperparameter sensitivity of MCQ. We also experimentally illustrate that the value estimation of MCQ will not incur severe overestimation and pessimistic value estimates are witnessed in practice. Finally, we show the superior offline-to-online fine-tuning benefits of MCQ on some MuJoCo datasets.
|
| 180 |
+
|
| 181 |
+
# 4.1 Results on MuJoCo Datasets
|
| 182 |
+
|
| 183 |
+
We experimentally compare our MCQ against behavior cloning (BC), SAC, and several recent strong baseline methods, CQL [35], UWAC [59], TD3+BC [13], and IQL [32], on D4RL [12] benchmarks.
|
| 184 |
+
|
| 185 |
+
We choose these methods as they typically represent different categories of model-free offline RL, i.e., CQL is a value penalization method, $\mathrm { T D } 3 { + } \mathrm { B C }$ involves explicit policy constraint (BC loss), UWAC relies on uncertainty estimation for training, and IQL learns without querying OOD samples.
|
| 186 |
+
|
| 187 |
+
We conduct experiments on MuJoCo locomotion tasks, which are made up of five types of datasets (random, medium, medium-replay, medium-expert, and expert), yielding a total of 15 datasets. We use the most recently released "-v2" datasets for performance evaluation. The results of BC and SAC are acquired by using our implemented code. The results of CQL and UWAC are obtained by running their official codes, because the reported scores in their papers are not obtained on MuJoCo "-v2" datasets. We take the results of $\mathrm { T D } 3 { + } \mathrm { B C }$ from its original paper (Table 7 in [13]). Since the IQL paper does not report its performance on MuJoCo random and expert datasets, we run IQL using the official codebase on them and take the results on medium, medium-replay, medium-expert datasets from its original paper directly. All methods are run for 1M gradient steps.
|
| 188 |
+
|
| 189 |
+
Table 1: Normalized average score comparison of MCQ against baseline methods on D4RL benchmarks over the final 10 evaluations. 0 corresponds to a random policy and 100 corresponds to an expert policy. The experiments are run on MuJoCo "-v2" datasets over 4 random seeds. $\mathbf { r } =$ random, $\mathbf { m } =$ medium, $\mathrm { m - r = }$ medium-replay, $\mathbf { m } { - } \mathbf { e } =$ medium-expert, ${ \bf e } =$ expert. We bold the highest mean.
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Task Name</td><td>BC</td><td>SAC</td><td>CQL</td><td>UWAC</td><td>TD3+BC</td><td>IQL</td><td>MCQ (ours)</td></tr><tr><td>halfcheetah-r</td><td>2.2±0.0</td><td>29.7±1.4</td><td>17.5±1.5</td><td>2.3±0.0</td><td>11.0±1.1</td><td>13.1±1.3</td><td>28.5±0.6</td></tr><tr><td>hopper-r</td><td>3.7±0.6</td><td>9.9±1.5</td><td>7.9±0.4</td><td>2.7±0.3</td><td>8.5±0.6</td><td>7.9±0.2</td><td>31.8±0.5</td></tr><tr><td>walker2d-r</td><td>1.3±0.1</td><td>0.9±0.8</td><td>5.1±1.3</td><td>2.0±0.4</td><td>1.6±1.7</td><td>5.4±1.2</td><td>17.0±3.0</td></tr><tr><td>halfcheetah-m</td><td>43.2±0.6</td><td>55.2±27.8</td><td>47.0±0.5</td><td>42.2±0.4</td><td>48.3±0.3</td><td>47.4±0.2</td><td>64.3±0.2</td></tr><tr><td>hopper-m</td><td>54.1±3.8</td><td>0.8±0.0</td><td>53.0±28.5</td><td>50.9±4.4</td><td>59.3±4.2</td><td>66.2±5.7</td><td>78.4±4.3</td></tr><tr><td>walker2d-m</td><td>70.9±11.0</td><td>-0.3±0.2</td><td>73.3±17.7</td><td>75.4±3.0</td><td>83.7±2.1</td><td>78.3±8.7</td><td>91.0±0.4</td></tr><tr><td>halfcheetah-m-r</td><td>37.6±2.1</td><td>0.8±1.0</td><td>45.5±0.7</td><td>35.9±3.7</td><td>44.6±0.5</td><td>44.2±1.2</td><td>56.8±0.6</td></tr><tr><td>hopper-m-r</td><td>16.6±4.8</td><td>7.4±0.5</td><td>88.7±12.9</td><td>25.3±1.7</td><td>60.9±18.8</td><td>94.7±8.6</td><td>101.6±0.8</td></tr><tr><td>walker2d-m-r halfcheetah-m-e</td><td>20.3±9.8</td><td>-0.4±0.3</td><td>81.8±2.7</td><td>23.6±6.9</td><td>81.8±5.5</td><td>73.8±7.1</td><td>91.3±5.7</td></tr><tr><td></td><td>44.0±1.6</td><td>28.4±19.4</td><td>75.6±25.7</td><td>42.7±0.3</td><td>90.7±4.3</td><td>86.7±5.3</td><td>87.5±1.3</td></tr><tr><td>hopper-m-e</td><td>53.9±4.7</td><td>0.7±0.0</td><td>105.6±12.9</td><td>44.9±8.1</td><td>98.0±9.4</td><td>91.5±14.3</td><td>111.2±0.1</td></tr><tr><td>walker2d-m-e</td><td>90.1±13.2</td><td>1.9±3.9</td><td>107.9±1.6</td><td>96.5±9.1</td><td>110.1±0.5</td><td>109.6±1.0</td><td>114.2±0.7</td></tr><tr><td>Average Above</td><td>36.5</td><td>11.3</td><td>59.1</td><td>37.0</td><td>58.2</td><td>59.9</td><td>72.8</td></tr><tr><td>halfcheetah-e</td><td>91.8±1.5</td><td>-0.8±1.8</td><td>96.3±1.3</td><td>92.9±0.6</td><td>96.7±1.1</td><td>95.0±0.5</td><td>96.2±0.4</td></tr><tr><td>hopper-e walker2d-e</td><td>107.7±0.7</td><td>0.7±0.0</td><td>96.5±28.0</td><td>110.5±0.5</td><td>107.8±7</td><td>109.4±0.5</td><td>111.4±0.4</td></tr><tr><td></td><td>106.7±0.2</td><td>0.7±0.3</td><td>108.5±0.5</td><td>108.4±0.4</td><td>110.2±0.3</td><td>109.9±1.2</td><td>107.2±1.1</td></tr><tr><td>Total Average</td><td>49.6</td><td>9.0</td><td>67.3</td><td>50.4</td><td>67.6</td><td>68.9</td><td>79.2</td></tr></table>
|
| 192 |
+
|
| 193 |
+
In our experiments, we set the number of sampled actions $N = 1 0$ by default and tune the weighting coefficient $\lambda$ . We report the $\lambda$ used for all tasks in Appendix C, along with details on the experiments and implementation. We summarize the normalized average score comparison of MCQ against recent baselines in Table 1. Unsurprisingly, we observe that MCQ behaves better than BC on all of the tasks, which is consistent with our theoretical analysis in Proposition 2 and 3. MCQ also significantly outperforms the base SAC algorithm. Prior offline RL methods struggle for good performance on non-expert datasets like random and medium-replay, while MCQ surpasses them with a remarkable margin on many non-expert datasets. We attribute the less satisfying performance of prior offline RL methods to their strict conservatism, which restricts their generalization beyond the support of the dataset and leads to limited performance. The results, therefore, validate our claim that milder pessimism is more we need for offline learning. Furthermore, MCQ is also competitive to baselines on expert datasets. MCQ achieves the best performance on 11 out of 15 datasets, yielding a total average score of 72.8 on non-expert datasets, and an average score of 79.2 on all 15 datasets. Whereas the second best method, IQL, has an average score of 59.9 on non-expert datasets and a total average score of 68.9 across all tasks.
|
| 194 |
+
|
| 195 |
+
# 4.2 Parameter Study
|
| 196 |
+
|
| 197 |
+
In this subsection, we conduct a detailed parameter study on MCQ. MCQ generally contains two hyperparameters, weighting coefficient $\lambda$ and number of sampled actions $N$ . To demonstrate the parameter sensitivity of MCQ, we choose two datasets from MuJoCo locomotion tasks and conduct experiments on them, halfcheetah-medium-v2, and hopper-medium-replay-v2. The experiments are run for 1M gradient steps over 4 different random seeds.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 2: Parameter study and $Q$ function estimation on halfcheetah-medium-v2 and hopper-mediumreplay-v2. The shaded region captures the standard deviation.
|
| 201 |
+
|
| 202 |
+
Weighting coefficient $\lambda$ . The weighting coefficient $\lambda$ is a critical hyperparameter for MCQ, which directly controls the balance between in-distribution actions training and OOD actions training. If we set $\lambda = 1$ , then MCQ degenerates into the base SAC algorithm. If $\lambda$ leans towards 0, the critics will be overwhelmed by OOD actions. Intuitively, one ought not to use small $\lambda$ , because more weights are desired for standard Bellman error such that in-distribution state-action pairs can be well-trained. We observe significant performance drop with smaller $\lambda$ in Figure 2(a) and 2(b). Also, we find that choosing $0 . 7 \leq \lambda < 1$ generally induces good performance.
|
| 203 |
+
|
| 204 |
+
Number of sampled actions $N$ . $N$ works as a regularizer to control the potential extrapolation error. In case the behavior policy $\mu$ is known, we require $N$ to be as large as possible to better estimate the maximum $Q$ value. While in practice, we leverage the CVAE to approximate $\mu$ , from which OOD actions can be sampled. $N$ then plays a role to balance pessimism and generalization. To see the influence of $N$ , we fix $\lambda = 0 . 9 5$ for the two datasets. Experimental results in Figure 2(d) and 2(e) indicate that MCQ is insensitive to $N$ for a wide range of $N$ . We therefore set $N = 1 0$ by default.
|
| 205 |
+
|
| 206 |
+
Value estimation. We present the $Q$ value estimates with respect to (w.r.t.) $\lambda$ and $N$ in Figure 2(c) and 2(f). The $Q$ estimation is calculated via $\mathbb { E } _ { i = 1 , 2 } \mathbb { E } _ { ( s , a ) \sim \mathcal { D } } \big [ Q _ { \theta _ { i } } ( s , a ) \big ]$ . The results illustrate that (1) smaller $\lambda$ will incur severe underestimation issue (as depicted by Figure 2(c), $Q$ values collapse with $\lambda = 0 . 5$ or $\lambda = 0 . 3$ ); (2) no overestimation is observed, even with a large $\lambda = 0 . 9 5$ , which validates the theoretical result in Proposition 5; (3) the $Q$ estimates resemble each other under different $N$ . We conclude that MCQ ensures a stable and good value estimation with a proper $\lambda$ .
|
| 207 |
+
|
| 208 |
+
# 4.3 Offline-to-online Fine-tuning
|
| 209 |
+
|
| 210 |
+
We examine the offline-to-online fine-tuning capability of MCQ against some prior strong offline RL baselines, CQL [35], $\mathrm { T D } 3 { + } \mathrm { B C }$ [13], IQL [32]. We additionally compare against AWAC [45], which is designed intrinsically for offline-to-online adaptation. We conduct experiments on MuJoCo random and medium-replay datasets. It is challenging to train on these datasets for both offline and offline-to-online fine-tuning as they are non-expert, or even contain many bad transitions. We first train baselines and MCQ for 1M gradient steps offline and then perform online fine-tuning for another 100K gradient steps. Note that IQL paper [32] adopts 1M steps for online fine-tuning. However, we argue that 1M steps of online interactions are even enough to train off-policy online RL algorithms from scratch to perform very well. We thus believe 100K steps is more reasonable for the online interaction. All methods are run over 4 random seeds. The results are shown in Figure 3, where the shaded region denotes the standard deviation. As expected, we observe that MCQ consistently outperforms prior offline RL methods as well as AWAC on all of the datasets, often surpassing all of them with a large margin. The mild pessimism of MCQ makes it adapt faster, or keep the offline good performance during online interactions. Other prior offline RL methods, unfortunately, fail in achieving satisfying performance during online interaction due to strict conservatism and lack of generalization ability.
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 3: Offline-to-online fine-tuning results on 6 D4RL MuJoCo locomotion tasks.
|
| 214 |
+
|
| 215 |
+
# 5 Related Work
|
| 216 |
+
|
| 217 |
+
Model-free offline RL. Prior model-free offline RL methods are typically designed to restrict the learned policy from producing OOD actions. They usually achieve this by leveraging importance sampling [47, 54, 39, 44, 16], incorporating explicit policy constraints [34, 58, 17, 13, 11], learning latent actions [67, 3], penalizing learned value functions such that low values are assigned to unseen actions [35, 33, 41], using adaptive methods [18], and uncertainty quantification [59, 65, 4]. Another line of the methods, instead, resorts to learning without querying OOD actions [56, 8, 32]. By doing so, they constrain the learning process within the support of the dataset. Nevertheless, existing methods may induce unnecessarily over-pessimistic value functions, and their performance is largely confined by how well the behavior policy is [45, 38, 4]. That partly explains why these methods are not satisfiable when trained on non-expert datasets (e.g., random datasets). MCQ keeps milder conservatism and better generalization ability as OOD actions are actively trained with proper targets.
|
| 218 |
+
|
| 219 |
+
Model-based offline RL. Model-based offline RL methods, in contrast, learn the dynamics model in a supervised manner, and leverage the learned dynamics for policy optimization. Advances in this field include uncertainty quantification [46, 64, 27, 10], learning conservative value functions [63], representation learning [37, 48], constraining the learned policy with a behavior cloning loss [42], and sequential modelling [7, 23, 43]. However, there is no guarantee that the trained dynamics models are reliable, e.g., poor transitions can be generated, especially in complex high-dimensional environments [22]. Meanwhile, training dynamics models raises extra computation costs.
|
| 220 |
+
|
| 221 |
+
Offline-to-online RL. There are some efforts on accelerating online interactions with the aid of offline logged data, which is also referred to as learning from demonstration [21, 26, 49]. Offline-to-online RL, instead, aims at enhancing the well-trained offline policy via online interactions. To ensure a fast adaptation and stable policy improvement, many techniques are adopted, such as model ensemble [38], explicit policy constraints [45, 66]. Offline-to-online fine-tuning will be difficult if the trained value function or policy is overly pessimistic, which may lead to a suboptimal policy.
|
| 222 |
+
|
| 223 |
+
# 6 Conclusion
|
| 224 |
+
|
| 225 |
+
In this paper, we propose Mildly Conservative $Q$ -learning (MCQ) to alleviate the over pessimism in existing offline RL methods. MCQ actively train OOD actions by constructing them proper pseudo target values following the guidance of the practical Mildly Conservative Bellman (MCB) operator. We theoretically illustrate that the policy induced by the MCB operator behaves at least as well as the behavior policy, and no erroneous overestimation will occur for the practical MCB operator. Furthermore, we extensively compare MCQ against recent strong baselines on MuJoCo locomotion tasks. Experimental results show that MCQ surpasses these baselines with a large margin on many non-expert datasets, and is also competitive with baselines on expert datasets. Moreover, we demonstrate the superior generalization capability of MCQ when transferring from offline to online. These altogether reveal that mild conservatism is critical for offline learning. We hope this work can promote the offline RL towards mild pessimism, and bring new insights into the community.
|
| 226 |
+
|
| 227 |
+
One drawback of our current algorithm lies in the need of tuning the weighting coefficient $\lambda$ . However, we empirically find that $0 . 7 \leq \lambda < 1$ can usually induce satisfying performance. We leave the automatic tuning of $\lambda$ as future work.
|
| 228 |
+
|
| 229 |
+
# Acknowledgments and Disclosure of Funding
|
| 230 |
+
|
| 231 |
+
This work was supported in part by the Science and Technology Innovation 2030-Key Project under Grant 2021ZD0201404, in part by the NSF China under Grant 61872009. The authors would like to thank the anonymous reviewers for their valuable comments and advice.
|
| 232 |
+
|
| 233 |
+
# References
|
| 234 |
+
|
| 235 |
+
[1] J. Achiam, D. Held, A. Tamar, and P. Abbeel. Constrained Policy Optimization. In International Conference on Machine Learning, 2017.
|
| 236 |
+
[2] R. Agarwal, M. Schwarzer, P. S. Castro, A. C. Courville, and M. G. Bellemare. Deep Reinforcement Learning at the Edge of the Statistical Precipice. In Advances in Neural Information Processing Systems, 2021.
|
| 237 |
+
[3] A. Ajay, A. Kumar, P. Agrawal, S. Levine, and O. Nachum. OPAL: Offline Primitive Discovery for Accelerating Offline Reinforcement Learning. In International Conference on Learning Representations, 2021.
|
| 238 |
+
[4] C. Bai, L. Wang, Z. Yang, Z.-H. Deng, A. Garg, P. Liu, and Z. Wang. Pessimistic Bootstrapping for Uncertainty-Driven Offline Reinforcement Learning. In International Conference on Learning Representations, 2022.
|
| 239 |
+
[5] D. Bang and H. Shim. MGGAN: Solving Mode Collapse Using Manifold-Guided Training. IEEE/CVF International Conference on Computer Vision Workshops, pages 2347–2356, 2021.
|
| 240 |
+
[6] D. Bau, J.-Y. Zhu, J. Wulff, W. S. Peebles, H. Strobelt, B. Zhou, and A. Torralba. Seeing What a GAN Cannot Generate. In IEEE/CVF International Conference on Computer Vision, pages 4501–4510, 2019.
|
| 241 |
+
[7] L. Chen, K. Lu, A. Rajeswaran, K. Lee, A. Grover, M. Laskin, P. Abbeel, A. Srinivas, and I. Mordatch. Decision Transformer: Reinforcement Learning via Sequence Modeling. ArXiv, abs/2106.01345, 2021.
|
| 242 |
+
[8] X. Chen, Z. Zhou, Z. Wang, C. Wang, Y. Wu, Q. Deng, and K. W. Ross. BAIL: Best-Action Imitation Learning for Batch Deep Reinforcement Learning. In Advances in Neural Information Processing Systems, 2020.
|
| 243 |
+
[9] I. Csiszár and J. Körner. Information Theory - Coding Theorems for Discrete Memoryless Systems, Second Edition. Cambridge University Press, 2011.
|
| 244 |
+
[10] C. P. Diehl, T. Sievernich, M. Krüger, F. Hoffmann, and T. Bertram. UMBRELLA: Uncertainty-Aware Model-Based Offline Reinforcement Learning Leveraging Planning. ArXiv, abs/2111.11097, 2021.
|
| 245 |
+
[11] R. Fakoor, J. Mueller, P. Chaudhari, and A. Smola. Continuous Doubly Constrained Batch Reinforcement Learning. In Advances in Neural Information Processing Systems, 2021.
|
| 246 |
+
[12] J. Fu, A. Kumar, O. Nachum, G. Tucker, and S. Levine. D4RL: Datasets for Deep Data-Driven Reinforcement Learning. ArXiv, abs/2004.07219, 2020.
|
| 247 |
+
[13] S. Fujimoto and S. S. Gu. A Minimalist Approach to Offline Reinforcement Learning. In Advances in Neural Information Processing Systems, 2021.
|
| 248 |
+
[14] S. Fujimoto, D. Meger, and D. Precup. Off-Policy Deep Reinforcement Learning without Exploration. In International Conference on Machine Learning, 2019.
|
| 249 |
+
[15] S. Fujimoto, H. van Hoof, and D. Meger. Addressing Function Approximation Error in Actor-Critic Methods. In International Conference on Machine Learning, 2018.
|
| 250 |
+
[16] C. Gelada and M. G. Bellemare. Off-Policy Deep Reinforcement Learning by Bootstrapping the Covariate Shift. In AAAI Conference on Artificial Intelligence, volume 33, 2019.
|
| 251 |
+
[17] S. K. S. Ghasemipour, D. Schuurmans, and S. S. Gu. EMaQ: Expected-Max Q-Learning Operator for Simple Yet Effective Offline and Online RL. In International Conference on Machine Learning, 2021.
|
| 252 |
+
[18] D. Ghosh, A. Ajay, P. Agrawal, and S. Levine. Offline RL Policies Should be Trained to be Adaptive. ArXiv, abs/2207.02200, 2022.
|
| 253 |
+
[19] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. C. Courville, and Y. Bengio. Generative Adversarial Nets. In Advances in Neural Information Processing Systems, 2014.
|
| 254 |
+
[20] T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine. Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor. In International Conference on Machine Learning, 2018.
|
| 255 |
+
[21] T. Hester, M. Vecerík, O. Pietquin, M. Lanctot, T. Schaul, B. Piot, D. Horgan, J. Quan, A. Sendonaris, I. Osband, G. Dulac-Arnold, J. P. Agapiou, J. Z. Leibo, and A. Gruslys. Deep Q-learning From Demonstrations. In AAAI Conference on Artificial Intelligence, 2018.
|
| 256 |
+
[22] M. Janner, J. Fu, M. Zhang, and S. Levine. When to Trust Your Model: Model-Based Policy Optimization. In Advances in Neural Information Processing Systems, 2019.
|
| 257 |
+
[23] M. Janner, Q. Li, and S. Levine. Offline Reinforcement Learning as One Big Sequence Modeling Problem. In Advances in Neural Information Processing Systems, 2021.
|
| 258 |
+
[24] Y. Jin, Z. Yang, and Z. Wang. Is Pessimism Provably Efficient for Offline RL? In International Conference on Machine Learning, pages 5084–5096. PMLR, 2021.
|
| 259 |
+
[25] S. M. Kakade and J. Langford. Approximately Optimal Approximate Reinforcement Learning. In International Conference on Machine Learning, 2002.
|
| 260 |
+
[26] B. Kang, Z. Jie, and J. Feng. Policy Optimization with Demonstrations. In International Conference on Machine Learning, 2018.
|
| 261 |
+
[27] R. Kidambi, A. Rajeswaran, P. Netrapalli, and T. Joachims. MOReL: Model-Based Offline Reinforcement Learning. In Advances in Neural Information Processing Systems, 2020.
|
| 262 |
+
[28] D. P. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. In International Conference on Learning Representation, 2015.
|
| 263 |
+
[29] D. P. Kingma and M. Welling. Auto-Encoding Variational Bayes. ArXiv, abs/1312.6114, 2013.
|
| 264 |
+
[30] V. R. Konda and V. S. Borkar. Actor-Critic - Type Learning Algorithms for Markov Decision Processes. SIAM J. Control. Optim., 38:94–123, 1999.
|
| 265 |
+
[31] V. R. Konda and J. N. Tsitsiklis. Actor-Critic Algorithms. In Advances in Neural Information Processing Systems, 1999.
|
| 266 |
+
[32] I. Kostrikov, A. Nair, and S. Levine. Offline Reinforcement Learning with Implicit Q-Learning. In International Conference on Learning Representations, 2022.
|
| 267 |
+
[33] I. Kostrikov, J. Tompson, R. Fergus, and O. Nachum. Offline Reinforcement Learning with Fisher Divergence Critic Regularization. In International Conference on Machine Learning, 2021.
|
| 268 |
+
[34] A. Kumar, J. Fu, G. Tucker, and S. Levine. Stabilizing Off-Policy Q-Learning via Bootstrapping Error Reduction. In Advances in Neural Information Processing Systems, 2019.
|
| 269 |
+
[35] A. Kumar, A. Zhou, G. Tucker, and S. Levine. Conservative Q-Learning for Offline Reinforcement Learning. In Advances in Neural Information Processing Systems, 2020.
|
| 270 |
+
[36] S. Lange, T. Gabel, and M. A. Riedmiller. Batch Reinforcement Learning. In Reinforcement Learning, 2012.
|
| 271 |
+
[37] B.-J. Lee, J. Lee, and K.-E. Kim. Representation Balancing Offline Model-based Reinforcement Learning. In International Conference on Learning Representations, 2021.
|
| 272 |
+
[38] S. Lee, Y. Seo, K. Lee, P. Abbeel, and J. Shin. Offline-to-Online Reinforcement Learning via Balanced Replay and Pessimistic Q-Ensemble. In Conference on Robot Learning, 2021.
|
| 273 |
+
[39] Y. Liu, A. Swaminathan, A. Agarwal, and E. Brunskill. Off-Policy Policy Gradient with State Distribution Correction. ArXiv, abs/1904.08473, 2019.
|
| 274 |
+
[40] X. Ma, Y. Yang, H. Hu, J. Yang, C. Zhang, Q. Zhao, B. Liang, and Q. Liu. Offline Reinforcement Learning with Value-based Episodic Memory. In International Conference on Learning Representations, 2022.
|
| 275 |
+
[41] Y. J. Ma, D. Jayaraman, and O. Bastani. Conservative Offline Distributional Reinforcement Learning. In Advances in Neural Information Processing Systems, volume 34, 2021.
|
| 276 |
+
[42] T. Matsushima, H. Furuta, Y. Matsuo, O. Nachum, and S. Gu. Deployment-Efficient Reinforcement Learning via Model-Based Offline Optimization. In International Conference on Learning Representations, 2021.
|
| 277 |
+
[43] L. Meng, M. Wen, Y. Yang, C. Le, X. Li, W. Zhang, Y. Wen, H. Zhang, J. Wang, and B. Xu. Offline Pre-trained Multi-Agent Decision Transformer: One Big Sequence Model Tackles All SMAC Tasks. ArXiv, abs/2112.02845, 2021.
|
| 278 |
+
[44] O. Nachum, Y. Chow, B. Dai, and L. Li. DualDICE: Behavior-Agnostic Estimation of Discounted Stationary Distribution Corrections. In Advances in Neural Information Processing Systems, 2019.
|
| 279 |
+
[45] A. Nair, M. Dalal, A. Gupta, and S. Levine. Accelerating Online Reinforcement Learning with Offline Datasets. ArXiv, abs/2006.09359, 2020.
|
| 280 |
+
[46] Y. Ovadia, E. Fertig, J. Ren, Z. Nado, D. Sculley, S. Nowozin, J. V. Dillon, B. Lakshminarayanan, and J. Snoek. Can You Trust Your Model’s Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shift. In Advances in Neural Information Processing Systems, 2019.
|
| 281 |
+
[47] D. Precup, R. S. Sutton, and S. Dasgupta. Off-Policy Temporal Difference Learning with Function Approximation. In International Conference on Machine Learning, 2001.
|
| 282 |
+
[48] R. Rafailov, T. Yu, A. Rajeswaran, and C. Finn. Offline Reinforcement Learning from Images with Latent Space Models. In Learning for Dynamics and Control (L4DC), 2021.
|
| 283 |
+
[49] A. Rajeswaran, V. Kumar, A. Gupta, J. Schulman, E. Todorov, and S. Levine. Learning Complex Dexterous Manipulation with Deep Reinforcement Learning and Demonstrations. ArXiv, abs/1709.10087, 2018.
|
| 284 |
+
[50] P. Rashidinejad, B. Zhu, C. Ma, J. Jiao, and S. Russell. Bridging Offline reinforcement Learning and Imitation Learning: A Tale of Pessimism. Advances in Neural Information Processing Systems, 34, 2021.
|
| 285 |
+
[51] K. Sohn, H. Lee, and X. Yan. Learning Structured Output Representation using Deep Conditional Generative Models. In Advances in Neural Information Processing Systems, 2015.
|
| 286 |
+
[52] A. Srivastava, L. Valkov, C. Russell, M. U. Gutmann, and C. Sutton. VEEGAN: Reducing Mode Collapse in GANs using Implicit Variational Learning. In Advances in Neural Information Processing Systems, 2017.
|
| 287 |
+
[53] R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction. MIT press, 2018.
|
| 288 |
+
[54] R. S. Sutton, A. R. Mahmood, and M. White. An Emphatic Approach to the Problem of Off-policy Temporal-Difference Learning. Journal of Machine Learning Research, 17:2603–2631, 2016.
|
| 289 |
+
[55] J. Wang, W. Li, H. Jiang, G. Zhu, S. Li, and C. Zhang. Offline Reinforcement Learning with Reverse Model-based Imagination. In Advances in Neural Information Processing Systems, 2021.
|
| 290 |
+
[56] Q. Wang, J. Xiong, L. Han, P. Sun, H. Liu, and T. Zhang. Exponentially Weighted Imitation Learning for Batched Historical Data. In Advances in Neural Information Processing Systems, 2018.
|
| 291 |
+
[57] Z. Wang, A. Novikov, K. Zolna, J. T. Springenberg, S. E. Reed, B. Shahriari, N. Siegel, J. Merel, C. Gulcehre, N. M. O. Heess, and N. de Freitas. Critic Regularized Regression. In Advances in Neural Information Processing Systems, 2020.
|
| 292 |
+
[58] Y. Wu, G. Tucker, and O. Nachum. Behavior Regularized Offline Reinforcement Learning. ArXiv, abs/1911.11361, 2019.
|
| 293 |
+
[59] Y. Wu, S. Zhai, N. Srivastava, J. M. Susskind, J. Zhang, R. Salakhutdinov, and H. Goh. Uncertainty Weighted Actor-Critic for Offline Reinforcement Learning. In International Conference on Machine Learning, 2021.
|
| 294 |
+
[60] T. Xie, C.-A. Cheng, N. Jiang, P. Mineiro, and A. Agarwal. Bellman-Consistent Pessimism for Offline Reinforcement Learning. Advances in Neural Information Processing Systems, 34, 2021.
|
| 295 |
+
[61] S. Yang, Z. Wang, H. Zheng, Y. Feng, and M. Zhou. A Regularized Implicit Policy for Offline Reinforcement Learning. ArXiv, abs/2202.09673, 2022.
|
| 296 |
+
[62] Y. Yang, X. Ma, L. Chenghao, Z. Zheng, Q. Zhang, G. Huang, J. Yang, and Q. Zhao. Believe what you see: Implicit constraint approach for offline multi-agent reinforcement learning. Advances in Neural Information Processing Systems, 34, 2021.
|
| 297 |
+
[63] T. Yu, A. Kumar, R. Rafailov, A. Rajeswaran, S. Levine, and C. Finn. COMBO: Conservative Offline Model-Based Policy Optimization. In Advances in Neural Information Processing Systems, 2021.
|
| 298 |
+
[64] T. Yu, G. Thomas, L. Yu, S. Ermon, J. Y. Zou, S. Levine, C. Finn, and T. Ma. MOPO: Model-based Offline Policy Optimization. In Advances in Neural Information Processing Systems, 2020.
|
| 299 |
+
[65] A. Zanette, M. J. Wainwright, and E. Brunskill. Provable Benefits of Actor-Critic Methods for Offline Reinforcement Learning. In Advances in Neural Information Processing Systems, 2021.
|
| 300 |
+
[66] Y. Zhao, R. Boney, A. Ilin, J. Kannala, and J. Pajarinen. Adaptive Behavior Cloning Regularization for Stable Offline-to-Online Reinforcement Learning, 2022.
|
| 301 |
+
[67] W. Zhou, S. Bajracharya, and D. Held. PLAS: Latent Action Space for Offline Reinforcement Learning. In Conference on Robot Learning, 2020.
|
| 302 |
+
|
| 303 |
+
# Checklist
|
| 304 |
+
|
| 305 |
+
1. For all authors...
|
| 306 |
+
|
| 307 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 308 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 309 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 310 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 311 |
+
|
| 312 |
+
2. If you are including theoretical results...
|
| 313 |
+
|
| 314 |
+
(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]
|
| 315 |
+
|
| 316 |
+
3. If you ran experiments...
|
| 317 |
+
|
| 318 |
+
(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]
|
| 319 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 320 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 321 |
+
(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]
|
| 322 |
+
|
| 323 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 324 |
+
|
| 325 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 326 |
+
(b) Did you mention the license of the assets? [Yes]
|
| 327 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 328 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No]
|
| 329 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 330 |
+
|
| 331 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 332 |
+
|
| 333 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 334 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 335 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/VpYBxaPLaj-/VpYBxaPLaj-.md
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ROBUST UNIVERSAL ADVERSARIAL PERTURBATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Universal Adversarial Perturbations (UAPs) are imperceptible, image-agnostic vectors that cause deep neural networks (DNNs) to misclassify inputs from a data distribution with high probability. In practical attack scenarios, adversarial perturbations may undergo transformations such as changes in pixel intensity, rotation, etc. while being added to DNN inputs. Existing methods do not create UAPs robust to these real-world transformations, thereby limiting their applicability in attack scenarios. In this work, we introduce and formulate robust UAPs. We build an iterative algorithm using probabilistic robustness bounds and transformations generated by composing arbitrary sub-differentiable transformation functions to construct such robust UAPs. We perform an extensive evaluation on the popular CIFAR-10 and ILSVRC 2012 datasets measuring our UAPs’ robustness under a wide range common, real-world transformations such as rotation, contrast changes, etc. Our results show that our method can generate UAPs up to $2 3 \%$ more robust than existing state-of-the-art baselines.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks (DNNs) have achieved impressive results in many application domains such as natural language processing (Abdel-Hamid et al., 2014; Brown et al., 2020), medicine (Esteva et al., 2017; 2019), and computer vision (Simonyan & Zisserman, 2014; Szegedy et al., 2016). Despite their performance, they can be fragile in the face of adversarial perturbations: small imperceptible changes added to a correctly classified input that make a DNN misclassify. While there is a large amount of work on generating adversarial perturbations (Szegedy et al., 2013; Goodfellow et al., 2014; Moosavi-Dezfooli et al., 2016; Madry et al., 2017; Carlini & Wagner, 2017; Xiao et al., 2018a; Dong et al., 2018; Croce & Hein, 2019; Wang et al., 2019; Zheng et al., 2019; Andriushchenko et al., 2019; Tramèr et al., 2020), the threat model considered by these works cannot be realized in practical scenarios. This is because the threat model depends upon unrealistic assumptions about the power of the attacker: the attacker knows the DNN input in advance, generates input-specific perturbations in real-time and exactly combines the perturbation with the input before being processed by the DNN.
|
| 12 |
+
|
| 13 |
+
Practically feasible adversarial perturbations. In this work, we consider a more practical adversary to reveal real-world vulnerabilities of state-of-the-art DNNs. We assume that the attacker (i) does not know the DNN inputs in advance, (ii) can only transmit additive adversarial perturbations, and (iii) their transmitted perturbations are susceptible to modification due to real-world effects. Examples of attacks in our threat model include adding stickers to the cameras for fooling image classifiers (Li et al., 2019b) or transmitting perturbations over the air for deceiving audio classifiers (Li et al., 2019a). Note that this threat model is distinct from directly generating adversarial examples (Athalye et al., 2018) which require access to the original input.
|
| 14 |
+
|
| 15 |
+
The first two requirements in our threat model can be fulfilled by generating Universal Adversarial Perturbations (UAPs) (Moosavi-Dezfooli et al., 2017). Here the attacker can train a single adversarial perturbation that has a high probability of being adversarial on all inputs in the training distribution. However, as our experimental results show, the generated UAPs need to be combined with the DNN inputs precisely, otherwise they fail to remain adversarial. In practice, changes to UAPs are likely due to real-world effects. For example, the stickers applied to a camera can undergo changes in contrast due to weather conditions or the transmitted perturbation in audio can change due to noise in the transmission channel. This non-robustness reduces the efficiency of practical attacks created with existing methods (Moosavi-Dezfooli et al., 2017; Shafahi et al., 2020; Li et al., 2019b;a).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Robust UAPs (left) cause a classier to misclassify on most of the data distribution even after transformations are applied on them. Standard UAPs (right) are not robust to transformations and have a low probability of remaining UAPs after transformation.
|
| 19 |
+
|
| 20 |
+
This work: Robust UAPs. To overcome the above limitation, we propose the concept of robust UAPs: perturbations that have a high probability of remaining adversarial on inputs in the training distribution even after applying a set of real-world transformations. The optimization problem in generating robust UAPs (Moosavi-Dezfooli et al., 2017) is the main challenge as we are looking for perturbations that are adversarial for a set of inputs as well as to transformations applied to the perturbations. To address this challenge, we make the following main contributions:
|
| 21 |
+
|
| 22 |
+
• We introduce Robust UAPs and formulate their generation as an optimization problem.
|
| 23 |
+
• We design a new method for constructing robust UAPs. Our method is general and works for any transformations generated by composing arbitrary sub-differentiable transformation functions. We provide an algorithm for computing provable probabilistic bounds on the robustness of our UAPs against many practical transformations.
|
| 24 |
+
• We perform an extensive evaluation of the effectiveness of our method, RobustUAP, on stateof-the-art models for the popular CIFAR-10 (Krizhevsky et al., 2009) and ILSVRC 2012 (Deng et al., 2009) datasets. We compare the robustness of our UAPs under compositions of challenging real-world transformations, such as rotation, contrast change, etc. We show that on both datasets, the UAPs generated by RobustUAP are significantly more robust, achieving up to $2 3 \%$ more robustness, than the UAPs generated from the baselines.
|
| 25 |
+
|
| 26 |
+
Our work is complementary to the development of real-world attacks (Li et al., $2 0 1 9 \mathrm { a } ; \mathrm { b } )$ ) in various domains, which require modeling how the universal perturbations change during transmission. RobustUAP can improve the efficiency of such attacks by constructing perturbations that are more robust against domain-specific, real-world transformations than possible with existing algorithms (Moosavi-Dezfooli et al., 2017; Shafahi et al., 2020; Li et al., 2019a;b).
|
| 27 |
+
|
| 28 |
+
# 2 BACKGROUND
|
| 29 |
+
|
| 30 |
+
In this section, we provide necessary background definitions and notation for our work.
|
| 31 |
+
|
| 32 |
+
Adversarial Examples and Perturbations. An adversarial example is a misclassified data point that is close (in some norm) to a correctly classified data point (Goodfellow et al., 2014; Madry et al., 2017; Carlini & Wagner, 2017). Let $\mu \doteq \mathbb { R } ^ { d }$ be the input data distribution, $\mathbf { x } \in \mu$ be an input point with the corresponding true label $y \in \mathbb { R }$ , and $f : \mathbb { R } ^ { \bar { d } } \mathbb { R } ^ { d ^ { \prime } }$ be our target classifier. For ease of notation, we define $f _ { k } ( { \bf x } )$ to be the $k ^ { \mathrm { { t h } } }$ element of $f ( \mathbf { x } )$ and allow ${ \hat { f } } ( \mathbf { x } ) = \arg \operatorname* { m a x } _ { k } f _ { k } ( \mathbf { x } )$ to directly refer to the classification label. We use $\mathbf { v }$ to reference image specific perturbations and $\mathbf { u }$ to reference universal adversarial perturbations, $\mathbf { v _ { r } }$ and $\mathbf { u _ { r } }$ refer to the robust variants and will be defined in Sec. 3. We now formally define an adversarial example.
|
| 33 |
+
|
| 34 |
+
Definition 2.1. Given a correctly classified point $\mathbf { x }$ , a distance function $d ( \cdot , \cdot ) : \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } \to \mathbb { R }$ , and bound $\epsilon \in \mathbb { R }$ , $\mathbf { x } ^ { \prime }$ is an adversarial example iff $d ( { \bf x } ^ { \prime } , { \bf x } ) < \epsilon$ and $\hat { f } ( { \bf x } ^ { \prime } ) \neq y$ .
|
| 35 |
+
|
| 36 |
+
In this paper, we consider examples $\mathbf { x } ^ { \prime }$ generated as $\mathbf { x } ^ { \prime } = \mathbf { x } + \mathbf { v }$ where $\mathbf { v }$ is an adversarial perturbation.
|
| 37 |
+
|
| 38 |
+
Universal Adversarial Perturbations. UAPs are single vector, input-agnostic perturbations (Moosavi-Dezfooli et al., 2017). They differ from traditional adversarial attacks, which create perturbations dependent on each input sample. To measure UAP performance, we introduce the notion of universal adversarial success rate, which measures the probability that a perturbation $\mathbf { u }$ when added to $\mathbf { x }$ , sampled from $\mu$ , causes a change in classification under $f$ .
|
| 39 |
+
|
| 40 |
+
Definition 2.2. Given a data distribution $\mu$ , and perturbation u, universal adversarial success rate $\operatorname { A S R } _ { U }$ for $\mathbf { u }$ , is defined as
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\operatorname { A S R } _ { U } ( f , \mu , { \mathbf { u } } ) = \underset { { \mathbf { x } } \sim \mu } { P } \left( \hat { f } ( { \mathbf { x } } + { \mathbf { u } } ) \neq \hat { f } ( { \mathbf { x } } ) \right)
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Using Definition 2.2, we formally define a UAP.
|
| 47 |
+
|
| 48 |
+
Definition 2.3. A universal adversarial perturbation is a vector $\mathbf { u } \in \mathbb { R } ^ { d }$ which, when added to almost all datapoints in $\mu$ causes the classifier $f$ to misclassify. Formally, given $\gamma$ , a bound on universal ASR, and $l _ { p }$ -norm with corresponding bound $\epsilon$ , $\mathbf { u }$ is a UAP iff $\mathrm { A S R } _ { U } ( f , \mu , { \bf u } ) > \gamma$ and $| | \mathbf { u } | | _ { p } < \epsilon$ .
|
| 49 |
+
|
| 50 |
+
In general, if the additive perturbations have small $l _ { p }$ -norm , then they look like noise and do not affect the semantic content of the image. For ease of notation in later parts of the paper, we can also pose the construction of UAPs as an expectation minimization problem:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\underset { u } { \arg \operatorname* { m i n } } \mathbb { E } _ { \mathbf { x } \sim \mu } [ \delta ( \hat { f } ( \mathbf { x } + \mathbf { u } ) , \hat { f } ( \mathbf { x } ) ) ] \mathrm { s . t . } | | \mathbf { u } | | _ { p } < \epsilon
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $\delta$ is the Kronecker Delta function (Agarwal, 2013).
|
| 57 |
+
|
| 58 |
+
# 3 ROBUST UNIVERSAL ADVERSARIAL PERTURBATIONS
|
| 59 |
+
|
| 60 |
+
In this section, we will define the optimization problem for generating robust UAPs. We first define transformation sets and neighborhoods.
|
| 61 |
+
|
| 62 |
+
Definition 3.1. A transformation, $\tau$ , is a composition of bijective sub-differentiable transformation functions. A transformation set, $T$ , is a set of distinct transformations. A point $\mathbf { v } ^ { \prime }$ is in the neighborhood $N _ { T } ( \mathbf { v } )$ , of $\mathbf { v }$ , if there is a transform in $T$ that maps $\mathbf { v }$ to $\mathbf { v } ^ { \prime }$ . Formally,
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathbf { v } ^ { \prime } \in N _ { T } ( \mathbf { v } ) \iff \exists \tau \in T { \mathrm { ~ s . t . ~ } } \tau ( \mathbf { v } ) = \mathbf { v } ^ { \prime }
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Example 3.2. Let $T$ be the set of all transformations represented by a rotation of $\pm 3 0 ^ { \circ }$ , scaling of up to a factor of 2, and a translation of up to $\pm 2$ pixels, in this case one $\tau \in T$ could be {rotation of $8 ^ { \circ }$ , scaling a factor of 1.2, and translation of -1.3} in that order and $N _ { T } ( \mathbf { v } )$ would include any point that can be obtained by applying one of the transformations from $T$ on $\mathbf { v }$ .
|
| 69 |
+
|
| 70 |
+
In order to define robust UAPs we introduce robust universal adversarial success rate.
|
| 71 |
+
|
| 72 |
+
Definition 3.3. Given a data distribution $\mu$ , transformation set $T$ , universal ASR level $\gamma$ , bound $\epsilon$ on $l _ { p }$ -norm, and perturbation $\mathbf { u _ { r } }$ , robust universal adversarial success rate, $\operatorname { A S R } _ { R }$ , is defined as,
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbf { A S R } _ { R } ( f , \mu , T , \gamma , \mathbf { u _ { r } } ) = \underset { \mathbf { u } _ { r } ^ { \prime } \sim N _ { T } ( \mathbf { u _ { r } } ) } { \cal P } ( \mathbf { A S R } _ { U } ( f , \mu , \mathbf { u } _ { r } ^ { \prime } ) > \gamma \land | | \mathbf { u } _ { \mathbf { r } } ^ { \prime } | | _ { p } < \epsilon )
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
The robust universal adversarial success rate measures the probability that a neighbor of $\mathbf { u _ { r } }$ is also an UAP on $\mu$ , i.e. after transformation it maintains high universal ASR. We note that even though $| | \mathbf { u } _ { \mathbf { r } } | | _ { p } \leq \epsilon$ , it can happen that a ${ \bf u } _ { \bf r } ^ { \prime } \in \ d { \cal N } _ { T } ( { \bf u } _ { \bf r } )$ has $| | \mathbf { u } _ { \mathbf { r } } ^ { \prime } | | _ { p } > \epsilon$ , this is particularly true for the semantic transformations considered in this work. Therefore, we require that the norm of $\mathbf { u } _ { \mathbf { r } } ^ { \prime }$ is small.
|
| 79 |
+
|
| 80 |
+
Using Definition 3.3 we can now formally define a robust UAP.
|
| 81 |
+
|
| 82 |
+
Definition 3.4. A robust universal adversarial perturbation, $\mathbf { u _ { r } }$ , is one which most points within a neighborhood of $\mathbf { u _ { r } }$ when added to most points in $\mu$ fool the classifier, $f . \mathbf { u _ { r } }$ satisfies $\bar { | } | \mathbf { u _ { r } } | | _ { p } < \epsilon$ and $\mathrm { A S R } _ { R } ( f , \mu , T , \gamma , \mathbf { u _ { r } } ) > \zeta$ .
|
| 83 |
+
|
| 84 |
+
In order to construct robust UAPs, we can pose the following expectation minimization problem:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\underset { \mathbf { u } _ { \mathbf { r } } } { \arg \operatorname* { m i n } } \ \underset { \mathbf { u } _ { \mathbf { r } } ^ { \prime } \in N _ { T } ( \mathbf { u } _ { \mathbf { r } } ) } { \mathbb { E } } [ I ( | | \mathbf { u } _ { \mathbf { r } } ^ { \prime } | | < \epsilon ) \times \underset { \mathbf { x } \sim \mu } { \mathbb { E } } [ \delta ( \hat { f } ( \mathbf { x } + \mathbf { u } _ { \mathbf { r } } ^ { \prime } ) , \hat { f } ( \mathbf { x } ) ) ] ] \ \mathrm { s . t . } \ | | \mathbf { u } _ { \mathbf { r } } | | _ { p } < \epsilon
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
Here $I : \mathbb { R } ^ { d } \mathbb { R }$ denotes an indicator function. The inner expectation represents the UAP condition for the transformed perturbation $\mathbf { u } _ { \mathbf { r } } ^ { \prime }$ while the outer expectation represents the neighborhood robustness condition. Solving Equation 5 requires computing $\mathbf { u _ { r } }$ which minimizes the expectation over the transformation set and data distribution. This composition makes it computationally harder than minimizing over only the transformation set, as in EOT (Athalye et al., 2018), or than minimizing over only the data distribution, as done for standard UAP (Moosavi-Dezfooli et al., 2017).
|
| 91 |
+
|
| 92 |
+
# 4 GENERATING ROBUST UNIVERSAL ADVERSARIAL PERTURBATIONS
|
| 93 |
+
|
| 94 |
+
In this section, we will discuss our approach for optimizing Equation 5 to generate UAPs robust to transformations generated by a composition of arbitrary sub-differentiable transformation functions. At a high level, the objective can be seen as gluing the outer expectation, a EOT objective over the transformations applied on the perturbation, with the inner expectation, a UAP objective over the input data distribution. We first describe intuitive baselines for optimizing Equation 5 and then present our new algorithm, RobustUAP.
|
| 95 |
+
|
| 96 |
+
# 4.1 STOCHASTIC GRADIENT DESCENT
|
| 97 |
+
|
| 98 |
+
The first baseline directly solves Equation 5 using gradient descent. Since we are solving a constrained optimization problem, we cannot use gradient descent directly. Instead, we can solve the Lagrangianrelaxed form of the problem as in (Carlini & Wagner, 2017; Athalye et al., 2018).
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\underset { \mathbf { u } _ { \mathbf { r } } } { \arg \operatorname* { m i n } } \ \underset { \mathbf { u } _ { \mathbf { r } } ^ { \prime } \in N _ { T } ( \mathbf { u } _ { \mathbf { r } } ) } { \mathbb { E } } [ I ( | | \mathbf { u } _ { \mathbf { r } } ^ { \prime } | | < \epsilon ) \times \underset { \mathbf { x } \sim \mu } { \mathbb { E } } [ \delta ( \hat { f } ( \mathbf { x } + \mathbf { u } _ { \mathbf { r } } ^ { \prime } ) , \hat { f } ( \mathbf { x } ) ) ] ] - \lambda | | \mathbf { u } _ { \mathbf { r } } | | _ { p }
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
We use a momentum based Stochastic Gradient Descent (SGD) method for solving Equation 6. Shafahi et al. (2020) suggests that this is an effective method for generating standard UAPs. In order to implement this, we replace the Kronecker Delta function with a loss function, $L$ . We iteratively converge towards the inner expectation by computing it in batches, and towards the outer expectation by sampling a large number of transformations. Given that we would like to estimate on a batch, $\hat { \mathbf { x } } \subset \mu$ , and a random set of transformations sampled from $T$ , $\hat { \tau } \subset T$ , we can approximate Equation 6:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\frac { I ( | | \hat { \tau } _ { j } ( \mathbf { u _ { r } } ) | | < \epsilon ) } { | \hat { \mathbf { x } } | \times | \hat { \tau } | } \sum _ { i = 1 } ^ { | \hat { \mathbf { x } } | } \sum _ { j = 1 } ^ { | \hat { \tau } | } L [ f ( \hat { \mathbf { x } } _ { \mathbf { i } } + \hat { \tau } _ { j } ( \mathbf { u _ { r } } ) ) , f ( \hat { \mathbf { x } } _ { \mathbf { i } } ) ] - \lambda | | \mathbf { u _ { r } } | | _ { p }
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Our final algorithm is in Appendix C.
|
| 111 |
+
|
| 112 |
+
# 4.2 STANDARD UAP ALGORITHM WITH ROBUST ADVERSARIAL PERTURBATIONS
|
| 113 |
+
|
| 114 |
+
For our second baseline, we leverage the standard UAP algorithm from Moosavi-Dezfooli et al. (2017) (see Appendix D for the algorithm). The standard UAP algorithm iterates over the entire training dataset and at each input, $\mathbf { x _ { i } }$ , computes the smallest additive change, $\Delta \mathbf { u }$ , to the current perturbation, u, that would make $\mathbf { u } + \Delta \mathbf { u }$ an adversarial perturbation for $\mathbf { x _ { i } }$ . Intuitively, over time the algorithm will approach a perturbation that works on most inputs in the training dataset. This approach works by computing robust adversarial perturbations rather than standard adversarial perturbations. At each point $\mathbf { x _ { i } }$ , we compute the smallest additive change, $\Delta \mathbf { u _ { r } }$ , to the current robust adversarial perturbation, $\mathbf { u _ { r } }$ , that would make $\mathbf { u } _ { \mathbf { r } } + \Delta \mathbf { u } _ { \mathbf { r } }$ a robust adversarial perturbation for $\mathbf { x _ { i } }$ .
|
| 115 |
+
|
| 116 |
+
We search for robust adversarial perturbations by optimizing the expectation that a point in the neighborhood of $\mathbf { v _ { r } }$ is adversarial while restricting the perturbation to an $l _ { p }$ norm of $\epsilon$ . We formulate this as the following minimization problem:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\underset { \mathbf { v _ { r } } } { \arg \operatorname* { m i n } } \quad \underset { \mathbf { v _ { r } ^ { \prime } } \in { \cal { W } } _ { T } ( \mathbf { v _ { r } } ) } { \mathbb { E } } [ I ( | | \mathbf { v _ { r } ^ { \prime } } | | < \epsilon ) \times \delta ( \hat { f } ( \mathbf { x } + \mathbf { v } _ { \mathbf { r } } ^ { \prime } ) , \hat { f } ( \mathbf { x } ) ) ] \mathrm { ~ s . t . ~ } | | \mathbf { v _ { r } } | | _ { p } < \epsilon
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
# 4.3 ROBUST UAP ALGORITHM
|
| 123 |
+
|
| 124 |
+
The baseline algorithms have two fundamental limitations: (i) they rely on random sampling over the symbolic transformation region, but the sampling strategy does not explicitly try to maximize the robustness of the generated UAP over the entire symbolic region, and (ii) they do not estimate robustness on unsampled transformations. As a result, the baselines yield suboptimal UAPs (as confirmed by our experiments below). To overcome these fundamental limitations, we create a method to compute probabilistic bounds for expected robustness on an entire symbolic region. We leverage this method for approximating expected robustness in a new algorithm to generate robust UAPs with guarantees. We make a simplifying assumption that ${ { N } _ { T } } ( { \bf { u } } _ { \bf { r } } )$ has a well defined, sampleable probability density function (PDF) as we cannot bound robustness for arbitrary transformations. Our experiments show that even though our assumptions do not hold for all the transformation sets considered in this work, they significantly improve the robustness of our generated UAPs. Our approximation of the expected robustness relies on the following theoretical result:
|
| 125 |
+
|
| 126 |
+
Theorem 4.1. Given a perturbation $\mathbf { u _ { r } }$ , a neural network $f _ { i }$ , a finite set of inputs $\mathbf { X }$ , a set of transformations $T$ , and minimum universal adversarial success rate $\gamma ~ \in ~ \mathbb { R }$ . Let $p ( \gamma ) =$ $P _ { \mathbf { u } _ { \mathbf { r } } ^ { \prime } \sim N _ { T } ( \mathbf { u } _ { \mathbf { r } } ) } ( A S R _ { U } ( f , \mathbf { X } , \mathbf { u } _ { \mathbf { r } } ^ { \prime } ) > \gamma )$ . For $i \in { 1 \dots n }$ , let ${ \bf u } _ { \bf r } ^ { \bf i } \sim N _ { T } ( { \bf u } _ { \bf r } )$ be random variables with a well defined PDF and $I : \mathbb { R } ^ { d } \mathbb { R }$ be the indicator function, let
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\hat { p } _ { n } ( \gamma ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } I ( A S R _ { U } ( f , \mathbf { X } , \mathbf { u } _ { \mathbf { r } } ^ { \mathbf { i } } ) > \gamma )
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
For accura0 and 1. If $\psi \in ( 0 , 1 )$ , and confidence, $\phi \in ( 0 , 1 )$ , where $( 0 , 1 )$ is the open interval between $\begin{array} { r } { \dot { n } \geq \frac { 1 } { 2 \psi ^ { 2 } } \ln \frac { 2 } { \phi } } \end{array}$
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
P ( | \hat { p } _ { n } ( \gamma ) - p ( \gamma ) | < \psi ) \geq 1 - \phi
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
Proof. The bound on $n$ is derived via the Chernoff inequality applied to $\hat { p } _ { n } ( \gamma )$ and $\mathbb { E } [ \hat { p } _ { n } ( \gamma ) ] =$ $p ( \gamma )$ (Chernoff, 1952; Alippi, 2014). Equation 10 holds since computing universal ASR is Lebesgue measurable over the data distribution and since we assume ${ { N } _ { T } } ( { \bf { u } } _ { \bf { r } } )$ has a well defined PDF. $\boxed { \begin{array} { r l } \end{array} }$
|
| 139 |
+
|
| 140 |
+
Theorem 4.1 states that with enough samples from the neighborhood of a perturbation, $\mathbf { u _ { r } }$ , the adversarial success rate of $\mathbf { u _ { r } }$ on the entire neighborhood is arbitrarily close to the adversarial success rate of $\mathbf { u _ { r } }$ on sampled transformations with probability greater than $1 - \phi$ . One key observation is that the Chernoff bound is independent of the dimensionality of the sample space which allows us to efficiently apply this result to high-dimensional transformation set provided they have a well-defined PDF (e.g., $L _ { \infty }$ -ball) and obtain provable bounds on the expected robustness. For the combinations of semantic transformations, such as rotation, translation, etc. used in the experiment section the neighborhood does not have a well-defined PDF, thus we uniformly sample the parameter space of each transformation to produce a point in the neighborhood. We believe uniformly sampling the parameter space is a realistic approximation of real-world effects.
|
| 141 |
+
|
| 142 |
+
Leveraging Theorem 4.1, we create EstimateRobustness which given accuracy, $\psi$ , and confidence, $\phi$ , returns the robust adversarial success rate on a finite set of inputs with probabilistic robustness guarantees under the assumptions of Theorem 4.1. The pseudocode for EstimateRobustness is in Algorithm 1
|
| 143 |
+
|
| 144 |
+
# Algorithm 1 EstimateRobustness
|
| 145 |
+
|
| 146 |
+
Our algorithm: RobustUAP. We leverage Theorem 4.1 and Algorithm 1 to develop RobustUAP, the pseudocode for which is seen in Algorithm 2. Similar to the SGD baseline, we approximate the expectation in Equation 5 in batches. We start by sampling transformations from the PDF of the neighborhood. We set the number of transformations, $n$ , based on Theorem 4.1 to satisfy the desired confidence level and accuracy. For each gradient step, we compute the mean loss over the current batch and set of sampled transforms (line 8). For each set of batch and sampled transformations, instead of making a single gradient update like SGD, we use Projected Gradient Descent (PGD) to iteratively compute a more robust update to the universal perturbation and end only when the estimated robustness on the batch satisfies a given threshold (line 10). At the end of each epoch, we check the robustness across the entire training set and transformation space using EstimateRobustness and stop when we have reached the desired performance (line 14).
|
| 147 |
+
|
| 148 |
+
# Algorithm 2 Robust UAP Algorithm
|
| 149 |
+
|
| 150 |
+
1: Init $\begin{array} { r } { \mathbf { u } _ { \mathbf { r } } 0 , n \lceil \frac { 1 } { 2 \psi ^ { 2 } } \ln \frac { 2 } { \phi } \rceil } \end{array}$
|
| 151 |
+
$i = 1 \dots n$ $\tau _ { i } \sim T$
|
| 152 |
+
3: repeat
|
| 153 |
+
4: for $\mathbf { B } \subset \mathbf { X }$ do
|
| 154 |
+
5: if EstimateRobustnes $\mathbf { \Phi } _ { \mathsf { S } } ( f , \mathbf { B } , T , \gamma , \mathbf { u _ { r } } , \psi , \phi ) < \zeta$ then
|
| 155 |
+
6: $\Delta \mathbf { u _ { r } } \gets 0$
|
| 156 |
+
7: repeat
|
| 157 |
+
8: Compute $\begin{array} { r } { L _ { \mathbf { B } , \tau } = \frac { 1 } { | \mathbf { B } | \times n } \sum _ { i = 1 } ^ { | \mathbf { B } | } \sum _ { j = 1 } ^ { n } L [ f ( \mathbf { B _ { i } } + \tau _ { j } ( \mathbf { u _ { r } } + \Delta \mathbf { u _ { r } } ) ) , f ( \mathbf { B _ { i } } ) ] } \end{array}$
|
| 158 |
+
9: $\Delta \mathbf { u } _ { \mathbf { r } } = \mathcal { P } _ { p , \epsilon } ( \Delta \mathbf { u } _ { \mathbf { r } } + \alpha \mathrm { s i g n } ( \nabla L _ { \mathbf { B } , \tau } ) )$
|
| 159 |
+
10: until EstimateRobustnes $\mathrm { s } ( f , \mathbf { B } , T , \gamma , \mathbf { u _ { r } } + \Delta \mathbf { u _ { r } } , \psi , \phi ) < \zeta$
|
| 160 |
+
11: Update the perturbation with projection: $\mathbf { u _ { r } } \gets \mathcal { P } _ { p , \epsilon } ( \mathbf { u _ { r } } + \Delta \mathbf { u _ { r } } )$
|
| 161 |
+
12: end if
|
| 162 |
+
13: end for
|
| 163 |
+
14: until EstimateRobustne $\mathfrak { s s } ( f , \mathbf { X } , T , \gamma , \mathbf { u _ { r } } , \psi , \phi ) < \zeta$
|
| 164 |
+
|
| 165 |
+
# 5 EVALUATION
|
| 166 |
+
|
| 167 |
+
Our RobustUAP framework is applicable to all transformation sets in a variety of domains. We empirically evaluate our method RobustUAP and three baseline approaches (SGD, StandardUAP_RP, StandardUAP (Moosavi-Dezfooli et al., 2017)) on popular models from the vision domain. We show that RobustUAP is more robust on both uniform random noise and compositions of real-world transformations such as rotation, scaling, etc.
|
| 168 |
+
|
| 169 |
+
Experimental evaluation. We consider two popular image recognition datasets: CIFAR10(Krizhevsky et al., 2009) and ILSVRC 2012(Deng et al., 2009). For CIFAR-10, we evaluate on the entire test set (1,000 images) and use a state-of-the-art pretrained VGG16 (Simonyan & Zisserman, 2014) network as the target classification model. For ILSVRC 2012, we evaluate on a random subset of the test set (1,000 images), and use a state-of-the-art Inception-v3 (Szegedy et al., 2016) network. We evaluate the robustness against uniform random noise as well as a composition of transformations from brightness/contrast, rotation, scaling, shearing, and translation. All experiments were performed on a desktop PC with a GeForce RTX(TM) 3090 GPU and a 16-core Intel(R) Core(TM) i9-9900KS CPU $\textcircled { a } 4 . 0 0 \mathrm { G H z }$ .
|
| 170 |
+
|
| 171 |
+
We report the results for $l _ { 2 }$ -norm with $\epsilon = 1 0 0$ for ILSVRC 2012 and $\epsilon = 1 0$ for CIFAR-10. These values were chosen based on the values presented by the original UAP paper (Moosavi-Dezfooli et al., 2017). We use an image normalization function given by our pretrained models and thus scaled our $\epsilon$ values accordingly. We note that the $\epsilon$ -values are significantly smaller than the image norms. Therefore the generated perturbation is imperceptible and does not affect the semantic content of the image. Due to the hardness of the optimization problem, for the same norm value, the effectiveness of a UAP is less than input-specific perturbations. We note that crafting input-specific perturbations requires making unrealistic assumptions about the power of the attacker as mentioned in the introduction and therefore we do not consider them part of our threat model which aims to generate practically feasible perturbations. We use $\psi = 0 . 0 5$ and $\phi = 0 . 0 5$ resulting in $n = 7 3 8$ for generating samples for our RobustUAP algorithm as well as reporting robust ASR in our evaluation. The UAPs are trained on 2,000 images, other parameters for evaluation are given in Appendix E.
|
| 172 |
+
|
| 173 |
+
# 5.1 ROBUSTNESS TO RANDOM NOISE
|
| 174 |
+
|
| 175 |
+
First, we show that our algorithm generates UAPs robust against uniform random noise. Here our neighborhood is defined as an $L _ { \infty }$ ball of radius $\epsilon$ around the perturbation. $U ( \epsilon )$ represents noise drawn uniformly from such a ball. Figure 2 shows the performance of each algorithm. For example, the RobustUAP algorithm achieves a $\operatorname { A S R } _ { U }$ of 0.9 greater than $9 7 \%$ of the time under $U ( 0 . { \bar { 1 } } )$ on CIFAR-10, where all other algorithms achieve 0.9 at most $3 0 \%$ of the time. RobustUAP outperforms all other algorithms for both noise sizes. StandardUAP has a lower mean and higher variance in universal ASR and is much less robust to transformation. A table of Robust ASR results for $\gamma = 0 . 8$ can be seen in Appendix F. Our Robust ASR results are guaranteed to be $\pm 0 . 0 5$ from the actual result with a probability of $9 5 \%$ . For example, we estimate that RobustUAP has $\operatorname { A S R } _ { R }$ of $9 6 . 1 \%$ for U(0.3), we are guaranteed that the true robustness is $> 9 1 . 1 \%$ with a probability of $9 5 \%$ . Note that we get robustness guarantees from EstimateRobustness as our neighborhood has a well-defined PDF.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 2: For each method, a point $( x , y )$ in the corresponding line represents the percentage of sampled UAPs $( y \% )$ with Universal $\mathbf { A } \mathbf { S } \mathbf { R } > x$ for $U ( 0 . 1 )$ and $U ( 0 . 3 )$ on ILSVRC and CIFAR-10.
|
| 179 |
+
|
| 180 |
+
# 5.2 ROBUSTNESS TO SEMANTIC TRANSFORMATIONS
|
| 181 |
+
|
| 182 |
+
Next, we consider transformation sets generated by composing five popular semantic transformations in existing literature (Athalye et al., 2018; Balunovic et al., 2019): brightness/contrast, rotation, ´ scaling, shearing, and translation.
|
| 183 |
+
|
| 184 |
+
We use a variety of different compositions to show that our algorithm works under different conditions, and base our parameters for the transformations on (Balunovic et al., 2019). For our experiments, ´ $R ( \theta )$ corresponds to rotations with angles between $\pm \theta$ ; $T ( x , y )$ , to translations of $\pm x$ horizontally and $\pm y$ vertically; $S c ( p )$ to scaling the image between $\pm p \%$ ; $S h ( m )$ to shearing by shearing factor between $\pm m \%$ ; and $B ( \alpha , \beta )$ to changes in contrast between $\pm \alpha \%$ and brightness between $\pm \beta$ . Further details about these transformations can be seen in Appendix A. We consider compositions of different subsets and ranges of these transformations shown in Table 1 including composing all transformations together. The hardness of generating robust UAPs depends on the effect that the transformation set has on the UAP (i.e. random noise has a relatively small effect compared to rotation). The hardness also increases with the number of transformations in the composition as well as the range of parameters for each individual transformation. For example, generating robust UAPs is harder for the composition shown in the first and last row for ILSVRC 2012 in Table 1 compared to the second and third row. The same is true for generating a UAP robust to uniform random noise.
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 3: For each method, a point $( x , y )$ in the corresponding line represents the percentage of sampled UAPs $( y \% )$ with Universal $\mathrm { A S R } > x$ for the different semantic transformations on ILSVRC.
|
| 188 |
+
|
| 189 |
+
Robust ASR $( \mathbf { A S R _ { R } } )$ ). Figure 3 shows performance of UAPs obtained by applying 738 randomly sampled transformations to the original UAPs generated by different methods on ILSVRC, similar graphs for CIFAR-10 can be found in Appendix G. The RobustUAP algorithm outperforms all others in each case, we observe that for these harder transformation sets StandardUAP loses its effectiveness completely. In Table 1 we compare robust universal adversarial success rate $\mathrm { A S R } _ { R }$ with $\gamma = 0 . 6$ , in other words, we are finding the percentage of sampled neighbors of the perturbation that are still UAPs with $6 0 \%$ effectiveness on the testing set. We provide average $\operatorname { A S R } _ { U }$ scores as well as $\mathrm { A S R } _ { R }$ for different $\gamma$ levels in Appendix $_ \mathrm { H }$ .
|
| 190 |
+
|
| 191 |
+
Our RobustUAP algorithm achieves at least $5 3 . 4 \%$ higher robust ASR when compared to the standard UAP algorithm on both datasets and the challenging transformation sets shown in Table 1. Furthermore, our RobustUAP algorithm significantly outperforms both robust baseline approaches. Except for the $T ( 2 , 2 )$ case which we observe to be the easiest, RobustUAP achieves at least $1 1 . 6 \%$ performance gain over the baselines. SGD is the best performing baseline and achieves high robust ASR on relatively easier transformation sets performing within $\bar { 1 } \%$ of RobustUAP on $T ( 2 , 2 )$ . On harder transformation sets, this gap widens considerably, see Table 1.
|
| 192 |
+
|
| 193 |
+
<table><tr><td>DATASET</td><td>TRANSFORMATION SET</td><td>STANDARD UAP</td><td>SGD</td><td>STANDARD UAP_RP</td><td>ROBUST UAP</td></tr><tr><td rowspan="4">ILSVRC 2012</td><td>R(20)</td><td>0.0%</td><td>69.9%</td><td>2.9%</td><td>93.2%</td></tr><tr><td>T(2,2)</td><td>35.9%</td><td>96.1%</td><td>38.8%</td><td>97.1%</td></tr><tr><td>Sc(5),R(5),B(5,0.01)</td><td>22.3%</td><td>85.4%</td><td>43.7%</td><td>96.1%</td></tr><tr><td>R(10),T(2,2), Sh(2),Sc(2),B(2,0.001)</td><td>0.0%</td><td>63.1%</td><td>2.9%</td><td>86.4%</td></tr><tr><td rowspan="3">CIFAR-10</td><td>R(30),B(2,0.001)</td><td>0.0%</td><td>64.1%</td><td>2.9%</td><td>75.7%</td></tr><tr><td>R(2),Sh(2)</td><td>42.7%</td><td>88.3%</td><td>52.4%</td><td>96.1%</td></tr><tr><td>R(10),T(2,2),Sh(2),Sc(2),B(2,0.001)</td><td>0.0%</td><td>58.3%</td><td>7.8%</td><td>79.6%</td></tr></table>
|
| 194 |
+
|
| 195 |
+
Table 1: Robust ASR of RobustUAP compared to the three baselines.
|
| 196 |
+
|
| 197 |
+
Visualization. We visualize UAPs generated with RobustUAP and StandardUAP transformed with random transformations from $\bar { R ( 1 0 ) } , \bar { T ( 2 , 2 ) } , S h ( 2 ) , S c ( 2 ) , \bar { B ( 2 , 0 . 0 0 1 ) }$ and added to images in ILSVRC 2012 in Figure 4. Our robust UAPs have a similar level of imperceptibility to standard UAPs and do not affect the semantic content of the images. Robust UAPs affect the model classification after transformation with high probability, unlike standard UAPs.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 4: Examples of perturbed images with labels. The top row is unperturbed ILSVRC 2012 test set images, the second row has a randomly transformed robust UAP added to it, and the bottom row has a randomly transformed standard UAP added to it. Labels calculated using Inception-v3.
|
| 201 |
+
|
| 202 |
+
We further visualize UAPs generated with our three robust algorithms on the same transformation set against a standard UAP generated on ILSVRC 2012 in Figure 5. We observe that UAPs generated by the StandardUAP algorithm resemble those generated by the StandardUAP_RP algorithm. We believe that this is due to the similarity in the workings of both algorithms. However, the two UAPs are not identical. Under our transformation set the center of the image is least likely to be perturbed so we observe StandardUAP_RP algorithm concentrates its budget towards the center. Both the RobustUAP and the SGD algorithm generate larger patterns distributed over the entire image.
|
| 203 |
+
|
| 204 |
+
# 5.3 ADDITIONAL EXPERIMENTS
|
| 205 |
+
|
| 206 |
+
In Appendix I we show how our robust UAPs compare to standard UAPs on the non-robust universal ASR metric. In Appendix J, we evaluate our methods on ResNet18 (He et al., 2015) and MobileNet (Howard et al., 2017) for CIFAR-10 and ILSVRC 2012 respectively. The results follow the same trends as those reported in Table 1. In Appendix H we provide the average $\operatorname { A S R } _ { U }$ achieved by all the algorithms and also provide $\operatorname { A S R } _ { R }$ computed with different values of $\gamma$ for the same transformation sets in Table 1. Finally, we provide runtimes for all algorithms in Appendix L.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 5: Comparison of UAPs generated with (a) StandardUAP, (b) RobustUAP, (c) StandardUAP_RP, and (d) RobustUAP on ILSVRC 2012.
|
| 210 |
+
|
| 211 |
+
# 6 RELATED WORK
|
| 212 |
+
|
| 213 |
+
In this section, we survey works closely related ours.
|
| 214 |
+
|
| 215 |
+
UAP Algorithms. Most works focusing on UAPs (Moosavi-Dezfooli et al., 2017; Mopuri et al., 2018; Zhang et al., 2020a; Khrulkov & Oseledets, 2018; Li et al., 2020; Akhtar et al., 2018; Hendrik Metzen et al., 2017; Zhang et al., 2020b) generate singular vectors and do not consider perturbation robustness. Bahramali et al. (2021) introduces a perturbation generator model (PGM) for the wireless domain which creates UAPs with random trigger patterns. They show that both adversarial training and noise subtracting defenses used in the wireless domain are highly effective in mitigating the effects of a single vector UAP attack; they further show that their method of generating a set of UAPs is an effective way for an attacker to circumvent these defenses. Although PGM provides a method for efficiently sampling unique UAPs, they do not train to be robust to real-world transformations. In contrast, our method enables efficient sampling of UAPs that are robust to transformations.
|
| 216 |
+
|
| 217 |
+
Robust Adversarial Examples. The following papers introduce notions of robustness under different viewpoints and environmental conditions for constructing realizable adversarial examples. This is a different threat model compared to the additive perturbations discussed in this paper. Luo et al. (2018) constructs adversarial examples which minimize human detectability, further introducing the idea of robustness for adversarial examples. They show that their attacks are robust against jpeg compression. Sharif et al. (2016) attack facial recognition systems by putting adversarial perturbations on glass frames. Their work demonstrates a successful physical attack under stable conditions and poses. Eykholt et al. (2018) proposes Robust Physical Perturbations $\mathrm { ( R P _ { 2 } ) }$ in order to show that adding graffiti on a stop sign can cause it to be misclassified in both simulations and in the real world. Athalye et al. (2018) introduce Expectation over Transformation (EOT) and use it to print real-world objects which are adversarial given a range of physical and environmental conditions.
|
| 218 |
+
|
| 219 |
+
Robust Adversarial Perturbations. Li et al. (2019a) generates music which affects a voice assistant based system from picking up its wake word. Li et al. (2019b) presents a method for generating a targeted adversarial sticker which changes an image classifier’s classification from one pre-specified class to another. Both of these methods rely on specific use cases and are tailored towards generating adversaries coming from strict distributions, e.g. (Li et al., 2019a) generates guitar music while (Li et al., 2019b) generates a small grid of dots. These works build on algorithms akin to our baseline approaches and are limited in scope to domain specific transformations. Our work provides a framework for improving robustness against a wide range of transformations in diverse domains and can be leveraged for improving the effectiveness of these attacks.
|
| 220 |
+
|
| 221 |
+
# 7 CONCLUSION
|
| 222 |
+
|
| 223 |
+
In this paper, we demonstrate that standard UAPs are highly susceptible to transformations, i.e. they fail to be universally adversarial under transformation. We propose a new method, RobustUAP to generate robust UAPs based upon obtaining probabilistic bounds on UAP robustness across an entire transformation space. Our experiments provide empirical evidence that this principled approach generates UAPs that are practically more robust under a wide range of transformation sets than those from the baseline methods.
|
| 224 |
+
|
| 225 |
+
# REFERENCES
|
| 226 |
+
|
| 227 |
+
Ossama Abdel-Hamid, Abdel-rahman Mohamed, Hui Jiang, Li Deng, Gerald Penn, and Dong Yu. Convolutional neural networks for speech recognition. IEEE/ACM Transactions on audio, speech, and language processing, 22(10):1533–1545, 2014.
|
| 228 |
+
|
| 229 |
+
DC Agarwal. Tensor Calculus and Riemannian Geometry. Krishna Prakashan Media, 2013.
|
| 230 |
+
|
| 231 |
+
Naveed Akhtar, Jian Liu, and Ajmal Mian. Defense against universal adversarial perturbations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3389–3398, 2018.
|
| 232 |
+
|
| 233 |
+
Cesare Alippi. Intelligence for embedded systems. Springer, 2014.
|
| 234 |
+
|
| 235 |
+
Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion, and Matthias Hein. Square attack: a query-efficient black-box adversarial attack via random search, 2019.
|
| 236 |
+
|
| 237 |
+
Anish Athalye, Logan Engstrom, Andrew Ilyas, and Kevin Kwok. Synthesizing robust adversarial examples. In International conference on machine learning, pp. 284–293. PMLR, 2018.
|
| 238 |
+
|
| 239 |
+
Alireza Bahramali, Milad Nasr, Amir Houmansadr, Dennis Goeckel, and Don Towsley. Robust adversarial attacks against dnn-based wireless communication systems. arXiv preprint arXiv:2102.00918, 2021.
|
| 240 |
+
|
| 241 |
+
Mislav Balunovic, Maximilian Baader, Gagandeep Singh, Timon Gehr, and Martin Vechev. Certifying ´ geometric robustness of neural networks. Advances in Neural Information Processing Systems 32, 2019.
|
| 242 |
+
|
| 243 |
+
Philipp Benz, Chaoning Zhang, Tooba Imtiaz, and In So Kweon. Double targeted universal adversarial perturbations. In Proceedings of the Asian Conference on Computer Vision, 2020.
|
| 244 |
+
|
| 245 |
+
Philipp Benz, Soomin Ham, Chaoning Zhang, Adil Karjauv, and In So Kweon. Adversarial robustness comparison of vision transformer and mlp-mixer to cnns. arXiv preprint arXiv:2110.02797, 2021.
|
| 246 |
+
|
| 247 |
+
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.
|
| 248 |
+
|
| 249 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 ieee symposium on security and privacy (sp), pp. 39–57. IEEE, 2017.
|
| 250 |
+
|
| 251 |
+
Herman Chernoff. A measure of asymptotic efficiency for tests of a hypothesis based on the sum of observations. The Annals of Mathematical Statistics, pp. 493–507, 1952.
|
| 252 |
+
|
| 253 |
+
Francesco Croce and Matthias Hein. Minimally distorted adversarial examples with a fast adaptive boundary attack, 2019.
|
| 254 |
+
|
| 255 |
+
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, pp. 248–255, 2009. doi: 10.1109/CVPR.2009.5206848.
|
| 256 |
+
|
| 257 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
|
| 258 |
+
|
| 259 |
+
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.
|
| 260 |
+
|
| 261 |
+
Andre Esteva, Brett Kuprel, Roberto A Novoa, Justin Ko, Susan M Swetter, Helen M Blau, and Sebastian Thrun. Dermatologist-level classification of skin cancer with deep neural networks. nature, 542(7639):115–118, 2017.
|
| 262 |
+
|
| 263 |
+
Andre Esteva, Alexandre Robicquet, Bharath Ramsundar, Volodymyr Kuleshov, Mark DePristo, Katherine Chou, Claire Cui, Greg Corrado, Sebastian Thrun, and Jeff Dean. A guide to deep learning in healthcare. Nature medicine, 25(1):24–29, 2019.
|
| 264 |
+
|
| 265 |
+
Kevin Eykholt, Ivan Evtimov, Earlence Fernandes, Bo Li, Amir Rahmati, Chaowei Xiao, Atul Prakash, Tadayoshi Kohno, and Dawn Song. Robust physical-world attacks on deep learning visual classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1625–1634, 2018.
|
| 266 |
+
|
| 267 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 268 |
+
|
| 269 |
+
Kaiming He, X Zhang, S Ren, and J Sun. Deep residual learning for image recognition." computer vision and pattern recognition (2015). Google Scholar There is no corresponding record for this reference, pp. 770–778, 2015.
|
| 270 |
+
|
| 271 |
+
Jan Hendrik Metzen, Mummadi Chaithanya Kumar, Thomas Brox, and Volker Fischer. Universal adversarial perturbations against semantic image segmentation. In Proceedings of the IEEE international conference on computer vision, pp. 2755–2764, 2017.
|
| 272 |
+
|
| 273 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 274 |
+
|
| 275 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. Advances in neural information processing systems, 28:2017–2025, 2015.
|
| 276 |
+
|
| 277 |
+
Oguzhan Fatih Kar, Teresa Yeo, Andrei Atanov, and Amir Zamir. 3d common corruptions and data ˘ augmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 18963–18974, 2022.
|
| 278 |
+
|
| 279 |
+
Valentin Khrulkov and Ivan Oseledets. Art of singular vectors and universal adversarial perturbations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8562– 8570, 2018.
|
| 280 |
+
|
| 281 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images, 2009.
|
| 282 |
+
|
| 283 |
+
Juncheng Li, Shuhui Qu, Xinjian Li, Joseph Szurley, J. Zico Kolter, and Florian Metze. Adversarial music: Real world audio adversary against wake-word detection system. In Proc. Neural Information Processing Systems (NeurIPS), pp. 11908–11918, 2019a.
|
| 284 |
+
|
| 285 |
+
Juncheng Li, Frank R. Schmidt, and J. Zico Kolter. Adversarial camera stickers: A physical camerabased attack on deep learning systems. In Proc. International Conference on Machine Learning, ICML, volume 97, pp. 3896–3904, 2019b.
|
| 286 |
+
|
| 287 |
+
Yingwei Li, Song Bai, Cihang Xie, Zhenyu Liao, Xiaohui Shen, and Alan Yuille. Regional homogeneity: Towards learning transferable universal adversarial perturbations against defenses. In European Conference on Computer Vision, pp. 795–813. Springer, 2020.
|
| 288 |
+
|
| 289 |
+
Bo Luo, Yannan Liu, Lingxiao Wei, and Qiang Xu. Towards imperceptible and robust adversarial example attacks against neural networks. In Thirty-second aaai conference on artificial intelligence, 2018.
|
| 290 |
+
|
| 291 |
+
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.
|
| 292 |
+
|
| 293 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2574–2582, 2016.
|
| 294 |
+
|
| 295 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1765–1773, 2017.
|
| 296 |
+
|
| 297 |
+
Konda Reddy Mopuri, Aditya Ganeshan, and R Venkatesh Babu. Generalizable data-free objective for crafting universal adversarial perturbations. IEEE transactions on pattern analysis and machine intelligence, 41(10):2452–2465, 2018.
|
| 298 |
+
|
| 299 |
+
Ali Shafahi, Mahyar Najibi, Zheng Xu, John Dickerson, Larry S Davis, and Tom Goldstein. Universal adversarial training. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 5636–5643, 2020.
|
| 300 |
+
|
| 301 |
+
Mahmood Sharif, Sruti Bhagavatula, Lujo Bauer, and Michael K Reiter. Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition. In Proceedings of the 2016 acm sigsac conference on computer and communications security, pp. 1528–1540, 2016.
|
| 302 |
+
|
| 303 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 304 |
+
|
| 305 |
+
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.
|
| 306 |
+
|
| 307 |
+
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, pp. 2818–2826, 2016.
|
| 308 |
+
|
| 309 |
+
Florian Tramèr, Nicholas Carlini, Wieland Brendel, and Aleksander Madry. On adaptive attacks to adversarial example defenses. CoRR, abs/2002.08347, 2020.
|
| 310 |
+
|
| 311 |
+
Shiqi Wang, Yizheng Chen, Ahmed Abdou, and Suman Jana. Enhancing gradient-based attacks with symbolic intervals, 2019.
|
| 312 |
+
|
| 313 |
+
Chaowei Xiao, Bo Li, Jun yan Zhu, Warren He, Mingyan Liu, and Dawn Song. Generating adversarial examples with adversarial networks. In Proc. International Joint Conference on Artificial Intelligence (IJCAI-18), pp. 3905–3911, 2018a.
|
| 314 |
+
|
| 315 |
+
Chaowei Xiao, Jun-Yan Zhu, Bo Li, Warren He, Mingyan Liu, and Dawn Song. Spatially transformed adversarial examples. arXiv preprint arXiv:1801.02612, 2018b.
|
| 316 |
+
|
| 317 |
+
Chaoning Zhang, Philipp Benz, Tooba Imtiaz, and In So Kweon. Understanding adversarial examples from the mutual influence of images and perturbations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14521–14530, 2020a.
|
| 318 |
+
|
| 319 |
+
Chaoning Zhang, Philipp Benz, Tooba Imtiaz, and In-So Kweon. Cd-uap: Class discriminative universal adversarial perturbation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 6754–6761, 2020b.
|
| 320 |
+
|
| 321 |
+
Tianhang Zheng, Changyou Chen, and Kui Ren. Distributionally adversarial attack. Proc. AAAI Conference on Artificial Intelligence, 33:2253–2260, 07 2019.
|
| 322 |
+
|
| 323 |
+
# APPENDIX
|
| 324 |
+
|
| 325 |
+
# A SEMANTIC TRANSFORMATIONS
|
| 326 |
+
|
| 327 |
+
In this section, we discuss the semantic transformations used in the paper. Brightness and contrast can be represented via bias $( \beta )$ and gain $( \alpha > 0 )$ ) parameters respectively. Formally, if $\mathbf { x }$ is the original image, then the transformed image, $\mathbf { x } ^ { \prime }$ , can be represented as
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\mathbf { x } ^ { \prime } = \alpha \mathbf { x } + \beta
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
Rotation, scaling, shearing, and translation are all affine transformations acting on the coordinate system, $c$ , of the images instead of the pixel values, $\mathbf { x }$ . In order to recover the pixel values and differentiate over the transformation, we will need sub-differentiable interpolation, see Appendix B. For finite dimensions, affine transformations can be represented as a linear coordinate map where the original coordinates are multiplied by an invertible augmented matrix and then translated with additional bias vector. Below, we give the general form for an affine transformation given augmented matrix A, bias matrix $\mathbf { b }$ , and input coordinates $c$ . We can compute the output coordinates, $c ^ { \prime }$ , as
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
{ \left[ \begin{array} { l } { \mathbf { c } ^ { \prime } } \\ { 1 } \end{array} \right] } = { \left[ \begin{array} { l l l l } { [ c c c | c ] } & { \mathbf { A } } & & { \mathbf { b } } \\ { 0 } & { \ldots } & { 0 } & { 1 } \end{array} \right] } { \left[ \begin{array} { l } { \mathbf { c } } \\ { 1 } \end{array} \right] }
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
Below, we give the augmented matrix A and additional bias matrix $\mathbf { b }$ for rotation, scaling, shearing, and translation.
|
| 340 |
+
|
| 341 |
+
Rotation, $R ( \theta )$ , by $\theta$ degrees:
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\mathbf { A } = { \binom { \cos { \theta } } { \sin { \theta } } } \quad { \cos { \theta } } ^ { \prime } \mathbf { , b } = { \binom { 0 } { 0 } }
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
Scaling, $S c ( p )$ , by $p \%$ :
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\mathbf { A } = \left( { \begin{array} { c c } { 1 + { \frac { p } { 1 0 0 } } } & { 0 } \\ { 0 } & { 1 + { \frac { p } { 1 0 0 } } } \end{array} } \right) , \mathbf { b } = \left( { \begin{array} { c } { 0 } \\ { 0 } \end{array} } \right)
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
Shearing, $S h ( m )$ , by shear factor $m \%$ :
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\mathbf { A } = { \binom { 1 } { 0 } } \quad { \overset { 1 + { \frac { m } { 1 0 0 } } } { 1 } } ) , \mathbf { b } = { \binom { 0 } { 0 } }
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
Translation, $T ( x , y )$ , by $x$ pixels horizontally and $y$ pixels vertically:
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\mathbf { A } = { \binom { 0 } { 0 } } \ { \begin{array} { l } { 0 } \\ { 0 } \end{array} } ) , \mathbf { b } = { \binom { x } { y } }
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
# B INTERPOLATION
|
| 366 |
+
|
| 367 |
+
Affine transformations may change a pixel’s integer coordinates into non-integer coordinates. Interpolation is typically used to ensure that the resulting image can be represented on a lattice (integer) pixel grid. For this paper, we will be using bilinear interpolation, a common interpolation method which achieves a good trade-off between accuracy and efficiency in practice and is commonly used in literature (Xiao et al., 2018b; Balunovic et al., 2019). Let ´ $x _ { i , j }$ , $x _ { i , j } ^ { \prime }$ represent the pixel value position -coordina $i , j$ fond the original and transform-coordinate of the pixel at image respectively. Let after transformation. We $c _ { i , j } ^ { \prime x } , c _ { i , j } ^ { \prime y }$ represent ther transformed $x$ $y$ $i , j$
|
| 368 |
+
image by summing over all pixels $n , m \in [ 1 \dots H ] \times [ 1 \dots W ]$ where $H$ and $W$ represent the height and width of the image.
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
x _ { i , j } ^ { \prime } = \sum _ { n } ^ { H } \sum _ { m } ^ { W } x _ { n , m } \operatorname* { m a x } ( 0 , 1 - | c _ { i , j } ^ { \prime x } - m | ) \operatorname* { m a x } ( 0 , 1 - | c _ { i , j } ^ { \prime y } - n | )
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
This interpolation can be computed for each channel in the image. While interpolation is typically not differentiable, in order to generate adversarial examples using standard techniques we need a differentiable version of interpolation. (Jaderberg et al., 2015) introduces differentiable image sampling. Their method works for any interpolation method as long as the (sub-)gradients can be defined with respect to $x , c ^ { \prime } { } _ { i , j }$ . For bilinear interpolation this becomes,
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
\frac { \partial x _ { i , j } ^ { \prime } } { \partial x _ { n , m } } = \sum _ { n } ^ { H } \sum _ { m } ^ { W } \operatorname* { m a x } ( 0 , 1 - | c ^ { \prime } _ { i , j } - m | ) \operatorname* { m a x } ( 0 , 1 - | c ^ { \prime } _ { i , j } - n | )
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\frac { \partial x _ { i , j } ^ { \prime } } { \partial c _ { i , j } ^ { \prime \boldsymbol { x } } } = \sum _ { n } ^ { H } \sum _ { m } ^ { W } x _ { n , m } \operatorname* { m a x } ( 0 , 1 - | c _ { i , j } ^ { \prime \boldsymbol { y } } - n | ) \left\{ \begin{array} { l l } { 1 } & { \mathrm { i f ~ } m \ge | c _ { i , j } ^ { \prime \boldsymbol { x } } - m | } \\ { - 1 } & { \mathrm { i f ~ } m < | c _ { i , j } ^ { \prime \boldsymbol { x } } - m | } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
# C SGD ALGORITHM
|
| 385 |
+
|
| 386 |
+
Our SGD UAP algorithm is based on standard momentum based SGD while optimizing over the objective proposed in 5, the algorithm details can be seen in Algorithm 3.
|
| 387 |
+
|
| 388 |
+
# Algorithm 3 Stochastic Gradient Descent UAP Algorithm
|
| 389 |
+
|
| 390 |
+
1: Initialize $\mathbf { u _ { r } } \gets 0 , \Delta \mathbf { u _ { r } } \gets 0$
|
| 391 |
+
2: repeat
|
| 392 |
+
3: for $\mathbf { B } \in \mathbf { X }$ do
|
| 393 |
+
4: 5: $\begin{array} { r } { \Delta \mathbf { u } _ { \mathbf { r } } \gets \alpha \Delta \mathbf { u } _ { \mathbf { r } } - \frac { \nu } { | \hat { \mathbf { x } } | \times | \hat { t } | } \sum _ { i = 1 } ^ { | \hat { \mathbf { x } } | } \sum _ { j = 1 } ^ { | \hat { t } | } \nabla L \big [ f \big ( \hat { \mathbf { x } } _ { \mathbf { i } } + \hat { t } _ { j } ( \mathbf { u } _ { \mathbf { r } } ) \big ) , f \big ( \hat { \mathbf { x } } _ { \mathbf { i } } \big ) \big ] } \end{array}$ $\hat { t } \subset T$
|
| 394 |
+
6: Update the perturbation with projection:
|
| 395 |
+
7: $\mathbf { u } \gets \mathcal { P } _ { p , \epsilon } ( \mathbf { u _ { r } } + \Delta \mathbf { u _ { r } } )$
|
| 396 |
+
8: end for
|
| 397 |
+
9: until $A S R _ { R } ( f , \mathbf { X } , T , \gamma , \mathbf { u _ { r } } ) < \zeta$
|
| 398 |
+
|
| 399 |
+
# D ITERATIVE UAP ALGORITHM
|
| 400 |
+
|
| 401 |
+
Moosavi-Dezfooli et al. (2017) introduces an iterative UAP algorithm, the algorithm can be seen in Algorithm 4.
|
| 402 |
+
|
| 403 |
+
1: Initialize $\mathbf u \gets 0$
|
| 404 |
+
2: repeat
|
| 405 |
+
3: for $\mathbf { x _ { i } } \in \mathbf { X }$ do
|
| 406 |
+
4: if ${ \bar { \hat { f } } } ( \mathbf { x _ { i } } + \mathbf { u } ) = { \hat { f } } ( \mathbf { x _ { i } } )$ then
|
| 407 |
+
5: Compute minimal adversarial perturbation:
|
| 408 |
+
6: $\Delta \mathbf { u } \arg \operatorname* { m i n } _ { \mathbf { r } } | | \mathbf { r } | | _ { 2 }$ s.t. $\hat { f } ( \mathbf { x _ { i } } + \mathbf { u } + \mathbf { r } ) \neq \hat { f } ( \mathbf { x _ { i } } )$
|
| 409 |
+
7: Update the perturbation with projection:
|
| 410 |
+
8: $\mathbf { u } \bar { \mathbf { \Omega } } \ll \mathcal { P } _ { p , \epsilon } ( \bar { \mathbf { u } } + \Delta \mathbf { u } )$
|
| 411 |
+
9: end if
|
| 412 |
+
10: end for
|
| 413 |
+
11: until $A S R _ { U } ( f , { \bf X } , { \bf u } ) < \gamma$
|
| 414 |
+
|
| 415 |
+
# E EXPERIMENT PARAMETERS
|
| 416 |
+
|
| 417 |
+
In our experiments, we have capped all algorithms at 5 epochs or if they have achieved an $\mathrm { A S R } _ { R }$ of 0.95. The UAPs are trained with the same transformation set that they are evaluated on. For algorithms running PGD internally, we have capped the number of iterations to 40.
|
| 418 |
+
|
| 419 |
+
# F FURTHER EVALUATION OF UNIFORM NOISE
|
| 420 |
+
|
| 421 |
+
Results in Table 2.
|
| 422 |
+
Table 2: Robust ASR with uniform random noise, $\gamma = 0 . 8$ .
|
| 423 |
+
|
| 424 |
+
<table><tr><td>DATASET</td><td>TRANSFORMATION SET</td><td>STANDARD UAP</td><td>SGD</td><td>STANDARD UAP_RP</td><td>ROBUST UAP</td></tr><tr><td>ILSVRC</td><td>U(0.1)</td><td>81.6%</td><td>94.2%</td><td>91.3%</td><td>99.0%</td></tr><tr><td>2012</td><td>U(0.3)</td><td>10.7%</td><td>68.9%</td><td>42.7%</td><td>96.1%</td></tr><tr><td>CIFAR-10</td><td>U(0.1)</td><td>66.0%</td><td>98.1%</td><td>96.1%</td><td>100%</td></tr><tr><td></td><td>U(0.3)</td><td>5.8%</td><td>96.1%</td><td>47.6%</td><td>100%</td></tr></table>
|
| 425 |
+
|
| 426 |
+
# G UAP PERFORMANCE AGAINST SEMANTIC TRANSFORMATIONS ON CIFAR-10
|
| 427 |
+
|
| 428 |
+

|
| 429 |
+
Figure 6: For each method, a point $( x , y )$ in the corresponding line represents the percentage of sampled UAPs $( y \% )$ with Universal ASR $> x$ for the different semantic transformations on CIFAR10.
|
| 430 |
+
|
| 431 |
+
# H AVERAGE $\mathrm { A S R } _ { U }$ AND $\operatorname { A S R } _ { R }$ WITH DIFFERENT $\gamma$ ’ S
|
| 432 |
+
|
| 433 |
+
We provide additional metrics computed on the same set of transformations, datasets, and models as in Table 1. In Table 3, we present the Average $\operatorname { A S R } _ { U }$ rather than $\mathrm { A S R } _ { R }$ . The average shows us that our RobustUAP algorithm creates UAPs which after transformation on average are better UAPs than all other algorithms. We observe that the average shows us that even standard UAPs aren’t completely ineffective after transformation they just have a very low chance of being highly effective.
|
| 434 |
+
|
| 435 |
+
<table><tr><td>DATASET</td><td>TRANSFORMATION SET</td><td>STANDARD UAP</td><td>SGD</td><td>STANDARD UAP_RP</td><td>ROBUST UAP</td></tr><tr><td rowspan="4">ILSVRC 2012</td><td>R(20)</td><td>16.3%</td><td>71.5%</td><td>24.7%</td><td>81.3%</td></tr><tr><td>T(2,2)</td><td>52.6%</td><td>82.6%</td><td>55.4%</td><td>85.4%</td></tr><tr><td>Sc(5),R(5),B(5,0.01)</td><td>44.9%</td><td>76.3%</td><td>58.5%</td><td>82.2%</td></tr><tr><td>R(10),T(2,2),Sh(2),Sc(2),B(2,0.001)</td><td>13.6%</td><td>64.8%</td><td>29.0%</td><td>75.3%</td></tr><tr><td rowspan="3">CIFAR-10</td><td>R(30),B(2,0.001)</td><td>9.9%</td><td>66.8%</td><td>22.2%</td><td>73.4%</td></tr><tr><td>R(2),Sh(2)</td><td>57.1%</td><td>78.8%</td><td>61.2%</td><td>82.9%</td></tr><tr><td>R(10),T(2,2),Sh(2),Sc(2),B(2,0.001)</td><td>16.2%</td><td>61.2%</td><td>32.6%</td><td>76.4%</td></tr></table>
|
| 436 |
+
|
| 437 |
+
Table 3: Average Universal ASR of our Robust UAP algorithms and the standard UAP (MoosaviDezfooli et al., 2017) method.
|
| 438 |
+
|
| 439 |
+
In Table 4, we present $\operatorname { A S R } _ { R }$ computed at $\gamma = [ 0 . 5 , 0 . 7 ]$ rather than $\gamma = 0 . 6$ . This table shows a similar story to above, and shows that our algorithm produces better results under a variety of success thresholds.
|
| 440 |
+
|
| 441 |
+
<table><tr><td rowspan="3">DATASET</td><td rowspan="3">TRANSFORMATION SET</td><td colspan="2">STANDARD UAP</td><td colspan="2">SGD</td><td colspan="2">STANDARD</td><td colspan="2"></td><td rowspan="3">ROBUST UAP</td></tr><tr><td colspan="2">0.5</td><td colspan="2">0.5</td><td colspan="2">UAP_RP 0.5</td><td colspan="2"></td></tr><tr><td></td><td>0.7</td><td></td><td></td><td>0.7</td><td></td><td>0.7</td><td>0.5</td></tr><tr><td rowspan="4">ILSVRC 2012</td><td>R(20)</td><td>1.9%</td><td>0.0%</td><td></td><td>88.3%</td><td>58.3%</td><td>10.7%</td><td>1.0%</td><td></td><td>98.1% 76.7%</td></tr><tr><td>T(2,2)</td><td>51.5% 21.4% 100% 84.5% 57.3% 2</td><td></td><td></td><td></td><td></td><td></td><td>23.3%</td><td></td><td>100% 91.3%</td></tr><tr><td>Sc(5),R(5),B(5,0.01)</td><td>38.8%11.7%</td><td></td><td></td><td>96.1% 67.0%64.1%25.2%</td><td></td><td></td><td></td><td></td><td>99.0%87.4%</td></tr><tr><td>R(10),T(2,2), Sh(2), Sc(2),B(2,0.001)</td><td>1.9%</td><td>0.0%</td><td></td><td>82.5% 38.8%12.6%</td><td></td><td></td><td>1.0%</td><td>95.1%</td><td>59.2%</td></tr><tr><td rowspan="3">CIFAR-10 R(2), Sh(2)</td><td>R(30),B(2,0.001)</td><td>1.0%</td><td>0.0%</td><td></td><td>80.6% 43.7% 12.6%</td><td></td><td></td><td>1.0%</td><td>93.2%</td><td>49.5%</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>62.1% 22.3% 96.1% 68.9% 68.0% 30.1% 99.0% 89.3%</td></tr><tr><td>R(10),T(2,2),Sh(2),Sc(2),B(2,0.001)</td><td>2.9%</td><td></td><td></td><td>0.0% 67.0% 38.8% 19.4%</td><td></td><td></td><td>1.0%</td><td></td><td>93.2% 55.3%</td></tr></table>
|
| 442 |
+
|
| 443 |
+
Table 4: Robust ASR of our Robust UAP algorithms and the standard UAP (Moosavi-Dezfooli et al., 2017) method with $\gamma = [ 0 . 5 , 0 . 7 ]$ .
|
| 444 |
+
Table 5: Universal ASR of our Robust UAP algorithms and the standard UAP method.
|
| 445 |
+
|
| 446 |
+
<table><tr><td>DATASET</td><td>STANDARDUAP</td><td>SGD</td><td>STANDARDUAP_RP</td><td>ROBUS TUAP</td></tr><tr><td>ILSVRC 2012</td><td>95.5%</td><td>85.6%</td><td>82.3%</td><td>91.3%</td></tr><tr><td>CIFAR-10</td><td>96.2%</td><td>89.3%</td><td>84.0%</td><td>93.7%</td></tr></table>
|
| 447 |
+
|
| 448 |
+
# I COMPARISON ON NON-ROBUST UNIVERSAL ASR METRIC
|
| 449 |
+
|
| 450 |
+
We compare our robust UAPs to standard UAPs on the non-robust universal ASR metric, see Table 5. All robust UAPs are generated to be robust against $R ( 1 0 ) , T ( 2 , 2 ) , S h ( 2 ) , S c ( 2 ) , B ( 2 , 0 . 0 0 1 )$ . We observe that at the same $l _ { 2 }$ -norm all robust UAPs achieve a lower universal ASR than the standard UAP algorithm. This result is not too surprising as solving the optimization problem for robust UAP is significantly more difficult. We further observe that our RobustUAP algorithm is the most effective in comparison to the other robust baseline approaches.
|
| 451 |
+
|
| 452 |
+
# J ADDITIONAL MODELS
|
| 453 |
+
|
| 454 |
+
We also provide additional data on our methods evaluated on the same transformations and datasets but on different models. In this case, we use ResNet-18 (He et al., 2015) for CIFAR-10 and MobileNet (Howard et al., 2017) for ILSVRC 2012. Results can be seen in Table 6. We observe similar performance across models suggesting that the performance of the attacks is more directly tied to transformation set and dataset.
|
| 455 |
+
|
| 456 |
+
Table 6: Robust ASR on Resnet-18 for CIFAR-10 and MobileNet for ILSVRC 2012.
|
| 457 |
+
|
| 458 |
+
<table><tr><td>DATASET</td><td>MODEL</td><td>TRANSFORMATION SET</td><td>STANDARD UAP</td><td>SGD</td><td>STANDARD ROBUST UAP_RP</td><td>UAP</td></tr><tr><td rowspan="4">ILSVRC 2012</td><td rowspan="4">MOBILENET</td><td>R(20)</td><td>8.1%</td><td>71.2%</td><td>2.6%</td><td>85.0%</td></tr><tr><td>T(2,2)</td><td>40.9%</td><td>98.7%</td><td>54.3%</td><td>99.6%</td></tr><tr><td>Sc(5), R(5),B(5,0.01)</td><td>16.3%</td><td>94.5%</td><td>44.3%</td><td>96.3%</td></tr><tr><td>R(10),T(2,2), Sh(2),Sc(2),B(2,0.001)</td><td>4.1%</td><td>75.7%</td><td>8.6%</td><td>86.2%</td></tr><tr><td rowspan="3">CIFAR-10 RESNET-18</td><td rowspan="3"></td><td>R(30),B(2,0.001)</td><td>0.9%</td><td>67.8%</td><td>6.4%</td><td>74.9%</td></tr><tr><td>R(2),Sh(2)</td><td>49.9%</td><td>99.5%</td><td>49.1%</td><td>99.8%</td></tr><tr><td>R(10),T(2,2),Sh(2),Sc(2),B(2,0.001)</td><td>8.0%</td><td>70.8%</td><td>12.2%</td><td>83.8%</td></tr></table>
|
| 459 |
+
|
| 460 |
+
# K COMMON CORRUPTIONS
|
| 461 |
+
|
| 462 |
+
We also evaluate robust UAP against the 2D fog transformations in (Kar et al., 2022). We set the shift intensity of the fog to be 1 and train our robust UAPs to be robust against random fog perturbations. We observe similar results to the transformations we experiment with above. The graph of the results can be seen in Figure 7.
|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
Figure 7: For each method, a point $( x , y )$ in the corresponding line represents the percentage of sampled UAPs $( y \% )$ with Universal ASR $> x$ for the different semantic transformations on ILSVRC2012.
|
| 466 |
+
|
| 467 |
+
# L ALGORITHM RUNTIMES
|
| 468 |
+
|
| 469 |
+
We compare the average runtimes of the different methods on one of our most challenging $R ( 1 0 ) , \bar { T ( 2 , 2 ) } , S h ( 2 ) , \bar { S c } ( 2 ) , B ( 2 , 0 . 0 0 1 )$ transformation set on ILSVRC-2012 and $n = 7 3 8$ . The results are in Table 7. We observe that RobustUAP is the slowest algorithm and SGD is the fastest. RobustUAP uses EstimateRobustness in each loop and thus with high $n$ it requires much more time to compute. The extra computation enables Robust UAP to obtain better robustness than all baselines. On the same set of transformations and dataset we observe that one iteration of EstimateRobustness on the entire test set takes on average 19 minutes. When running EstimateRobustness in the RobustUAP loop, each call takes 36 seconds for a batch size of 32.
|
| 470 |
+
|
| 471 |
+
Table 7: Average Runtime for Robust UAP algorithms
|
| 472 |
+
|
| 473 |
+
<table><tr><td>ALGORITHM</td><td>TIME(MIN)</td></tr><tr><td>STANDARD UAP</td><td>37</td></tr><tr><td>SGD</td><td>32</td></tr><tr><td>STANDARD UAP_RP</td><td>43</td></tr><tr><td>ROBUST UAP</td><td>118</td></tr></table>
|
| 474 |
+
|
| 475 |
+
# M EFFECT OF COMPUTE TIME ON ROBUSTNESS
|
| 476 |
+
|
| 477 |
+
Previous sections highlight SGD as the most competitive algorithm to RobustUAP in terms of performance. However, in the previous section we note that SGD takes significantly less time to run. In this section, we investigate how RobustUAP performs with limited compute time as well as how SGD performs with increased runtime. We first add results to the ILSVRC 2012 part of Table 1 by also computing RobustUAP performance when limited to the same amount of time that SGD takes. Table 8 shows that RobustUAP outperforms SGD even when its compute time is limited with up to $9 \%$ more robustness on our most challenging transformation $R ( 1 0 ) , \bar { T } ( 2 , 2 ) , S h ( 2 ) , S c ( 2 ) , B ( \bar { 2 , } 0 . 0 0 1 ) .$ .
|
| 478 |
+
|
| 479 |
+
<table><tr><td>DATASET</td><td>TRANSFORMATION SET</td><td>SGD</td><td>ROBUST UAP</td><td>RESTRICTED ROBUST UAP</td></tr><tr><td rowspan="4">ILSVRC 2012</td><td>R(20)</td><td>69.9%</td><td>93.2%</td><td>72.9%</td></tr><tr><td>T(2,2)</td><td>96.1%</td><td>97.1%</td><td>96.9%</td></tr><tr><td>Sc(5),R(5),B(5,0.01)</td><td>85.4%</td><td>96.1%</td><td>86.3%</td></tr><tr><td>R(10),T(2,2),Sh(2),Sc(2),B(2,0.001)</td><td>63.1%</td><td>86.4%</td><td>72.0%</td></tr></table>
|
| 480 |
+
|
| 481 |
+
Table 8: Robust ASR of RobustUAP restricted to the same amount of compute time as SGD.
|
| 482 |
+
|
| 483 |
+
Next, we vary the number of SGD iterations. We compute the robust ASR on ILSVRC for robustness against $R ( 1 0 ) , T ( 2 , 2 ) , S h ( 2 ) , S c ( 2 ) , B ( 2 , 0 . 0 0 1 )$ . Figure 8, shows the robust ASR achieved by SGD over time, here we observe that SGD’s performance flatlines after a small number of iterations and seems to be unable to surpass about 65. Here SGD is allowed to continue to run past where it would usually stop (at around 250 iterations), in this experiment we allow it to go to 1250 iterations which is about the same amount of time that RobustUAP takes to run. RobustUAP is able to achieve a performance of 72 even when restricted to the amount of compute time of base SGD (It achieves 86.4 when unrestricted). These two results in combination show that RobustUAP is able to find more robust UAPs than SGD whose performance stabilizes.
|
| 484 |
+
|
| 485 |
+

|
| 486 |
+
Figure 8: The Robust ASR with $\gamma = 0 . 6$ for SGD over time
|
| 487 |
+
|
| 488 |
+
# N ROBUSTNESS ON HOLD-OUT TRANSFORMATIONS
|
| 489 |
+
|
| 490 |
+
In this section, we measure the effectiveness of our robust UAPs against hold-out transformations. In this experiment, we learn a UAP which is robust to $R ( 5 )$ and obtain a robust ASR of 96.2 at $\gamma = 0 . 6$ . We then measure its effectiveness against $S c ( 5 )$ and get a robust ASR of 85.4, in contrast, a robust UAP trained directly to be robust to $S c ( 5 )$ obtains robust ASR of 98.1. Next, we measure the robustness of UAP trained against $R ( 5 )$ when subjected to transformations from $B ( 5 , 0 . 0 1 )$ . Here we get a robust ASR of 97.3, whereas a robust UAP trained to be robust to $B ( 5 , 0 . 0 1 )$ obtains a robust ASR of 99.2. Finally, we test the robust UAP on $R ( 5 ) , S c ( 5 ) , B ( 5 , 0 . 0 1 )$ and get a robust ASR of 83.1. Our previous results show that a UAP trained to be robust against these parameters directly can obtain a robust ASR of 96.1. In each case, our UAP maintains robustness on hold-out transformations but has lower performance compared to robust UAPs trained directly to be robust to those transformations.
|
| 491 |
+
|
| 492 |
+
# O TARGETED ATTACK
|
| 493 |
+
|
| 494 |
+
So far in this paper we have focused on untargeted attacks, i.e. attacks which aim to degrade the general performance of the model. Targeted attacks are also possible with both standard adversarial attack methods and universal adversarial perturbation methods. Here, we can simply turn our algorithm from untargeted to targeted by replacing the loss function. We would like to have target class, A, be classified as target class, B. Instead of maximizing the expected value of the cross entropy loss we can instead formulate the loss based on maximizing B while minimizing A similar to (Benz et al., 2020). For ILSVRC 2012, we randomly select a couple of target classes and perform this attack, for each of these cases, we train our robust UAP to be robust to $R ( 1 0 ) , T ( 2 , 2 ) , S h ( 2 ) , S c ( 2 ) , B ( 2 , 0 . 0 0 1 )$ . Table 9 shows our results for robust ASR with $\gamma = 0 . 6$ . We are measuring our robust ASR of turning class A into class B and observe similar results with RobustUAP being the most robust followed by SGD. It is also interesting to note that different random combinations lead to more or less success, i.e. it is easier to turn a dog into another dog than perfume into a padlock.
|
| 495 |
+
|
| 496 |
+
Table 9: Robust ASR of RobustUAP for target to target attack compared to the three baselines with $\gamma = 0 . 6$ .
|
| 497 |
+
|
| 498 |
+
<table><tr><td>DATASET</td><td>TARGET CLASS</td><td>STANDARD UAP</td><td>SGD</td><td>STANDARD UAP_RP</td><td>ROBUST UAP</td></tr><tr><td>ILSVRC-2012</td><td>TOY POODLE →→MALTESE DOG PERFUME-→PADLOCK</td><td>42.4% 0.0%</td><td>99.1% 63.8%</td><td>85.6% 5.1%</td><td>99.8% 76.4%</td></tr></table>
|
| 499 |
+
|
| 500 |
+
# P DATA EFFICIENCY
|
| 501 |
+
|
| 502 |
+
In this section, we will evaluate the data efficiency of RobustUAP. We use RobustUAP to generate UAPs robust to $R ( 1 0 ) , T ( 2 , 2 ) , S h ( 2 ) , S c ( 2 ) , B ( 2 , 0 . 0 0 1 )$ on ILSVRC-2012 with differing amounts of training data. The results can be seen in Figure 9. These results show that the algorithm is able to achieve good performance at 500 data points but continues to improve up to 4000 data points. After that it seems to stagnate.
|
| 503 |
+
|
| 504 |
+

|
| 505 |
+
Figure 9: Robust ASR with $\gamma = 0 . 6$ for RobustUAP with differing amounts of training data
|
| 506 |
+
|
| 507 |
+
# Q TRANSFERABILITY
|
| 508 |
+
|
| 509 |
+
In this section, we will evaluate the transferability of RobustUAP. Previous works on UAPs (Moosavi-Dezfooli et al., 2017) show that UAPs are transferable across different models. Here, we will evaluate whether robust UAPs exhibit the same behavior for robustness. The robust UAPs studied here are generated with RobustUAP on $R ( 1 0 ) , T ( 2 , 2 ) , S h ( 2 ) , S c ( 2 ) , B ( 2 , 0 . 0 0 1 )$ for ILSVRC-2012 with $\gamma = 0 . 6$ . We use a variety of models: Inception-v3 (Szegedy et al., 2016), MobileNet (Howard et al., 2017), Inception-v3 trained to be robust on $R ( 2 0 )$ (InceptionR20), Inceptionv3 trained to be robust on horizontal flips (InceptionHF), and ViT (Dosovitskiy et al., 2020). Table 10 shows us that our robust UAPs are transferable between different architectures. Our results show that robust UAPs transfer their robustness properties between architectures and models. Ignoring ViT, on all of the Inception and MobileNet models, the generated UAPs maintain at least $65 \%$ robust ASR when transferred to each other. This transfer is less but still significant for ViT where it maintains at least $32 \%$ robustness when transferred to or from the other models.
|
| 510 |
+
|
| 511 |
+
Table 10: Robust ASR when UAP is learned on source model and transfered to target model.
|
| 512 |
+
|
| 513 |
+
<table><tr><td></td><td colspan="5">TARGET MODEL</td></tr><tr><td>SOURCE MODEL</td><td>INCEPTION</td><td>MOBILENET</td><td>INCEPTIONR20</td><td>INCEPTIONHF</td><td>VIT</td></tr><tr><td>INCEPTION</td><td>86.4%</td><td>65.2%</td><td>75.2%</td><td>78.5%</td><td>35.1%</td></tr><tr><td>MOBILENET</td><td>74.3%</td><td>86.2%</td><td>67.3%</td><td>68.6%</td><td>38.3%</td></tr><tr><td>INCEPTIONR20</td><td>80.1%</td><td>67.3%</td><td>81.3%</td><td>73.1%</td><td>32.0%</td></tr><tr><td>INCEPTIONHF</td><td>77.8%</td><td>70.9%</td><td>75.8%</td><td>83.8%</td><td>34.6%</td></tr><tr><td>VIT</td><td>41.2%</td><td>32.4%</td><td>43.2%</td><td>39.7%</td><td>88.5%</td></tr></table>
|
| 514 |
+
|
| 515 |
+
# R TRANSFORMER-BASED MODELS
|
| 516 |
+
|
| 517 |
+
Recently, transformers have become popular as a new architecture for deep learning models for computer vision tasks. In this section, we evaluate the effectiveness of robust UAPs against one such model, ViT (Dosovitskiy et al., 2020). Benz et al. (2021) has shown that standard UAPs are still effective against transformer based architectures. In Table 11 we can see that we get similar results compared to our results on Inception and MobileNet. This shows that our methods work against transformer based models as well.
|
| 518 |
+
|
| 519 |
+
<table><tr><td>DATASET</td><td>MODEL TRANSFORMATION SET</td><td></td><td>STANDARD UAP</td><td>SGD</td><td>STANDARD ROBUST UAP_RP</td><td>UAP</td></tr><tr><td>ILSVRC-2012 VIT</td><td></td><td>R(10),T(2,2),Sh(2),Sc(2),B(2,0.001)</td><td>2.0%</td><td>72.1%</td><td>12.9%</td><td>88.5%</td></tr></table>
|
| 520 |
+
|
| 521 |
+
Table 11: Robust ASR of RobustUAPcompared to the three baselines for ViT.
|
| 522 |
+
|
| 523 |
+
# S ROBUST UAPS AGAINST ROBUSTLY TRAINED NETWORKS
|
| 524 |
+
|
| 525 |
+
In this section, we are interested in seeing whether training networks to be robust against the same transformations that the UAP is trying to be robust against is helpful. For this, we trained two new Inception-v3 networks. Because of time limitations, we started with our base Inception-v3 network and fine-tuned it using data augmentations. For the first network InceptionR20, we augmented the data by adding random rotations within 20 degrees. For the second network InceptionHF, we augmented the data by adding horizontal flips. We then crafted UAPs robust against rotations and flips on InceptionR20 and InceptionHF respectively. The results can be seen in Table 12. We can compare the $R ( 2 0 )$ results to those from our normal inception network. We postulate that since the network has received some additional robustness training it is harder to attack, and thus we should see slightly lower robustness scores. However, it seems that training the network to be robust to $R ( 2 0 )$ does not significantly effect the ability to create robust UAPs. The horizontal flips seems like it might be too easy of a transformation as even standard UAP performs quite well for robust ASR.
|
| 526 |
+
|
| 527 |
+
<table><tr><td>DATASET</td><td>MODEL</td><td>TRANSFORMATION SET</td><td>STANDARD UAP</td><td>SGD</td><td>STANDARD UAP_RP</td><td>ROBUST UAP</td></tr><tr><td>ILSVRC-2012</td><td>INCEPTIONR20 INCEPTIONHF</td><td>R(20) HF</td><td>6.3% 81.3%</td><td>72.4% 99.5%</td><td>10.2% 89.7%</td><td>81.3% 99.6%</td></tr></table>
|
| 528 |
+
|
| 529 |
+
Table 12: Robust ASR of RobustUAP compared to the three baselines for robust networks.
|
| 530 |
+
|
| 531 |
+
# T ABLATION ON OPTIMIZATION STRATEGY
|
| 532 |
+
|
| 533 |
+
In this section, we study the effect of using different optimizers in addition to SGD. We use a variety of standard PyTorch optimizers, Adam, Adamax, Adagrad, and RMSProp. We formulate the optimization problem in the same way but instead use these algorithms in order to optimize our perturbation. We compute these results on ILSVRC-2012 with Inception-v3 and use $R ( 1 0 ) , T ( 2 , 2 ) , S h ( 2 ) , S c ( 2 ) , B ( 2 , 0 . 0 0 1 )$ as the transformation set and with $\gamma = 0 . 6$ . The results can be seen in Table 13. We see that the optimization strategy has some affect on the results and that SGD performs the best. We also found that SGD performed marginally faster than the rest of the approaches.
|
| 534 |
+
|
| 535 |
+
Table 13: Comparison of different optimization strategies.
|
| 536 |
+
|
| 537 |
+
<table><tr><td>OPTIMIZER|ASRR</td><td></td></tr><tr><td>SGD ADAM</td><td>63.1% 59.7%</td></tr><tr><td>ADAMAX ADAGRAD</td><td>60.1% 62.3%</td></tr><tr><td>RMSPROP</td><td>58.3%</td></tr></table>
|
md/dev/jQgsZDspz5h/jQgsZDspz5h.md
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contrastive and Non-Contrastive Self-Supervised Learning Recover Global and Local Spectral Embedding Methods
|
| 2 |
+
|
| 3 |
+
Randall Balestriero Meta AI Research, FAIR NYC, USA rbalestriero@meta.com
|
| 4 |
+
|
| 5 |
+
Yann LeCun Meta AI Research, FAIR, NYU NYC, USA ylecun@meta.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Self-Supervised Learning (SSL) surmises that inputs and pairwise positive relationships are enough to learn meaningful representations. Although SSL has recently reached a milestone: outperforming supervised methods in many modalities. . . the theoretical foundations are limited, method-specific, and fail to provide principled design guidelines to practitioners. In this paper, we propose a unifying framework under the helm of spectral manifold learning to address those limitations. Through the course of this study, we will rigorously demonstrate that VICReg, SimCLR, BarlowTwins et al. correspond to eponymous spectral methods such as Laplacian Eigenmaps, Multidimensional Scaling et al. This unification will then allow us to obtain (i) the closed-form optimal representation for each method, (ii) the closedform optimal network parameters in the linear regime for each method, (iii) the impact of the pairwise relations used during training on each of those quantities and on downstream classification task performances, and most importantly, (iv) the first theoretical bridge between contrastive and non-contrastive methods towards global and local spectral embedding methods respectively, hinting at the benefits and limitations of each. For example, (i) if the pairwise relation is aligned with the downstream task, any SSL method can be employed successfully and will recover the supervised method, but in the low data regime, SimCLR or VICReg with high invariance hyper-parameter should be preferred; (ii) if the pairwise relation is misaligned with the downstream task, BarlowTwins or VICReg with small invariance hyper-parameter should be preferred.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Self-Supervised Learning (SSL) is one of the most promising method to learn data representations that generalize across downstream tasks. SSL places itself in-between supervised and unsupervised learning as it does not require labels but does require knowledge of what makes some samples semantically close to others. Hence, where unsupervised learning relies on a collection of inputs $( X )$ , and supervised learning relies on inputs and outputs $( X , Y )$ , SSL relies on inputs and inter-sample relations $( X , G )$ that indicate semantic similarity. The latter matrix $G$ is often constructed by augmenting $\boldsymbol { X }$ through data-augmentations known to preserve input semantics [1–3] e.g. horizontal flip for an image, although recent methods have went away from Data-Augmentation (DA)by using videos from which consecutive frames can be seen as semantically equivalent [4–6].
|
| 14 |
+
|
| 15 |
+
Although SSL originated decades ago [7], recent advances have pushed SSL performances beyond expectations [8–10]. Due to those rapid empirical advances, an urgent need for a principled theoretical understanding of those methods has emerged [11, 12]. Studies in this direction often take one of the three following approaches: (i) studying the training dynamics and optimization landscapes of existing methods e.g. validating some empirically found tricks as necessary conditions for stable gradient dynamics [13–16], (ii) studying the role of each SSL component e.g. the projector and predictor networks [17–19], or (iii) developing novel SSL criteria that often combine multiple interpretable objectives that a SSL model must fulfill [20–25]. While those branches have led to novel understandings and even stem novel SSL methods, some fundamental questions remain open.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Summary of our unification of SSL methods to known local and global spectral embedding methods. In doing so, we are able to find the exact settings for which different methods provably become identical. In short, all are concerned in preserving the left-singular vectors of the similarity matrix $\pmb { G }$ (see Fig. 6) in the representation $z$ .
|
| 19 |
+
|
| 20 |
+
More recently, a few focused studies have started to provide theoretical works e.g. Tian [27] on contrastive losses with deep linear networks, HaoChen et al. [28, 29] on SimCLR [8], [30] on the projector of contrastive models, [14] on BYOL [31] and SimSIAM [8].Those studies paved our way forward as we propose in this paper a much broader analysis that applies to most (if not all) existing SSL methods allowing us for the first time to provide provable design guildelines to practitioners in their choice of architecture and methods. We do so by unifying most SSL methods as different flavors of spectral methods for embedding and clustering as summarized in Fig. 1. The instrumental results we obtain allow us to answer some long-standing questions both when employing a linear model and an infinite capacity one which we summarize as part of our contributions below:
|
| 21 |
+
|
| 22 |
+
1. Closed-form optimal representation for SSL losses. The Deep Network (DN)representation $z$ of inputs $\boldsymbol { X }$ learned by minimizing any SSL loss given a sample relation matrix $G$ is obtained in closed-form, shedding light to many spectral properties of those representations e.g. SSL only constrains the left singular vectors and singular values of $z$ to align with the ones of $G$ (Sections 3.1, 4.1 and 5.1 for VICReg, SimCLR and BarlowTwins).
|
| 23 |
+
2. Closed-form optimal network parameters for SSL losses with linear networks. The linear representation $\pmb { Z } = \pmb { X } \pmb { W } + \pmb { b }$ parameters obtained by minimizing any SSL loss given a sample relation matrix $G$ are obtained in closed-form, providing insights into the type of input statistics that a network parameters focuses on to produce the optimal input mapping (Sections 3.2 and 5.2 for VICReg and BarlowTwins).
|
| 24 |
+
3. Exact equivalence between SSL and spectral embedding methods. SSL methods employ diverse criterion that can be tied to eponymous spectral analysis methods both in embedding space and in data space, and with a nonlinear or a linear DN e.g. Laplacian Eigenmaps (VICReg, Section 3.2), ISOMAP (SimCLR/NNCLR, Section 4.3), Canonical Correlation Analysis (BarlowTwins, Section 5.2) and when employing a linear network as Locality Preserving Projection (VICReg), Cannonical Correlation Analysis (BarlowTwins), and Linear Discriminant Analysis for both VICReg and BarlowTwins (summarized in Fig. 1).
|
| 25 |
+
|
| 26 |
+
We also relegate to Appendix C a study quantifying the relationship between the optimal representation of each SSL method and the downstream classification task performances e.g. when the correct data relation matrix is given (Appendix C.3) as those results, although not crucial to our contributions, follow directly from the above ties between SSL and spectral embedding. We carefully prove each statement of this study in Appendix $F$ .
|
| 27 |
+
|
| 28 |
+
# 2 Notations and Background on Self-Supervised Learning
|
| 29 |
+
|
| 30 |
+
We provide in this section a brief reminder of the main Self-Supervised Learning (SSL) methods, their associated losses, and the common notations that we will rely on for the remaining of the study.
|
| 31 |
+
|
| 32 |
+
Dataset, Embedding and Relation Matrix Notations. Regardless of the loss and method employed, SSL relies on having access to a set of observations i.e. input samples $\pmb { X } \triangleq [ \pmb { x } _ { 1 } , \ldots , \pmb { x } _ { N } ] ^ { T } \in \mathbb { R } ^ { N \times D }$ and a known pairwise positive relation between those samples e.g. in the form of a symmetric matrix $G \in ( \mathbb { R } ^ { + } ) ^ { N \times N }$ where $( G ) _ { i , j } > 0$ iff samples $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ and $\boldsymbol { \mathscr { x } } _ { j }$ are known to be semantically related, and with 0 in the diagonal. Commonly, one is only given a dataset $X ^ { \prime }$ and artificially constructs $\boldsymbol { X }$ and $G$ from augmentations of $X ^ { \prime }$ e.g. rotated, noisy versions of the original samples and turning the corresponding entries of $G$ to be positive for the samples that have been augmented form the same original sample. Lastly, $\boldsymbol { Z } \in \mathbb { R } ^ { \boldsymbol { \tilde { N } \times K } }$ denotes the matrix of feature maps obtained from a model $f _ { \theta } : \mathbb { R } ^ { D } \mapsto \mathbb { R } ^ { K }$ —commonly a Deep Network— as $Z \triangleq [ f _ { \boldsymbol \theta } ( \pmb { x } _ { 1 } ) , \ldots , f _ { \boldsymbol \theta } ( \pmb { x } _ { N } ) ] ^ { T }$ .
|
| 33 |
+
|
| 34 |
+
VICReg. With the above notations out of the way, we can remind the VICReg loss as defined in Bardes et al. [25] as a function of $\boldsymbol { X }$ and $G$ in the following triplet loss
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\mathcal { L } _ { \mathrm { v i c } } = \alpha \sum _ { k = 1 } ^ { K } \operatorname* { m a x } \Bigg ( 0 , 1 - \sqrt { \mathrm { C o v } ( \boldsymbol { Z } ) _ { k , k } } \Bigg ) + \beta \sum _ { j \neq k } \mathrm { C o v } ( \boldsymbol { Z } ) _ { k , j } ^ { 2 } + \frac { \gamma } { N } \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } ( \boldsymbol { G } ) _ { i , j } \| \boldsymbol { Z } _ { i , \cdot } - \boldsymbol { Z } _ { j , \cdot } \| _ { 2 } ^ { 2 } .
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
We will often refer to each term in Eq. (1) as ${ \mathcal { L } } _ { \mathrm { v a r } }$ , ${ \mathcal { L } } _ { \mathrm { c o v } }$ , and ${ \mathcal { L } } _ { \mathrm { i n v } }$ respectively.
|
| 41 |
+
|
| 42 |
+
SimCLR. The SimCLR loss [8] is slightly different and first produces an estimated relation matrix ${ \widehat { G } } ( Z )$ generally using the cosine similarity (CoSim) via
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
( \widehat { G } ( Z ) ) _ { i , j } = \frac { e ^ { \operatorname { C o S i m } ( z _ { i } , z _ { j } ) / \tau } } { \sum _ { j = 1 , j \neq i } ^ { N } e ^ { \operatorname { C o S i m } ( z _ { i } , z _ { j } ) / \tau } } ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
with $\tau > 0$ a temperature parameter. Then SimCLR encourages the elements of ${ \widehat { G } } ( Z )$ and $G$ to match. The most popular solution to achieve that is to leverage the infoNCE loss given by
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathcal { L } _ { \mathrm { S i m C L R } } = - \sum _ { i = 1 } ^ { N } \sum _ { h = 1 } ^ { N } ( G ) _ { i , j } \log ( \widehat { G } ( Z ) ) _ { i , j } .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
The only difference between SimCLR and its varients e.g. NNCLR [32] lies in defining $G$ .
|
| 55 |
+
|
| 56 |
+
BarlowTwins. Lastly, BarlowTwins [24] proposes yet a slightly different approach where $z _ { i }$ must be close to $z _ { j }$ if $G _ { i , j } > 0$ . They do so with different flavors of losses and constraints to facilitate training. Hence, and for those models only, it is common to explicitly group $\boldsymbol { X }$ into two subsets $X _ { \mathrm { l e f t } }$ and $X _ { \mathrm { r i g h t } }$ based on $G$ so that $( ( X _ { \mathrm { l e f t } } ) _ { n } , ( X _ { \mathrm { r i g h t } } ) _ { n } ) , \forall n$ are all the positive pairs from $( X , G )$ . This does not lose any generality. In fact, suppose that we have 5 samples $a , b , c , d , e$ , and that $G$ says that $a , b , c$ are related to each other, and that $d , e$ are related to each other. Then, we can create the two data matrices as
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\begin{array} { r } { \mathbf { X } _ { \mathrm { l e f t } } = [ a , a , b , b , c , c , d , e ] , \ X _ { \mathrm { r i g h t } } = [ b , c , a , c , a , b , e , d ] . \ } \end{array}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Once the two (left/right) views are obtained, the corresponding embeddings $Z _ { \mathrm { l e f t } } , Z _ { \mathrm { r i g h t } }$ can be computed and the BarlowTwins is then defined as
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathcal { L } _ { \mathrm { B T } } = \sum _ { k = 1 } ^ { K } ( \mathrm { C o S i m } ( ( Z _ { \mathrm { l e f t } } ) _ { , k } , ( Z _ { \mathrm { r i g h t } } ) _ { , k } ) - 1 ) ^ { 2 } + \alpha \sum _ { k = 1 , k ^ { \prime } \neq k } ^ { K } \mathrm { C o S i m } ( ( Z _ { \mathrm { l e f t } } ) _ { , k } , ( Z _ { \mathrm { r i g h t } } ) _ { , k ^ { \prime } } ) ^ { 2 } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where one should notice that those terms correspond to the cross-correlation matrix between the two embeddings.
|
| 69 |
+
|
| 70 |
+
Our goal in the following sections (Section 3 for VICReg, Section 4 for SimCLR/NNCLR, and Section 5 for BarlowTwins) will be to find the optimal representations $z$ of $\boldsymbol { X }$ in various regimes. Three surprising facts will emerge: (i) all existing methods recover exactly some flavors of famous spectral methods, (ii) the spectral properties of $z$ can be provably characterized for each methods, and (iii) from those properties, we will provide necessary and sufficient conditions for a SSL representation to perfectly solve a downstream task. We provide linear algebra notations in Appendix B that might be useful for readers unfamiliar with methods such as the Singular Value Decomposition (SVD) [33].
|
| 71 |
+
|
| 72 |
+
# 3 VICReg Minimizes the Dirichlet Energy to Produce Smooth Signals on the Graph $G$ While Preventing Dimensional Collapse
|
| 73 |
+
|
| 74 |
+
Recall from Section 2 and Eq. (1) that VICReg is defined as a triplet loss (variance/invariance/covariance). We first demonstrate in Section 3.1 that the optimal VICReg representation can be obtained in closed form (Theorem 1) and that turning the VICReg optimization as a constrained problem recovers Laplacian Eigenmaps in embedding space and Kernel Locality Preserving Projection in data space (Section 3.2). We also consider the linear network regime where we obtain the analytical form of the optimal network’s parameters (Theorem 3).
|
| 75 |
+
|
| 76 |
+
# 3.1 Close-Form Optimal Representation for VICReg
|
| 77 |
+
|
| 78 |
+
First, we build up some insights into VICReg by demonstrating how the invariance term corresponds to the Dirichlet energy of the signal $z$ on the graph $G$ . Then, replacing the variance hinge loss at 1 with the squared loss at 1 as in minimizing the former. With t ${ \textstyle \sum _ { k = 1 } ^ { K } \left( 1 - \operatorname { C o v } ( Z ) _ { k , k } \right) ^ { 2 } }$ , notice that minimizing the latter impthe close-form optimal representation $Z ^ { * }$ minimizing Eq. (1) only as a function of $G$ and the loss’ hyperparameters.
|
| 79 |
+
|
| 80 |
+
From invariance to trace minimization. The first insight that we propose into VICReg is obtained by rewriting the invariance loss of VICReg as the energy of the signal $z$ on the graph $G$ [34] since we have (derivations in Appendix F.5)
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } ( G ) _ { i , j } \| ( \boldsymbol { Z } ) _ { i , \cdot } - ( \boldsymbol { Z } ) _ { j , \cdot } \| _ { 2 } ^ { 2 } = 2 \operatorname { T r } \left( \boldsymbol { Z } ^ { T } \boldsymbol { L } \boldsymbol { Z } \right) \ ( \triangleq \operatorname { D i r i c h l e t } \operatorname { e n e r g y } \operatorname { o f } \boldsymbol { Z } \operatorname { o n } G ) ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\pmb { L }$ is the graph Laplacian matrix $L = D - G$ with $_ { D }$ the diagonal degree matrix of $G$ i.e. $\begin{array} { r } { ( D ) _ { i , j } = \sum _ { j } ( \mathbf { \bar { G } } ) _ { i , j } } \end{array}$ and $( \boldsymbol { D } ) _ { i , j } = \boldsymbol { 0 } , \forall i \neq j$ . From Eq. (6) it is clear that the invariance term depends on the matching between the left singular vectors of $z$ and the eigenvectors of $\pmb { L }$ . Hence, non-contrastive learning aims at producing non-degenerate signals $z$ that are smooth on $G$ .
|
| 87 |
+
|
| 88 |
+
Optimal representation. To gain further insights into VICReg, we ought to obtain the analytical form of the optimal representation $Z ^ { \ast }$ minimizing Eq. (1) —although this optimum is not unique e.g. adding a constant entry to each column of $z$ does not change the loss value (details in Appendix F.6). We can now obtain the following characterization of $Z ^ { * }$ as a function of the spectral decomposition of the matrix that combines two Laplacian matrices (details in Appendix F.7). The first, (left of Eq. (7)) comes form the variance+covariance term is the Laplacian of a complete graph i.e. where each node/sample is connected all others. The second comes from the SSL graph $G$ to form the following (with its eigen-decomposition)
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\underbrace { I - \mathbf { 1 } \mathbf { 1 } ^ { T } / N } _ { \mathrm { a \ c o m p l e t e \ g r a p h } } - \underbrace { \frac { \gamma } { \alpha } \left( \pmb { D } - \pmb { G } \right) } _ { \mathrm { L a p l a c i a n \ o f \ t h e \ S S L / s u p . \ g r a p h } } = P _ { \alpha , \gamma } \mathrm { d i a g } ( \pmb { \lambda } _ { \alpha , \gamma } ) P _ { \alpha , \gamma } ^ { T } ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where the eigenvalues/eigenvectors are in descending orders. The eigenvectors of the combined Laplacians will be key to produce the optimal VICReg representation as formalized below.
|
| 95 |
+
|
| 96 |
+
Theorem 1. A global minimizer of the VICReg loss $\mathbf { \zeta } \alpha = \beta , \forall \gamma )$ denoted by $\mathbf { \delta Z } _ { \alpha , \gamma } ^ { * }$ is obtained from Eq. (7) along with the minimal achievable loss which are given by
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
Z _ { \alpha , \gamma } ^ { * } = ( P _ { \alpha , \gamma } ( \operatorname { d i a g } ( \lambda _ { \alpha , \gamma } ) N ) ^ { 1 / 2 } ) _ { : 1 : K } \quad a n d \quad \operatorname * { m i n } _ { Z \in \mathbb { R } ^ { N \times K } } { \mathscr { L } _ { \mathrm { V I C } } } = \alpha ( K - \| ( \lambda _ { \alpha , \beta } ) _ { 1 : K } \| _ { 2 } ^ { 2 } ) ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
and any $K$ -out-of- $N$ columns of $P _ { \alpha , \gamma } ( \mathbf { A } _ { \alpha , \gamma } N ) ^ { 1 / 2 }$ is a local minimum. (Proof in Appendix $F . 7 .$ )
|
| 103 |
+
|
| 104 |
+
The above result provides a few key insights. First, only the ratio $\gamma / \alpha$ governs the VICReg representation. Second, there exists many local minimum, some of which can be explicitly found by taking various $K$ -out-of- $N$ columns of $P _ { \alpha , \gamma } ( \mathbf { A } _ { \alpha , \gamma } N ) ^ { 1 / 2 }$ which we display in Fig. 2 along with the loss landscape of ${ \mathcal { L } } _ { \mathrm { V I C } }$ around the optimal representation $Z ^ { * }$ . We also depict in Fig. 3 the evolution of the eigenvalues $( \lambda _ { \alpha , \gamma } ) _ { 1 : K }$ for varying $\gamma$ along with the downstream task (induced by $G$ ) training performance. We observe that VICReg benefits from a sweet-spot where it can both preserve a full-rank representation $Z ^ { \ast }$ and incorporate enough information about $G$ to solve the task at hand perfectly.
|
| 105 |
+
|
| 106 |
+
Before moving to other SSL methods, we first emphasize the ability of VICReg to recover local spectral methods in the following sections.
|
| 107 |
+
|
| 108 |
+
# 3.2 VICReg Recovers Local Spectral Embedding Methods
|
| 109 |
+
|
| 110 |
+
The goal of this section is to relate VICReg to known local spectral embedding methods both in feature space $( Z )$ and in data space $( X )$ .
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 2: Left: depiction of the optimal VICReg loss with varying hyper-parameters (blue line) when the representation is formed from the top $[ k : K + k - 1 ]$ eigenvectors of Eq. (7) with convex interpolation in-between. Recall from Theorem 1 that the global optimum is given by the $[ 1 : K - 1 ]$ case. We also depict the downstream task performance (orange line) and we clearly observe that both are closely related as expected (see Theorem 9). Notice that since we are considering classification, even without the correct first eigenvector the linear classifier on top of $Z _ { \alpha , \gamma } ^ { * }$ is able to solve the task at hand thanks to the probability constraint that must sum to 1 i.e. the last component can be recovered from the first $C - 1$ . Right: depiction of the loss landscape of ${ \mathcal { L } } _ { \mathrm { V I C } }$ around the optimal $Z _ { \alpha , \gamma } ^ { * }$ on the left using the directions provides by the top $[ 2 : K ]$ and $[ 3 : K \bar { + } 1 ]$ eigenvectors of Eq. (7), and then with random directions in $z$ -space. All experiments employed $N = 2 5 6$ , $K = 1 6$ , $\operatorname { r a n k } ( G ) { \overset { - } { = } } 4$ .
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 3: Top: minimal VICReg loss (blue) from Theorem 1 and corresponding downstream task performance (orange). Bottom: evolution of $Z _ { \alpha , \gamma } ^ { * }$ ’s singular values. VICReg benefits from a $( \alpha , \gamma )$ -zone for which $\mathbf { \delta Z } _ { \alpha , \gamma } ^ { * }$ remains full rank and incorporates enough information on $\pmb { G }$ to solve the downstream task. Hence, VICReg hyper-parameters $\gamma / \alpha$ should be adapted depending on the confidence one has into $_ G$ All experiments employed $N =$ 256, $\bar { K } = 3 2$ , $\operatorname { r a n k } ( G ) = 8$ .
|
| 117 |
+
|
| 118 |
+
In feature space. Laplacian Eigenmaps (LE) [35] is a non-parametric method searching for a representation $z$ by minimizing the following Brockett [36] optimization problem
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\operatorname* { m i n } _ { \theta : Z ^ { T } D Z = I } \mathrm { T r } \left( Z ^ { T } \left( D - G \right) Z \right) ,
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
with $_ { D }$ the diagonal degree matrix of $G$ (recall Eq. (7)).
|
| 125 |
+
|
| 126 |
+
Theorem 2. Given a dataset $\boldsymbol { X }$ and relation matrix $G$ solving the $L E$ optimization problem Eq. (8) produces a representation that minimizes the VICReg loss with constraint that the variance and covariance loss are 0 as in ${ \mathcal { L } } _ { \mathrm { v i c } } ( Z _ { \mathrm { L E } } ^ { * } ) { = } \mathrm { m i n } _ { Z } { \mathcal { L } } _ { \mathrm { i n v } } ( Z )$ s.t. ${ \mathcal { L } } _ { \mathrm { v a r } } { = } O$ and ${ \mathcal { L } } _ { \mathrm { c o v } } { = } O .$ . (Proof in Appendix F.8.)
|
| 127 |
+
|
| 128 |
+
One important observation is that 8 recovers yet another SSL method known as W-MSE [37] which can now be seen as the constrained counterpart of VICReg, and in the linear regime, recovers Slow Feature Analysis (SFA) although without the dimension ordering, and is thus also closely related to its extension presented in Pfau et al. [38]. Furthermore, Eq. (8) and variants have been studied in Agrawal et al. [39] in the context of kernel PCA, some of which could provide interesting variations of the constrained VICReg setting. We also ought to highlight however that a crucial part of LE lies in the design of that matrix $G$ , often found from a $k$ -NN graph [40] of the samples $\boldsymbol { X }$ in the input space, while in SSL it is constructed from data-augmentations, or given.
|
| 129 |
+
|
| 130 |
+
In data space with DNs. The difficulty to produce new representations $_ z$ for new data samples (a shared difficulty among non-parametric methods) led to the development of a two-step modeling process [41] as x (∈ RD) 7→ h = ϕ(x) (∈ RS) 7→ z = W T h (∈ RK ) with S ≫ K, W ∈ RM×K , and where $\phi$ ’s goal is to learn a generic input embedding that can be reused on new samples $_ { \textbf { \em x } }$ . To see this, we collect those mappings for all the training set into the matrix $\Phi \in \mathbb { R } ^ { N \times S }$ . With that, the LE problem in data space —known as the kernel Locality Preserving Projection (kLPP) [42] problem— becomes
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\operatorname* { m i n } _ { \theta : W ^ { T } \Phi ^ { T } D \Phi W = I } \mathrm { T r } \left( W ^ { T } \Phi ^ { T } \left( D - G \right) \Phi W \right) ,
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
so that the original LE representation $z$ can be obtained simply as ${ Z = \Phi W }$ . And more importantly, given a new sample $_ { \textbf { \em x } }$ , one directly computes $z = W ^ { T } \phi ( \mathbf { \dot { x } } )$ . The crucial result of interest for our study is the following one that simply combines Theorem 2 with a result from He and Niyogi [42] demonstrating the equivalence between LE in feature space and KLLE in data space.
|
| 137 |
+
|
| 138 |
+
Proposition 1. VICReg with variance/covariance constraint solves $L E$ in embedding space and KLLE in input space (recall Eq. (9)) employing a DN for $\phi$ .
|
| 139 |
+
|
| 140 |
+
In data space with linear models. We now consider a linear mapping $Z = X W$ (the offset is taken care of by adding a 1 column to $\boldsymbol { X }$ ). In that case, VICReg with constrained $\mathcal { L } _ { \mathrm { v a r } } = 0 , \mathcal { L } _ { \mathrm { c o v } } = 0$ (as in Theorem 3)recovers two known spectral methods: Locality Preserving Projections (LPP) [42] for an arbitrary relation matrix $G$ , and Linear Discriminant Analysis (LDA) [43, 44] when $G$ is the supervised relation matrix. In both cases we obtain the analytical form of the optimal weights $W$ , as long as the within class/cluster variance is positive.
|
| 141 |
+
|
| 142 |
+
Theorem 3. Linear VICReg recovers LPP for any $G$ and $K \leq N$ , and recovers LDA for supervised $G$ and $K = C$ , in both cases the optimal parameter $W ^ { * }$ is given by the top- $K$ eigenvectors of $( X ^ { T } ( D - G ) X ) ^ { - 1 } X ^ { T } G X$ . (Proofs in Appendices F.13 and F.14.)
|
| 143 |
+
|
| 144 |
+
Interestingly, the eigenvalues associated to the eigenvectors of $W ^ { * }$ exactly recover the multivariate analysis of variance (MANOVA) sufficient statistics of the data [45, 46]. Hence, although not further explored in this study, we believe that important statistical results could be further obtained e.g. to assess the goodness-of-fit of the model without requiring a downstream task [47–49]. We now turn to another important SSL loss which is SimCLR and its variants.
|
| 145 |
+
|
| 146 |
+
# 4 SimCLR Solves a Generalized Multidimensional Scaling Problem à la ISOMAP
|
| 147 |
+
|
| 148 |
+
Recall from Section 2 and Eq. (2) that SimCLR first computes a similarity matrix $\widehat { G }$ of some flavor that depends on the representation $z$ , and then matches it against the known data relation $G$ . Different $z \mapsto { \widehat { \hat { G } } }$ methods lead to different variants of SimCLR [8] such as NNCLR [32] or MeanShift [50]. The goal of this section is two-fold. First, we demonstrate in Section 4.1 that different $Z \mapsto { \widehat { G } }$ mappings are solutions of different optimization problems (Theorem 4) —all trying to estimate the similarity matrix $G$ from the signals $z$ akin to Laplacian estimation in Graph Signal Processing. Second, we demonstrate in Section 4.2 that SimCLR and its variants force $z$ ’s spectrum to align with the one of $G$ as the training task falls back to a generalized (kernel) Multi-Dimensional Scaling method (Proposition 2).
|
| 149 |
+
|
| 150 |
+
# 4.1 Step 1: SimCLR Pairwise Similarities Solve a Graph Laplacian Estimation Problem
|
| 151 |
+
|
| 152 |
+
Let’s first define the minimization problem that given a set of signals i.e. rows of $z$ produces a relation estimate $\widehat { G }$ of $G$ . To ease notations, we gather in the $N \times N$ matrix $_ { D }$ all the pairwise distances $( \pmb { { \cal D } } ) _ { i , j } = d ( f _ { \theta } ( \pmb { x } _ { i } ) , f _ { \theta } ( \pmb { x } _ { j } ) )$ with $d$ any preferred metric. The standard problem of estimating $\widehat { G }$ from $z$ can be cast as an optimization problem [51, 52] as
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\widehat { G } _ { d , \mathcal { R } } = \underset { G \in \mathcal { G } } { \arg \operatorname* { m i n } } \sum _ { i , j } d \big ( f _ { \theta } ( \boldsymbol { x } _ { i } ) , f _ { \theta } ( \boldsymbol { x } _ { j } ) \big ) ( G ) _ { i , j } + \mathcal { R } ( G ) = \underset { G \in \mathcal { G } } { \arg \operatorname* { m i n } } \mathrm { T r } ( D G ) + \mathcal { R } ( G ) ,
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
with $\mathcal { G }$ the set (or subset) of symmetric matrices with nonnegative entries and zero diagonal, and with $\mathcal { R }$ a regularizer preventing $\widehat { G }$ to be the trivial zero matrix e.g.
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\mathcal { R } _ { \mathrm { l o g } } ( G ) = \sum _ { i \neq j } \tau G _ { i , j } ( \log ( G _ { i , j } ) - 1 ) \quad \mathrm { o r } \quad \mathcal { R } _ { \mathrm { F } } ( G ) = \sum _ { i \neq j } \tau G _ { i , j } ( G _ { i , j } - 1 ) .
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 4: Depiction of the representation’s singular values during training (from blue to red with the SimCLR loss with $\mathcal { G } _ { \mathrm { r s t o } }$ , varying $\operatorname { r a n k } ( G ) \in \{ 8 , 1 6 , 3 2 \}$ (rows, green dotted lines), number in top-right corner) with various $( d , \mathcal { R } )$ configurations (columns, recall Theorem 4). The rank of the learned representation matches exactly the one of $_ G$ validating the result from Theorem 5 regardless of the chosen hyper-parameters.
|
| 166 |
+
|
| 167 |
+
We provide in Fig. 7 a depiction of the impact of ${ \mathcal { R } } ( G )$ which pushes the entries of the weight matrix to be close to 1 with strength depending on the temperature parameter $\tau$ . Hence $\widehat { G }$ from Eq. (10) is the optimal graph —expressed as a weight matrix— for which the signal $Z = f _ { \theta } ( { \boldsymbol { X } } )$ on that graph is smooth. For example one can solve Eq. (10) only on $\mathcal { G } _ { \mathrm { r s t o } }$ , the space of right-stochastic matrices i.e. a subset of $\mathcal { G }$ that only contains matrices whose rows sum to 1 i.e. $\mathcal { G } _ { \mathrm { r s t o } } \overset { - } { = } \{ G \in \mathcal { G } : G { \bf 1 } = { \bf 1 } \}$ .
|
| 168 |
+
|
| 169 |
+
Theorem 4. Using $\mathcal { R }$ from Eq. (11) leads to the following graph weight estimate
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\begin{array} { r l } & { ( \widehat { \pmb { G } } _ { d , \mathcal { R } _ { \mathrm { l o g } } } ) _ { i , j } = e ^ { \frac { - 1 } { \tau } d ( f _ { \theta } ( \pmb { x } _ { i } ) , f _ { \theta } ( \pmb { x } _ { j } ) ) } 1 _ { \{ 1 \neq j \} } , \qquad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad ( w i t h \mathscr { G } ) } \\ & { ( \widehat { \pmb { G } } _ { d , \mathcal { R } _ { \mathrm { l o g } } } ) _ { i , j } = \frac { e ^ { \frac { - 1 } { \tau } d ( f _ { \theta } ( \pmb { x } _ { i } ) , f _ { \theta } ( \pmb { x } _ { j } ) ) } } { \sum _ { j \neq i } e ^ { \frac { - 1 } { \tau } d ( f _ { \theta } ( \pmb { x } _ { i } ) , f _ { \theta } ( \pmb { x } _ { j } ) ) } } 1 _ { \{ 1 \neq j \} } , \qquad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad ( w i t h \mathscr { G } _ { \mathrm { r s t o } } ) } \end{array}
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
and thus if d is the cosine distance, Eq. (12) recovers SimCLR’s case. (Proof in Appendix F.9.)
|
| 176 |
+
|
| 177 |
+
Based on this result, deriving novel, principled and interpretable variations of SimCLR is streamlined as we demonstrate in Appendix E by solving Eq. (10) with different constraints. Now that we understood the first part of the SimCLR method, we move to the second part, matching that graph estimate to the given one.
|
| 178 |
+
|
| 179 |
+
# 4.2 Step 2: SimCLR Fits the Estimated Graph $\widehat { G }$ to the Known Graph $G$
|
| 180 |
+
|
| 181 |
+
After SimCLR estimates the graph with $\widehat { G }$ as per the previous section, it employs a loss to enforce $\widehat { G }$ to be as close as possible to $G$ with some desired metric. That metric should reflect the properties that $G$ fulfills e.g. being a doubly-stochastic, right-stochastic or else. We demonstrate in this section that in doing so, SimCLR forces $z$ to have the same nonzero left singular vectors as the nonzero eigenvectors of $G$ , and that as opposed to VICReg, the rank of $\boldsymbol { Z } _ { \tau } ^ { \ast }$ and $G$ always matches.
|
| 182 |
+
|
| 183 |
+
Let’s first denote the SimCLR contrastive loss to be one of the two following variants (depending on the type of constraints put on $\widehat { G }$ and $G$
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\mathcal { L } _ { \mathrm { S i m C L R } } = \Vert \pmb { G } - \widehat { \pmb { G } } \Vert _ { F } ^ { 2 } \mathrm { o r } - \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \sum _ { n ^ { \prime } = 1 } ^ { N } ( \pmb { G } ) _ { n , n ^ { \prime } } \log ( ( \widehat { \pmb { G } } ) _ { n , n ^ { \prime } } ) .
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
When minimizing Eq. (13), SimCLR will learn an embedding $z$ so that the graph estimate matches closely the known graph $G$ . This already brings a contrast from VICReg showing that instead, SimCLR learns to produce signals such that the graph estimate is close to the known graph.We now characterize the optimal SimCLR representation $\boldsymbol { Z } _ { \tau } ^ { \ast }$ , recalling that we denote by $U _ { G }$ and $\Sigma _ { G }$ the left singular vectors and singular values of $G$ respectively. Notice that since $G$ is symmetric semi-definite positive, $U$ also corresponds to its eigenvectors and $\Sigma _ { G } ^ { 2 }$ to its eigenvalues.
|
| 190 |
+
|
| 191 |
+
Theorem 5. A global minimizer of the SimCLR loss denoted by $Z ^ { * }$ along with the minimal achievable loss using Eq. (16) or Eq. (17), $\tau \geq \mathrm { m a x } _ { i , j } ( D ) _ { i , j }$ and with the LHS of Eq. (13) are given by
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
\pmb { Z } _ { \tau } ^ { * } = ( \pmb { U } _ { G } \pmb { \Sigma } _ { G } ^ { 1 / 2 } ) _ { : , 1 : K } \quad a n d \quad \operatorname* { m i n } _ { \pmb { Z } \in \mathbb { R } ^ { N \times K } } \mathcal { L } _ { \mathrm { S i m C L R } } = \sum _ { k = K + 1 } ^ { N } ( \pmb { \Sigma } _ { G } ^ { 2 } ) _ { k , k } ,
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
up to permutations of the singular vectors associated to the same singular value. Also, for any loss of Eq. (13) and graph estimation, the rank of $\boldsymbol { Z } _ { \tau } ^ { * }$ is $\operatorname* { m i n } ( K , \operatorname { r a n k } ( G ) )$ . (Proof in Appendix F.10.)
|
| 198 |
+
|
| 199 |
+
We illustrate the above theorem for many combinations of distances and regularizers in Fig. 4 where we see that in all cases, SimCLR forces the representations $z$ to have a dimensional collapse, a phenomenon first observed in Hua et al. [17] and that has been one of the unanswered phenomenon in SSL [20, 30].
|
| 200 |
+
|
| 201 |
+
In our goal to unify SSL methods under the helm of spectral embedding methods, we now propose the following section that ties SimCLR and its variants to global spectral methods.
|
| 202 |
+
|
| 203 |
+
# 4.3 SimCLR Recovers Global Spectral Embedding Methods
|
| 204 |
+
|
| 205 |
+
We now propose to tie the SimCLR method along with its variants e.g. NNCLR to known global spectral methods, e.g. ISOMAP [53] which is in contrast to VICReg which was tied to local spectral methods (recall Section 3.2).
|
| 206 |
+
|
| 207 |
+
In feature space. Let’s first recall that ISOMAP is a variation of Multi-Dimensional Scaling (MDS) [54] also known as Principal Coordinates Analysis. Classical MDS tries to learn embedding vectors that have similar pairwise distance (usually $\ell _ { 2 }$ ) than the pairwise distance of the given input data. Often, MDS does this by using similarities instead of distances and thus by solving the following optimization problem minZ $\| \check { G } - Z Z ^ { T } \| _ { F } ^ { 2 }$ . At the most general level, ISOMAP simply corresponds to solving that same optimization problem but after redefining $G$ to better capture the geometric information of $\boldsymbol { X }$ e.g. using the shortest path distance of the $k$ -NN graph of $\boldsymbol { X }$ [55]. The surprising result that we formalize below is that SimCLR and its variants recover ISOMAP.
|
| 208 |
+
|
| 209 |
+
Proposition 2. SimCLR, using the settings of Theorem 5, recovers ISOMAP (and MDS for the correct choice of $G$ ). (Proof in Appendix F.11.)
|
| 210 |
+
|
| 211 |
+
In data space with DNs. From the above, we can extend Proposition 2 but in input space, in a very similar way as was done in Section 3.2. In fact, originating in Webb [56], there was a search to extend MDS, and ISOMAP to an input space formulation to solve the out-of-bag problem. In this setting, and taking MDS as an example, the original similarity matrix ${ \boldsymbol { z } } { \boldsymbol { z } } ^ { T }$ is replaced with $\Phi { \cal W } ^ { T } { \cal W } \Phi ^ { \breve { T } }$ using the same notations as in Eq. (9) and already known relationship between those models, we obtain the following.
|
| 212 |
+
|
| 213 |
+
Proposition 3 ([57]). Whenever SimCLR recovers ISOMAP or MDS in feature space, it recovers kernel ISOMAP or kernel PCA [58] in input space.
|
| 214 |
+
|
| 215 |
+
We now ought to turn to BarlowTwins, another non-contrastive method akin to VICReg (both of which fall back to LDA in the linear regime and with supervised $G$ ).
|
| 216 |
+
|
| 217 |
+
# 5 BarlowTwins Solves a (Kernel) Canonical Correlation Analysis Problem and Can Recover VICReg
|
| 218 |
+
|
| 219 |
+
Our last step in our journey to unify SSL methods under spectral embedding methods deals with BarlowTwins. Akin to the development for VICReg and SimCLR, BarlowTwins will also fall back to a known spectral method in embedding space (Section 5.1) and in data space (Section 5.2) where in the later case we again obtain the close-form optimal network parameters in the linear regime.
|
| 220 |
+
|
| 221 |
+
# 5.1 BarlowTwins Recovers Kernel Canonical Correlation Analysis
|
| 222 |
+
|
| 223 |
+
Recall from Section 2 and Eq. (5) that the BarlowTwins loss is based on a cross-correlation matrix between positive pairs of samples. As we did for VICReg and SimCLR, our goal here is to tie BarlowTwins to a known spectral method known as Kernel Canonical Correlation Analysis.
|
| 224 |
+
|
| 225 |
+
Although we focus here on BarlowTwins for clarity. We hope that our results on BarlowTwins will stem the unification of those methods too in future works. Going back to BarlowTwins, we now obtain the following result that nicely parallels with the ones we obtained for VICReg and SimCLR. In data space, BarlowTwins can be regarded (put in perspective with Section 5.2) as a nonlinear canonical correlation analysis (NLCA) [59] and in particular Kernel CCA (KCCA) [60, 61] akin to how VICReg recovered Kernel Locality Preserving Projection and SimCLR Kernel ISOMAP. We leverage the same notations as in Section 3.2.
|
| 226 |
+
|
| 227 |
+
Theorem 6. BarlowTwins recovers Kernel Canonical Correlation Analysis with a DN as the featurizer $\phi$ and produce a representation with rank $\operatorname* { m i n } ( K , D )$ for any value of α (recall Eq. (5)) and with orthogonal columns. (Proof in Appendix F.12.).
|
| 228 |
+
|
| 229 |
+
We thus obtain from the above that BarlowTwins employing a DN featurized is akin to the Deep CCA [62] that proposed this setting exactly, and further akin to SimSIAM and BYOL [31] since Lee et al. [26] related the latter to Deep CCA. In addition to those links, the above provides further interpretation into the BarlowTwins’ loss e.g. the additional $\epsilon$ constant added in the denominator of the BarlowTwins loss further corresponds to a ridge-type regularization which as been introduced in Gretton et al. [63] as a mean to introduce numerical stability.
|
| 230 |
+
|
| 231 |
+
The above statement also brings yet another flavor of SSL methods. In fact, where VICReg allows to control the rank of $z$ to be in-between $K$ and $\mathrm { { r a n k } } ( G )$ throug the loss hyper-parameters, and where SimCLR enforces the rank of $z$ to be exactly the rank of $G$ , BarlowTwins enforces to have a full-rank representation. We depict in Fig. 8 the evolution of $\operatorname { r a n k } ( Z )$ depending on the rank of the initialized representation rank $Z _ { \mathrm { i n i t } } )$ using a gradient descent optimizer. We see that if the initialization is full rank but $G$ is lower rank, the BarlowTwins loss does not collapse the extra nonzero singular values of $z$ . Vice-versa, if $\operatorname { r a n k } ( Z _ { \mathrm { i n i t } } ) < \operatorname { r a n k } ( G )$ then BarlowTwins loss will increase the rank of $z$ . lastly, although not further studied here, we should point out to the reader that regularized forms of KCCA can be shown to include kernel ridge regression and regularized kernel Fisher LDA as special cases [64], further tying the special cases for which different SSL methods would fall back to the same model.
|
| 232 |
+
|
| 233 |
+
In the following section we will demonstrate how BarlowTwins in the linear regime exactly recovers Canonical Correlation Analysis.
|
| 234 |
+
|
| 235 |
+
# 5.2 With a Linear Network BarlowTwins Recovers Canonical Correlation Analysis and Linear Discriminant Analysis
|
| 236 |
+
|
| 237 |
+
The goal of this section is to further demonstrate the benefits of connecting SSL methods to spectral methods by exploiting the known techniques of the latter to help answer questions on the former.
|
| 238 |
+
|
| 239 |
+
As was done $\mathrm { V I C R e g }$ (we use linear settings of Section 3.2), we now obtain the optimal weights for BarlowTwins in the linear regime. We can even provide additional insights in this case since BarlowTwins is often seen as a key method that allows the use of different parameters/architectures to process $X _ { \mathrm { l e f t } }$ and $X _ { \mathrm { r i g h t } }$ . We now show under what conditions on $G$ sharing parameters is sufficient by first demonstrating how BarlowTwins recovers exactly CCA, and even LDA for supervised $G$ . To streamline notations, we assume that our data is already centered, and thus define the covariance and cross-covariance matrices as $C _ { l l } = X _ { \mathrm { l e f t } } ^ { T } X _ { \mathrm { r i g h t } } , C _ { l r } \overset { \cdot } { = } X _ { \mathrm { l e f t } } ^ { T } X _ { \mathrm { r i g h t } }$ and so on.
|
| 240 |
+
|
| 241 |
+
Theorem 7. In the linear regime BarlowTwins recovers CCA with optimal weights given by
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
W _ { \mathrm { l e f t } } ^ { * } = \ t o p { - } K \ e i g e n \nu e c t o r s \ o f \ C _ { \mathrm { l l } } ^ { - 1 } C _ { \mathrm { l r } } C _ { \mathrm { r r } } ^ { - 1 } C _ { \mathrm { r l } } \ a n d \ W _ { \mathrm { r i g h t } } ^ { * } = C _ { \mathrm { r r } } ^ { - 1 } C _ { \mathrm { r l } } W _ { \mathrm { l e f t } } ^ { * } ,
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
and $( i )$ —with a symmetric $G$ , weight-sharing naturally occurs— as the optimal weights are $W _ { \mathrm { l e f t } } ^ { * } =$ $W _ { \mathrm { r i g h t } } ^ { * } = t o p { - } K$ eigenvectors of $C _ { \mathrm { r r } } ^ { - 1 } C _ { \mathrm { r l } }$ and (ii) if $G$ is supervised and $K = C$ then BarlowTwins recovers $L D A$ and thus constrained VICReg (recall Theorem 3). (Proof in Appendix F.15.)
|
| 248 |
+
|
| 249 |
+
The above result opens new venues to extend current SSL methods (BarlowTwins in this case). For example, penalized matrix decomposition (PMD) from Witten et al. [65] formulates a novel sparse formulation of CCA. In our context, this could lead to a new variation of BarlowTwins, in both the linear and nonlinear regimes. With the above results, we now connected most SSL methods to spectral methods, and found key properties that their representations/parameters inherit. We provide for completeness a few direct results in Appendix C that directly leverage the above results to characterize downstream performances of each method.
|
| 250 |
+
|
| 251 |
+
# 6 Conclusions and Limitations
|
| 252 |
+
|
| 253 |
+
We provided a unifying analysis of the major self-supervised learning methods covering VICReg (Section 3), SimCLR (Section 4) and BarlowTwins (Section 5) along with SimSIAM and BYOL thanks to already existing results tying those to Deep CCA. In doing so, we were able to find the commonalities between all those methods and to provide general guidelines on how to derive alternative SSL methods from first principles. At a more general level, we were able to parallel the many SSL methods to global and local methods in spectral methods respectively. Among the many insights that we obtained, the most crucial one is that VICReg enables a continue control on collapsing the representation’s rank versus encapsulating information about $G$ . This is in contrast to BarlowTwins and SimCLR that either always maintain full-rank, or always collapse the representation none of which would be ideal. One major limitation is that for the nonlinear regime, we study the case of an infinite capacity model i.e. no implicit bias coming from the architecture comes into play. A potentially insightful future work would thus be to perform a similar analysis as the one provided here but including the implicit bias on the nonlinear mapping that different architecture exhibit. This way, we would obtain not only insights into the various SSL methods but also in their combination with various model architectures.
|
| 254 |
+
|
| 255 |
+
# References
|
| 256 |
+
|
| 257 |
+
[1] Angjoo Kanazawa, David W Jacobs, and Manmohan Chandraker. Warpnet: Weakly supervised matching for single-view reconstruction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3253–3261, 2016.
|
| 258 |
+
[2] David Novotny, Samuel Albanie, Diane Larlus, and Andrea Vedaldi. Self-supervised learning of geometrically stable features through probabilistic introspection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3637–3645, 2018. [3] Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. arXiv preprint arXiv:1803.07728, 2018.
|
| 259 |
+
[4] Pierre Sermanet, Corey Lynch, Yevgen Chebotar, Jasmine Hsu, Eric Jang, Stefan Schaal, Sergey Levine, and Google Brain. Time-contrastive networks: Self-supervised learning from video. In 2018 IEEE international conference on robotics and automation (ICRA), pages 1134–1141. IEEE, 2018.
|
| 260 |
+
[5] Dahun Kim, Donghyeon Cho, and In So Kweon. Self-supervised video representation learning with space-time cubic puzzles. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 8545–8552, 2019. [6] Dejing Xu, Jun Xiao, Zhou Zhao, Jian Shao, Di Xie, and Yueting Zhuang. Self-supervised spatiotemporal learning via video clip order prediction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10334–10343, 2019. [7] Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Säckinger, and Roopak Shah. Signature verification using a" siamese" time delay neural network. Advances in neural information processing systems, 6, 1993. [8] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597–1607. PMLR, 2020.
|
| 261 |
+
[9] Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6707–6717, 2020.
|
| 262 |
+
[10] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9650–9660, 2021.
|
| 263 |
+
[11] Priya Goyal, Dhruv Mahajan, Abhinav Gupta, and Ishan Misra. Scaling and benchmarking self-supervised visual representation learning. In Proceedings of the ieee/cvf International Conference on computer vision, pages 6391–6400, 2019.
|
| 264 |
+
[12] Linus Ericsson, Henry Gouk, and Timothy M Hospedales. How well do self-supervised models transfer? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5414–5423, 2021.
|
| 265 |
+
[13] Xiang Wang, Xinlei Chen, Simon S Du, and Yuandong Tian. Towards demystifying representation learning with non-contrastive self-supervision. arXiv preprint arXiv:2110.04947, 2021.
|
| 266 |
+
[14] Yuandong Tian, Xinlei Chen, and Surya Ganguli. Understanding self-supervised learning dynamics without contrastive pairs. In International Conference on Machine Learning, pages 10268–10278. PMLR, 2021.
|
| 267 |
+
[15] Zixin Wen and Yuanzhi Li. Toward understanding the feature learning process of self-supervised contrastive learning. In International Conference on Machine Learning, pages 11112–11122. PMLR, 2021.
|
| 268 |
+
[16] Ashwini Pokle, Jinjin Tian, Yuchen Li, and Andrej Risteski. Contrasting the landscape of contrastive and non-contrastive learning. arXiv preprint arXiv:2203.15702, 2022.
|
| 269 |
+
[17] Tianyu Hua, Wenxiao Wang, Zihui Xue, Sucheng Ren, Yue Wang, and Hang Zhao. On feature decorrelation in self-supervised learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9598–9608, 2021.
|
| 270 |
+
[18] Li Jing, Pascal Vincent, Yann LeCun, and Yuandong Tian. Understanding dimensional collapse in contrastive self-supervised learning. arXiv preprint arXiv:2110.09348, 2021.
|
| 271 |
+
[19] Florian Bordes, Randall Balestriero, and Pascal Vincent. High fidelity visualization of what your self-supervised representation knows about. arXiv preprint arXiv:2112.09164, 2021.
|
| 272 |
+
[20] Sanjeev Arora, Hrishikesh Khandeparkar, Mikhail Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. arXiv preprint arXiv:1902.09229, 2019.
|
| 273 |
+
[21] Azade Nazi, Will Hang, Anna Goldie, Sujith Ravi, and Azalia Mirhoseini. Generalized clustering by learning to optimize expected normalized cuts. arXiv preprint arXiv:1910.07623, 2019.
|
| 274 |
+
[22] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In International Conference on Machine Learning, pages 9929–9939. PMLR, 2020.
|
| 275 |
+
[23] Haizhou Shi, Dongliang Luo, Siliang Tang, Jian Wang, and Yueting Zhuang. Run away from your teacher: Understanding byol by a novel self-supervised approach. arXiv preprint arXiv:2011.10944, 2020.
|
| 276 |
+
[24] Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Selfsupervised learning via redundancy reduction. arXiv preprint arXiv:2103.03230, 2021.
|
| 277 |
+
[25] Adrien Bardes, Jean Ponce, and Yann LeCun. Vicreg: Variance-invariance-covariance regularization for self-supervised learning. arXiv preprint arXiv:2105.04906, 2021.
|
| 278 |
+
[26] Jason D Lee, Qi Lei, Nikunj Saunshi, and Jiacheng Zhuo. Predicting what you already know helps: Provable self-supervised learning. Advances in Neural Information Processing Systems, 34:309–323, 2021.
|
| 279 |
+
[27] Yuandong Tian. Deep contrastive learning is provably (almost) principal component analysis. arXiv preprint arXiv:2201.12680, 2022.
|
| 280 |
+
[28] Jeff Z HaoChen, Colin Wei, Adrien Gaidon, and Tengyu Ma. Provable guarantees for selfsupervised deep learning with spectral contrastive loss. Advances in Neural Information Processing Systems, 34, 2021.
|
| 281 |
+
[29] Jeff Z HaoChen, Colin Wei, Ananya Kumar, and Tengyu Ma. Beyond separability: Analyzing the linear transferability of contrastive representations to related subpopulations. arXiv preprint arXiv:2204.02683, 2022.
|
| 282 |
+
[30] Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive learning, multi-view redundancy, and linear models. In Algorithmic Learning Theory, pages 1179–1206. PMLR, 2021.
|
| 283 |
+
[31] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent-a new approach to self-supervised learning. Advances in Neural Information Processing Systems, 33:21271–21284, 2020.
|
| 284 |
+
[32] Debidatta Dwibedi, Yusuf Aytar, Jonathan Tompson, Pierre Sermanet, and Andrew Zisserman. With a little help from my friends: Nearest-neighbor contrastive learning of visual representations. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9588–9597, 2021.
|
| 285 |
+
[33] Carl Eckart and Gale Young. The approximation of one matrix by another of lower rank. Psychometrika, 1(3):211–218, 1936.
|
| 286 |
+
[34] Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395–416, 2007.
|
| 287 |
+
[35] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural computation, 15(6):1373–1396, 2003.
|
| 288 |
+
[36] Roger W Brockett. Dynamical systems that sort lists, diagonalize matrices, and solve linear programming problems. Linear Algebra and its applications, 146:79–91, 1991.
|
| 289 |
+
[37] Aleksandr Ermolov, Aliaksandr Siarohin, Enver Sangineto, and Nicu Sebe. Whitening for self-supervised representation learning. In International Conference on Machine Learning, pages 3015–3024. PMLR, 2021.
|
| 290 |
+
[38] David Pfau, Stig Petersen, Ashish Agarwal, David G. T. Barrett, and Kimberly L. Stachenfeld. Spectral inference networks: Unifying deep and spectral learning. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ SJzqpj09YQ.
|
| 291 |
+
[39] Akshay Agrawal, Alnur Ali, Stephen Boyd, et al. Minimum-distortion embedding. Foundations and Trends® in Machine Learning, 14(3):211–378, 2021.
|
| 292 |
+
[40] Ville Hautamaki, Ismo Karkkainen, and Pasi Franti. Outlier detection using k-nearest neighbour graph. In Proceedings of the 17th International Conference on Pattern Recognition, 2004. ICPR 2004., volume 3, pages 430–433. IEEE, 2004.
|
| 293 |
+
[41] Yoshua Bengio, Jean-françcois Paiement, Pascal Vincent, Olivier Delalleau, Nicolas Roux, and Marie Ouimet. Out-of-sample extensions for lle, isomap, mds, eigenmaps, and spectral clustering. Advances in neural information processing systems, 16, 2003.
|
| 294 |
+
[42] Xiaofei He and Partha Niyogi. Locality preserving projections. Advances in neural information processing systems, 16, 2003.
|
| 295 |
+
[43] Ronald A Fisher. The use of multiple measurements in taxonomic problems. Annals of eugenics, 7(2):179–188, 1936.
|
| 296 |
+
[44] Patricia Cohen, Stephen G West, and Leona S Aiken. Applied multiple regression/correlation analysis for the behavioral sciences. Psychology press, 2014.
|
| 297 |
+
[45] Ralph G O’Brien and Mary K Kaiser. Manova method for analyzing repeated measures designs: an extensive primer. Psychological bulletin, 97(2):316, 1985.
|
| 298 |
+
[46] Carl J Huberty and Stephen Olejnik. Applied MANOVA and discriminant analysis. John Wiley & Sons, 2006.
|
| 299 |
+
[47] Sebastian Mika, Gunnar Ratsch, Jason Weston, Bernhard Scholkopf, and Klaus-Robert Mullers. Fisher discriminant analysis with kernels. In Neural networks for signal processing IX: Proceedings of the 1999 IEEE signal processing society workshop (cat. no. 98th8468), pages 41–48. Ieee, 1999.
|
| 300 |
+
[48] Sergey Ioffe. Probabilistic linear discriminant analysis. In European Conference on Computer Vision, pages 531–542. Springer, 2006.
|
| 301 |
+
[49] Jing-Hao Xue and Peter Hall. Why does rebalancing class-unbalanced data improve auc for linear discriminant analysis? IEEE transactions on pattern analysis and machine intelligence, 37(5):1109–1112, 2014.
|
| 302 |
+
[50] Soroush Abbasi Koohpayegani, Ajinkya Tejankar, and Hamed Pirsiavash. Mean shift for selfsupervised learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10326–10335, 2021.
|
| 303 |
+
[51] Xiaowen Dong, Dorina Thanou, Pascal Frossard, and Pierre Vandergheynst. Learning laplacian matrix in smooth graph signal representations. IEEE Transactions on Signal Processing, 64 (23):6160–6173, 2016.
|
| 304 |
+
[52] Vassilis Kalofolias. How to learn a graph from smooth signals. In Artificial Intelligence and Statistics, pages 920–929. PMLR, 2016.
|
| 305 |
+
[53] Joshua B Tenenbaum, Vin de Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. science, 290(5500):2319–2323, 2000.
|
| 306 |
+
[54] Joseph B Kruskal. Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. Psychometrika, 29(1):1–27, 1964.
|
| 307 |
+
[55] Franco P Preparata and Michael I Shamos. Computational geometry: an introduction. Springer Science & Business Media, 2012.
|
| 308 |
+
[56] Andrew R Webb. Multidimensional scaling by iterative majorization using radial basis functions. Pattern Recognition, 28(5):753–759, 1995.
|
| 309 |
+
[57] Christopher Williams. On a connection between kernel pca and metric multidimensional scaling. Advances in neural information processing systems, 13, 2000.
|
| 310 |
+
[58] Bernhard Schölkopf, Alexander Smola, and Klaus-Robert Müller. Nonlinear component analysis as a kernel eigenvalue problem. Neural computation, 10(5):1299–1319, 1998.
|
| 311 |
+
[59] Jacques Dauxois and Guy Martial Nkiet. Nonlinear canonical analysis and independence tests. The Annals of Statistics, 26(4):1254–1278, 1998.
|
| 312 |
+
[60] Pei Ling Lai and Colin Fyfe. Kernel and nonlinear canonical correlation analysis. International Journal of Neural Systems, 10(05):365–377, 2000.
|
| 313 |
+
[61] Kenji Fukumizu, Francis R Bach, and Arthur Gretton. Statistical consistency of kernel canonical correlation analysis. Journal of Machine Learning Research, 8(2), 2007.
|
| 314 |
+
[62] Galen Andrew, Raman Arora, Jeff Bilmes, and Karen Livescu. Deep canonical correlation analysis. In International conference on machine learning, pages 1247–1255. PMLR, 2013.
|
| 315 |
+
[63] Arthur Gretton, Ralf Herbrich, Alexander Smola, Olivier Bousquet, Bernhard Schölkopf, et al. Kernel methods for measuring independence. 2005.
|
| 316 |
+
[64] Malte Kuss and Thore Graepel. The geometry of kernel canonical correlation analysis. 2003.
|
| 317 |
+
[65] Daniela M Witten, Robert Tibshirani, and Trevor Hastie. A penalized matrix decomposition, with applications to sparse principal components and canonical correlation analysis. Biostatistics, 10(3):515–534, 2009.
|
| 318 |
+
[66] Laurenz Wiskott and Terrence J Sejnowski. Slow feature analysis: Unsupervised learning of invariances. Neural computation, 14(4):715–770, 2002.
|
| 319 |
+
[67] Huan Xu, Constantine Caramanis, and Sujay Sanghavi. Robust pca via outlier pursuit. Advances in neural information processing systems, 23, 2010.
|
| 320 |
+
[68] Magnus R Hestenes. Inversion of matrices by biorthogonalization and related results. Journal of the Society for Industrial and Applied Mathematics, 6(1):51–90, 1958.
|
| 321 |
+
[69] Han Bao, Yoshihiro Nagano, and Kento Nozawa. Sharp learning bounds for contrastive unsupervised representation learning. arXiv preprint arXiv:2110.02501, 2021.
|
| 322 |
+
[70] Gene H Golub and Christian Reinsch. Singular value decomposition and least squares solutions. In Linear algebra, pages 134–151. Springer, 1971.
|
| 323 |
+
[71] Like Hui and Mikhail Belkin. Evaluation of neural architectures trained with square loss vs crossentropy in classification tasks, 2020. URL https://arxiv.org/abs/2006.07322.
|
| 324 |
+
[72] Robert Geirhos, Kantharaju Narayanappa, Benjamin Mitzkus, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. On the surprising similarities between supervised and selfsupervised models. arXiv preprint arXiv:2010.08377, 2020.
|
| 325 |
+
[73] Nicholas J Higham. Computing a nearest symmetric positive semidefinite matrix. Linear algebra and its applications, 103:103–118, 1988.
|
| 326 |
+
[74] Octavian Ganea, Sylvain Gelly, Gary Bécigneul, and Aliaksei Severyn. Breaking the softmax bottleneck via learnable monotonic pointwise non-linearities. In International Conference on Machine Learning, pages 2073–2082. PMLR, 2019.
|
| 327 |
+
[75] Zhilin Yang, Zihang Dai, Ruslan Salakhutdinov, and William W Cohen. Breaking the softmax bottleneck: A high-rank rnn language model. arXiv preprint arXiv:1711.03953, 2017.
|
| 328 |
+
[76] H Knaf. Kernel fisher discriminant functions–a concise and rigorous introduction. 2007.
|
| 329 |
+
[77] Andrew J Wathen and Shengxin Zhu. On spectral distribution of kernel matrices related to radial basis functions. Numerical Algorithms, 70(4):709–726, 2015.
|
| 330 |
+
[78] Xin Liang, Ren-Cang Li, and Zhaojun Bai. Trace minimization principles for positive semidefinite pencils. Linear Algebra and its Applications, 438(7):3085–3106, 2013.
|
| 331 |
+
[79] Effrosini Kokiopoulou, Jie Chen, and Yousef Saad. Trace optimization and eigenproblems in dimension reduction methods. Numerical Linear Algebra with Applications, 18(3):565–602, 2011.
|
| 332 |
+
[80] Andrew R Webb. Statistical pattern recognition. John Wiley & Sons, 2003.
|
| 333 |
+
[81] Yue-Fei Guo, Shi-Jin Li, Jing-Yu Yang, Ting-Ting Shu, and Li-De Wu. A generalized foley– sammon transform based on generalized fisher discriminant criterion and its application to face recognition. Pattern Recognition Letters, 24(1-3):147–158, 2003.
|
| 334 |
+
[82] Huan Wang, Shuicheng Yan, Dong Xu, Xiaoou Tang, and Thomas Huang. Trace ratio vs. ratio trace for dimensionality reduction. In 2007 IEEE Conference on Computer Vision and Pattern Recognition, pages 1–8. IEEE, 2007.
|
| 335 |
+
[83] Cheng Li and Bingyu Wang. Fisher linear discriminant analysis. CCIS Northeastern University, 2014.
|
| 336 |
+
[84] Maurice S Bartlett. Further aspects of the theory of multiple regression. In Mathematical Proceedings of the Cambridge Philosophical Society, volume 34, pages 33–40. Cambridge University Press, 1938.
|
| 337 |
+
[85] Trevor Hastie, Andreas Buja, and Robert Tibshirani. Penalized discriminant analysis. The Annals of Statistics, 23(1):73–102, 1995.
|
| 338 |
+
[86] MJR Healy. A rotation method for computing canonical correlations. Mathematics of Computation, 11(58):83–86, 1957.
|
| 339 |
+
[87] L Magnus Ewerbring and Franklin T Luk. Canonical correlations and generalized svd: applications and new algorithms. Journal of computational and applied mathematics, 27(1-2):37–52, 1989.
|
| 340 |
+
[88] David R Hardoon, Sandor Szedmak, and John Shawe-Taylor. Canonical correlation analysis: An overview with application to learning methods. Neural computation, 16(12):2639–2664, 2004.
|
| 341 |
+
[89] Olcay Kursun, Ethem Alpaydin, and Oleg V Favorov. Canonical correlation analysis using within-class coupling. Pattern Recognition Letters, 32(2):134–144, 2011.
|
| 342 |
+
|
| 343 |
+
[90] Viivi Uurtio, João M Monteiro, Jaz Kandola, John Shawe-Taylor, Delmiro Fernandez-Reyes, and Juho Rousu. A tutorial on canonical correlation methods. ACM Computing Surveys (CSUR), 50(6):1–33, 2017.
|
| 344 |
+
|
| 345 |
+
# Checklist
|
| 346 |
+
|
| 347 |
+
1. For all authors...
|
| 348 |
+
|
| 349 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] Each section of the study answers a specific aspect of the abstract
|
| 350 |
+
(b) Did you describe the limitations of your work? [Yes] We discussed the assumptions of each result.
|
| 351 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] We do not believe that our work has any potential negative societal impacts
|
| 352 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 353 |
+
|
| 354 |
+
2. If you are including theoretical results...
|
| 355 |
+
|
| 356 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] For each method we carefully state our assumptions and provide background and citations for known results/assumptions
|
| 357 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] All the proofs are carefully expressed in multiple appendices with additional details to ensure full transparency on our results.
|
| 358 |
+
|
| 359 |
+
3. If you ran experiments...
|
| 360 |
+
|
| 361 |
+
(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] Code to reproduce the figures is provided in the supplementary materials
|
| 362 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] For each figure we provided the exact hyper-parameters used in each case within the caption
|
| 363 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We only provide empirical validation that do not require errors bars
|
| 364 |
+
(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)? [No] We only provide empirical validation on toy settings that do not require GPU or cluster computations
|
| 365 |
+
|
| 366 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 367 |
+
|
| 368 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A] we did not use existing assets
|
| 369 |
+
(b) Did you mention the license of the assets? [Yes] No licence provided
|
| 370 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include in the supplementary material the code to reproduce the figures provides in this paper.
|
| 371 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 372 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 373 |
+
|
| 374 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 375 |
+
|
| 376 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 377 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 378 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/-xEk43f_EO6/-xEk43f_EO6.md
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Multi-Scale Representation Learning on Proteins
|
| 2 |
+
|
| 3 |
+
Vignesh Ram Somnath∗ Dept. of Computer Science ETH Zurich vsomnath@ethz.ch
|
| 4 |
+
|
| 5 |
+
Charlotte Bunne∗ Dept. of Computer Science ETH Zurich bunnec@ethz.ch
|
| 6 |
+
|
| 7 |
+
Andreas Krause Dept. of Computer Science ETH Zurich krausea@ethz.ch
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Proteins are fundamental biological entities mediating key roles in cellular function and disease. This paper introduces a multi-scale graph construction of a protein – HOLOPROT – connecting surface to structure and sequence. The surface captures coarser details of the protein, while sequence as primary component and structure – comprising secondary and tertiary components – capture finer details. Our graph encoder then learns a multi-scale representation by allowing each level to integrate the encoding from level(s) below with the graph at that level. We test the learned representation on different tasks, (i.) ligand binding affinity (regression), and (ii.) protein function prediction (classification). On the regression task, contrary to previous methods, our model performs consistently and reliably across different dataset splits, outperforming all baselines on most splits. On the classification task, it achieves a performance close to the top-performing model while using $1 0 \mathrm { x }$ fewer parameters. To improve the memory efficiency of our construction, we segment the multiplex protein surface manifold into molecular superpixels and substitute the surface with these superpixels at little to no performance loss.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Protein design and engineering has become a crucial component of pharmaceutical research and development, finding application in a wide variety of diagnostic and industrial settings. Besides understanding the design principles determining structure and function of proteins, current efforts seek to further enhance or discover proteins with properties useful for technological or therapeutic applications. To efficiently guide the search in the vast design space of functional proteins, we need to be able to robustly predict properties of a candidate protein [Yang et al., 2019]. Moreover, understanding role and function of proteins is crucial to study causes and mechanism of human disease [Fessenden, 2017].
|
| 16 |
+
|
| 17 |
+
To achieve this, representations incorporating the complex nature of proteins are required. Proteins consist of amino acids, organic molecules linked by peptide bonds forming a linear sequence. Each of the twenty amino acids carries a unique side chain, giving rise to an incomprehensibly large combinatorial space of possible protein sequences. The primary sequence drives the folding of polymers – a spontaneous process guided by hydrophobic interactions, formation of intramolecular hydrogen bonds, and van der Waals forces into a unique three-dimensional structure. The resulting shape and surface manifold with rich physiochemical properties carry essential information for understanding function and potential molecular interactions.
|
| 18 |
+
|
| 19 |
+
Previous methods typically only consider an individual subset within these scales, focusing on either sequence [Öztürk et al., 2018, Hou et al., 2018], three-dimensional structure [Hermosilla et al., 2021, Derevyanko et al., 2018] or surface [Gainza et al., 2020]. Two proteins with similar sequences can fold into entirely different conformations. While these proteins might catalyze the same type of ooreactions, their behavior to specific inhibiting drugs might be divergent. Interaction between proteins and ligands, on the other hand, is controlled by molecular surface contacts [Gainza et al., 2020]. Molecular surfaces, determined by subjacent amino acids, are fingerprinted with patterns of geometric and chemical properties, and thus their integration in protein representations is crucial.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Overview of HOLOPROT Our multi-scale protein representation algorithm integrates primary, secondary and tertiary elements of protein structures and connects them to the surface. We extract higher-level protein motifs by introducing molecular superpixels. Both structure and surface are represented as graphs $\mathcal { G } _ { B }$ and $\mathcal { G } _ { S }$ , respectively. The method is evaluated on two representative fintasks, protein-ligand binding affinity and enzyme-catalyzed reaction classification.
|
| 23 |
+
|
| 24 |
+
In this work, we present a novel multi-scale graph representation which integrates and connects the complex nature of proteins across all levels of information. HOLOPROT consists of a surface and structure layer (both represented as graphs) with explicit edges between the layers. Our construction finiris guided by the intuition that propagating information from surface to structure would allow each residue to learn encodings reflective of not just its immediate residue neighborhood, but also the higher-level geometric and chemical properties that arise from interactions between a residue and ooits neighborhood. The associated multi-scale encoder then learns representations by integrating sathe encoding from the layer below, with the graph at that layer (Section 3). Such multi-scale representations have been previously used in molecular graph generation [Jin et al., 2020] with impressive results.
|
| 25 |
+
|
| 26 |
+
We further improve the memory efficiency of our construction by segmenting the large and rich protein surface into molecular “superpixels”, summarizing higher-level fingerprint features and motifs of proteins. Substituting the surface layer with these superpixels results in little to no performance degradation across the evaluated tasks. The concept of molecular superpixels might be of interest beyond our model (Section 4).
|
| 27 |
+
|
| 28 |
+
The multi-objective and multi-task nature of protein engineering poses a challenge for current methods, often designed and evaluated only on specific subtasks of protein design. By incorporating the biology of proteins, strong representations exhibit robust performance across tasks. We demonstrate our model’s versatility and range of applications by deploying it to tasks of rather distinct nature, including a regression task, e.g., inference of protein ligand binding affinity, and classification tasks, i.e., enzyme-catalyzed reaction classification (Section 5).
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
Protein Representation Learning With increasing availability of sequence and structure data, the field of protein representation learning has advanced rapidly, with methods falling largely in one of the following categories:
|
| 33 |
+
|
| 34 |
+
Sequence-based methods. One-dimensional amino acid sequences continue to be the simplest, most abundant source of protein data and various methods have been developed that borrow architectures developed in natural language processing (NLP). One-dimensional convolutional neural networks have been used to classify a protein sequence into folds and enzyme function [Hou et al., 2018, Dalkiran et al., 2018], and to predict their binding affinity to ligands [Öztürk et al., 2018]. Furthermore, methods have applied complex NLP models trained unsupervised on millions of unlabeled protein sequences and fine-tuned them on different downstream tasks [Rao et al., 2019, Elnaggar et al., 2020, Bepler and Berger, 2019]. Despite being advantageous when only the sequence is available, these methods ignore the full spatial complexity of proteins.
|
| 35 |
+
|
| 36 |
+
Structure-based methods. To learn beyond sequences, approaches have been developed, that consider the 3D structure of proteins. 3D convolutional neural networks have been utilized for protein quality assessment [Derevyanko et al., 2018], protein contact prediction [Townshend et al., 2019] and protein-ligand binding affinity tasks [Ragoza et al., 2017, Jiménez et al., 2018, Townshend et al., 2020]. An alternate representation treats proteins as graphs, applying graph neural networks for enzyme classification [Dobson and Doig, 2005], interface prediction [Fout et al., 2017], and protein structure quality prediction [Baldassarre et al., 2021]. Gligorijevic et al. [2021] use a long short term memory cell (LSTM) to encode the sequence, followed by a graph convolutional network (GCN) [Kipf and Welling, 2017] to capture the tertiary structure, and apply this to the function prediction task. Hermosilla et al. [2021] propose a convolutional operator that learns to adapt filters based on the primary, secondary, and tertiary structure of a protein, showing strong performance on reaction and fold class prediction.
|
| 37 |
+
|
| 38 |
+
Surface-based methods. Taking a different viewpoint, Gainza et al. [2020] hypothesize that the protein surface displays patterns of chemical and geometric features that fingerprint a protein’s interaction with other biomolecules. They utilize geodesic convolutions, which are extensions of convolutions on surfaces, and learn fingerprint vectors, showing improved performance across binding pocket and protein interface prediction tasks.
|
| 39 |
+
|
| 40 |
+
Protein Motif Detection Protein motifs have largely been synonymous with common and conserved patterns in a protein’s sequence or structure influencing protein function, e.g., the helixturn-helix motif binds DNA. Understanding these fragments is essential for 3D structure prediction, modeling, and drug design. While reliably detecting evolutionary motifs, existing tools [Golovin and Henrick, 2008] do not provide a full segmentation of the protein surface manifold. Our work takes a different viewpoint, by looking at protein motifs from the context of a protein surface. Previous methods developed in this context either only consider geometric information rather than physiological properties [Cantoni et al., 2010], are computationally expensive [Cantoni et al., 2011], or designed for particular downstream tasks [Stepniewska-Dziubinska et al., 2020]. Our molecular superpixel approach provides a task-independent segmentation utilizing both geometric and chemical features, while also being computationally efficient.
|
| 41 |
+
|
| 42 |
+
# 3 Multi-Scale Protein Representation
|
| 43 |
+
|
| 44 |
+
In this section, we describe our multi-scale graph construction and the associated encoder. Figure 1 illustrates the main principles of HOLOPROT. We represent a protein $\mathcal { P }$ as a graph $\mathcal { G } _ { \mathcal { P } }$ with two layers capturing different scales:
|
| 45 |
+
|
| 46 |
+
(i.) Surface layer. This layer captures the coarser representation details of a protein. The protein surface is generated using the triangulation software MSMS [Connolly, 1983, Sanner et al., 1996]. We represent this layer as a graph $\mathcal { G } _ { S }$ , where each surface node $u _ { \cal S }$ has a feature vector $\mathbf { f } _ { u _ { S } }$ denoting its charge, hydrophobicity and local curvature [Gainza et al., 2020]. Two surface nodes $( u _ { S } , v _ { S } )$ have an edge if they are part of a triangulation. Each surface node additionally has a residue identifier $r$ , indicating the amino acid residue it corresponds to. Multiple surface nodes can have the same residue identifier.
|
| 47 |
+
(ii.) Structure layer. This layer captures the finer representation details of a protein. A protein typically has four structural levels: (i.) primary structure (sequence), (ii.) secondary structure $\alpha$ -helices and $\beta$ -sheets), (iii.) tertiary structure (3D structure) and (iv.) quaternary structure (complexes) [Fout et al., 2017]. We represent this layer as a graph $\mathcal { G } _ { B }$ , where each node $u _ { B }$ corresponds to a residue $r$ . Two nodes $( u _ { B } , v _ { B } )$ have an edge in $\mathcal { G } _ { B }$ if the $\mathbf { C } _ { \alpha }$ atoms of the two nodes occur within a certain distance of each other. Distance based thresholding ensures that different structural levels are implicitly captured in the neighborhood of a node $u _ { B }$ .
|
| 48 |
+
|
| 49 |
+
We further introduce edges from the surface layer to the structure layer in order to propagate information between them. Specifically, we introduce a directed edge between a surface node $u _ { \mathcal { S } }$ and a backbone node $u _ { B }$ if they both have the same residue identifier $r$ . Typically, we have between 20-40 surface nodes $\{ u _ { \mathcal { S } } \}$ that map to the same structure node $u _ { B }$ . This gives us the multi-scale graph which is then encoded by our multi-scale message passing network. Details on the features used for both the structure and surface layer can be found in Appendix ??.
|
| 50 |
+
|
| 51 |
+
# 3.1 Multi-Scale Encoder
|
| 52 |
+
|
| 53 |
+
Our multi-scale message passing network uses one message passing neural network (MPN) for each layer in the multi-scale graph [Lei et al., 2017, Gilmer et al., 2017]. This allows us to learn structured representations of each scale, which can then be tied together through connections between the scales. Before detailing the remainder of the architecture, we introduce some notational preliminaries. For simplicity, we denote the MPN encoding process as $\mathbf { M P N } _ { \theta } ( \cdot )$ with parameters $\theta$ . We denote $\mathbf { M L P } _ { \theta } ( \bar { \mathbf { x } } , \mathbf { y } )$ for a multi-layer perceptron (MLP) with parameters $\theta$ , whose input is the concatenation of $\mathbf { x }$ and $\mathbf { y }$ , and $\operatorname { M L P } _ { \theta } ( \mathbf { x } )$ when the input is only $\mathbf { x }$ . We also denote the residue identifier of a node $u$ with $\operatorname { i d } ( u )$ , and the neighbors of a node $u$ as $\mathcal { N } ( u )$ . The details of the MPN architecture are listed in the Appendix ??.
|
| 54 |
+
|
| 55 |
+
# 3.1.1 Surface Message Passing Network
|
| 56 |
+
|
| 57 |
+
We first encode the surface layer $\mathcal { G } _ { S }$ of the multi-scale protein graph $\mathcal { G } _ { \mathcal { P } }$ . The inputs to the MPN are node features $\mathbf { f } _ { u _ { S } }$ and edge features $\mathbf { f } _ { u _ { S } v _ { S } }$ of $\mathcal { G } _ { S }$ . For more details on the input features used for surface nodes and edges, refer to Appendix ??. The MPN (with parameters $\theta _ { S }$ ) propagates messages between the nodes for $K$ iterations, and outputs a representation $h _ { u s }$ for each surface node $u _ { \cal S }$ ,
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\{ \mathbf h _ { u _ { S } } \} = \mathrm { M P N } _ { \theta _ { S } } ( \mathcal G _ { S } , \{ \mathbf f _ { u _ { S } } \} , \{ \mathbf f _ { u _ { S } v _ { S } } \} _ { v _ { S } \in \mathcal N ( u _ { S } ) } ) .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
# 3.1.2 Structure Message Passing Network
|
| 64 |
+
|
| 65 |
+
For each node $u _ { B }$ in the structure layer $\mathcal { G } _ { B }$ , we first prepare the input to the MPN (with parameters $\theta _ { B } ,$ ) by using an MLP (with parameters $\theta$ ) on the concatenated version of its initial features $\mathbf { f } _ { u B }$ and the mean of the surface node vectors with the same residue identifier $S = \{ \mathbf { h } _ { u _ { s } } | \mathrm { i d } ( u _ { S } ) = \mathrm { i d } ( \bar { u } _ { B } ) \}$
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r } { { \bf x } _ { u s } = \mathrm { M L P } _ { \theta } \big ( { \bf f } _ { u s } , \Sigma _ { s } { \bf h } _ { u _ { S } } \big / | S | \big ) . } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Given the edge features $\mathbf { f } _ { u B v s }$ , we then run $K$ iterations of message passing, to compute the representations $\mathbf { h } _ { u _ { B } }$ for each structure node $u _ { B }$ ,
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { \{ \mathbf { h } _ { u _ { B } } \} = \mathrm { M P N } _ { \theta _ { B } } ( \mathcal G _ { B } , \{ \mathbf { x } _ { u _ { B } } \} , \{ \mathbf { f } _ { u _ { B } v _ { B } } \} _ { v _ { B } \in \mathcal N ( u _ { B } ) } ) . } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
The graph representation $\mathbf { c } _ { \mathcal { G } _ { \mathcal { P } } }$ is an aggregation of structure node representations,
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathbf { c } _ { \mathcal { G } _ { \mathcal { P } } } = \sum _ { u _ { B } \in \mathcal { G } _ { B } } \mathbf { h } _ { u _ { B } } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
# 3.2 Task Specific Training
|
| 84 |
+
|
| 85 |
+
This multi-scale encoding allows us to learn a structured representation of a protein tying different scales together, which can then be utilized for any downstream task. In this work, we evaluate our method on two rather distinct tasks (i.) protein-ligand binding affinity regression, and (ii.) enzyme– catalyzed reaction classification. The architectural details for both downstream tasks are described below. These modules can be adapted and modified in order to utilize HOLOPROT for other use cases.
|
| 86 |
+
|
| 87 |
+
# 3.2.1 Protein-Ligand Binding Affinity
|
| 88 |
+
|
| 89 |
+
Protein-ligand binding affinity prediction depends on the interaction of a protein, encoded using the HOLOPROT framework, and a corresponding ligand, in most cases small molecules. To encode the ligand represented as a graph $\mathcal { G } _ { \mathcal { L } }$ , we use another MPN (with parameters $\theta _ { \mathcal { L } }$ ) and aggregate its node representations to obtain a graph representation $c _ { \mathcal { G } _ { \mathcal { L } } }$ . We concatenate the graph representations $\mathbf { c } _ { \mathcal { G } _ { \mathcal { P } } }$ (Equation 1) of the protein and $c _ { \mathcal { G } _ { \mathcal { L } } }$ of the ligand, and use that as input to a MLP (with parameters $\phi$ ) to obtain predictions,
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
s _ { a } = \mathrm { M L P } _ { \phi } ( c _ { \mathcal { G } _ { \mathcal { P } } } , c _ { \mathcal { G } _ { \mathcal { L } } } ) .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
The model is trained by minimizing the mean squared error.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 2: Molecular Superpixels and Surface Features of the HIV-1 Protease (PDB ID: 2AVQ). a. Molecular superpixels, indicated by different colors $k = 2 0$ ), and the corresponding surface features, i.e., b. hydropathy, c. shape index, and d. free electrons. As highlighted, molecular superpixels are spatially compact and overlap with surface regions dominated by single features such as hydrophobic patches while capturing coherent areas across all surface features. The protein complex contains 198 residues.
|
| 99 |
+
|
| 100 |
+
# 3.2.2 Enzyme-Catalyzed Reaction Classification
|
| 101 |
+
|
| 102 |
+
To predict the enzyme-catalyzed reaction class, we use the graph representation $\mathbf { c } _ { \mathcal { G } _ { \mathcal { P } } }$ of the protein obtained via HOLOPROT as the input to a MLP (with parameters $\phi$ ) to obtain the prediction logits,
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
p _ { k } = \mathrm { M L P } _ { \phi } ( c _ { \mathcal { G } } ) .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
The model is trained by minimizing the cross-entropy loss.
|
| 109 |
+
|
| 110 |
+
# 4 Superpixels on Molecular Surfaces
|
| 111 |
+
|
| 112 |
+
Protein surface manifolds are complex and represented via large meshes. In order to improve the computational and memory efficiency of our construction, we introduce the notion of molecular superpixels. Originally developed in computer vision [Ren and Malik, 2003, Mori et al., 2004, Kohli et al., 2009], superpixels are defined as perceptually uniform regions in the image. In the molecular context, we refer to superpixels as segments on the protein surface capturing higher-level fingerprint features and protein motifs such as hydrophobic binding sites.
|
| 113 |
+
|
| 114 |
+
In order to apply the segmentation principle to three-dimensional molecular surfaces, we employ graph-based superpixel algorithms on triangulated surface meshes. The superpixel representation of the protein surface needs to satisfy several requirements, as (i.) molecular superpixels should not reduce the overall achievable performance of HOLOPROT, and (ii.) molecular superpixels need to form geometrically compact clusters, and overlap with surface regions that are coherent in physiological surface properties, e.g., capture hydrophobic binding sides or highly charged areas. Popular graph-based segmentation tools such as Felzenszwalb and Huttenlocher [2004, FH], mean shift [Comaniciu and Meer, 2002], and watershed [Vincent and Soille, 1991], however, produce non-compact superpixels of irregular sizes and shapes. By posing the segmentation task as a maximization problem on a graph maximizing over (i.) the entropy rate of the random walk on the surface graph $\bar { \mathcal { G } } s = ( \gamma _ { S } , \mathcal { E } _ { S } )$ favoring the formation of compact and homogeneous clusters, and (ii.) a balancing term encouraging clusters with similar sizes, the entropy rate superpixel (ERS) segmentation algorithm [Liu et al., 2011] outperforms previous methods across different tasks [Stutz et al., 2018] and achieves the desired properties of molecular superpixels.
|
| 115 |
+
|
| 116 |
+
In order to incorporate geometric and chemical features of the surface $\mathbf { F } _ { S }$ , we extend the surface graph $\mathcal { G } _ { S } = ( \nu _ { S } , \mathcal { E } _ { S } )$ with a non-negative similarity measure $w$ , given as $\begin{array} { r } { w _ { i j } = \sum _ { \mathbf { f } \in \mathbf { F } _ { \mathcal { S } } } | \mathbf { f } _ { v _ { i } } \mathbf { f } _ { v _ { j } } | } \end{array}$ for nodes $v _ { i }$ and $v _ { j }$ if connected by an edge $e _ { i j }$ . We simulate a random walk $\mathbf { X } = \{ X _ { t } | t \in T , X _ { t } \in \mathcal { V } _ { S } \}$ on a protein surface mesh, where the transition probability $p _ { i j }$ between two nodes $v _ { i }$ and $v _ { j }$ is defined as $p _ { i j } = P ( X _ { t + 1 } = v _ { j } | X _ { t } = v _ { i } ) = w _ { i j } / w _ { i }$ , where $\begin{array} { r } { \boldsymbol { w } _ { i } = \sum _ { k : e _ { i k } \in \mathcal { E } _ { S } } \boldsymbol { w } _ { i k } } \end{array}$ .The corresponding stationary distributions of nodes $\gamma _ { s }$ are given by
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\pmb { \mu } = \left( \mu _ { 1 } , \mu _ { 2 } , . . . , \mu _ { | \mathcal { V } s | } \right) ^ { \top } = \left( \frac { w _ { 1 } } { w _ { T } } , \frac { w _ { 2 } } { w _ { T } } , . . . , \frac { w _ { | \mathcal { V } s | } } { w _ { T } } \right) ^ { \top } .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
Molecular superpixels are then defined by a subset of edges $\mathcal { M } \subseteq \mathcal { E } _ { S }$ such that the resulting graph, $\mathcal { G } _ { S } = ( \nu _ { S } , \bar { \mathcal { M } } )$ , contains exactly $k$ connected subgraphs. Computing molecular superpixels is achieved via optimizing the objective function with respect to the edge set $\mathcal { M }$
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\operatorname* { m a x } _ { \mathcal { M } } - \sum _ { i } \mu _ { i } \sum _ { j } p _ { i j } ( \mathcal { M } ) \log \left( p _ { i j } ( \mathcal { M } ) \right) - \sum _ { i } p _ { Z _ { \mathcal { M } } } ( i ) \log \left( p _ { Z _ { \mathcal { M } } } ( i ) \right) - n _ { \mathcal { M } }
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
# s.t. $\mathcal { M } \subseteq \mathcal { E } _ { S }$ and $n _ { \mathcal { M } } \geq k$ ,
|
| 129 |
+
|
| 130 |
+
where $n _ { \mathcal { M } }$ is the number of connected components in the graph, $p _ { Z _ { \mathcal { M } } }$ denotes the distribution of cluster memberships $Z _ { \mathcal { M } }$ , and $\lambda \geq 0$ is the weight of the balancing term. Both terms satisfy monotonicity and submodularity and can thus be efficiently optimized based on techniques from submodular optimization [Nemhauser et al., 1978]. For further details on the entropy rate superpixel algorithm, see Liu et al. [2011].
|
| 131 |
+
|
| 132 |
+
A molecular superpixel $m$ comprising $k$ surface vertices is then given as $\mathbf { f } _ { m } = ( \mathbf { f } _ { v _ { 1 } } , \ldots , \mathbf { f } _ { v _ { k } } )$ for all f $\in \mathbf { F } _ { \mathcal { S } }$ . We summarize the feature representation of each molecular superpixel via the graph $\mathcal { G _ { M } } = ( \nu _ { \mathcal { M } } , \mathcal { E _ { M } } )$ , where each node $m \in \mathcal { V } _ { \mathcal { M } }$ is represented via $( \mathrm { m e a n } ( \mathbf { f } _ { m } )$ , std $( \mathbf { f } _ { m } )$ , $\mathtt { m a x } ( \mathbf { f } _ { m } )$ $\mathfrak { m i n } ( \mathbf { f } _ { m } ) )$ for all $\mathbf { f } \in \mathbf { F } _ { \mathcal { S } }$ and an edge $e \in \mathcal { E } _ { \mathcal { M } }$ via the Wasserstein distance between neighboring superpixels.
|
| 133 |
+
|
| 134 |
+
Figure 2 demonstrates molecular superpixels for the enzyme HIV-1 protease [Brik and Wong, 2003]. Besides being spatially compact, superpixels overlap with surface regions dominated by single features such as hydrophobic patches, while capturing coherent areas across all surface features. Further examples of superpixels are displayed in Appendix ??.
|
| 135 |
+
|
| 136 |
+
# 5 Evaluation
|
| 137 |
+
|
| 138 |
+
Successful protein engineering requires optimization of multiple objectives. When searching for a protein with desired functionality, auxiliary but crucial properties such as stability measured in terms of free energy of folding also need to be satisfied. Furthermore, the field is also subject to a plethora of potential tasks and applications. In order to capture the multi-objective and multi-task nature of protein engineering, we evaluate our method on two representative tasks: regression of the binding affinity between proteins and their ligands, and classification of enzyme proteins based on the type of reaction they catalyze.
|
| 139 |
+
|
| 140 |
+
# 5.1 Protein-Ligand Binding Affinity Prediction
|
| 141 |
+
|
| 142 |
+
Studying the interaction between proteins and small molecules is crucial for many downstream tasks, e.g., accelerating virtual screening for potential candidates in drug discovery or protein design to improve the output of an enzyme-catalyzed reaction. The architecture of the regression module is described in Equation 2.
|
| 143 |
+
|
| 144 |
+
Dataset. The PDBBIND database (version 2019) [Liu et al., 2017] is a collection of the experimentally measured binding affinity data for all types of biomolecular complexes deposited in the Protein Data Bank [Berman et al., 2000]. After quality filtering for resolution and surface construction, the refined subset comprises a total of 4, 709 biomolecular complexes. The binding affinity provided in PDBBIND is experimentally determined and expressed in molar units of the inhibition constant $( K _ { i } )$ or dissociation constant $( K _ { d } )$ . Similar to previous methods [Öztürk et al., 2018, Townshend et al., 2020], we do not distinguish both constants and predict negative log-transformed binding affinity $p K _ { d } / p K _ { i }$ . We split the dataset into training, test and validation splits based on the scaffolds of the corresponding ligands (scaffold), or a $30 \%$ and a $60 \%$ sequence identity threshold (identity $30 \%$ , identity $60 \%$ ) to limit homologous ligands or proteins appearing in both train and test sets.
|
| 145 |
+
|
| 146 |
+
Baselines. For evaluating the overall performance on the regression task, we compare HOLOPROT against several baselines including current state-of-the-art methods on both tasks. This comprises sequence-based methods [Öztürk et al., 2018, Rao et al., 2019, Bepler and Berger, 2019, Elnaggar et al., 2020] as well as methods based on the three-dimensional structure of proteins [Townshend et al., 2020, Hermosilla et al., 2021], and recent methods using geometric deep learning on protein molecular surfaces [Gainza et al., 2020].
|
| 147 |
+
|
| 148 |
+
Table 1: Protein-Ligand Binding Affinity Prediction Results Comparison predictive performance of ligand binding affinity using the PDBbind dataset [Liu et al., 2017] of HOLOPROT against other methods. Results are reported for 3 experimental runs.
|
| 149 |
+
|
| 150 |
+
<table><tr><td>Model</td><td>#Params</td><td colspan="3">Sequence Identity (30 %)</td><td colspan="3">Sequence Identity (60 %)</td></tr><tr><td></td><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td><td>RMSE</td><td>Pearson</td><td>Spearman</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Ozturk et al. [2018]</td><td>1.93M</td><td>1.866 ± 0.080</td><td>0.472 ± 0.022</td><td>0.471 ± 0.024</td><td>1.762 ± 0.261</td><td>0.666 ± 0.012</td><td>0.663 ± 0.015</td></tr><tr><td>Bepler and Berger [2019]</td><td>48.8M 93.0M</td><td>1.985 ± 0.006</td><td>0.165 ± 0.006</td><td>0.152 ± 0.024</td><td>1.891 ± 0.004</td><td>0.249 ± 0.006</td><td>0.275 ± 0.008</td></tr><tr><td>Rao et al. [2019]</td><td>2.4M1</td><td>1.890 ± 0.035 1.544 ± 0.015</td><td>0.338 ± 0.044</td><td>0.286 ± 0.124 0.434± 0.058</td><td>1.633 ± 0.016 1.641 ± 0.016</td><td>0.568± 0.033</td><td>0.571 ± 0.021</td></tr><tr><td>Elnaggar et al.[2020] Surface-based Methods</td><td></td><td></td><td>0.438 ± 0.053</td><td></td><td></td><td>0.595 ± 0.014</td><td>0.588 ± 0.009</td></tr><tr><td>Gainza et al. [2020]</td><td>0.62M</td><td>1.484 ± 0.018</td><td>0.467 ± 0.020</td><td>0.455 ± 0.014</td><td>1.426 ± 0.017</td><td>0.709 ±0.008</td><td>0.701 ± 0.011</td></tr><tr><td>Structure-based Methods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Townshend et al. [2020]2</td><td></td><td>1.429 ± 0.042</td><td>0.541 ± 0.029</td><td>0.532 ± 0.033</td><td>1.450 ± 0.024</td><td>0.716 ± 0.008</td><td>0.714 ± 0.009</td></tr><tr><td>Townshend et al.[2020]3</td><td>5.80M</td><td>1.936 ± 0.120 1.554 ± 0.016</td><td>0.581 ± 0.039 0.414 ± 0.053</td><td>0.647± 0.071</td><td>1.493 ± 0.010 1.473 ± 0.024</td><td>0.669 ± 0.013</td><td>0.691± 0.010</td></tr><tr><td>Hermosilla et al. [2021]</td><td></td><td></td><td></td><td>0.428 ±0.032</td><td></td><td>0.667 ± 0.011</td><td>0.675 ± 0.019</td></tr><tr><td>HOLOPROT (O)</td><td>1.44 M</td><td>1.464 ± 0.006</td><td>0.509 ± 0.002</td><td>0.500 ± 0.005</td><td>1.365 ± 0.038</td><td>0.749 ± 0.014</td><td>0.742 ± 0.011</td></tr><tr><td>HOLOPROT()</td><td>1.76 M</td><td>1.491 ± 0.004</td><td>0.491 ± 0.014</td><td>0.482 ± 0.017</td><td>1.416 ± 0.022</td><td>0.724 ± 0.011</td><td>0.715 ± 0.006</td></tr></table>
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Model</td><td>#Params</td><td colspan="3">Scaffold</td></tr><tr><td></td><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td><td></td><td></td></tr><tr><td>Ozturk et al. [2018]</td><td>1.93 M</td><td>1.908 ± 0.145</td><td>0.384 ± 0.014</td><td>0.387 ± 0.016</td></tr><tr><td>Bepler and Berger [2019]</td><td>48.8M</td><td>1.864 ± 0.009</td><td>0.269 ±0.002</td><td>0.285 ± 0.019</td></tr><tr><td>Rao et al. [2019]</td><td>93.0M</td><td>1.680 ± 0.055</td><td>0.487 ± 0.029</td><td>0.462 ± 0.051</td></tr><tr><td>Elnaggar et al. [2020]</td><td>2.4M1</td><td>1.592 ± 0.009</td><td>0.398 ± 0.027</td><td>0.409 ± 0.029</td></tr><tr><td>Surface-based Methods Gainza et al. [2020]</td><td>0.62 M</td><td>1.583 ± 0.132</td><td>0.416 ± 0.111</td><td>0.412 ± 0.126</td></tr><tr><td>Structure-based Methods</td><td></td><td></td><td></td><td></td></tr><tr><td>Hermosilla et al. [2021]</td><td>5.80M</td><td>1.592 ± 0.012</td><td>0.365 ± 0.024</td><td>0.373 ± 0.019</td></tr><tr><td>HOLOPROT (O)</td><td>1.44 M</td><td>1.523 ± 0.028</td><td>0.489 ± 0.019</td><td>0.491 ± 0.020</td></tr><tr><td>HOLOPROT()</td><td>1.28M</td><td>1.516 ± 0.014</td><td>0.491 ± 0.016</td><td>0.493 ± 0.014</td></tr></table>
|
| 153 |
+
|
| 154 |
+
full surface molecular superpixels
|
| 155 |
+
|
| 156 |
+
Evaluation metrics. For evaluating different methods, we use three metrics – root mean squared error (RMSE), Pearson correlation coefficient, and Spearman correlation coefficient. We also include the mean and standard deviation across 3 experimental runs.
|
| 157 |
+
|
| 158 |
+
Results. Table 1 displays the results on protein-ligand binding affinity. HOLOPROT $( \circ , \bullet )$ performs consistently well across different tasks and dataset splits, outperforming all methods on the splits scaffold and identity $60 \%$ . On identity $30 \%$ , our method outperforms most baselines, while having lower variability across the evaluated metrics. HOLOPROT with molecular superpixels $( \bullet )$ performs similar to HOLOPROT on the entire surface, with no or little performance loss, suggesting that molecular superpixels capture meaningful biological motifs. We include the models from [Townshend et al., 2020] for completeness, but note that these models were trained only using the protein binding pocket. Binding sites on proteins are often structurally highly conserved regions [Panjkovich and Daura, 2010]. Considering only binding pockets, which vary less between the train and test splits, provides an additional simplification making the task less challenging. All other baselines were tested on the full proteins.
|
| 159 |
+
|
| 160 |
+
# 5.2 Enzyme-Catalyzed Reaction Classification
|
| 161 |
+
|
| 162 |
+
Predicting the reaction class of enzymes without the use of sequence similarity allows for efficient screening of de novo proteins, i.e., macromolecules without evolutionary homologs, for catalytic properties [des Jardins et al., 1997]. The architecture of the classification module is described in Equation 3).
|
| 163 |
+
|
| 164 |
+
Table 2: Enzyme-Catalyzed Reaction Classification Results Comparison of classification accuracy of HOLOPROT against other methods.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Reaction Class Accuracy</td></tr><tr><td>Sequence-based Methods</td><td></td><td></td></tr><tr><td>Hou et al. [2018]</td><td>41.7M</td><td>70.9 %</td></tr><tr><td>Bepler and Berger [2019]</td><td>31.7 M</td><td>66.7 %</td></tr><tr><td>Rao et al.[2019] (Transformer)</td><td>38.4M</td><td>69.8 %</td></tr><tr><td>Elnaggar et al. [2020]</td><td>420.0M</td><td>72.2 %</td></tr><tr><td>Structure-basedMethods</td><td></td><td></td></tr><tr><td>Kipf and Welling [2017]</td><td>1.0 M</td><td>67.3 %</td></tr><tr><td>Derevyanko et al. [2018]</td><td>6.0M</td><td>78.8 %</td></tr><tr><td>Hermosilla et al. [2021]</td><td>9.8M</td><td>87.2 %</td></tr><tr><td>HOLOPROT(O)</td><td>0.64M</td><td>77.8 %</td></tr><tr><td>HOLOPROT()</td><td>0.64 M</td><td>78.9 %</td></tr></table>
|
| 167 |
+
|
| 168 |
+
full surface molecular superpixels
|
| 169 |
+
|
| 170 |
+
Dataset. Enzyme Commission (EC) numbers constitute an ontological system with the purpose of defining and organizing enzyme functions [Webb, 1992]. The four digits of an EC number are related in a functional hierarchy, where the first level annotates the main enzymatic classes, while the next levels constitute subclasses, e.g. the EC number of the HIV-1 protease is 3.4.23.16. This task aims at predicting the enzyme-catalyzed reaction class of a protein based on according to all four levels of the EC number. We use the same dataset and splits as provided by [Hermosilla et al., 2021], comprising 37, 428 proteins from 384 EC numbers, with 29, 215 instances for training, 2, 562 instances for validation, and 5, 651 for testing. For more details on dataset construction, we refer to Hermosilla et al. [2021, Appendix C].
|
| 171 |
+
|
| 172 |
+
Baselines. For the classification task, we again compare HOLOPROT against several baselines including sequence-based methods [Hou et al., 2018], methods partially pretrained on millions of sequences [Rao et al., 2019, Bepler and Berger, 2019, Elnaggar et al., 2020] as well as methods utilizing principles of geometric deep learning [Kipf and Welling, 2017, Derevyanko et al., 2018, Hermosilla et al., 2021]. The values for different baselines are taken from [Hermosilla et al., 2021].
|
| 173 |
+
|
| 174 |
+
Evaluation metric. Model performance is measured via the mean accuracy score.
|
| 175 |
+
|
| 176 |
+
Results. We report the results of enzyme-catalyzed reaction classification in Table 2. While our method $( \circ , \bullet )$ is unable to outperform the current state-of-the-art method [Hermosilla et al., 2021], we achieve equivalent, if not better results to other methods at a fraction of the parameters used. Molecular superpixels also capture biologically meaningful protein surface motifs, as evidenced by a small increase in the overall classification performance.
|
| 177 |
+
|
| 178 |
+
# 5.3 Ablation Studies
|
| 179 |
+
|
| 180 |
+
To further evaluate the contribution of HOLOPROT to learning multi-scale protein representations, we conduct several ablation studies. First, we analyze if the performance of the multi-scale model outperforms its isolated components, i.e. when using only structure or surface representation for subsequent downstream tasks. The second ablation axis analyzes the construction of molecular superpixel representations. Besides computing summary features for each molecular superpixel as described in Section 4, we learn patch representations via a MPN on the superpixel graph. The ablation study were conducted on both tasks, ligand binding affinity (Section 5.1) and enzyme catalytic function classification (Section 5.2).
|
| 181 |
+
|
| 182 |
+
As displayed in Table 3, HOLOPROT with $( \bullet )$ and without molecular superpixels ( ) improve over the performance of structure and surface representations. Further, the results of the ablation study clearly show that different protein scales are more relevant for particular downstream tasks, e.g., predicting the enzyme-catalyzed reaction class from surface only results in poor performance. We further see no
|
| 183 |
+
|
| 184 |
+
Table 3: Ablation Studies Results Evaluation of architectural design choices of HOLOPROT by analyzing the performance of its individual components as well as feature summarization of molecular superpixels.
|
| 185 |
+
|
| 186 |
+
<table><tr><td>Model</td><td colspan="3">Ligand Binding Affinity Sequence Identity (30 %)</td><td>Enzyme Class</td></tr><tr><td></td><td>RMSE</td><td>Pearson</td><td>Spearman</td><td>Accuracy</td></tr><tr><td>Structure</td><td>1.476 ± 0.027</td><td>0.51 ± 0.029</td><td>0.503 ± 0.027</td><td>74.2 %</td></tr><tr><td>Surface</td><td>1.482 ± 0.015</td><td>0.512 ± 0.022</td><td>0.505 ± 0.017</td><td>28.6 %</td></tr><tr><td>HOLOPROT(O)</td><td>1.464 ± 0.006</td><td>0.509 ± 0.002</td><td>0.500 ± 0.005</td><td>77.8 %</td></tr><tr><td>HOLOPROT()</td><td>1.491 ± 0.004</td><td>0.491 ±0.014</td><td>0.482 ± 0.017</td><td>78.9 %</td></tr><tr><td>HOLOPROT()</td><td>1.491 ± 0.027</td><td>0.503 ±0.005</td><td>0.492 ± 0.004</td><td>75.7 %</td></tr></table>
|
| 187 |
+
|
| 188 |
+
full surface ? molecular superpixels molecular superpixel with MPN
|
| 189 |
+
|
| 190 |
+
improvement in applying a MPN within a molecular superpixel ( ) over using summary features ( ).
|
| 191 |
+
Further ablation studies are presented in Appendix ??.
|
| 192 |
+
|
| 193 |
+
# 5.4 Limitations
|
| 194 |
+
|
| 195 |
+
Despite the reported success of HOLOPROT, our method faces some limitations. First, HOLOPROT relies on existing protein structures and the corresponding generated surface manifolds. However, protein sequence data still remains the most abundant data source, and in protein design, conformations of mutated macromolecules are unknown. This limitation could however be partly remedied, (i.) by the recent advancements in protein structure prediction [Senior et al., 2020, Jumper et al., 2021, AlphaFold] [Baek et al., 2021, RoseTTAFold] and protein structure determination methods such as cryo-electron microscopy [Callaway, 2020], and (ii.) by utilizing homology modeling algorithms on available wild type structures for mutant analysis [Schymkowitz et al., 2005]. Second, our method requires precomputed surface meshes, resulting in an additional preprocessing step before deploying HOLOPROT to the desired application. This bottleneck can be bypassed by utilizing techniques developed in the concurrent work by Sverrisson et al. [2020], which allow computation and sampling of the molecular surface on-the-fly.
|
| 196 |
+
|
| 197 |
+
# 6 Conclusion
|
| 198 |
+
|
| 199 |
+
In this work, we present a novel multi-scale protein graph construction, HOLOPROT, which integrates finer and coarser representation details of a protein by connecting sequence and structure with surface. We further establish molecular superpixels, which capture higher-level fingerprint motifs on the protein surface, improving the memory efficiency of our construction without reducing the overall performance. We validate HOLOPROT’s effectiveness and versatility through representative tasks on protein-ligand binding affinity and enzyme-catalyzed reaction class prediction. While being significantly more parameter-efficient, HOLOPROT performs consistently well across different tasks and dataset splits, partly outperforming current state-of-the-art methods. This will potentially be of great benefit and advantage when working with datasets of reduced size, e.g., comprising experiments on mutational fitness of proteins, thus opening up new possibilities within protein engineering and design, which we leave for future work.
|
| 200 |
+
|
| 201 |
+
# Acknowledgments
|
| 202 |
+
|
| 203 |
+
This project received funding from the Swiss National Science Foundation under the National Center of Competence in Research (NCCR) Catalysis under grant agreement 51NF40 180544. Moreover, we thank Mojmír Mutný and Clemens Isert for their valuable feedback.
|
| 204 |
+
|
| 205 |
+
# References
|
| 206 |
+
|
| 207 |
+
M. Baek, F. DiMaio, I. Anishchenko, J. Dauparas, S. Ovchinnikov, G. R. Lee, J. Wang, Q. Cong, L. N. Kinch, R. D. Schaeffer, et al. Accurate prediction of protein structures and interactions using a three-track neural network. Science, 373(6557), 2021.
|
| 208 |
+
|
| 209 |
+
F. Baldassarre, D. Menéndez Hurtado, A. Elofsson, and H. Azizpour. GraphQA: protein model quality assessment using graph convolutional networks. Bioinformatics, 37(3), 2021.
|
| 210 |
+
|
| 211 |
+
T. Bepler and B. Berger. Learning Protein Sequence Embeddings using Information From Structure. In International Conference on Learning Representations (ICLR), 2019.
|
| 212 |
+
|
| 213 |
+
H. M. Berman, J. Westbrook, Z. Feng, G. Gilliland, T. N. Bhat, H. Weissig, I. N. Shindyalov, and P. E. Bourne. The Protein Data Bank. Nucleic Acids Research, 28(1), 2000.
|
| 214 |
+
|
| 215 |
+
A. Brik and C.-H. Wong. HIV-1 protease: mechanism and drug discovery. Organic & Biomolecular Chemistry, 1(1), 2003.
|
| 216 |
+
|
| 217 |
+
E. Callaway. ’It will change everything’: DeepMind’s AI makes gigantic leap in solving protein structures. Nature, 2020.
|
| 218 |
+
|
| 219 |
+
V. Cantoni, R. Gatti, and L. Lombardi. Segmentation of SES for Protein Structure Analysis. In Bioinformatics, 2010.
|
| 220 |
+
|
| 221 |
+
V. Cantoni, R. Gatti, and L. Lombardi. 3D Protein Surface Segmentation through Mathematical Morphology. In International Joint Conference on Biomedical Engineering Systems and Technologies. Springer, 2011.
|
| 222 |
+
|
| 223 |
+
D. Comaniciu and P. Meer. Mean Shift: A Robust Approach Toward Feature Space Analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(5), 2002.
|
| 224 |
+
|
| 225 |
+
M. L. Connolly. Solvent-accessible surfaces of proteins and nucleic acids. Science, 221(4612), 1983.
|
| 226 |
+
|
| 227 |
+
A. Dalkiran, A. S. Rifaioglu, M. J. Martin, R. Cetin-Atalay, V. Atalay, and T. Dogan. ECPred: a tool ˘ for the prediction of the enzymatic functions of protein sequences based on the EC nomenclature. BMC Bioinformatics, 19(1), 2018.
|
| 228 |
+
|
| 229 |
+
G. Derevyanko, S. Grudinin, Y. Bengio, and G. Lamoureux. Deep convolutional networks for quality assessment of protein folds. Bioinformatics, 34(23), 2018.
|
| 230 |
+
|
| 231 |
+
M. des Jardins, P. D. Karp, M. Krummenacker, T. J. Lee, and C. A. Ouzounis. Prediction of enzyme classification from protein sequence without the use of sequence similarity. In Proceedings. International Conference on Intelligent Systems for Molecular Biology, volume 5, 1997.
|
| 232 |
+
|
| 233 |
+
P. D. Dobson and A. J. Doig. Predicting Enzyme Class From Protein Structure Without Alignments. Journal of Molecular Biology, 345(1), 2005.
|
| 234 |
+
|
| 235 |
+
A. Elnaggar, M. Heinzinger, C. Dallago, G. Rihawi, Y. Wang, L. Jones, T. Gibbs, T. Feher, C. Angerer, D. Bhowmik, et al. ProtTrans: Towards Cracking the Language of Life’s Code Through SelfSupervised Deep Learning and High Performance Computing. arXiv Preprint, 2020.
|
| 236 |
+
|
| 237 |
+
P. F. Felzenszwalb and D. P. Huttenlocher. Efficient Graph-Based Image Segmentation. International Journal of Computer Vision, 59(2), 2004.
|
| 238 |
+
|
| 239 |
+
M. Fessenden. Protein maps chart the causes of disease. Nature, 549(7671), 2017.
|
| 240 |
+
|
| 241 |
+
A. Fout, J. Byrd, B. Shariat, and A. Ben-Hur. Protein Interface Prediction using Graph Convolutional Networks. In Advances in Neural Information Processing Systems (NeurIPS), volume 30, 2017.
|
| 242 |
+
|
| 243 |
+
P. Gainza, F. Sverrisson, F. Monti, E. Rodola, D. Boscaini, M. Bronstein, and B. Correia. Deciphering interaction fingerprints from protein molecular surfaces using geometric deep learning. Nature Methods, 17(2), 2020.
|
| 244 |
+
|
| 245 |
+
J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, and G. E. Dahl. Neural Message Passing for Quantum Chemistry. In International Conference on Machine Learning (ICML), 2017.
|
| 246 |
+
|
| 247 |
+
V. Gligorijevic, P. D. Renfrew, T. Kosciolek, J. K. Leman, K. Cho, T. Vatanen, D. Berenberg, B. Taylor, I. M. Fisk, R. J. Xavier, R. Knight, and R. Bonneau. Structure-Based Function Prediction using Graph Convolutional Networks. Nature Communications, 12(1), 2021.
|
| 248 |
+
|
| 249 |
+
A. Golovin and K. Henrick. MSDmotif: exploring protein sites and motifs. BMC Bioinformatics, 9 (1), 2008.
|
| 250 |
+
P. Hermosilla, M. Schäfer, M. Lang, G. Fackelmann, P.-P. Vázquez, B. Kozlikova, M. Krone, T. Ritschel, and T. Ropinski. Intrinsic-Extrinsic Convolution and Pooling for Learning on 3D Protein Structures. In International Conference on Learning Representations (ICLR), 2021.
|
| 251 |
+
J. Hou, B. Adhikari, and J. Cheng. DeepSF: deep convolutional neural network for mapping protein sequences to folds. Bioinformatics, 34(8), 2018.
|
| 252 |
+
J. Jiménez, M. Skalic, G. Martinez-Rosell, and G. De Fabritiis. KDEEP: Protein–Ligand Absolute Binding Affinity Prediction via 3D-Convolutional Neural Networks. Journal of Chemical Information and Modeling, 58(2), 2018.
|
| 253 |
+
W. Jin, R. Barzilay, and T. Jaakkola. Hierarchical generation of molecular graphs using structural motifs. In International Conference on Machine Learning, pages 4839–4848. PMLR, 2020.
|
| 254 |
+
J. Jumper, R. Evans, A. Pritzel, T. Green, M. Figurnov, O. Ronneberger, K. Tunyasuvunakool, R. Bates, A. Žídek, A. Potapenko, et al. Highly accurate protein structure prediction with AlphaFold. Nature, 596(7873), 2021.
|
| 255 |
+
T. N. Kipf and M. Welling. Semi-Supervised Classification with Graph Convolutional Networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 256 |
+
P. Kohli, P. H. Torr, et al. Robust Higher Order Potentials for Enforcing Label Consistency. International Conference on Computer Vision (ICCV), 82(3), 2009.
|
| 257 |
+
T. Lei, W. Jin, R. Barzilay, and T. Jaakkola. Deriving Neural Architectures from Sequence and Graph Kernels. In International Conference on Machine Learning (ICML), 2017.
|
| 258 |
+
M.-Y. Liu, O. Tuzel, S. Ramalingam, and R. Chellappa. Entropy Rate Superpixel Segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2011.
|
| 259 |
+
Z. Liu, M. Su, L. Han, J. Liu, Q. Yang, Y. Li, and R. Wang. Forging the Basis for Developing Protein–Ligand Interaction Scoring Functions. Accounts of Chemical Research, 50(2), 2017.
|
| 260 |
+
G. Mori, X. Ren, A. A. Efros, and J. Malik. Recovering Human Body Configurations: Combining Segmentation and Recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2004.
|
| 261 |
+
G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular set functions. Mathematical programming, 14(1), 1978.
|
| 262 |
+
H. Öztürk, A. Özgür, and E. Ozkirimli. DeepDTA: deep drug–target binding affinity prediction. Bioinformatics, 34(17), 2018.
|
| 263 |
+
A. Panjkovich and X. Daura. Assessing the structural conservation of protein pockets to study functional and allosteric sites: implications for drug discovery. BMC structural biology, 10(1): 1–14, 2010.
|
| 264 |
+
M. Ragoza, J. Hochuli, E. Idrobo, J. Sunseri, and D. R. Koes. Protein–ligand scoring with convolutional neural networks. Journal of chemical information and modeling, 57(4):942–957, 2017.
|
| 265 |
+
R. Rao, N. Bhattacharya, N. Thomas, Y. Duan, X. Chen, J. Canny, P. Abbeel, and Y. S. Song. Evaluating Protein Transfer Learning with TAPE. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 266 |
+
X. Ren and J. Malik. Learning a Classification Model for Segmentation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2003.
|
| 267 |
+
M. F. Sanner, A. J. Olson, and J.-C. Spehner. Reduced Surface: An Efficient Way to Compute Molecular Surfaces. Biopolymers, 38(3), 1996.
|
| 268 |
+
J. Schymkowitz, J. Borg, F. Stricher, R. Nys, F. Rousseau, and L. Serrano. The FoldX web server: an online force field. Nucleic Acids Research, 33, 2005.
|
| 269 |
+
A. W. Senior, R. Evans, J. Jumper, J. Kirkpatrick, L. Sifre, T. Green, C. Qin, A. Žídek, A. W. Nelson, A. Bridgland, et al. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792), 2020.
|
| 270 |
+
M. M. Stepniewska-Dziubinska, P. Zielenkiewicz, and P. Siedlecki. Improving detection of proteinligand binding sites with 3d segmentation. Scientific Reports, 10(1), 2020.
|
| 271 |
+
D. Stutz, A. Hermans, and B. Leibe. Superpixels: An evaluation of the state-of-the-art. Computer Vision and Image Understanding, 166, 2018.
|
| 272 |
+
F. Sverrisson, J. Feydy, B. Correia, and M. Bronstein. Fast end-to-end learning on protein surfaces. bioRxiv, 2020.
|
| 273 |
+
R. Townshend, R. Bedi, P. Suriana, and R. Dror. End-to-End Learning on 3D Protein Structure for Interface Prediction. Advances in Neural Information Processing Systems (NeurIPS), 32, 2019.
|
| 274 |
+
R. J. Townshend, M. Vögele, P. Suriana, A. Derry, A. Powers, Y. Laloudakis, S. Balachandar, B. Anderson, S. Eismann, R. Kondor, et al. ATOM3D: Tasks On Molecules in Three Dimensions. NeurIPS Workshop of Learning Meaningful Representations of Life (LMRL), 2020.
|
| 275 |
+
L. Vincent and P. Soille. Watersheds in Digital Spaces: An Efficient Algorithm Based on Immersion Simulations. IEEE Computer Architecture Letters, 13(06), 1991.
|
| 276 |
+
E. C. Webb. Enzyme Nomenclature 1992. Recommendations of the Nomenclature Committee of the International Union of Biochemistry and Molecular Biology on the Nomenclature and Classification of Enzymes. Academic Press, 1992.
|
| 277 |
+
K. K. Yang, Z. Wu, and F. H. Arnold. Machine-learning-guided directed evolution for protein engineering. Nature Methods, 16(8), 2019.
|
md/train/2-0wS9-cSL/2-0wS9-cSL.md
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Robustifying $\ell _ { \infty }$ Adversarial Training to the Union of Perturbation Models
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Classical adversarial training (AT) frameworks are designed to achieve high ad
|
| 11 |
+
2 versarial accuracy against a single attack type, typically $\ell _ { \infty }$ norm-bounded per
|
| 12 |
+
3 turbations. Recent extensions in AT have focused on defending against the union
|
| 13 |
+
4 of multiple perturbation models but this benefit is obtained at the expense of a
|
| 14 |
+
5 significant (up to $1 0 \times$ ) increase in training complexity over single-attack $\ell _ { \infty }$ AT.
|
| 15 |
+
6 In this work, we expand the capabilities of widely popular single-attack $\ell _ { \infty }$ AT
|
| 16 |
+
7 frameworks to provide robustness to the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations while
|
| 17 |
+
8 preserving their training efficiency. Our technique, referred to as Shaped Noise
|
| 18 |
+
9 Augmented Processing (SNAP), exploits a well-established byproduct of single
|
| 19 |
+
10 attack AT frameworks – the reduction in the curvature of the decision boundary of
|
| 20 |
+
11 networks. SNAP prepends a given deep net with a shaped noise augmentation layer
|
| 21 |
+
12 whose distribution is learned along with network parameters using any standard
|
| 22 |
+
13 single-attack AT. As a result, SNAP enhances adversarial accuracy of ResNet-18
|
| 23 |
+
14 on CIFAR-10 against the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations by $1 \dot { 4 } \%$ -to- $2 0 \%$ for
|
| 24 |
+
15 four state-of-the-art (SOTA) single-attack $\ell _ { \infty }$ AT frameworks, and, for the first
|
| 25 |
+
16 time, establishes a benchmark for ResNet-50 and ResNet-101 on ImageNet.
|
| 26 |
+
|
| 27 |
+
# 17 1 Introduction
|
| 28 |
+
|
| 29 |
+
18 Today adversarial training (AT) provides state-of-the-art (SOTA) empirical defense against adver
|
| 30 |
+
19 sarial perturbations. For this, adversarial perturbations are used during training to optimize a robust
|
| 31 |
+
20 loss function [20, 41, 30, 35]. Early AT frameworks [20, 41] were $7 \times$ -to- $1 0 \times$ more computationally
|
| 32 |
+
21 demanding than vanilla training. More recent works [30, 35, 40] have significantly reduced the
|
| 33 |
+
22 computational demands of AT via single-step attacks and superconvergence.
|
| 34 |
+
23 However, today’s AT frameworks predominantly focus on a single-attack, i.e., they seek robustness
|
| 35 |
+
24 to a single perturbation, typically $\ell _ { \infty }$ -bounded [30, 35, 37, 41, 43, 40, 39, 26, 9, 34, 42, 10, 11, 14].
|
| 36 |
+
25 This results in low performance against other perturbations such as $\ell _ { 2 } , \ell _ { 1 }$ , or the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ .
|
| 37 |
+
26 Indeed, as showemploying only $\ell _ { \infty }$ Fig. 1, four state-of-the-art (SOTA) single-attack AT fra-bounded perturbations achieve low adversarial accuracy ${ \mathcal { A } } _ { \mathrm { a d v } } ^ { ( U ) }$ rksof $\approx 1 5 \%$ mar-to- $2 0 \%$
|
| 38 |
+
28 against the union of perturbations. Recent extensions in AT [21, 32, 18] do seek higher
|
| 39 |
+
29 A(U) but only at the expense of $6 \times$ -to- $. 1 0 \times$ increase in the total training time (blue markers in
|
| 40 |
+
30 Fig. 1). The large training time of these AT frameworks has inhibited their application to large-scale
|
| 41 |
+
31 datasets such as ImageNet, e.g., Maini et al. [21], Tramèr & Boneh [32] show results for MNIST and
|
| 42 |
+
32 CIFAR-10 only, while Laidlaw et al. [18] only additionally show $6 4 \times 6 4$ ImageNet-100 results.
|
| 43 |
+
33 The high training time for AT frameworks arises from two sources: (i) the need to employ larger
|
| 44 |
+
34 networks, e.g., MSD [21] with ResNet-18 achieves higher $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ than PAT [18] with ResNet-50 (see
|
| 45 |
+
35 Fig. 1); and (ii) the need to incorporate multiple perturbations during each attack step and a higher
|
| 46 |
+
36 overall number of attack steps, e.g., 50 in MSD [21], 20 in AVG [32]. Obviously one can always
|
| 47 |
+
37 reduce the number of attack steps in MSD/AVG to proportionally reduce training time. Doing so
|
| 48 |
+
38 results in training time and $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ to rapidly approach the training complexity and $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \bar { U } ) }$ of standard AT
|
| 49 |
+
39 frameworks, e.g., a 5-step MSD and 2-step AVG is equivalent in training time and accuracy to PGD
|
| 50 |
+
40 and TRADES, respectively. Notwithstanding the expensive nature of 50-step multi-attack training,
|
| 51 |
+
41 today MSD [21] achieves a SOTA $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ of $47 \%$ with ResNet-18 on CIFAR-10.
|
| 52 |
+
42 This poses a question: can we approach the high
|
| 53 |
+
43 robustness of multiple-attack AT such as 50-step
|
| 54 |
+
44 MSD against the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations
|
| 55 |
+
45 while maintaining the low training time of fast single
|
| 56 |
+
46 attack AT frameworks such as FreeAdv [30] and Fas
|
| 57 |
+
47 tAdv [35]?
|
| 58 |
+
48 In our quest to answer this question we find that noise
|
| 59 |
+
49 augmentation using adequately shaped noise within
|
| 60 |
+
50 standard single-attack AT frameworks employing $\ell _ { \infty }$ -
|
| 61 |
+
51 bounded perturbations significantly improves robust
|
| 62 |
+
52 ness against the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations.
|
| 63 |
+
53 The improvement appears to be a consequence of a
|
| 64 |
+
54 well-established byproduct of AT frameworks – the
|
| 65 |
+
55 reduction in the curvature of the decision boundary of
|
| 66 |
+
56 networks trained using single-attack AT [6, 23]. We
|
| 67 |
+
57 confirm this connection by quantifying the impact
|
| 68 |
+
58 of single-attack AT on the geometric orientations of
|
| 69 |
+
59 different perturbations.
|
| 70 |
+
60 Based on this insight, we propose Shaped Noise
|
| 71 |
+
61 Augmented Processing (SNAP) – a method to en
|
| 72 |
+
62 hance robustness against the union of perturbation types by augmenting single-attack AT frameworks.
|
| 73 |
+
63 SNAP prepends a deep net with a shaped noise (SN) augmentation layer (see Fig. 4) whose dis
|
| 74 |
+
64 tribution parameter $\Sigma$ is learned with that of the network $\mathbf { \eta } ^ { ( \theta ) }$ within any standard single-attack AT
|
| 75 |
+
65 framework. SNAP improves the robustness of four SOTA $\ell _ { \infty }$ -AT frameworks against the union of
|
| 76 |
+
66 $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations by $15 \%$ -to- $20 \%$ on CIFAR-10 (red markers in Fig. 1) with only a modest
|
| 77 |
+
67 $( \sim 1 0 \% )$ increase in training time. This expands the capabilities of widely popular single-attack $\ell _ { \infty }$
|
| 78 |
+
68 AT frameworks to providing robustness to the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations without sacrificing
|
| 79 |
+
69 training efficiency. We validate SNAP’s benefits via thorough comparisons with nine SOTA adver
|
| 80 |
+
70 sarial training and randomized smoothing frameworks across different operating regimes on both
|
| 81 |
+
71 CIFAR-10 and ImageNet.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 1: Adv uracy $( \mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) } )$ $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ wall-clock total training time on CIFAR10 with different AT frameworks on single NVIDIA TESLA P100 GPU. $\epsilon =$ (0.031, 0.5, 12) for $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations, respectively. SNAP enhances robustness with a small increase in training time. All frameworks except PAT employ ResNet-18.
|
| 85 |
+
|
| 86 |
+
72 Onenetw73 ome of our woeNet that achieve $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) } = 3 2 \% ( 3 5 \% )$ e for the first time R against the union of $( \ell _ { \infty } ( \epsilon = 2 / 2 5 5 ) , \ell _ { 2 } ( \epsilon =$ $\ell _ { 1 } ( \epsilon = 7 2 . 0 )$ ) perturbations. Our code and trained models will be shared publicly on GitHub.
|
| 87 |
+
|
| 88 |
+
# 2 Related Work
|
| 89 |
+
|
| 90 |
+
76 We categorize works on adversarial vulnerability of DNNs as follows:
|
| 91 |
+
|
| 92 |
+
77 Low-complexity adversarial training: The high computational needs of AT frameworks has spurred
|
| 93 |
+
78 significant efforts in reducing their complexity [40, 30, 35, 43]. FreeAdv [30] updates weights while
|
| 94 |
+
79 accumulating multiple attack iterations. FastAdv [35] employs appropriate use of single-step attacks,
|
| 95 |
+
80 while Zheng et al. [43] leverage inter-epoch similarity between adversarial perturbations. However,
|
| 96 |
+
81 these fast AT methods seek robustness against a single perturbation type, e.g., $\ell _ { \infty }$ norm-bounded
|
| 97 |
+
82 perturbations. In contrast, SNAP expands the capabilities of these AT frameworks by enhancing
|
| 98 |
+
83 robustness to the union of three perturbation types $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ , while preserving their efficiency.
|
| 99 |
+
|
| 100 |
+
Robustness against union of perturbation models: The focus on the robustness against the union of multiple perturbation types is relatively new. Kang et al. [16] studied transferability between different perturbation types, while Jordan et al. [15] considered combination attacks with low perceptual distortion. Stutz et al. [31] proposed a modification in AT to detect images with different models of perturbations via confidence thresholding, but they don’t attempt to classify perturbed images correctly. For accurate classification in the presence of different perturbation models, Tramèr &
|
| 101 |
+
|
| 102 |
+
90 Boneh [32] studied empirical and theoretical trade-offs involved in including multiple perturbation
|
| 103 |
+
91 types simultaneously during training. Maini et al. [21] further built upon this work to propose the
|
| 104 |
+
92 multi steepest descent (MSD) AT framework which chooses one among the three perturbation models
|
| 105 |
+
93 $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ in each attack iteration during training, achieving SOTA adversarial accuracy on CIFAR
|
| 106 |
+
94 10 against the union of the $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbation models, albeit at a high $( 1 0 \times )$ training time. In
|
| 107 |
+
95 contrast, SNAP provides high robustness against the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbation models using
|
| 108 |
+
96 established single-attack $\ell _ { \infty }$ AT frameworks. This enables to showcase the benefits of our approach
|
| 109 |
+
97 on large-scale datasets such as ImageNet.
|
| 110 |
+
98 Recently, Laidlaw et al. [18] developed a novel AT framework (PAT) with low perceptual distortion
|
| 111 |
+
99 attacks to demonstrate impressive generalization to unseen attacks. In contrast, we focus on extending
|
| 112 |
+
100 the capabilities of widely popular $\ell _ { \infty }$ -AT frameworks to providing robustness against the union of
|
| 113 |
+
101 $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations, while preserving their training efficiency.
|
| 114 |
+
102 Noise augmentation: Multiple recent works have investigated the role of randomization in enhancing
|
| 115 |
+
103 adversarial robustness [12, 24, 8, 25] with theoretical guarantees. Another prominent line of work
|
| 116 |
+
104 in this category is randomized smoothing [5, 29, 19, 38], where random noise is used as a tool to
|
| 117 |
+
105 compute certification bounds. Rusak et al. [28] also explored the role of noise augmentation for
|
| 118 |
+
106 improving the robustness against common-corruptions [13]. In contrast, in SNAP, noise augmentation
|
| 119 |
+
107 is used as a means to enable widely popular $\ell _ { \infty }$ -AT frameworks to efficiently achieve high robustness
|
| 120 |
+
108 against the union of multiple norm-bounded perturbations. As is the characteristic of AT works, our
|
| 121 |
+
109 results are primarily empirical in nature. Hence, we follow recent guidelines [33, 21] to evaluate the
|
| 122 |
+
110 accuracy against the strongest possible adversaries. We do explicitly compare $\ell _ { \infty } { - } \mathrm { A T } { + } \mathrm { S N A P }$ with
|
| 123 |
+
111 randomized smoothing approaches in the Appendix.
|
| 124 |
+
|
| 125 |
+
# 112 3 Subspace Analysis of Adversarial Perturbations
|
| 126 |
+
|
| 127 |
+
113 In this section, we employ subspace methods to compre
|
| 128 |
+
114 hend the distinction between $\ell _ { \infty }$ , $\ell _ { 2 }$ and $\ell _ { 1 }$ perturbations.
|
| 129 |
+
115 For each input $\pmb { x } _ { i } \in \mathbb { R } ^ { D }$ in dataset $X$ , consider adversar
|
| 130 |
+
116 ial perturbations $\alpha _ { i }$ , $\beta _ { i }$ , and $\gamma _ { i }$ bounded within $\ell _ { \infty }$ , $\ell _ { 2 }$ ,
|
| 131 |
+
117 and $\ell _ { 1 }$ norms, respectively.
|
| 132 |
+
118 We begin with a hypothesis (see Fig. 2): The perturbations
|
| 133 |
+
119 $\alpha , \beta ,$ , and $\gamma$ corresponding to input x have directions that
|
| 134 |
+
120 differ significantly if the curvature of the decision bound
|
| 135 |
+
121 ary is high in the neighborhood of $_ { \textbf { \em x } }$ . Conversely, if the
|
| 136 |
+
122 curvature of the decision boundary is low, the perturba
|
| 137 |
+
123 tions $_ \alpha$ , $\beta$ , and $\gamma$ tend to point in similar directions.
|
| 138 |
+
124 Since, prior works [6, 23] have found that single-attack
|
| 139 |
+
125 AT reduces the curvature of the decision boundary, we test
|
| 140 |
+
126 our hypothesis by studying the following two networks
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
!: ℓ! norm bounded; $\beta \colon \ell _ { 2 }$ norm bounded; %: $\ell _ { 1 }$ norm bounded
|
| 144 |
+
Figure 2: Illustration of the role of decision boundary curvature on the distinction between different types of perturbations $_ { \pmb { \alpha } }$ , $\beta$ and $\gamma$ of the given input $_ { \textbf { \em x } }$ .
|
| 145 |
+
|
| 146 |
+
on CIFAR-10 data: a non-robust ResNet18 $f _ { \theta } ^ { \mathrm { v a n } }$ trained using vanilla training, and a robust ResNet18 $f _ { \theta } ^ { \mathrm { r o b } }$ trained using the TRADES [41] AT framework employing $\ell _ { \infty }$ perturbations.
|
| 147 |
+
|
| 148 |
+
129 We compute perturbations $\alpha _ { i } , \beta _ { i }$ , and $\gamma _ { i }$ for each $\pmb { x } _ { i } \in X$ for both networks, i.e., $\kappa \in \{ \mathrm { v a n } , \mathrm { r o b } \}$ . We
|
| 149 |
+
130 compute the singular vector basis ${ \mathcal { P } } ^ { \kappa }$ for the set of $\ell _ { 2 }$ bounded perturbations $\Delta ^ { \kappa } = \{ \beta _ { 1 } ^ { \kappa } , \ldots , \beta _ { | X | } ^ { \kappa } \}$
|
| 150 |
+
131 The normalized mean squared projections of the three types of perturbation vectors on the singular
|
| 151 |
+
132 vector basis ${ \mathcal { P } } ^ { \kappa }$ of vanilla trained ResNet-18 $( \mathcal { P } ^ { \mathrm { v a n } } )$ )(Fig. 3(a)) and TRADES trained ResNet-18
|
| 152 |
+
133 $( \mathcal { P } ^ { \mathrm { r o b } } )$ )(Fig. 3(b)) shows a clear contrast.
|
| 153 |
+
134 The perturbations of a vanilla trained network roll-off gradually to occupy a larger subspace as
|
| 154 |
+
135 indicated in Fig. 3(a). Specifically, the projections of $_ { \pmb { \alpha } }$ and $\gamma$ occupy almost all 3000 directions in
|
| 155 |
+
136 the basis $\mathcal { P } ^ { \mathrm { v a n } }$ since their mean squared projections are within $\sim 1 0 \%$ of the maximum value $m _ { \mathrm { m a x } }$
|
| 156 |
+
137 This shows that the dominant singular vectors of $\beta$ are not well-aligned with $_ { \pmb { \alpha } }$ and $\gamma$ in a vanilla
|
| 157 |
+
138 trained network. With TRADES AT (Fig. 3(b)), however, all three types of perturbations are squeezed
|
| 158 |
+
139 into a much smaller subspace spanning only the top 250 singular vectors in the perturbation basis
|
| 159 |
+
140 ${ \mathcal { P } } ^ { \mathrm { r o b } }$ . Outside these 250 dimensions, the mean squared projections fall to $< 1 0 \%$ of their maximum
|
| 160 |
+
141 value.
|
| 161 |
+
142 In summary, the results in Fig. 3 validate the hypothesis that single-attack AT increases the average
|
| 162 |
+
143 alignment of different perturbation types due to the reduction in the decision boundary curvature. In
|
| 163 |
+
44 Sec. 4, we exploit this behavior of single-attack $\ell _ { \infty }$ AT to improve its robustness against the union of
|
| 164 |
+
45 multiple perturbation models via SNAP.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 3: Normalized mean squared projections of three perturbation types on the singular vector basis ${ \mathcal { P } } ^ { \kappa }$ of $\ell _ { 2 }$ perturbations of ResNet18 on CIFAR-10 after: (a) vanilla training $\kappa \equiv \operatorname { v a n } )$ , and (b) TRADES training $\kappa \equiv \mathrm { r o b }$ ). The singular vectors $\mathbf { \Delta } _ { \mathbf { \mathcal { p } } _ { i } ^ { \kappa } }$ comprising $\mathcal { P } ^ { \kappa } = \{ p _ { 1 } ^ { \kappa } , \ldots , p _ { D } ^ { \kappa } \}$ are ordered in descending order of their singular values.
|
| 168 |
+
|
| 169 |
+
# 146 4 Shaped Noise Augmented Processing (SNAP)
|
| 170 |
+
|
| 171 |
+
We show that single-attack AT can be enhanced to address multiple perturbations by introducing noise to appropriately wiggle the $\ell _ { \infty }$ -bounded perturbations (Fig. 4(a)). However, to do so, the noise distribution needs to be chosen and shaped appropriately to minimize its impact on natural accuracy and robustness to $\ell _ { \infty }$ -bounded perturbations.
|
| 172 |
+
|
| 173 |
+
153 We experiment with both $\ell _ { \infty }$ and $\ell _ { 2 }$ perturbations in single
|
| 174 |
+
154 attack AT frameworks and find $\ell _ { \infty } { \cdot } \mathbf { A } \mathrm { T }$ to be suitable for
|
| 175 |
+
155 our proposed shaped noise augmentation (see Sec. 5.2.1 for
|
| 176 |
+
156 details). Hence, in this section, we describe SNAP for single
|
| 177 |
+
157 attack AT frameworks employing $\ell _ { \infty }$ perturbations.
|
| 178 |
+
|
| 179 |
+
# 4.1 SNAPnet
|
| 180 |
+
|
| 181 |
+
A deep net $f _ { \theta } ( \pmb { x } ) _ { \mathbf { \lambda } } \colon \mathbb { R } ^ { D } \{ 0 , 1 \} ^ { C }$ parametrized by $\theta$ maps the input $\pmb { x } \in \mathbb { R } ^ { D }$ to a one-hot vector ${ \pmb y } \in \{ 0 , 1 \} ^ { \tilde { C } }$ over $C$ classes.
|
| 182 |
+
|
| 183 |
+
162 We construct a SNAP-based deep net (SNAPnet) $f _ { \boldsymbol { \theta } , \Sigma } ^ { \mathrm { S N } } ( \boldsymbol { x } )$ by
|
| 184 |
+
163 introducing an additive shaped noise (SN) layer (Fig. 4(b)),
|
| 185 |
+
164 where the noise distribution parameter $\Sigma$ is learned during
|
| 186 |
+
165 training. Formally,
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 4: SNAP: (a) intuition underlying SNAP (not an exact depiction), and (b) SNAPnet $f _ { \boldsymbol { \theta } , \Sigma } ^ { \mathrm { S N } } ( \boldsymbol { x } )$ constructed from a given deep net $f _ { \boldsymbol { \theta } } ( \pmb { x } )$ by prepending a shaped noise (SN) augmentation layer which perturbs the primary input $_ { \textbf { \em x } }$ with noise $\mathbf { n }$ whose distribution parameter $\Sigma$ is learned during AT along with the base network parameter $\theta$ .
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
{ \pmb y } = f _ { \theta , \Sigma } ^ { \mathrm { S N } } ( { \pmb x } ) = f _ { \theta } \big ( { \pmb x } + { \pmb n } \big ) = f _ { \theta } \big ( { \pmb x } + V \Sigma { \pmb n } _ { 0 } \big ) ,
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
166 where $\mathbf { n } _ { 0 } \sim \mathcal { L } ( 0 , \mathbf { I } _ { D \times D } )$ is a zero-mean isotropic Laplace
|
| 196 |
+
167 noise vector, $\Sigma = \mathrm { D i a g } [ \sigma _ { 1 } , \dots , \sigma _ { D } ]$ is a distribution param
|
| 197 |
+
168 eter denoting its per-dimension standard deviation, ${ \bf { I } } _ { D \times D }$
|
| 198 |
+
169 denotes the $D \times D$ identity matrix, and $V = [ \pmb { v } _ { 1 } , \dots , \pmb { v } _ { D } ]$ denotes a basis in $\mathbb { R } ^ { D }$ . We also studied
|
| 199 |
+
170 Gaussian and Uniform distributed ${ \bf n } _ { 0 }$ , but empirically find the Laplace distribution to yield better
|
| 200 |
+
171 results (Sec. 5.2.1). We use $V = \mathbf { I } _ { D \times D }$ for all our experiments in the main text and study other
|
| 201 |
+
172 options for $V$ in the Appendix.
|
| 202 |
+
|
| 203 |
+
173 The final classification decision $d$ is computed via
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
d = \arg \operatorname* { m a x } _ { c } { \left[ \mathbb { E } _ { \mathbf { n } } [ \pmb { y } ] \right] } _ { c } ,
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
174 where $[ \pmb { a } ] _ { c }$ denotes the $c$ -th element of vector $^ { a }$ . Note, the shaped noise perturbs the input $_ { \textbf { \em x } }$ with a
|
| 210 |
+
175 noise source $\mathbf { n } = V \Sigma \mathbf { n } _ { 0 }$ (Eq. (1)). The distribution parameter $\Sigma$ is learned in the presence of any
|
| 211 |
+
176 standard AT method [20, 41, 30] used for learning deep net parameters $\theta$ as described next.
|
| 212 |
+
|
| 213 |
+
# Algorithm 1 Training SNAPnet
|
| 214 |
+
|
| 215 |
+
Input: training set $X$ ; basis $V = [ \pmb { v } _ { 1 } , \dots , \pmb { v } _ { D } ]$ ; total noise power $P _ { \mathrm { n o i s e } }$ ; minibatch size $r$ ; baseline training method BASE; noise variance update frequency $U _ { f }$ ; Total number of epochs $T$
|
| 216 |
+
|
| 217 |
+
Initialize: noise variances $\Sigma _ { 0 } = \mathrm { { D i a g } } [ \sigma _ { 1 , 0 } , . . . , \sigma _ { D , 0 } ]$ .
|
| 218 |
+
Output: robust network $f _ { \boldsymbol { \theta } , \Sigma } ^ { \mathrm { S N } }$ , noise variances $\Sigma _ { T } = \operatorname { \bar { D i a g } } [ \sigma _ { 1 , T } ^ { 2 } , \dots , \sigma _ { D , T } ^ { 2 } ]$ .
|
| 219 |
+
1: for epoch $t = 1 \dots T$ do
|
| 220 |
+
2: for mini-batch $B = \{ { \pmb x } _ { 1 } , \ldots , { \pmb x } _ { r } \}$ do θ ← BASE\`∞ f SNθ,Σt {xi}ri=1, θ . BASE() Training
|
| 221 |
+
3: end for
|
| 222 |
+
4: if $t$ mod $U _ { f } = 0$ then . SNAP Distribution Update once every $U _ { f }$ epochs
|
| 223 |
+
5: for mini-batch $B = \{ { \pmb x } _ { 1 } , \ldots , { \pmb x } _ { r } \}$ do
|
| 224 |
+
6: $\begin{array} { r l r } & { } & { \{ \pmb { x } _ { i } ^ { \mathrm { a d v } } \} _ { i = 1 } ^ { r } \mathrm { P G D } _ { \ell _ { 2 } } ^ { ( K ) } \bigg ( f _ { \theta , \Sigma _ { t } } ^ { \mathrm { S N } } \big ( \{ \pmb { x } _ { i } \} _ { i = 1 } ^ { r } \big ) \bigg ) ; \quad \eta _ { i } = \pmb { x } _ { i } ^ { \mathrm { a d v } } - \pmb { x } _ { i } \forall i \in \{ 1 , \dots , r \} } \\ & { } & { \gamma _ { j } \gamma _ { j } + \sum _ { i = 1 } ^ { r } \big ( \langle \pmb { v } _ { j } , \eta _ { i } \rangle \big ) ^ { 2 } \quad \forall j \in \{ 1 , \dots , D \} \qquad \mathrm { ~ \mathbb { b } \ c c u m u l a t e \ p r o j e c t i o n s } ; } \\ & { } & { \frac { \mathrm { n d \ d \Pi \ f o r } } { j , t + 1 } = P _ { \mathrm { n o i s e } } \frac { \sqrt { \gamma _ { j } } } { \sum _ { k = 1 } ^ { D } \sqrt { \gamma _ { k } } } \quad \forall j \in \{ 1 , \dots , D \} \quad \mathrm { ~ \mathbb { b } \ c n o r m a l i z e \ a c c u m u l a t e d \ p r o j e c t i o n s } ; } \end{array}$
|
| 225 |
+
7: See Eq. (3)
|
| 226 |
+
8: 9: eσ See Eq. (3)
|
| 227 |
+
10: else
|
| 228 |
+
11: $\Sigma _ { t + 1 } \Sigma _ { t }$
|
| 229 |
+
12: end if
|
| 230 |
+
13: end for
|
| 231 |
+
|
| 232 |
+
# 177 4.2 Training SNAPnet
|
| 233 |
+
|
| 234 |
+
178 Algorithm 1 summarizes the procedure for training SNAPnet $f _ { \boldsymbol { \theta } , \Sigma } ^ { \mathrm { S N } } ( \boldsymbol { x } )$ . In each epoch, an arbitrary
|
| 235 |
+
179 AT method BASE() (line 2) updates network parameters $\theta$ with input perturbed by noise $\mathbf { n }$ . Here
|
| 236 |
+
180 BASE() can be any established AT framework [20, 41, 30, 35] employing $\ell _ { \infty }$ perturbation.
|
| 237 |
+
181 The SNAP parameter $\Sigma$ is updated once every $U _ { f } = 1 0$ epochs via a SNAP distribution update (lines
|
| 238 |
+
182 4-10). In this update, the per-dimension noise variance $\sigma _ { j } ^ { 2 }$ is updated proportional to the root mean
|
| 239 |
+
183 squared projection of the adversarial perturbations $\eta$ on the basis $V$ given a total noise constraint
|
| 240 |
+
184 $\begin{array} { r } { \bar { \sum _ { j = 1 } ^ { D } } \sigma _ { j } ^ { 2 } = P _ { \mathrm { n o i s e } } } \end{array}$ , where $P _ { \mathrm { n o i s e } }$ denotes the total noise power. Formally,
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\sigma _ { j } ^ { 2 } \propto \sqrt { \mathbb { E } _ { \pmb { x } \in X } \left( \langle \pmb { \eta } , \pmb { v } _ { j } \rangle ^ { 2 } \right) } \quad \mathrm { s . t . } \quad \sum _ { j = 1 } ^ { D } \sigma _ { j } ^ { 2 } = P _ { \mathrm { n o i s e } } ,
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
185 where $\eta$ is the $\ell _ { 2 }$ norm-bounded PGD adversarial perturbation for the given input $\boldsymbol { x } \in \boldsymbol { X }$ (line 6).
|
| 247 |
+
186 Note that these $\ell _ { 2 }$ perturbations are employed only for noise shaping and are distinct from the $\ell _ { \infty }$
|
| 248 |
+
187 perturbations employed by BASE() AT (line 2). Also, $\ell _ { \infty }$ perturbations cannot be used here since
|
| 249 |
+
188 their projections are constant $\forall j$ when $V = \mathbf { I } _ { D \times D }$ , whereas employing $\ell _ { 1 }$ perturbations leads to poor
|
| 250 |
+
189 shaping due to high sparsity.
|
| 251 |
+
190 Thus, in SNAP, the average squared $\ell _ { 2 }$ norm of the noise vector $\mathbf { n }$ is held constant at $P _ { \mathrm { n o i s e } }$ while
|
| 252 |
+
191 adapting the noise variances in the individual dimensions so as to align the noise vectors with the
|
| 253 |
+
192 adversarial perturbations on average. Intuitively, the decision boundary is pushed aggressively in
|
| 254 |
+
193 those directions.
|
| 255 |
+
|
| 256 |
+
# 194 4.3 Remarks
|
| 257 |
+
|
| 258 |
+
195 Note that the SNAP distribution update is distinct from BASE() AT. Hence, SNAP doesn’t require any
|
| 259 |
+
196 hyperparameter tuning in BASE(). For fairness to baselines we keep all hyperparameters identical
|
| 260 |
+
197 when introducing SNAP in all our experiments. However, SNAP introduces a new hyperparameter
|
| 261 |
+
198 $P _ { \mathrm { n o i s e } }$ , which permits to trade adversarial robustness $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ for natural accuracy ${ \mathcal { A } } _ { \mathrm { n a t } }$ . This trade-off is
|
| 262 |
+
199 explored in Sec. 5.2.2.
|
| 263 |
+
200 The computational overhead of SNAP is small $( \sim 1 0 \%$ ) since the SNAP Distribution Update occurs
|
| 264 |
+
201 once in 10 epochs using just $20 \%$ of the training data to update the noise standard deviations $\sigma _ { j }$ . We
|
| 265 |
+
202 provide more details about the SNAP Distribution Update in the Appendix.
|
| 266 |
+
|
| 267 |
+
<table><tr><td>Method</td><td>Anat</td><td>A ∈=0.03</td><td>A ∈=0.5</td><td>A ∈= 12</td><td>A</td></tr><tr><td colspan="6">PGD AT withloo perturbations</td></tr><tr><td>PGD +SNAP[G] +SNAP[U]</td><td>84.6 80.7 85.1</td><td>48.8 45.7 42.7</td><td>62.3 66.9 66.7</td><td>15.0 34.6 28.6</td><td>15.0 31.9 26.6</td></tr><tr><td colspan="6">+SNAP[L] 83.0 44.8 68.6 40.1 PGD AT withl2 perturbations</td></tr><tr><td>PGD +SNAP[G] +SNAP[U]</td><td>89.3 83.0</td><td>28.8 35.0</td><td>67.3 65.8</td><td>31.8 39.9</td><td>25.1 30.2</td></tr></table>
|
| 268 |
+
|
| 269 |
+
Table 1: ResNet-18 CIFAR-10 results showing the impact of SNAP augmentation of PGD [20] AT framework with $\ell _ { \infty }$ (top) and $\ell _ { 2 }$ (bottom) perturbations where [G], [U], and [L], denote shaped Gaussian, Uniform, and Laplace noise.
|
| 270 |
+
|
| 271 |
+
<table><tr><td>Method</td><td>Anat</td><td>A ∈= 0.03</td><td>A ∈=0.5</td><td>A e=12</td><td>A</td></tr><tr><td colspan="6">High Complexity ATwith loperturbations</td></tr><tr><td>PGD +SNAP</td><td>84.6 83.0</td><td>48.8 44.8</td><td>62.3 68.6</td><td>15.0 40.1</td><td>15.0 35.6</td></tr><tr><td>TRADES +SNAP</td><td>82.1 80.9</td><td>50.2 45.2</td><td>59.6 66.9</td><td>19.8 46.6</td><td>19.7 41.2</td></tr><tr><td colspan="6">Low Complexity AT with looperturbations</td></tr><tr><td>FreeAdv +SNAP</td><td>81.7 83.5</td><td>46.1 39.7</td><td>59 66.2</td><td>15.0 34.3</td><td>15.0 29.6</td></tr><tr><td>FastAdv +SNAP</td><td>85.7 84.2</td><td>46.2 40.4</td><td>60.0 67.9</td><td>13.2 36.6</td><td>13.2 30.8</td></tr></table>
|
| 272 |
+
|
| 273 |
+
Table 2: ResNet-18 CIFAR-10 results showing the impact of SNAP augmentation of established $\ell _ { \infty }$ -AT frameworks. The computational overhead of SNAP is limited to $\sim 1 0 \%$ .
|
| 274 |
+
|
| 275 |
+
# 03 5 Experimental Results
|
| 276 |
+
|
| 277 |
+
# 5.1 Setup
|
| 278 |
+
|
| 279 |
+
Following experimental settings of prior work [41, 30, 21], we employ a ResNet-18 network for CIFAR-10 experiments and both ResNet-50 and ResNet-101 networks for ImageNet experiments. Accuracy on clreferred to via $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { \infty } ) }$ t , $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 2 } ) }$ s refe, and $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ o wit, for $\ell _ { \infty }$ ${ \mathcal { A } } _ { \mathrm { n a t } }$ $\ell _ { 2 }$ and a, and $\ell _ { 1 }$ uracy on adversarially perturbed test data isnorm bounded perturbations, respectively. Accuracy against the union of all three perturbations is denoted by $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ .
|
| 280 |
+
|
| 281 |
+
For a fair robustness comparison, our evaluation setup closely follows the setup of Maini et al. [21] for CIFAR-10 data: (1) choose norm bounds $\epsilon = ( 0 . 0 3 1 , 0 . 5 , 1 2 . 0 )$ for $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations, respectively; (2) scale norm bounds for images to lie between $[ 0 , 1 ]$ ; (3) choose the PGD attack configuration to be $I O O$ iterations with $I O$ random restarts for all perturbation types1; and (4) estimate $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ as the fraction of test data that is simultaneously resistant to all three perturbation models.
|
| 282 |
+
|
| 283 |
+
Following the guidelines of Tramer et al. [33], we carefully design adaptive PGD attacks that target the full defense – SN layer – since SNAPnet is end-to-end differentiable. Specifically, we backpropagate to primary input $_ { \textbf { \em x } }$ through the SN layer (see Fig. 4). Thus, the final shaped noise distribution is exposed to the adversary. We also account for the expectation $\mathbb { E } _ { \mathbf { n } } [ \cdot ]$ in Eq. (2) by explicitly averaging deep net logits over $N _ { 0 } ( = 8 )$ noise samples before computing the gradient, which eliminates any gradient obfuscation, and is known to be the strongest attack against noise augmented models [29]. In the Appendix we also show robustness stress tests and evaluate more attacks.
|
| 284 |
+
|
| 285 |
+
On CIFAR-10 data, we compare with the following seven key SOTA AT frameworks: PGD [20], TRADES [41], FreeAdv [30], FastAdv [35], AVG [32], MSD [21], PAT [18]. We also compare with two randomized smoothing frameworks [5, 29] in the Appendix. Thanks to their GitHub code releases, we first successfully reproduce their results with a ResNet-18 network in our environment. In the case of PAT [18], we evaluate and compare with their pretrained ResNet-50 model on CIFAR-10. We compare all training times on a single NVIDIA P100 GPU. On ImageNet data, we primarily compare to FreeAdv [30]. We train ResNet-50 and its SNAPnet version with FreeAdv on a Google Cloud server with four NVIDIA P100 GPUs to compare their accuracy and training times. We will release our pretrained models and code on GitHub.
|
| 286 |
+
|
| 287 |
+
# 5.2 Ablation Studies
|
| 288 |
+
|
| 289 |
+
# 5.2.1 Impact of Noise Distribution and Model of BASE() AT Perturbations
|
| 290 |
+
|
| 291 |
+
line 2 in Alg. 1) on In this subsection, we first study the impact of employing $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ . For each choice, we further experiment with three $\ell _ { \infty }$ vs. $\ell _ { 2 }$ perturbations in BASE AT() (see ributions for the $\ell _ { 1 }$
|
| 292 |
+
|
| 293 |
+
237 BASE AT() since Maini et al. [21] showed that employing $\ell _ { 1 }$ single-attack AT achieves very low
|
| 294 |
+
238 robustness to all attacks. We choose PGD [20] AT as BASE AT() for this ablation study. For a fair
|
| 295 |
+
239 comparison across the noise distributions, we fix $P _ { \mathrm { n o i s e } } = 1 6 0$ , enforcing all noise vectors to have the
|
| 296 |
+
240 same average $\ell _ { 2 }$ norm. For each distribution, the noise is shaped per the procedure summarized in
|
| 297 |
+
241 Alg. 1.
|
| 298 |
+
|
| 299 |
+
As observed in Table 1, $\ell _ { \infty }$ -PGD AT achieves much lower $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ than $\ell _ { 2 }$ -PGD AT, an observation also reported by Maini et al. [21]. With SNAP, however, we find that there is an interaction between the perturbation model in PGD AT and the noise distribution in SNAP. For instance, SNAP[U] enhances $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ by $11 \%$ with $\ell _ { \infty }$ -PGD AT while not achieving any improvement with $\ell _ { 2 }$ -PGD AT. In fact, SNAP appears to be particularly suitable for $\ell _ { \infty }$ -AT, since it always improves $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ by $11 \%$ -to- $2 0 . 6 \%$
|
| 300 |
+
|
| 301 |
+
Finally, of the three noise distributions, we find the Laplace distribution to be distinctly superior, achieving the highest A(U)adv ( $3 5 . 6 \%$ and $3 0 . 8 \%$ ) due to a significant improvement in $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ for both $\ell _ { \infty }$ and $\ell _ { 2 }$ PGD AT, respectively. The superiority of the Laplace distribution in achieving high $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ stems from its heavier tail compared to the Gaussian and Uniform distributions with the same variance. Shaped Laplace noise generates the highest fraction of extreme values in a given noise sample. Hence, it is more effective in improving accuracy against $\ell _ { 1 }$ -bounded attacks, which are the strongest when perturbing few pixels by a large magnitude [21, 32]. We discuss this further in the Appendix. Henceforth, unless otherwise mentioned, we choose Laplace noise for SNAP and $\ell _ { \infty }$ perturbations for BASE() AT as the default setting since it achieves the highest ${ \mathcal { A } } _ { \mathrm { a d v } } ^ { ( U ) }$ .
|
| 302 |
+
|
| 303 |
+
# 5.2.2 Impact of $P _ { \mathrm { n o i s e } }$
|
| 304 |
+
|
| 305 |
+
Next, we explore the impact of the SNAP hyperparameter $P _ { \mathrm { n o i s e } }$ , which constrains the average squared $\ell _ { 2 }$ norm of the noise vector n. It enables to trade between adversarial and natural accuracy.
|
| 306 |
+
|
| 307 |
+
Fig. 5 shows that, as $P _ { \mathrm { n o i s e } }$ increases, $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ improves from $31 \%$ to $47 \%$ , accompanied by a graceful $( 5 \% )$ drop in ${ \mathcal { A } } _ { \mathrm { n a t } }$ and a small drop of $2 \%$ in $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { \infty } ) }$ that stabilizes to $\approx 4 5 \%$ . These results show: (1) SNAP preserves the impact of $\ell _ { \infty }$ perturbations which is not surprising since PGD AT [20] explicitly includes those, and (2) $P _ { \mathrm { n o i s e } }$ provides an explicit knob to control the $\boldsymbol { A } _ { \mathrm { n a t } }$ vs. ${ \mathcal { A } } _ { \mathrm { a d v } }$ trade-off. Henceforth, we choose $P _ { \mathrm { n o i s e } }$ values that incur $< 1 . 5 \%$ drop in ${ \mathcal { A } } _ { \mathrm { n a t } }$ for all $\mathrm { S N A P { + } A T }$ experiments.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 5: ResNet-18 CIFAR-10 results: ad-(a) versarial racy $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ , $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { \infty } ) }$ , an ural ${ \mathcal { A } } _ { \mathrm { n a t } }$ vs. total noise power $P _ { \mathrm { n o i s e } }$ $\mathrm { P G D + S N A P }$ .
|
| 311 |
+
|
| 312 |
+
# 5.2.3 SNAP augmented SOTA AT Frameworks
|
| 313 |
+
|
| 314 |
+
Table 2 shows the effectiveness of SNAP for four SOTA AT frameworks: high complexity frameworks, such as PGD [20], TRADES [41], and low complexity frameworks such as FreeAdv [30], FastAdv [35]. All are trained against $\ell _ { \infty }$ attacks with $\epsilon = 0 . 0 3 1$ . As expected, while they achieve high $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { \infty } ) }$ , their $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 2 } ) }$ and $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ are lower.
|
| 315 |
+
|
| 316 |
+
For high-complexity AT, SNAP enhances $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 2 } ) }$ and $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ by $\sim 6 \%$ and $\sim 2 5 \%$ , respectively, while incurring only a drop of $\sim 5 \%$ in $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { \infty } ) }$ adv adv . Thus overall, SNAP improves robustness $( \mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) } )$ by $\sim 2 0 \%$ against the union of the three perturbation models. Note that this robustness improvement comes robustness at only a $\sim 1 \%$ $( \mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) } )$ drop in are also significant ${ \mathcal { A } } _ { \mathrm { n a t } }$ (see Table 2). For low-complexity ATs, SNAP improvements in union $( \sim 1 5 \% )$ ). Again, presence of SNAP improves $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 2 } ) }$ and $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ This time the drop in $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { \infty } ) }$ is $\sim 7 \%$ . We believe this is due to the fact that thes frameworks employ weaker single-step attacks during training. Note that in the case of FreeAdv $^ +$ observe a $\sim 2 \%$ increase in ${ \mathcal { A } } _ { \mathrm { n a t } }$ , a trend we also observe in the ImageNet experiments described later.
|
| 317 |
+
|
| 318 |
+
Table 3: CIFAR-10 results for comparing adversarial accuracy A(U)adv vs. training time (on single NVIDIA P100 GPU) for different AT frameworks and the improvements by introducing proposed SNAP technique. All frameworks except PAT [18] (which employs ResNet-50) employ ResNet-18.
|
| 319 |
+
|
| 320 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>LR schedule</td><td rowspan=1 colspan=1>Epochs</td><td rowspan=1 colspan=1>Anat</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Total time(minutes)</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SetA:Total Time</td><td rowspan=1 colspan=1>SetA:Total Time≥</td><td rowspan=1 colspan=1>12 Hrs</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=5 colspan=1>AVG 50Step[32]AVG 20 Step [32]AVG 10 Step [32]PAT[18]MSD 50 Step [21]MSD 30 Step [21]</td><td rowspan=1 colspan=1>cyclic</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>84.8</td><td rowspan=1 colspan=1>40.4</td><td rowspan=5 colspan=1>4217183495613641693978</td></tr><tr><td rowspan=4 colspan=1>cycliccyclicstepcycliccyclic</td><td rowspan=2 colspan=1>5050</td><td rowspan=2 colspan=1>85.686.7</td><td rowspan=1 colspan=1>40.438.9</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=3 colspan=1>501005050</td><td></td></tr><tr><td rowspan=2 colspan=1>86.782.481.782.4</td><td></td></tr><tr><td rowspan=1 colspan=1>38.936.647.044.9</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SetB:8Hrs</td><td rowspan=1 colspan=3>Set B:8 Hrs<Total Time<12 Hrs</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>AVG 5 Step [32]MSD 20 Step [21]TRADES [41]TRADES+SNAP</td><td rowspan=1 colspan=1>cycliccyclicstepstep</td><td rowspan=1 colspan=1>5050100100</td><td rowspan=1 colspan=1>87.883.082.080.9</td><td rowspan=1 colspan=1>33.737.319.741.2</td><td rowspan=1 colspan=1>489690516566</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SetC:5Hr</td><td rowspan=1 colspan=1><TotalTi</td><td rowspan=1 colspan=1>ne<8Hi</td><td rowspan=1 colspan=1>S</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>MSD 10 Step [21]PGD [20]PGD+SNAP</td><td rowspan=1 colspan=1>cyclicstepstep</td><td rowspan=1 colspan=1>50100100</td><td rowspan=1 colspan=1>83.684.683.0</td><td rowspan=1 colspan=1>33.315.035.6</td><td rowspan=1 colspan=1>342354403</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SetD:2Hr</td><td rowspan=1 colspan=1><TotalTi</td><td rowspan=1 colspan=1>ne<5Hi</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>AVG 2 Step [32]MSD 5 Step [21]PGD [20]TRADES [41]PGD+SNAPTRADES+SNAP</td><td rowspan=1 colspan=1>cycliccycliccycliccycliccycliccyclic</td><td rowspan=1 colspan=1>505050505050</td><td rowspan=1 colspan=1>88.484.082.880.082.378.8</td><td rowspan=1 colspan=1>22.012.615.721.433.540.8</td><td rowspan=1 colspan=1>232185177258199280</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SetE:</td><td rowspan=1 colspan=1>TotalTime<</td><td rowspan=1 colspan=1>2Hrs</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>FreeAdv [30]FastAdv [35]FreeAdv+SNAPFastAdv+SNAP</td><td rowspan=2 colspan=1>stepcyclicstepcyclic</td><td rowspan=1 colspan=1>200</td><td rowspan=1 colspan=1>81.7</td><td rowspan=1 colspan=1>15.0</td><td rowspan=2 colspan=1>66478869</td></tr><tr><td rowspan=1 colspan=1>5020050</td><td rowspan=1 colspan=1>85.783.584.2</td><td rowspan=1 colspan=1>13.229.630.8</td></tr></table>
|
| 321 |
+
|
| 322 |
+
<table><tr><td>Training</td><td>Anat (%)</td><td>A e= 2/255</td><td>A ∈ = 2.0</td><td>A e = 72.0</td><td>A</td><td>Total time (minutes)</td></tr><tr><td colspan="7">ResNet-50</td></tr><tr><td>FreeAdv [30]</td><td>61.7</td><td>47.8</td><td>19.9</td><td>14.8</td><td>12.6</td><td>3590</td></tr><tr><td>FreeAdv+SNAP</td><td>66.8</td><td>46.1</td><td>37.8</td><td>37.4</td><td>32.4</td><td>3756</td></tr><tr><td colspan="7">ResNet-101</td></tr><tr><td>FreeAdv [30]</td><td>65.4</td><td>51.8</td><td>22.8</td><td>18.8</td><td>16.1</td><td>5678</td></tr><tr><td>FreeAdv+SNAP</td><td>69.7</td><td>50.3</td><td>41.1</td><td>40.2</td><td>35.4</td><td>5904</td></tr></table>
|
| 323 |
+
|
| 324 |
+
Table 4: ImageNet results: Iso-hyperparameter introduction of SNAP yields $\sim 2 0 \%$ improvement in adversarial accuracy $( \mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) } )$ with modest impact on training time for ResNet-50 and ResNet-101.
|
| 325 |
+
|
| 326 |
+
# 286 5.3 Robustness vs. Training Complexity
|
| 327 |
+
|
| 328 |
+
Next we quantify adversarial robustness vs. training time trade-offs. Table 3 shows that SNAP augmentation of single-attack AT frame rks achieves the highest $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ , when training time is $\mathbf { E }$
|
| 329 |
+
|
| 330 |
+
For instance, TRADES $^ +$ SNAP achieves a $4 \%$ higher $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) } ( = 4 1 \% )$ than MSD-20 with 2 hours lower training time (Set B in Table 3). Similarly, PGD $^ +$ SNAP achieves a $2 \%$ higher $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ than MSD-10 while having a similar training time (Set C). Note that both PGD and TRADES here use 100 training epochs with standard step learning rate (LR) schedule, while MSD frameworks employ a cyclic learning rate schedule to achieve superconvergence in 50 epochs.
|
| 331 |
+
|
| 332 |
+
295 In Set D, following Maini et al. [21], we employ a cyclic learning rate schedule for PGD, TRADES,
|
| 333 |
+
296 as well as for $\mathrm { P G D + S N A P }$ and TRADES $^ +$ SNAP to achieve convergence in 50 epochs. Improvements
|
| 334 |
+
297 in $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ for PGD $^ +$ SNAP and TRADES $^ +$ SNAP are similar to those in Sets $\mathbf { B }$ and C. Most notably,
|
| 335 |
+
|
| 336 |
+
298 $\mathrm { P G D + S N A P }$ with cyclic learning rate achieves $\sim 2 0 \%$ and $1 1 . 5 \%$ high $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ than MSD-5 and 299 AVG-2, respectively, while having aTable 2 with training times. FastAdv300 training time and FreeAdv $\sim 3$ hours). Set AP achieve $\mathbf { E }$ auigh a from, while $+ { \mathrm { S N A P } }$ $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) } \sim 3 0 \%$ 301 $1 8 \%$ erving thigher $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ ining efficiency of both Fthan MSD-5, while being $\sim 2 . 7 \times$ nd FreeAdv. Notably, FastAdv+SNAP achievesmore efficient to train.
|
| 337 |
+
|
| 338 |
+
# 5.4 ImageNet Results
|
| 339 |
+
|
| 340 |
+
Thanks to SNAP’s low computational overhead combined with FreeAdv’s fast training time, we are for the first time able to report adversarial accuracy of ResNet-50 and ResNet-101 against the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ attacks on ImageNet.
|
| 341 |
+
|
| 342 |
+
We closely follow the evaluation setup of Shafahi et al. [30]. Specifically, we use 100 step PGD attack, one of the strongest adversaries considered by Shafahi et al. [30], and evaluate on the entire test set. We first reproduce FreeAdv [30] results using the same hyperparameters and then introduce SNAP. All hyperparameter details are specified in the Appendix.
|
| 343 |
+
|
| 344 |
+
In order to clearly demonstrate the contrast between robustness to different perturbation models, we evaluate with FreeAdv achi $\epsilon \overset { \cdot } { = } ( 2 / 2 5 5 , 2 . 0 , 7 2 . 0 )$ $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ attacks, respectivet-50, but a lower n inand adv , and consequently, a low $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { \infty } ) } = 4 7 . 8 \%$ $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ o f $1 2 . 6 \%$ against the union of the perturbations. In contrast, $A _ { \mathrm { a d v } } ^ { ( \ell _ { 2 } ) } = 2 0 \%$ $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) } =$ FreeAdv+SNAP improves $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 2 } ) }$ and $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { 1 } ) }$ by $1 7 \%$ and $2 2 \%$ , respectively, accompanied by a $5 \%$ improvement in ${ \mathcal { A } } _ { \mathrm { n a t } }$ and a small $2 \%$ loss in $\mathcal { A } _ { \mathrm { a d v } } ^ { ( \ell _ { \infty } ) }$ . This results in an overall robustness improvement of $\mathrm { \bar { 2 0 \% } }$ against the union of the perturbation models, setting a first benchmark for ResNet-50 on ImageNet. Upon increasing the network to ResNet-101, both natural and adversarial accuracies improve by $\approx 4 \%$ for FreeAdv, a trend also observed by Shafahi et al. [30]. SNAP further improves FreeAdv’s results for $\boldsymbol { A } _ { \mathrm { n a t } }$ and $\mathcal { A } _ { \mathrm { a d v } } ^ { ( U ) }$ by $4 . 3 \%$ and $1 9 . 3 \%$ .
|
| 345 |
+
|
| 346 |
+
# 6 Discussion
|
| 347 |
+
|
| 348 |
+
Given the wide popularity of $\ell _ { \infty } { \cdot } \mathbf { A } \mathbf { T } .$ , in this paper, we propose SNAP as an augmentation that generalizes the effectiveness of $\ell _ { \infty }$ -AT to the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations. SNAP’s strength is its simplicity and efficiency. Consequently, this work sets a first benchmark for ResNet-50 and ResNet101 networks which are resilient to the union of $( \ell _ { \infty } , \ell _ { 2 } , \ell _ { 1 } )$ perturbations on ImageNet. Note that norm-bounded perturbations include a large class of attacks, e.g., gradient-based [20, 27, 32, 21, 4, 22], decision-based [3] and black-box [1] attacks.
|
| 349 |
+
|
| 350 |
+
More work is needed to extend the proposed SNAP technique to attacks beyond norm-bounded additive perturbations, e.g., functional [17, 36], rotation [7], texture [2], etc. We provide preliminary evaluations in this direction in the Appendix. It is important to note that SNAP is meant to be an efficient technique for improving $\ell _ { \infty }$ -AT, and not a new defense. Indeed defending against a large variety of attacks simultaneously remains an open problem, with encouraging results from recent efforts [21, 18].
|
| 351 |
+
|
| 352 |
+
Another limitation of our approach is that its benefits are demonstrated empirically. It is an inevitable consequence of a lack of any theoretical guarantees for underlying AT frameworks. An interesting direction of future work is to explore whether any theoretical guarantees can be derived for anisotropic shaped noise distributions in SNAP by building upon the recent developments in randomized smoothing [29, 38]. This could be a potential avenue for bridging the gap between certification bounds and empirical adversarial accuracy.
|
| 353 |
+
|
| 354 |
+
Finally, we believe that any effort on improving adversarial robustness of deep nets has net positive societal impact. However, recent past in this field has shown that any improvements in defense techniques also lead to more effective threat models. While such a cat-and-mouse game is of great intellectual value in the academic setting, it does have an unintentional negative societal consequence of equipping malicious outside actors with a broad set of tools. This further underscores the wellrecognized need for provable defenses.
|
| 355 |
+
|
| 356 |
+
# References
|
| 357 |
+
|
| 358 |
+
[1] Andriushchenko, M., Croce, F., Flammarion, N., and Hein, M. Square attack: a query-efficient black-box adversarial attack via random search. In European Conference on Computer Vision, pp. 484–501. Springer, 2020. [2] Bhattad, A., Chong, M. J., Liang, K., Li, B., and Forsyth, D. A. Unrestricted adversarial examples via semantic manipulation. arXiv preprint arXiv:1904.06347, 2019. [3] Brendel, W., Rauber, J., and Bethge, M. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. In International Conference on Learning Representations, 2018. [4] Chen, P.-Y., Sharma, Y., Zhang, H., Yi, J., and Hsieh, C.-J. Ead: elastic-net attacks to deep neural networks via adversarial examples. In Thirty-second AAAI conference on artificial intelligence, 2018. [5] Cohen, J., Rosenfeld, E., and Kolter, Z. Certified adversarial robustness via randomized smoothing. In International Conference on Machine Learning (ICML), 2019. [6] Dezfooli, S. M. M., Fawzi, A., Fawzi, O., Frossard, P., and Soatto, S. Robustness of classifiers to universal pertur-bations: A geometric perspective. In International Conference on Learning Representations (ICLR), 2018. [7] Engstrom, L., Tran, B., Tsipras, D., Schmidt, L., and Madry, A. Exploring the landscape of spatial robustness. In International Conference on Machine Learning, pp. 1802–1811. PMLR, 2019. [8] Gilmer, J., Ford, N., Carlini, N., and Cubuk, E. Adversarial examples are a natural consequence of test error in noise. In International Conference on Machine Learning, pp. 2280–2289, 2019. [9] Gowal, S., Qin, C., Uesato, J., Mann, T., and Kohli, P. Uncovering the limits of adversarial training against norm-bounded adversarial examples. arXiv preprint arXiv:2010.03593, 2020.
|
| 359 |
+
[10] Gui, S., Wang, H., Yu, C., Yang, H., Wang, Z., and Liu, J. Model compression with adversarial robustness: A unified optimization framework. arXiv preprint arXiv:1902.03538, 2019.
|
| 360 |
+
[11] Guo, M., Yang, Y., Xu, R., Liu, Z., and Lin, D. When nas meets robustness: In search of robust architectures against adversarial attacks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 631–640, 2020.
|
| 361 |
+
[12] He, Z., Rakin, A. S., and Fan, D. Parametric noise injection: Trainable randomness to improve deep neural network robustness against adversarial attack. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 362 |
+
[13] Hendrycks, D. and Dietterich, T. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2018.
|
| 363 |
+
[14] Hu, T.-K., Chen, T., Wang, H., and Wang, Z. Triple wins: Boosting accuracy, robustness and efficiency together by enabling input-adaptive inference. arXiv preprint arXiv:2002.10025, 2020.
|
| 364 |
+
[15] Jordan, M., Manoj, N., Goel, S., and Dimakis, A. G. Quantifying perceptual distortion of adversarial examples. arXiv preprint arXiv:1902.08265, 2019.
|
| 365 |
+
[16] Kang, D., Sun, Y., Brown, T., Hendrycks, D., and Steinhardt, J. Transfer of adversarial robustness between perturbation types. arXiv preprint arXiv:1905.01034, 2019.
|
| 366 |
+
[17] Laidlaw, C. and Feizi, S. Functional adversarial attacks. Advances in Neural Information Processing Systems, 2019.
|
| 367 |
+
[18] Laidlaw, C., Singla, S., and Feizi, S. Perceptual adversarial robustness: Defense against unseen threat models. International Conference on Learning Representations (ICLR), 2018.
|
| 368 |
+
[19] Li, B., Chen, C., Wang, W., and Duke, L. C. Certified adversarial robustness with addition gaussian noise. Neural Information Processing Systems (NeurIPS), 2019.
|
| 369 |
+
[20] Madry, A., Makelov, A., Schmidt, L., Tsipras, D., and Vladu, A. Towards deep learning models resistant to adversarial attacks. International Conference on Learning Representations (ICLR), 2018.
|
| 370 |
+
[21] Maini, P., Wong, E., and Kolter, J. Z. Adversarial robustness against the union of multiple perturbation models. In International Conference on Machine Learning (ICML), 2020.
|
| 371 |
+
[22] Moosavi-Dezfooli, S.-M., Fawzi, A., and Frossard, P. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), 2016.
|
| 372 |
+
[23] Moosavi-Dezfooli, S.-M., Fawzi, A., Uesato, J., and Frossard, P. Robustness via curvature regularization, and vice versa. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 373 |
+
[24] Pinot, R., Meunier, L., Araujo, A., Kashima, H., Yger, F., Gouy-Pailler, C., and Atif, J. Theoretical evidence for adversarial robustness through randomization: the case of the exponential family. In Advances in Neural Information Processing Systems, 2019.
|
| 374 |
+
[25] Pinot, R., Ettedgui, R., Rizk, G., Chevaleyre, Y., and Atif, J. Randomization matters. how to defend against strong adversarial attacks. In International Conference on Machine Learning (ICML), 2020.
|
| 375 |
+
[26] Rebuffi, S.-A., Gowal, S., Calian, D. A., Stimberg, F., Wiles, O., and Mann, T. Fixing data augmentation to improve adversarial robustness. arXiv preprint arXiv:2103.01946, 2021.
|
| 376 |
+
[27] Rony, J., Hafemann, L. G., Oliveira, L. S., Ayed, I. B., Sabourin, R., and Granger, E. Decoupling direction and norm for efficient gradient-based l2 adversarial attacks and defenses. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4322–4330, 2019.
|
| 377 |
+
[28] Rusak, E., Schott, L., Zimmermann, R. S., Bitterwolf, J., Bringmann, O., Bethge, M., and Brendel, W. A simple way to make neural networks robust against diverse image corruptions. In European Conference on Computer Vision, pp. 53–69. Springer, 2020.
|
| 378 |
+
[29] Salman, H., Li, J., Razenshteyn, I., Zhang, P., Zhang, H., Bubeck, S., and Yang, G. Provably robust deep learning via adversarially trained smoothed classifiers. In Advances in Neural Information Processing Systems, pp. 11289–11300, 2019.
|
| 379 |
+
[30] Shafahi, A., Najibi, M., Ghiasi, A., Xu, Z., Dickerson, J., Studer, C., Davis, L. S., Taylor, G., and Goldstein, T. Adversarial training for free! Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 380 |
+
[31] Stutz, D., Hein, M., and Schiele, B. Confidence-calibrated adversarial training: Generalizing to unseen attacks. In International Conference on Machine Learning, pp. 9155–9166. PMLR, 2020.
|
| 381 |
+
[32] Tramèr, F. and Boneh, D. Adversarial training and robustness for multiple perturbations. In Advances in Neural Information Processing Systems, pp. 5858–5868, 2019.
|
| 382 |
+
[33] Tramer, F., Carlini, N., Brendel, W., and Madry, A. On adaptive attacks to adversarial example defenses. arXiv preprint arXiv:2002.08347, 2020.
|
| 383 |
+
[34] Vivek, B. and Babu, R. V. Single-step adversarial training with dropout scheduling. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 947–956. IEEE, 2020.
|
| 384 |
+
[35] Wong, E., Rice, L., and Kolter, J. Z. Fast is better than free: Revisiting adversarial training. In International Conference on Machine Learning (ICLR), 2020.
|
| 385 |
+
[36] Xiao, C., Zhu, J.-Y., Li, B., He, W., Liu, M., and Song, D. Spatially transformed adversarial examples. In International Conference on Learning Representations, 2018.
|
| 386 |
+
[37] Xie, C. and Yuille, A. Intriguing properties of adversarial training at scale. In International Conference on Learning Representations, 2020.
|
| 387 |
+
[38] Yang, G., Duan, T., Hu, E., Salman, H., Razenshteyn, I., and Li, J. Randomized smoothing of all shapes and sizes. International Conference on Machine Learning (ICML), 2020.
|
| 388 |
+
[39] Yang, Y.-Y., Rashtchian, C., Zhang, H., Salakhutdinov, R., and Chaudhuri, K. A closer look at accuracy vs. robustness. Advances in Neural Information Processing Systems, 33, 2020.
|
| 389 |
+
[40] Zhang, D., Zhang, T., Lu, Y., Zhu, Z., and Dong, B. You only propagate once: Accelerating adversarial training via maximal principle. arXiv preprint arXiv:1905.00877, 2019.
|
| 390 |
+
[41] Zhang, H., Yu, Y., Jiao, J., Xing, E., El Ghaoui, L., and Jordan, M. Theoretically principled trade-off between robustness and accuracy. In International Conference on Machine Learning (ICML), 2019.
|
| 391 |
+
[42] Zhang, J., Xu, X., Han, B., Niu, G., Cui, L., Sugiyama, M., and Kankanhalli, M. Attacks which do not kill training make adversarial learning stronger. In International Conference on Machine Learning, pp. 11278–11287. PMLR, 2020.
|
| 392 |
+
[43] Zheng, H., Zhang, Z., Gu, J., Lee, H., and Prakash, A. Efficient adversarial training with transferable adversarial examples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1181���1190, 2020.
|
| 393 |
+
|
| 394 |
+
1. For all authors...
|
| 395 |
+
|
| 396 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 397 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 6.
|
| 398 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 6.
|
| 399 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 400 |
+
|
| 401 |
+
2. If you are including theoretical results...
|
| 402 |
+
|
| 403 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 404 |
+
|
| 405 |
+
3. If you ran experiments...
|
| 406 |
+
|
| 407 |
+
(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] An URL to our code as well as the pretrained models is provided in the Appendix.
|
| 408 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] All training hyperparameters are mentioned in the Appendix. Our technique does introduce a new hyperparameter, whose impact is discussed in Sec. 5.2.2.
|
| 409 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We do run a subset of experiments multiple times to obtain error bars (see Appendix). In doing so we confirm that our technique is effective across random initializations. However, some of the training runs in our work are too expensive to run multiple times.
|
| 410 |
+
(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] Yes, we explicitly mention the type of GPUs used and the training times in Section 5.
|
| 411 |
+
|
| 412 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 413 |
+
|
| 414 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We appropriately cite the relevant papers while using their code to reproduce/extend their results.
|
| 415 |
+
(b) Did you mention the license of the assets? [Yes] Our own codes & models, as well as, all the other codes that we use are available freely in public domain. We do mention so explicitly in Section 5.1
|
| 416 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We do share our own code and pretrained model as a part of the supplemental material
|
| 417 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 418 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 419 |
+
|
| 420 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 421 |
+
|
| 422 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 423 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 424 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/3Aoft6NWFej/3Aoft6NWFej.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PMI-MASKING: PRINCIPLED MASKING OF CORRELATED SPANS
|
| 2 |
+
|
| 3 |
+
Yoav Levine Barak Lenz Opher Lieber Omri Abend
|
| 4 |
+
|
| 5 |
+
Kevin Leyton-Brown Moshe Tennenholtz Yoav Shoham
|
| 6 |
+
|
| 7 |
+
AI21 Labs, Tel Aviv, Israel
|
| 8 |
+
|
| 9 |
+
{yoavl,barakl,opherl,omria,...}@ai21.com
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Masking tokens uniformly at random constitutes a common flaw in the pretraining of Masked Language Models (MLMs) such as BERT. We show that such uniform masking allows an MLM to minimize its training objective by latching onto shallow local signals, leading to pretraining inefficiency and suboptimal downstream performance. To address this flaw, we propose PMI-Masking, a principled masking strategy based on the concept of Pointwise Mutual Information (PMI), which jointly masks a token $n$ -gram if it exhibits high collocation over the corpus. PMIMasking motivates, unifies, and improves upon prior more heuristic approaches that attempt to address the drawback of random uniform token masking, such as whole-word masking, entity/phrase masking, and random-span masking. Specifically, we show experimentally that PMI-Masking reaches the performance of prior masking approaches in half the training time, and consistently improves performance at the end of training.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
In the couple of years since BERT was introduced in a seminal paper by Devlin et al. (2019a), Masked Language Models (MLMs) have rapidly advanced the NLP frontier (Sun et al., 2019; Liu et al., 2019; Joshi et al., 2020; Raffel et al., 2019). At the heart of the MLM approach is the task of predicting a masked subset of the text given the remaining, unmasked text. The text itself is broken up into tokens, each token consisting of a word or part of a word; thus “chair” constitutes a single token, but out-of-vocabulary words like “e-igen-val-ue” are broken up into several sub-word tokens. In BERT, $1 5 \%$ of tokens are chosen to be masked uniformly at random. It is the random choice of single tokens that we address in this paper: we show that this approach is suboptimal and offer a principled alternative.
|
| 18 |
+
|
| 19 |
+
To see why Random-Token Masking is suboptimal, consider the special case of sub-word tokens. Given the masked sentence “To approximate the matrix, we use the eigenvector corresponding to its largest e-[mask]-val-ue”, an MLM will quickly learn to predict “igen” based only on the context “e[mask]-val-ue”, rendering the rest of the sentence redundant. The question is whether the network will also learn to relate the broader context to the tokens comprising “eigenvalue”. When they are masked together, the network is forced to do so, but such masking occurs with vanishingly small probability. One might hypothesize that the network would nonetheless be able to piece such meaning together from local cues; however, we show that it often struggles to do so.
|
| 20 |
+
|
| 21 |
+
We establish this via a controlled experiment, in which we reduced the size of the vocabulary, thereby breaking more words into sub-word tokens. We compared the extent to which such vocabulary reduction degraded regular BERT relative to so-called Whole-Word Masking BERT (WWBERT) (Devlin et al., 2019b), a version of BERT that jointly masks all sub-word tokens comprising an out-of-vocabulary word during training. We show that vanilla BERT’s performance degrades much more rapidly than that of WWBERT as the vocabulary size shrinks. The intuitive explanation is that Random-Token Masking is wasteful; it overtrains on easy sub-word tasks (such as predicting “igen”) and undertrains on harder whole-word tasks (predicting “eigenvalue”).
|
| 22 |
+
|
| 23 |
+
The advantage of Whole-Word Masking over Random-Token Masking is relatively modest for standard vocabularies, because out-of-vocabulary words are rare. However, the tokenization of words is a very special case of a much broader statistical linguistic phenomenon of collocation: the cooccurrence of series of tokens at levels much greater than would be predicted simply by their individual frequencies in the corpus. There are millions of collocated word $n$ -grams — multi-word expressions, phrases, and other common word combinations — whereas there are only tens of thousands of words in frequent use. So it is reasonable to hypothesize that Random-Token Masking generates many wastefully easy problems and too few usefully harder problems because of multiword collocations, and that this affects performance even more than the rarer case of tokenized words; we show that this indeed is the case.
|
| 24 |
+
|
| 25 |
+
Several prior works have considered the idea of masking across spans longer than a single word. Sun et al. (2019) and Guu et al. (2020) proposed Knowledge Masking and Salient Span Masking, respectively, in which tokens comprising entities or phrases, as identified by external parsers, are jointly masked. While extending the scope of Whole-Word Masking, the restriction to specific types of correlated $n$ -grams, along with the reliance on imperfect tools for their identification, has limited the gains achievable by these approaches. With a similar motivation in mind, SpanBERT of Joshi et al. (2020) introduced Random-Span Masking, which masks word spans of lengths sampled from a geometric distribution at random positions in the text. Random-Span Masking was shown to consistently outperform Knowledge Masking, is simple to implement, and inspired prominent MLMs (Raffel et al., 2019). However, while Random-Span Masking increases the chances of masking collocations, with high probability the selected spans break up correlated n-grams, such that the prediction task can often be performed by relying on local cues.
|
| 26 |
+
|
| 27 |
+
In this paper we offer a principled approach to masking spans that consistently provide high signal, unifying the intuitions behind the above approaches while also outperforming them. Our approach, dubbed PMI-Masking, uses Pointwise Mutual Information (PMI) to identify collocations, which we then mask jointly. At a high level, PMI-Masking consists of two stages. First, given any pretraining corpus, we identify a set of contiguous $n$ -grams that exhibit high cooccurrence probability relative to the individual occurrence probabilities of their components. We for
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: SQuAD2.0 development set F1 scores of BERTBASE models trained with different masking schemes, evaluated every 200K steps during pretraining.
|
| 31 |
+
|
| 32 |
+
malize this notion by proposing an extended definition of Pointwise Mutual Information from bigrams to longer $n$ -grams. Second, we treat these collocated $n$ -grams as single units; the masking strategy selects at random both from these units and from standard tokens that do not participate in such units. Figure 1, detailed and reinforced by further experiments in section 5, shows that (1) PMI-Masking dramatically accelerates training, matching the end-of-pretraining performance of existing approaches in roughly half of the training time; and (2) PMI-Masking improves upon previous masking approaches at the end of pretraining.
|
| 33 |
+
|
| 34 |
+
# 2 MOTIVATION: MLMS ARE SENSITIVE TO TOKENIZATION
|
| 35 |
+
|
| 36 |
+
In this section we describe a simple experiment that motivates our PMI-Masking approach. We examined BERT’s ability to learn effective representations for words consisting of multiple subword tokens, treating this setting as an easily controlled analogue for the multi-word collocation problem that truly interests us. Our experiment sought to assess the performance gain obtained from always masking whole words as opposed to masking each individual token uniformly at random. We compared performance across a range of vocabulary sizes, using the same WordPiece Tokenizer1 that produced the original vocabulary of $\sim 3 0 \mathrm { K }$ tokens. As we decreased a 30K-token vocabulary to 10K and 2K tokens, the average length of a word over the pretraining corpus increased from 1.08 tokens to 1.22 and 2.06 tokens, respectively. Thus, by reducing the vocabulary size, we increased the frequency of multi-token words by a large factor.
|
| 37 |
+
|
| 38 |
+
Table 1: SQuAD2.0 development set F1 scores of BERTBASE models trained with Random-Token and Whole-Word masking schemes and with different vocabulary sizes (30K; 10K; 2K).
|
| 39 |
+
|
| 40 |
+
<table><tr><td></td><td>1.08 tokens per word (30K vocabulary)</td><td>1.22 tokens per word (10K vocabulary)</td><td>2.06 tokens per word (2K vocabulary)</td></tr><tr><td>Random-Token Masking</td><td>79.3</td><td>77.8</td><td>72.8</td></tr><tr><td>Whole-Word Masking</td><td>79.7</td><td>79.5</td><td>77.6</td></tr></table>
|
| 41 |
+
|
| 42 |
+
Table 1 presents the performance of BERT models trained with these vocabularies, measured as score on the SQuAD2.0 development set (the experimental setup is described in section 4). The downstream performance of Random-Token Masking substantially degraded as vocabulary size decreased and the number of spans of sub-word tokens increased. One reason for such degradation might be the model seeing less text as context (512 input tokens cover less text when more words are broken into multiple tokens). This possibly plays a role; however, for models with the same vocabularies trained via Whole-Word Masking, this degradation was significantly attenuated. We therefore conjecture that this degradation occurred primarily because of the random masking strategy, which allows the model to use “shortcuts” for minimizing its loss, thus hindering its ability to learn the distribution of the entire multi-token word.
|
| 43 |
+
|
| 44 |
+
If our conjecture is correct, such shortcuts are just as problematic in the case of inter-word collocations. In fact, for the regular 30K-token vocabulary, divided words are rare, so inter-word collocations would pose a larger problem than intra-word collocations in the common setting. One possible mitigation might be to expand the vocabulary to include multi-word collocations. However, there are millions of these, and such vocabulary sizes are currently infeasible. Even if we could get around the practical issue of size, this approach may suffer from generalization problems: the frequency of each multi-word collocation can be lower than the sample complexity for learning a meaningful representation. An alternative, more practical approach is to leave the vocabulary as is, but jointly mask co-located words, with the intention of cutting off local statistical “shortcuts” and allowing the model to improve further by learning from broader context. This is the approach we take in this paper. In what follows we detail such a masking approach and show its advantages experimentally.
|
| 45 |
+
|
| 46 |
+
# 3 MASKING CORRELATED $n$ -GRAMS
|
| 47 |
+
|
| 48 |
+
# 3.1 EXISTING MASKING APPROACHES
|
| 49 |
+
|
| 50 |
+
We now more formally present the MLM setup as well as existing masking approaches, which we implement as baselines. Given text tokenized into a sequence of tokens, Masked Language Models are trained to predict a set fraction of “masked” tokens, where this fraction is called the masking budget and is traditionally set to $1 5 \%$ . The modified input is inserted into the Transformer-based architecture (Vaswani et al., 2017) of BERT, and the pretraining task is to predict the original identity of each chosen token. Several alternatives have been proposed for choosing the set of tokens to mask.
|
| 51 |
+
|
| 52 |
+
Random-Token Masking (Devlin et al., 2019a) The original BERT implementation selects tokens for masking independently at random, where $80 \%$ of the $1 5 \%$ chosen tokens are replaced with [MASK], $10 \%$ are replaced with a random token, and $10 \%$ are kept unchanged.
|
| 53 |
+
|
| 54 |
+
Whole-Word Masking (Devlin et al., 2019b) The sequence of input tokens is segmented into units corresponding to whole words. Tokens for masking are then chosen by sampling entire units at random until the masking budget is met. Following Devlin et al. (2019a), for $8 0 \% / 1 0 \% / 1 0 \%$ of the units, all tokens are replaced with [MASK]tokens/ random tokens/ the original tokens, respectively.
|
| 55 |
+
|
| 56 |
+
Random-Span Masking (Joshi et al., 2020) Contiguous random spans are selected iteratively until the $1 5 \%$ masking budget is spent. At each iteration, a span length (in words) is sampled from a geometric distribution $\ell \sim \mathrm { G e o } ( 0 . 2 )$ , and capped at 10 words. Then, the starting point for the span to be masked is randomly selected. Replacement with [MASK], random, or original tokens is done as above, where spans constitute the units.
|
| 57 |
+
|
| 58 |
+
# 3.2 PMI: FROM BIGRAMS TO $n$ -GRAMS
|
| 59 |
+
|
| 60 |
+
Our aim is to define a masking strategy that targets correlated sequences of tokens in a principled way. Of course, modeling such correlations in large corpora was widely studied in computational linguistics (Zuidema (2006); Ramisch et al. (2012); inter alia). Particularly relevant to our work is the notion of Pointwise Mutual Information (Fano, 1961), which quantifies how often two events occur, compared with what we would expect if they were independent. Define the probability of any $n$ -gram as the number of its occurrences in the corpus divided by the number of all the $n$ -grams in the corpus. PMI leverages these probabilities to give a natural measure of collocation of bigrams: how surprising the bigram $w _ { 1 } w _ { 2 }$ is, given the unigram probabilities of $w _ { 1 }$ and $w _ { 2 }$ . Formally, given two tokens $w _ { 1 }$ and $w _ { 2 }$ , the PMI of the bigram “ $\cdot _ { w _ { 1 } w _ { 2 } }$ ” is
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathrm { P M I } ( w _ { 1 } w _ { 2 } ) = \log \frac { p ( w _ { 1 } w _ { 2 } ) } { p ( w _ { 1 } ) p ( w _ { 2 } ) } .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Importantly, PMI is qualitatively different from pure frequency: a relatively frequent bigram may not have a very high PMI score, and vice versa. For example, the bigram “book is” appears 34772 times in the WIKIPEDIA $+ \mathbf { B }$ OOKCORPUS dataset but is ranked around position 760K in the PMI ranking for bi-grams over this corpus, while the bigram “boolean algebra” appears 849 times in the corpus but is ranked around position 16K in the PMI ranking.
|
| 67 |
+
|
| 68 |
+
What about contiguous spans of more than two tokens? For a given $n$ -gram, we would again like to measure how strongly its components indicate one another. We thus require a measure that captures correlations among more than two variables. A standard and direct extension of the PMI measure to more than two variables, referred to as ‘specific correlation’ in Van de Cruys (2011), and as ‘Naive$\mathrm { P M I } _ { n } $ in this paper, is based on the ratio between the $n$ -gram’s probability and the probabilities of its component unigrams:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\mathrm { N a i v e \mathrm { - } P M I } _ { n } ( w _ { 1 } \ldots w _ { n } ) = \log { \frac { p ( w _ { 1 } \ldots w _ { n } ) } { \prod _ { j = 1 } ^ { n } p ( w _ { j } ) } }
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
As in the bivariate case, this measure compares the actual empirical probability of the $n$ -gram in the corpus with the probability it would have if its components occurred independently. However, the above definition suffers from an inherent flaw: an $n$ -gram’s Naive- $\mathrm { P M I } _ { n }$ will be high if it contains a segment with high PMI, even if that segment is not particularly correlated with the rest of the $n$ -gram. Consider for example the case of trigrams:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { \operatorname { i v e - P M I } _ { 3 } ( w _ { 1 } w _ { 2 } w _ { 3 } ) = \log \{ \frac { p ( w _ { 1 } w _ { 2 } w _ { 3 } ) } { p ( w _ { 1 } ) p ( w _ { 2 } ) p ( w _ { 3 } ) } \cdot \frac { p ( w _ { 1 } w _ { 2 } ) } { p ( w _ { 1 } w _ { 2 } ) } \} = \operatorname { P M I } ( w _ { 1 } w _ { 2 } ) + \log \frac { p ( w _ { 1 } w _ { 2 } w _ { 3 } ) } { p ( w _ { 1 } w _ { 2 } ) p ( w _ { 3 } ) } } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Where $\mathrm { P M I } ( w _ { 1 } w _ { 2 } )$ is defined in eq. 1. When $\mathrm { P M I } ( w _ { 1 } w _ { 2 } )$ is high, the Naive- $\mathrm { P M I _ { 3 } }$ measure of the trigram “w1w2w3” will start at this high baseline. The added term of log p(w1w2w3)p(w1w2)p(w3) quantifies the actual added information of “ $w _ { 3 } \mathrm { ^ { , } }$ to this correlated bigram, i.e., it quantifies how far $p ( w _ { 1 } w _ { 2 } w _ { 3 } )$ is from being separable w.r.t. the segmentation into $" w _ { 1 } w _ { 2 } "$ and $^ { 6 6 } w _ { 3 } \ '$ . For example, since the PMI of the bigram “Kuala Lumpur” is very high, the Naive- $\mathrm { P M I } _ { n }$ of the trigram “Kuala Lumpur is” is misleadingly high, placing it at position 43K out of all trigrams in the WIKIPEDIA $^ +$ BOOKCORPUS dataset. It is in fact placed much higher than obvious collocations such as the trigram “editor in chief ”, which is ranked at position 210K out of all trigrams.
|
| 81 |
+
|
| 82 |
+
In order to favor $n$ -grams that cannot be easily subdivided into shorter unrelated spans, we propose a measure of distance from separability with respect to all of an $n$ -gram’s possible segmentations rather than with respect only to the segmentation into single tokens:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\operatorname { \mathbf { P M I } } _ { n } ( w _ { 1 } \dots w _ { n } ) = \operatorname* { m i n } _ { \substack { \sigma \in \sec ( w _ { 1 } \dots w _ { n } ) } } \log \frac { p ( w _ { 1 } \dots w _ { n } ) } { \prod _ { s \in \sigma } p ( s ) }
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Here, $\sec ( w _ { 1 } \ldots w _ { n } )$ is the set of all contiguous segmentations of the $n$ -gram $^ { \bullet } w _ { 1 } \ldots w _ { n } ^ { \quad \bullet }$ (excluding the identity segmentation), where any segmentation $\sigma \in \sec ( w _ { 1 } \ldots w _ { n } )$ is composed of sub-spans which together give $^ { } w _ { 1 } \dots w _ { n } ^ { \quad \prime \prime }$ . Intuitively, this measure effectively discards the contribution of high PMI segments; the minimum in Eq. 3 implies that an $n$ -gram’s collocation score is given by its weakest link, i.e., by the segmentation that is closest to separability. When ranked by the above $\mathrm { P M I } _ { n }$ measure, the trigram “Kuala Lumpur is” is demoted to position 1.6M, since the segmentation into “Kuala Lumpur” and “is” yields unrelated segments, while the trigram “editor in chief ” is upgraded to position 33K since its segmentations yield correlated components. As we will see, this definition is not only conceptually cleaner, but also leads to improved performance.
|
| 89 |
+
|
| 90 |
+
# 3.2.1 PMI-MASKING
|
| 91 |
+
|
| 92 |
+
We implement our strategy of treating highly collocating $n$ -grams as units for masking by assembling a list of $n$ -grams as a masking vocabulary in parallel to the 30K-token vocabulary. Specifically, we make use of the entire pretraining corpus for compiling a list of collocations. We consider word $n$ -grams of lengths 2–5 having over 10 occurrences in the corpus, and include the highest ranking collocations over the corpus, as measured via our proposed $\mathrm { P M I } _ { n }$ measure (Eq. 3). Noticing that the $\mathrm { P M I } _ { n }$ measure is sensitive to the length of the $n$ -gram, we assemble per-length rankings for each $n \in \{ 2 , 3 , 4 , 5 \}$ , and integrate these rankings to compose the masking vocabulary. After conducting a preliminary evaluation of how an $n$ -gram’s quality as a collocation degrades with its $\mathrm { P M I } _ { n }$ rank (detailed in the appendix), we chose the masking vocabulary size to be 800K, for which approximately half of pretraining corpus tokens were identified as part of some correlated $n$ -gram.
|
| 93 |
+
|
| 94 |
+
In order to get some sense of the differences between the attained masking vocabulary and prior approaches, we annotated a random sample of 500 bigrams and 500 trigrams from the masking vocabulary with Entity/Not-Entity labels. We found that only around $14 \%$ of the entries in the bigrams/trigrams lists were annotated as entities, while the rest are other types of collocations. Moreover, we found that while named entities are very prevalent at the very top of the list, they are scarce otherwise. By refining the view into highest and lowest ranking PMI bigram groups, we get that $50 \%$ of the top $20 \%$ are entities while only $1 \%$ of the bottom $20 \%$ are entities, and similar trends are attained for trigrams. This breakdown can illuminate a natural intuition regarding high ranking PMI n-grams representing entities (employed also by previous works (Downey et al., 2007; Korkontzelos et al., 2008)) – indeed the top ranking PMI entries are largely entities. But we chose a much larger PMI-based masking vocabulary (see appendix 1 on the process of choosing its size), and the proportion of entities drops to around 1/7, with many of the added entries representing other types of collocations (the annotated lists are given as supplementary material).
|
| 95 |
+
|
| 96 |
+
After composing the masking vocabulary, we treat its entries as units to be masked together. All input tokens not identified with entries from the masking vocabulary are treated independently as units for masking according to the Whole-Word Masking scheme. If one masking vocabulary entry contains another entry in a given input, we treat the larger one as the unit for masking, e.g., if the masking vocabulary contains the $n$ -grams “the united states”, “air force”, and “the united states air force”, the latter will be one unit for masking when it appears. In the case of overlapping entries, we choose one at random as a unit for masking and treat the remaining tokens as independent units, e.g., if the input text contains “by the way out” and the masking vocabulary contains the $n$ -grams “by the way” and “the way out”, we can choose either “by the way” and “out” or “by” and “the way out” as units for masking.
|
| 97 |
+
|
| 98 |
+
After we segment the sequence of input tokens into units for masking, we then choose tokens for masking by sampling units uniformly at random until $1 5 \%$ of the tokens (the standard tokens of the 30K-token vocabulary) in the input are selected. As in the prior methods, replacement with [MASK] $( 8 0 \% )$ , random $( 1 0 \% )$ , or original $( 1 0 \% )$ ) tokens is done at the unit level.
|
| 99 |
+
|
| 100 |
+
# 4 EXPERIMENTAL SETUP
|
| 101 |
+
|
| 102 |
+
To evaluate the impact of PMI-Masking, we trained Base-sized BERT models (Devlin et al., 2019a) with each of the masking schemes presented in Section 3. Rather than relying on existing implementations for baseline masking schemes, which vary in training specifics, we reimplemented each scheme within the same framework used to train our PMI-Masked models. For control, we trained within the same framework models with Naive-PMI-Masking and Frequency-Masking, following the procedure described above for PMI-Masking, but ranking by the Naive- $\mathrm { P M I } _ { n }$ measure (Eq. 2) and by pure-frequency, respectively. In Section 5, we compare our PMI-Masking to all internallytrained masking schemes (Table 2) as well as with externally released models (Table 3).
|
| 103 |
+
|
| 104 |
+
# 4.1 PRETRAINING
|
| 105 |
+
|
| 106 |
+
We trained uncased models with a 30K-sized vocabulary that we constructed over WIKIPEDIA +BOOKCORPUS via the WordPiece Tokenizer used in BERT. We omitted the Next Sentence Prediction task, as it was shown to be superfluous (Joshi et al., 2020), and trained only on the Masked Language Model task during pretraining. We trained with a sequence length of 512 tokens, batch size of 256, and a varying number of steps detailed in Section 5. For pretraining, after a warmup of 10, 000 steps we used a linear learning rate decay, therefore models that ran for a different overall amount of steps are not precisely comparable after a given amount of steps. We set remaining parameters to values similar to those used in the original BERT pretraining, detailed in the appendix.
|
| 107 |
+
|
| 108 |
+
We performed the baseline pretraining over the original corpus used to train BERT: the 16GB WIKIPEDIA $^ +$ BOOKCORPUS dataset. We show that PMI-Masking achieved even larger performance gains relative to the baselines when training over more data, by adding the 38GB OPENWEBTEXT (Gokaslan & Cohen, 2019) dataset, an open-source recreation of the WebText corpus described in Radford et al. (2019). As described in section 3, we compose our $\mathrm { P M I } _ { n }$ -based masking vocabulary according to the pretraining corpus in use.
|
| 109 |
+
|
| 110 |
+
# 4.2 EVALUATION
|
| 111 |
+
|
| 112 |
+
We evaluate our pretrained models on two question answering benchmarks: the Stanford Question Answering Dataset (SQuAD) and the ReAding Comprehension from Examinations (RACE), as well as on the General Language Understanding Evaluation (GLUE) benchmark. Additionally, we report the Single-Token perplexity of our pretrained models.
|
| 113 |
+
|
| 114 |
+
• SQuAD (Rajpurkar et al., 2016) has served as a major question answering benchmark for pretrained models. It provides a paragraph of context and a question, and the task is to answer the question by extracting the relevant span from the context. We focus on the latest more challenging variant, SQuAD2.0 (Rajpurkar et al., 2018), in which some questions are not answered in the provided context, and the task includes identifying such cases.
|
| 115 |
+
• RACE (Lai et al., 2017) is a large-scale reading comprehension dataset collected from English examinations in China, designed for middle and high school students. Each passage is associated with multiple questions; for each, the task is to select one correct answer from four options. RACE has significantly longer context than other popular reading comprehension datasets and the proportion of questions that requires reasoning is very large.
|
| 116 |
+
GLUE (Wang et al., 2018) is a collection of 9 datasets for evaluating natural language understanding systems. Tasks are framed as either single-sentence classification or sentence-pair classification tasks. For full details, please see the appendix.
|
| 117 |
+
• Single-Token perplexity We evaluate an MLM’s ability to predict single-tokens by measuring perplexity over a held out test set of 110K tokens from OPENWEBTEXT. For each test example, a single token for prediction is masked and the remainder of the input tokens are unmasked.
|
| 118 |
+
|
| 119 |
+
In Tables 2 and 3, for every downstream task we swept 8 different hyperparameter configurations (batch sizes $\in \{ 1 6 , 3 2 \}$ and learning rates $\in \{ 1 , 2 , 3 , 5 \} \cdot 1 0 ^ { - 5 } )$ . We report the best median development set score over five random initializations per hyper-parameter. When applicable, the model with this score was evaluated on the test set. The development set score of each configuration was attained by fine-tuning the model over 4 epochs (SQuAD2.0 and RACE) or 3 epochs (all GLUE tasks except RTE and $\mathrm { S T S } - 1 0 $ epochs) and performing early stopping based on each task’s evaluation metric on the development set. In the preliminary experiments of Table 1, and in Figures 1 and 2 for which we evaluate many pretraining checkpoints per model, we report the average of the three middle scores out of 5 random initializations for a single set of hyper-parameters (batch size 32 and learning rate $3 \cdot 1 0 ^ { - 5 }$ ).
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
2.4M steps on Wikipedia+BookCorpus (16G)
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 2: Scores on $\mathrm { S Q u A D 2 . 0 }$ development set of BERTBASE models trained for $2 . 4 \mathbf { M }$ steps, as done by Joshi et al. (2020) when proposing Random-Span Masking. Left: PMI-Masking efficiently elicits information from limited data. Right: More data, PMI-Masking continues to improve. See numerical scores in the appendix, along with the same trends on the RACE benchmark.
|
| 126 |
+
|
| 127 |
+
# 5 EXPERIMENTAL RESULTS
|
| 128 |
+
|
| 129 |
+
We evaluated the different masking strategies in two key ways. First, we measured their effect on downstream performance throughout pretraining to assess how efficiently they used the pretraining phase. Second, we more exhaustively evaluated downstream performance of different approaches at the end of pretraining. We examine how the advantage of PMI-Masking is affected by the size of the pretraining corpus and by amount of examples seen during pretraining (batch size $\times$ training steps).
|
| 130 |
+
|
| 131 |
+
# 5.1 EVALUATING DOWNSTREAM PERFORMANCE THROUGHOUT PRETRAINING
|
| 132 |
+
|
| 133 |
+
By examining the model’s downstream performance after each 200K steps of pretraining, we demonstrate that PMI-Masking speeds up MLM training. Figure 1 investigates the standard BERT setting of pretraining on the Wikipedia $^ +$ BookCorpus dataset for 1M training steps with batch size 256. It shows that the PMI-Masking method clearly outperformed a variety of prior approaches, as well as the baseline pure frequency based masking, on the SQuAD2.0 development set for all examined checkpoints (these patterns are consistent on RACE, see detailed scores in the appendix). PMIMasking achieved the score of Random-Span Masking, the best of the existing approaches, after roughly half as many steps of pretraining.
|
| 134 |
+
|
| 135 |
+
We ran a second experiment that increased the number of steps from 1M to 2.4M, while maintaining the batch size and the pretraining corpus; this was the setting used by Joshi et al. (2020) when proposing Random-Span Masking. We observed that while PMI-masking learned much more quickly, it eventually reached a plateau, and Random-Span Masking caught up after enough training steps. Figure 2 (left) details these results.
|
| 136 |
+
|
| 137 |
+
Finally, we increased the amount of training data by adding the OPENWEBTEXT corpus $( \sim 3 . 5 \times$ more data). Figure 2 (right) demonstrates that the plateau we previously observed in PMIMasking’s performance was due to limited training data. When training for $2 . 4 \mathbf { M }$ training steps on the Wikipedia+BookCorpus $+$ OpenWebText dataset, PMI-masking reached the same score that Random-Span Masking did at the end of training after roughly half of the pretraining, and continued to improve. Thus, PMI-Masking definitively outperformed Random-Span masking in a scenario where data was not a bottleneck, as is ideally the case in MLM pretraining (Raffel et al., 2019).
|
| 138 |
+
|
| 139 |
+
# 5.2 EVALUATING DOWNSTREAM PERFORMANCE AFTER PRETRAINING
|
| 140 |
+
|
| 141 |
+
Table 2 shows that after pretraining was complete, PMI-Masking outperformed prior masking approaches in downstream performance on the SQuAD2.0, RACE, and GLUE benchmarks. In agreement with Figure 2, for longer pretraining (2.4M training steps) the absolute advantage of PMIMasking is boosted across all tasks when pretraining over a larger corpus (adding OPENWEBTEXT). The table also shows that Naive-PMI Masking, based on the straightforward extension in eq. 2 to the standard bivariate PMI, significantly falls behind our more nuanced definition in eq. 3, and is often on par with Random-Span Masking.
|
| 142 |
+
|
| 143 |
+
Table 2: Dev/Test performance on the SQuAD, RACE, and GLUE benchmarks of BERT Base sized models pretrained and evaluated according to section 4. We report EM (exact match) and F1 scores for SQuAD2 and accuracy for RACE. For GLUE we report the average scores on the development set and the official leaderboard scores on the test set (see the per-task scores in the appendix).
|
| 144 |
+
|
| 145 |
+
<table><tr><td>BERTBasewith different maskings</td><td colspan="2">SQuAD2.0 EM F1</td><td>RACE Acc.</td><td>GLUE Avg</td></tr><tr><td>1M training steps on WIKIPEDIA+BOOKCORPUS(16G):</td><td colspan="4"></td></tr><tr><td>Random-Token Masking</td><td colspan="4">76.4/- 79.6/-</td></tr><tr><td>Random-Span Masking Naive-PMI-Masking</td><td>77.1/-</td><td>80.3/-</td><td>67.8/66.2 68.6/66.9 69.7/67.8</td><td>83.1/- 83/-</td></tr><tr><td>PMI-Masking</td><td>78.2/- 78.5/-</td><td>81.3/- 81.4/-</td><td>70.1/68.4</td><td>84.1/- 84.1/-</td></tr><tr><td>2.4M training steps on WIKIPEDIA+BOOKCORPUS(16G)</td><td colspan="4"></td></tr><tr><td>Random-Span Masking</td><td>79.7/80.0</td><td>82.7/82.8</td><td>71.9/69.5</td><td>84.8/79.7</td></tr><tr><td>Naive-PMI-Masking</td><td>80.3/80.2</td><td>83.2/83.2</td><td>71.7/69.8</td><td>84.5/80.0</td></tr><tr><td>PMI-Masking</td><td>80.2/80.9</td><td>83.3/ 83.6</td><td>72.3/70.9</td><td>84.7/80.3</td></tr><tr><td>2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT(54G):</td><td colspan="4"></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>80.1/80.4</td><td>83.2/83.3</td><td>74.0/72.2</td><td>85.1/80.1</td></tr><tr><td>Naive-PMI-Masking</td><td>80.4/80.0</td><td>83.3/83.0</td><td>73.9/71.4</td><td>85.6/80.3</td></tr><tr><td>PMI-Masking</td><td>80.9/82.0</td><td>83.9/84.9</td><td>74.8/73.2</td><td>86.0/80.8</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 3: Comparing the RACE scores of our PMI-Masked models with comparable published Basesized models. The scores of prior MLMs were attained by finetuning released models in the same setup of the PMI-Masked models (Section 4), except for those marked in $^ { \bullet } \dag ^ { \bullet }$ , reported in Zhang & Li (2020). The number of examples reflects the amounts of text examined during training, as all prior models train over the same sequence length as our PMI-Masked models, namely 512. AMBERT was trained over WIKIPEDIA $^ +$ OPENWEBTEXT (47G), SpanBERT over WIKIPEDIA $^ +$ BOOKCORPUS (16G), and RoBERTa over WIKIPEDIA $^ +$ BOOKCORPUS $^ +$ OPENWEBTEXT $^ +$ STORIES $^ +$ CCNEWS (160G – see details in Liu et al. (2019)).
|
| 148 |
+
|
| 149 |
+
<table><tr><td>PMI vsPrior BASE MLMs</td><td>Corpus size</td><td>Batch × Steps = Examples</td><td>RACE dev/test</td></tr><tr><td> PMI vs n-grams in vocabulary</td><td></td><td></td><td></td></tr><tr><td>AMBERT (Zhang& Li, 2020)</td><td>47G</td><td>1024 × 0.5M= 512G</td><td>68.9†/66.8t</td></tr><tr><td>PMI-Masking</td><td>16G</td><td>256 ×1M =256M</td><td>70.1/68.4</td></tr><tr><td>PMI vs Random-Span Masking</td><td></td><td></td><td></td></tr><tr><td>SpanBERTBASE (Joshi et al., 2020)</td><td>16G</td><td>256 × 2.4M = 614.4M</td><td>70.5/68.7</td></tr><tr><td>PMI-Masking</td><td>16G</td><td>256 × 2.4M = 614.4M</td><td>72.3/70.9</td></tr><tr><td colspan="4">PMI vs Random-Token Masking with 3X more data and 6X more training examples</td></tr><tr><td>RoBERTaBAsE (Liu et al.,2019)</td><td>160G</td><td>8K × 0.5M=4G</td><td>74.9/73</td></tr><tr><td>PMI-Masking</td><td>54G</td><td>256 × 2.4M= 614.4M</td><td>74.8/73.2</td></tr></table>
|
| 150 |
+
|
| 151 |
+
We also compared our PMI-Masking Base-sized models to published Base-sized models (Table 3), and again saw PMI-Masking increase both pretraining efficiency and end-of-training downstream performance. Zhang & Li (2020) trained their ‘AMBERT’ model over a vocabulary of $n$ -grams in parallel to the regular word/subword level vocabulary, performing the hard task of $n$ -gram prediction in parallel to the easy Random-Token level prediction task during pretraining. This approach yielded a model with $7 5 \%$ more parameters than the common Base size of our PMI-Masking model. By using the PMI-masking scheme on a regular BERT architecture and vocabulary, we attained a significantly higher score on the RACE benchmark, despite training over a corpus $3 \times$ smaller and showing the model $2 \times$ fewer examples during pretraining.
|
| 152 |
+
|
| 153 |
+
Joshi et al. (2020) and Liu et al. (2019) only reported scores for SpanBERT and RoBERTa (respectively) for Large-sized models in their original papers, but did release weights for Base-sized models. We fine-tuned these models on the RACE development set via the same fine-tuning procedure we employed for our PMI-Masking models (described in Section 4), and evaluated the best performing model on the publicly available RACE test set. A PMI-Masking Base-sized model scored more than 2 points higher than the SpanBERTBASE trained by Random-Span Masking over the same pretraining corpus when shown the same number of examples. Remarkably, a PMI-Masking Base-sized model scored slightly higher than RoBERTaBASE trained by Random-Token Masking, even though RoBERTa was given access to a pretraining corpus $3 \times$ larger and shown $6 \times$ more training examples.
|
| 154 |
+
|
| 155 |
+
Lastly, we note that the measure of Single-Token perplexity is not indicative of downstream performance, when reported for models trained with different masking schemes. Comparing the adjacent table with the downstream evaluation of the same models in Table 2, it is clear that the ability to predict single tokens from context is not correlated with performance. This reinforces our observation that by minimizing their training objective, standard MLMs, which mask tokens randomly, train to excel on relatively many easy tasks that do not reflect the knowledge required for downstream understanding.
|
| 156 |
+
|
| 157 |
+
Table 4: The Single-Token perplexity of MLMs trained for 1M steps over WIKI+BOOKCORPUS.
|
| 158 |
+
|
| 159 |
+
<table><tr><td colspan="2">Single-Token Perplexity</td></tr><tr><td>Random-Token Masking</td><td>2.96</td></tr><tr><td>Random-Span Masking</td><td>4.30</td></tr><tr><td>Naive-PMI-Masking</td><td>7.35</td></tr><tr><td>PMI-Masking</td><td>21.85</td></tr></table>
|
| 160 |
+
|
| 161 |
+
# 6 CONCLUSION
|
| 162 |
+
|
| 163 |
+
Bidirectional language models hold the potential to unlock greater signal from the training data than unidirectional models (such as GPT). BERT-based MLMs are historically the first (and still the most prominent) implementation of inherently bidirectional language models, but they come at a price. A hint of this price is the fact that Single-Token perplexity, which captures the ability to predict single tokens and which has a natural probabilistic interpretation in the autoregressive unidirectional case, ceases to correlate with downstream performance across different MLMs (see Table 4). This means that the original MLM task, which is focused on single token prediction, should be reconsidered. This has been the focus of this paper, which points to the inefficiency of random-token masking, and offers PMI-masking as an alternative with several advantages: (i) It is a principled approach, based on a nuanced extension of binary PMI to the n-ary case. (ii) It leads to better downstream performance, for example it surpasses RoBERTa (which uses vanilla random token masking) on the challenging reading comprehension RACE test with $6 \times$ less training over a $3 \times$ smaller corpus, and it dominates the more naive, heuristic approach of random span masking at any point during pretraining, matches its end-of-training performance halfway during its own pretraining, and at the end of training improves on it by 1-2 points across a variety of downstream tasks. Perhaps due to their conceptual simplicity, unidirectional models were the first to break the 100B parameter limit with the recent GPT3 (Brown et al., 2020). Bidirectional models will soon follow, and this paper can accelerate their development by offering a way to significantly lower their training costs while boosting performance.
|
| 164 |
+
|
| 165 |
+
# REFERENCES
|
| 166 |
+
|
| 167 |
+
Roy Bar-Haim, Ido Dagan, Bill Dolan, Lisa Ferro, Danilo Giampiccolo, Bernardo Magnini, and Idan Szpektor. The second PASCAL recognising textual entailment challenge. In Proceedings of the second PASCAL challenges workshop on recognising textual entailment, pp. 6–4, 2006. 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. Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. Semeval-2017 task ˜ 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In International Workshop on Semantic Evaluation (SemEval), pp. 1–14, Vancouver, Canada, 2017. Ido Dagan, Oren Glickman, and Bernardo Magnini. The PASCAL recognising textual entailment challenge. In Machine Learning Challenges Workshop, pp. 177–190. Springer, 2005.
|
| 168 |
+
|
| 169 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In North American Association for Computational Linguistics (NAACL), 2019a.
|
| 170 |
+
|
| 171 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Original bert github repository. https://github.com/google-research/bert, 2019b.
|
| 172 |
+
|
| 173 |
+
William B Dolan and Chris Brockett. Automatically constructing a corpus of sentential paraphrases. In Proceedings of the International Workshop on Paraphrasing, 2005.
|
| 174 |
+
|
| 175 |
+
Doug Downey, Matthew Broadhead, and Oren Etzioni. Locating complex named entities in web text. In Proceedings of the 20th International Joint Conference on Artifical Intelligence, IJCAI’07, pp. 2733–2739, San Francisco, CA, USA, 2007. Morgan Kaufmann Publishers Inc.
|
| 176 |
+
|
| 177 |
+
R.M Fano. Transmission of Information: A Statistical Theory of Communications. Transmission of Information: A Statistical Theory of Communications. M.I.T. Press, 1961. ISBN 9780262060011. URL https://books.google.co.il/books?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ VSYIAQAAIAAJ.
|
| 178 |
+
|
| 179 |
+
Danilo Giampiccolo, Bernardo Magnini, Ido Dagan, and Bill Dolan. The third PASCAL recognizing textual entailment challenge. In Proceedings of the ACL-PASCAL workshop on textual entailment and paraphrasing, pp. 1–9, 2007.
|
| 180 |
+
|
| 181 |
+
Aaron Gokaslan and Vanya Cohen. Openwebtext corpus, 2019.
|
| 182 |
+
|
| 183 |
+
Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020.
|
| 184 |
+
|
| 185 |
+
Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. Transactions of the Association for Computational Linguistics, 8:64–77, 2020.
|
| 186 |
+
|
| 187 |
+
Ioannis Korkontzelos, Ioannis P Klapaftis, and Suresh Manandhar. Reviewing and evaluating automatic term recognition techniques. In International Conference on Natural Language Processing, pp. 248–259. Springer, 2008.
|
| 188 |
+
|
| 189 |
+
Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. Race: Large-scale reading comprehension dataset from examinations. arXiv preprint arXiv:1704.04683, 2017.
|
| 190 |
+
|
| 191 |
+
Hector J Levesque, Ernest Davis, and Leora Morgenstern. The Winograd schema challenge. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, volume 46, pp. 47, 2011.
|
| 192 |
+
|
| 193 |
+
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, 2019.
|
| 194 |
+
|
| 195 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. arXiv preprint, 2019.
|
| 196 |
+
|
| 197 |
+
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. arXiv preprint arXiv:1910.10683, 2019.
|
| 198 |
+
|
| 199 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016.
|
| 200 |
+
|
| 201 |
+
Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for squad. arXiv preprint arXiv:1806.03822, 2018.
|
| 202 |
+
|
| 203 |
+
Carlos Ramisch, Vitor De Araujo, and Aline Villavicencio. A broad evaluation of techniques for automatic acquisition of multiword expressions. In Proceedings of ACL 2012 Student Research Workshop, pp. 1–6, 2012.
|
| 204 |
+
|
| 205 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Empirical Methods in Natural Language Processing (EMNLP), pp. 1631–1642, 2013.
|
| 206 |
+
|
| 207 |
+
Yu Stephanie Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xinlun Tian, Danxiang Zhu, Hao Tian, and Hua Wu. ERNIE: Enhanced representation through knowledge integration. arXiv preprint arXiv:1904.09223, 2019.
|
| 208 |
+
|
| 209 |
+
Tim Van de Cruys. Two multivariate generalizations of pointwise mutual information. In Proceedings of the Workshop on Distributional Semantics and Compositionality, pp. 16–20, 2011.
|
| 210 |
+
|
| 211 |
+
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 (NIPS), 2017.
|
| 212 |
+
|
| 213 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018.
|
| 214 |
+
|
| 215 |
+
Alex Wang, Amapreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations (ICLR), 2019.
|
| 216 |
+
|
| 217 |
+
Alex Warstadt, Amanpreet Singh, and Samuel R. Bowman. Neural network acceptability judgments. arXiv preprint arXiv:1805.12471, 2018.
|
| 218 |
+
|
| 219 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In North American Association for Computational Linguistics (NAACL), pp. 1112–1122, 2018.
|
| 220 |
+
|
| 221 |
+
Xinsong Zhang and Hang Li. Ambert: A pre-trained language model with multi-grained tokenization. arXiv preprint arXiv:2008.11869, 2020.
|
| 222 |
+
|
| 223 |
+
Willem Zuidema. What are the productive units of natural language grammar? a dop approach to the automatic identification of constructions. In Proceedings of the Tenth Conference on Computational Natural Language Learning (CoNLL-X), pp. 29–36, 2006.
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 3: Quality measures of top ranking $\mathrm { P M I } _ { n }$ $n$ -grams lists increased in increments of 50K. The masking vocabulary size was chosen such that it includes as many $n$ -grams labeled as collocation as possible, while not including too many $n$ -grams labeled as not a collocation, in an internally constructed test set detailed below. $r$ is the percent of all positively labeled examples from the test set that appear within the given list (recall), $c$ is the percent of all negatively labeled examples from the test set that do not appear within the given list (complement-recall). We aim for a list size for which both $r$ and $c$ are high enough, and employ $f$ as a measure for this, finally choosing a list size of $8 0 0 \mathrm { K }$ .
|
| 227 |
+
|
| 228 |
+
# A DETERMINING THE MASKING VOCABULARY SIZE
|
| 229 |
+
|
| 230 |
+
The $\mathrm { P M I } _ { n }$ measure, defined in eq. 3, provides an $n$ -gram ranking function that is intended to rank an $n$ -gram higher if its components are more indicative of one another. However, this measure alone is not enough for composing a masking vocabulary: we need to decide on its size $M$ (the masking vocabulary will be composed of the top- $M$ ranked $n$ -grams). One could advocate for an ablation study in which $M$ is varied, and models are pretrained per $M$ and evaluated. This can be done in future work, and perhaps an even stronger result can be shown for PMI-Masking with masking vocabulary size chosen by such optimization.
|
| 231 |
+
|
| 232 |
+
As a proxy, we determined the masking vocabulary size $M$ via a small scale evaluation of an $n$ - gram’s “collocation quality” as a function of its $\mathrm { P M I } _ { n }$ rank. Specifically, we created an ad hoc test set composed of $1 0 0 0 ~ n$ -grams that we labeled either as collocation or not a collocation (available upon request). We did that by choosing at random 10 words with frequency above 10000 in WIKIPEDIA $^ +$ BOOKCORPUS, and for each word sampled 25 $n$ -grams per length $n \in \{ 2 , 3 , 4 , 5 \}$ that contain it. Finally, we manually labeled each collected $n$ -gram, where the textbook definition of collocation was given to the annotators (the annotator agreement was $80 \%$ over 100 shared examples).
|
| 233 |
+
|
| 234 |
+
Then, we increased a list size $M$ in steps of $5 0 \mathrm { K }$ , adding $n$ -grams from the top ranking $\mathrm { P M I } _ { n }$ downwards. For each $M$ -sized list we computed two different scores on the test set. The first is the recall of the positive examples in the list, denoted $r$ : the percent of all positively labeled examples from the test set that appear within the given list. The second is the recall of the negative examples in the complement of the list, dubbed complement-recall, denoted $c$ : the percent of all negatively labeled examples from the test set that do not appear within the given list. By these definitions, the recall $r$ starts low and increases with list size and the complement-recall $c$ follows an opposite trend, as can be seen in Figure 3. Our desired masking vocabulary size should yield a list with many $n$ -grams labeled as collocation while containing little $n$ -grams labeled not a collocation. we define $\textstyle f { \overset { } { = } } { \frac { 2 r \cdot c } { r + c } }$ as a measure for optimization which balances the two requirements, and Figure 3 shows that this measure is highest at sizes of around 700-800, so we set the masking vocabulary size to be 800K.
|
| 235 |
+
|
| 236 |
+
Table 5 shows the pretraining hyper-parameters we used, as well as the architecture specifics, both follow the standard implementation of BERT.
|
| 237 |
+
|
| 238 |
+
Number of Layers 12
|
| 239 |
+
Hidden Size 768
|
| 240 |
+
Sequence Length 512
|
| 241 |
+
FFN Inner Hidden Size 3072
|
| 242 |
+
Attention Heads 1 2
|
| 243 |
+
Attention Head Size 64
|
| 244 |
+
Dropout 0.1
|
| 245 |
+
Attention Dropout 0.1
|
| 246 |
+
Warmup Steps 10,000
|
| 247 |
+
Peak Learning Rate 1e-4
|
| 248 |
+
Batch Size 256
|
| 249 |
+
Weight Decay 0.01
|
| 250 |
+
Initializer Range 0.02
|
| 251 |
+
Learning Rate Decay Linear
|
| 252 |
+
Adam 1e-6
|
| 253 |
+
Adam $\beta _ { 1 }$ 0.9
|
| 254 |
+
Adam $\beta _ { 2 }$ 0.999
|
| 255 |
+
|
| 256 |
+
# C EVALUATION OF DIFFERENT CHECKPOINTS DURING PRETRAINING
|
| 257 |
+
|
| 258 |
+
Tables 6 and 7 respectively present the development set scores on SQuAD2.0 and RACE, attained for models at different checkpoints during pretraining. The SQuAD2.0 scores are depicted in Figures 1 and 2.
|
| 259 |
+
|
| 260 |
+
<table><tr><td>pretraining checkpoint:</td><td>200</td><td>400</td><td>600</td><td>800</td><td>1000</td><td>1200</td><td>1600</td><td>2000</td><td>2400</td></tr><tr><td colspan="10">1M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Token Masking</td><td>74.4</td><td>76.7</td><td>77.9</td><td>78.9</td><td>79.3</td><td>一</td><td></td><td></td><td></td></tr><tr><td>Whole-Word Masking</td><td>74.8</td><td>77.9</td><td>78.4</td><td>79.1</td><td>79.6</td><td></td><td></td><td></td><td></td></tr><tr><td>Frequency-Masking</td><td>75.5</td><td>78</td><td>79.2</td><td>79.4</td><td>79.7</td><td>1</td><td>1</td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>74.8</td><td>77.4</td><td>78.9</td><td>79.6</td><td>80.0</td><td></td><td></td><td></td><td></td></tr><tr><td>PMI-Masking</td><td>77.0</td><td>78.8</td><td>80.3</td><td>81.1</td><td>81.3</td><td>1</td><td></td><td></td><td></td></tr><tr><td colspan="10"> 2.4M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Span Masking</td><td>75.8</td><td>78.4</td><td></td><td></td><td>80.9</td><td>81.8</td><td>82.2</td><td></td><td>83.1</td></tr><tr><td>PMI-Masking</td><td>77.2</td><td>79.8</td><td>79.8 81.0</td><td>80.4 81.6</td><td>81.8</td><td>82.4</td><td>83.1</td><td>82.9 83.0</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>83.3</td></tr><tr><td colspan="10"> 2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT</td></tr><tr><td>Random-Span Masking</td><td>77.1</td><td>78.9</td><td>80.9</td><td>81.0</td><td>81.8</td><td>82.3</td><td>82.7</td><td>83.1</td><td>83.2</td></tr><tr><td>PMI-Masking</td><td>78.4</td><td>80.7</td><td>82.1</td><td>82.4</td><td>82.9</td><td>83.3</td><td>83.8</td><td>84.0</td><td>84.3</td></tr></table>
|
| 261 |
+
|
| 262 |
+
Table 6: The F1 score on the SQuAD2.0 development set of models taken at various checkpoints along the pretraining of BERT Base sized models trained with different masking schemes. These scores are depicted in Figures 1 and 2. We finetuned on SQuAD2.0 with batch size of 32 and learning rate of $3 \cdot 1 0 ^ { \bar { - } 5 }$ over 4 epochs without early stopping. We did this for 5 random initializations of the task’s head and the reported score is an average of the three middle scores.
|
| 263 |
+
|
| 264 |
+
<table><tr><td>pretraining checkpoint:</td><td>200</td><td>400</td><td>600</td><td>800</td><td>1000</td><td>1200</td><td>1600</td><td>2000</td><td>2400</td></tr><tr><td colspan="10">1M training steps on WIKIPEDIA+BoOKCORPUS</td></tr><tr><td>Random-Token Masking</td><td>61.2</td><td>64.3</td><td>65.6</td><td>66.4</td><td>67.1</td><td></td><td></td><td></td><td></td></tr><tr><td>Whole-Word Masking</td><td>62.0</td><td>64.9</td><td>66.0</td><td>67.0</td><td>67.8</td><td></td><td></td><td></td><td></td></tr><tr><td>Frequency-Masking</td><td>63.7</td><td>65.7</td><td>67.3</td><td>68.5</td><td>68.8</td><td></td><td></td><td></td><td></td></tr><tr><td>Random-Span Masking</td><td>61.7</td><td>64.7</td><td>66.8</td><td>67.9</td><td>68.0</td><td></td><td></td><td></td><td></td></tr><tr><td>PMI-Masking</td><td>63.5</td><td>66.8</td><td>68.4</td><td>68.9</td><td>69.7</td><td></td><td></td><td></td><td></td></tr><tr><td colspan="10">2.4M training steps on WIKIPEDIA+BOOKCORPUS</td></tr><tr><td>Random-Span Masking</td><td>62.3</td><td>64.3</td><td>65.6</td><td>67.8</td><td>69.0</td><td>68.9</td><td>70.3</td><td>71.0</td><td>71.4</td></tr><tr><td>PMI-Masking</td><td>63.6</td><td>66.7</td><td>67.3</td><td>68.5</td><td>69.2</td><td>70.4</td><td>70.5</td><td>71.2</td><td>72.2</td></tr><tr><td colspan="10">2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT</td></tr><tr><td>Random-Span Masking</td><td>64.6</td><td>67.0</td><td>69.2</td><td>69.9</td><td>70.5</td><td>71.3</td><td>72.9</td><td>73.5</td><td>73.4</td></tr><tr><td>PMI-Masking</td><td>66.5</td><td>68.6</td><td>70.7</td><td>71.4</td><td>72.4</td><td>72.5</td><td>73.6</td><td>74.1</td><td>74.5</td></tr></table>
|
| 265 |
+
|
| 266 |
+
Table 7: The accuracy score on the RACE development set of models taken at various checkpoints along the pretraining of BERT Base sized models trained with different masking schemes. We finetuned on RACE with batch size of 32 and learning rate of $3 \cdot 1 0 ^ { - 5 }$ over 4 epochs without early stopping. We did this for 5 random initializations of the task’s head and the reported score is an average of the three middle scores.
|
| 267 |
+
|
| 268 |
+
# D GLUE TASKS AND DETAILED SCORES
|
| 269 |
+
|
| 270 |
+
The General Language Understanding Evaluation (GLUE) benchmark (Wang et al., 2019) consists of 9 sentence-level tasks. Sentence-level classification tasks: CoLA (Warstadt et al., 2018) (evaluating linguistic acceptability) and SST-2 (Socher et al., 2013) (sentiment classification). Sentencepair similarity tasks: MRPC (Dolan & Brockett, 2005) (binary paraphrasing classification task), STS-B (Cer et al., 2017): (graded similarity scoring task), and $\mathrm { \bar { Q } O P ^ { 2 } }$ (binary paraphrasing classification task). Natural language inference tasks: MNLI (Williams et al., 2018), QNLI (Rajpurkar et al., 2016), RTE (Dagan et al., 2005; Bar-Haim et al., 2006; Giampiccolo et al., 2007) and WNLI (Levesque et al., 2011). Table 8 shows the detailed per-task scores of our examined models.
|
| 271 |
+
|
| 272 |
+
Table 8: Results on the different tasks of the GLUE benchmark. For all tasks the scores reflect accuracy, except for STS-B (spearman score) and CoLA (Mathews Correlation). For results reported on the development set (1M training steps), the average score is simply the average of reported scores. For results reported on the test sets (2.4M training steps), the average score is the official GLUE leaderboard score. The official score includes averaging of F1 scores for QQP and MRPC, as well as the default majority submission score of 65.1 for WNLI.
|
| 273 |
+
|
| 274 |
+
<table><tr><td>GLUE</td><td>MNLI</td><td>QNLI</td><td>QQP</td><td>RTE</td><td>SST</td><td>MRPC</td><td>CoLA</td><td>STS</td><td>Avg</td></tr><tr><td colspan="10">1Mtraining steps on Wikipedia+BookCorpus; ondev</td></tr><tr><td>Random-Span Masking</td><td>84.0/-</td><td>91.4</td><td>90.8</td><td>69.0</td><td>92.8</td><td>88.5</td><td>58.5</td><td>88.9</td><td>83.0</td></tr><tr><td>Naive-PMI-Masking</td><td>85.1/-</td><td>91.9</td><td>91.0</td><td>74.0</td><td>93.3</td><td>88.2</td><td>60.3</td><td>89.3</td><td>84.1</td></tr><tr><td>PMI-Masking</td><td>85.2/-</td><td>91.8</td><td>91.0</td><td>72.2</td><td>92.7</td><td>89.7</td><td>60.6</td><td>89.3</td><td>84.1</td></tr><tr><td colspan="10">2.4M training steps on WIKIPEDIA+BoOKCORPUS; ( on</td></tr><tr><td>Random-Span Masking</td><td>85.7/84.7</td><td>92.9</td><td>89.4</td><td>test 69.8</td><td>93</td><td>85.4</td><td>56.5</td><td>86.6</td><td>79.7</td></tr><tr><td>Naive-PMI-Masking</td><td>85.5/85.3</td><td>92.2</td><td>89.2</td><td>68.9</td><td>93.6</td><td>85.4</td><td>59.4</td><td>87.3</td><td>80.0</td></tr><tr><td>PMI-Masking</td><td>85.3/85.0</td><td>92.0</td><td>89.2</td><td>69.0</td><td>94.0</td><td>85.6</td><td>61.8</td><td>86.8</td><td>80.3</td></tr><tr><td colspan="10">2.4M training steps on WIKIPEDIA+BOOKCORPUS+OPENWEBTEXT; on test</td></tr><tr><td>Random-Span Masking</td><td>86.3/85.1</td><td>92.2</td><td>89.4</td><td>71.1</td><td>94.6</td><td>85.6</td><td>56.8</td><td>87.2</td><td>80.1</td></tr><tr><td>Naive-PMI-Masking</td><td>86/85.4</td><td>91.7</td><td>89.4</td><td>69.2</td><td>95.1</td><td>87.8</td><td>57.5</td><td>87.9</td><td>80.3</td></tr><tr><td>PMI-Masking</td><td>86.6/85.8</td><td>93.1</td><td>89.5</td><td>72.9</td><td>94.7</td><td>87.7</td><td>57.4</td><td>87.7</td><td>80.8</td></tr></table>
|
md/train/B1M8JF9xx/B1M8JF9xx.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE QUANTITATIVE ANALYSIS OF DECODERBASED GENERATIVE MODELS
|
| 2 |
+
|
| 3 |
+
Yuri Burda
|
| 4 |
+
OpenAI
|
| 5 |
+
yburda@openai.com
|
| 6 |
+
|
| 7 |
+
Yuhuai Wu Department of Computer Science University of Toronto ywu@cs.toronto.edu
|
| 8 |
+
|
| 9 |
+
Ruslan Salakhutdinov School of Computer Science Carnegie Mellon University rsalakhu@cs.cmu.edu
|
| 10 |
+
|
| 11 |
+
Roger Grosse Department of Computer Science University of Toronto rgrosse@cs.toronto.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
The past several years have seen remarkable progress in generative models which produce convincing samples of images and other modalities. A shared component of many powerful generative models is a decoder network, a parametric deep neural net that defines a generative distribution. Examples include variational autoencoders, generative adversarial networks, and generative moment matching networks. Unfortunately, it can be difficult to quantify the performance of these models because of the intractability of log-likelihood estimation, and inspecting samples can be misleading. We propose to use Annealed Importance Sampling for evaluating log-likelihoods for decoder-based models and validate its accuracy using bidirectional Monte Carlo. The evaluation code is provided at https:// github.com/tonywu95/eval_gen. Using this technique, we analyze the performance of decoder-based models, the effectiveness of existing log-likelihood estimators, the degree of overfitting, and the degree to which these models miss important modes of the data distribution.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
In recent years, deep generative models have dramatically pushed forward the state-of-the-art in generative modelling by generating convincing samples of images (Radford et al., 2016), achieving state-of-the-art semi-supervised learning results (Salimans et al., 2016), and enabling automatic image manipulation (Zhu et al., 2016). Many of the most successful approaches are defined in terms of a process which samples latent variables from a simple fixed distribution (such as Gaussian or uniform) and then applies a learned deterministic mapping which we will refer to as a decoder network. Important examples include variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), generative adversarial networks (GANs) (Goodfellow et al., 2014), generative moment matching networks (GMMNs) (Li & Swersky, 2015; Dziugaite et al., 2015), and nonlinear independent components estimation (Dinh et al., 2014). We refer to this set of models collectively as decoder-based models, also known as density networks (MacKay & Gibbs, 1998).
|
| 20 |
+
|
| 21 |
+
While many decoder-based models are able to produce convincing samples (Denton et al., 2015; Radford et al., 2016), rigorous evaluation remains a challenge. Comparing models by inspecting samples is labor-intensive, and potentially misleading (Theis et al., 2016). While alternative quantitative criteria have been proposed (Bounliphone et al., 2016; Im et al., 2016; Salimans et al., 2016), log-likelihood of held-out test data remains one of the most important measures of a generative model’s performance. Unfortunately, unless the decoder is designed to be reversible (Dinh et al., 2014; 2016), log-likelihood estimation in decoder-based models is typically intractable. In the case of VAE-based models, a learned encoder network gives a tractable lower bound, but for GANs and GMMNs it is not obvious how even to compute a good lower bound. Even when lower bounds are available, their accuracy may be hard to determine. Because of the difficulty of log-likelihood evaluation, it is hard to answer basic questions such as whether the networks are simply memorizing training examples, or whether they are missing important modes of the data distribution.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: (a) samples from a GAN with 10 latent dimensions, (b) and (c) samples from a GAN with 50 latent dimensions at different epochs of training. While it is difficult to visually discern differences between these three models, their log-likelihood (LLD) values span almost 300 nats.
|
| 25 |
+
|
| 26 |
+
The most widely used estimator of log-likelihood for GANs and GMMNs is the Kernel Density Estimator (KDE) (Parzen, 1962). It estimates the likelihood under an approximation to the model’s distribution obtained by simulating from the model and convolving the set of samples with a kernel (typically Gaussian). Unfortunately, KDE is notoriously inaccurate for estimating likelihood in high dimensions, because it is hard to tile a high-dimensional manifold with spherical Gaussians (Theis et al., 2016).
|
| 27 |
+
|
| 28 |
+
In this paper, we propose to use annealed importance sampling (AIS; (Neal, 2001)) to estimate log-likelihoods of decoder-based generative models and to obtain approximate posterior samples. Importantly, we validate this approach using Bidirectional Monte Carlo (BDMC) (Grosse et al., 2015), which provably bounds the log-likelihood estimation error and the KL divergence from the true posterior distribution for data simulated from a model. For most models we consider, we find that AIS is two orders of magnitude more accurate than KDE, and is accurate enough to perform fine-grained comparisons between generative models. In the case of VAEs, we show that AIS can be further sped up by using the recognition network to determine the initial distribution; this yields an estimator which is fast enough to be run repeatedly during training.
|
| 29 |
+
|
| 30 |
+
Using the proposed method, we analyze several scientific questions central to understanding decoderbased generative models. First, we measure the accuracy of KDE and of the importance weighting bound which is commonly used to evaluate VAEs. We find that the KDE error is larger than the (quite significant) log-likelihood differences between different models, and that KDE can lead to misleading conclusions. The importance weighted bound, while reasonably accurate, can also yield misleading results in some cases.
|
| 31 |
+
|
| 32 |
+
Second, we compare the log-likelihoods of VAEs, GANs, and GMMNs, and find that VAEs achieve log-likelihoods several hundred nats higher than the other models (even though KDE considers all three models to have roughly the same log-likelihood). Third, we analyze the degree of overfitting in VAEs, GANs, and GMMNs. Contrary to a commonly proposed hypothesis, we find that GANs and GMMNs are not simply memorizing their training data; in fact, their log-likelihood gaps between training and test data are much smaller relative to comparably-sized VAEs. Finally, by visualizing (approximate) posterior samples obtained from AIS, we observe that GANs miss important modes of the data distribution, even ones which are represented in the training data.
|
| 33 |
+
|
| 34 |
+
We emphasize that none of the above phenomena can be measured using KDE or the importance weighted bound, or by inspecting samples. (See Fig. 1 for an example where it is tricky to compare models based on samples.) While log-likelihood is by no means a perfect measure, we find that the ability to accurately estimate log-likelihoods of decoder-based models yields crucial insight into their behavior and suggests directions for improving them.
|
| 35 |
+
|
| 36 |
+
# 2 BACKGROUND
|
| 37 |
+
|
| 38 |
+
# 2.1 DECODER-BASED GENERATIVE MODELS
|
| 39 |
+
|
| 40 |
+
In generative modelling, a decoder network is often used to define a generative distribution by transforming samples from some simple distribution (e.g. normal) to the data manifold. In this
|
| 41 |
+
|
| 42 |
+
paper, we consider three kinds of decoder-based generative models: Variational Autoencoder (VAE) (Kingma & Welling, 2014), Generative Adversarial Network (GAN) (Goodfellow et al., 2014), and Generative Moment Matching Network (GMMN) (Li & Swersky, 2015; Dziugaite et al., 2015).
|
| 43 |
+
|
| 44 |
+
# 2.1.1 VARIATIONAL AUTOENCODER
|
| 45 |
+
|
| 46 |
+
A variational autoencoder (VAE) (Kingma & Welling, 2014) is a probabilistic directed graphical model. It is defined by a joint distribution over a set of latent random variables $z$ and the observed variables $x$ $: p ( x , z ) = p ( x | z ) p ( z )$ . The prior over the latent random variables, $p ( z )$ , is usually chosen to be a standard Gaussian distribution. The data likelihood $p ( x | z )$ is usually a Gaussian or Bernoulli distribution whose parameters depend on $z$ through a deep neural network, known as the decoder network. It also uses an approximate inference model called an encoder or recognition network, that serves as a variational approximation $q ( z | x )$ to the posterior $p ( z | x )$ . The decoder network and the encoder networks are jointly trained to maximize the evidence lower bound (ELBO):
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\log p ( x ) \geq \mathbb { E } _ { q ( z | x ) } [ \log p ( x | z ) ] - K L ( q ( z | x ) | | p ( z ) )
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
In addition, the reparametrization trick is used to reduce the variance of the gradient estimate.
|
| 53 |
+
|
| 54 |
+
# 2.1.2 GENERATIVE ADVERSARIAL NETWORK (GAN)
|
| 55 |
+
|
| 56 |
+
A generative adversarial network (GAN) (Goodfellow et al., 2014) is a generative model trained by a game between a decoder network and a discriminator network. It defines the generative model by sampling the latent variable $z$ from some simple prior distribution $p ( z )$ (e.g., Gaussian) followed through the decoder network. The discriminator network $D ( \cdot )$ outputs a probability of a given sample coming from the data distribution. Its task is to distinguish samples from the generator distribution from real data. The decoder network, on the other hand, tries to produce samples as realistic as possible, in order to fool the discriminator into accepting its outputs as being real. The competition between the two networks results in the following minimax problem:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } \mathbb { E } _ { x \sim p _ { d a t a } } [ \log D ( x ) ] + \mathbb { E } _ { z \sim p ( z ) } [ \log ( 1 - D ( G ( z ) ) ]
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Unlike VAE, the objective is not explicitly related to the log-likelihood of the data. Moreover, the generative distribution is a deterministic mapping, i.e., $\bar { p } ( x | z )$ is a Dirac delta distribution, parametrized by the deterministic decoder. This can make data likelihood ill-defined, as the probability density of any particular point $x$ can be either infinite, or exactly zero.
|
| 63 |
+
|
| 64 |
+
# 2.1.3 GENERATIVE MOMENT MATCHING NETWORK (GMMN)
|
| 65 |
+
|
| 66 |
+
Generative moment matching networks (GMMNs) (Li & Swersky, 2015; Dziugaite et al., 2015) adopt maximum mean discrepancy (MMD) as the training objective, a moment matching criterion where kernel mean embedding techniques are used to avoid unnecessary assumptions of the distributions. It has the same issue as GAN in that the log-likelihood is undefined.
|
| 67 |
+
|
| 68 |
+
# 2.2 ANNEALED IMPORTANCE SAMPLING
|
| 69 |
+
|
| 70 |
+
We are interested in estimating the probability $\begin{array} { r } { p ( x ) = \int p ( z ) p ( x | z ) \mathrm { d } z } \end{array}$ a model assigns to an observation $x$ . This is equivalent to computing the normalizing constant of the unnormalized distribution $f ( z ) ~ = ~ p ( z , { \bar { x } } )$ . One naïve approach is likelihood weighting, where one samples $\{ z ^ { ( k ) } \} _ { k = 1 } ^ { K } \sim p ( z )$ and averages the conditional likelihoods $p ( x | z ^ { ( k ) } )$ . This is justified by the following identity:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
p ( x ) = \int \frac { p ( x , z ) } { p ( z ) } p ( z ) \mathrm { d } z = \mathbb { E } _ { z \sim p ( z ) } [ p ( x | z ) ]
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
Likelihood weighting can be viewed as simple importance sampling, where the proposal distribution is the prior $p ( z )$ and the target distribution is the posterior $p ( z | x )$ . Unfortunately, importance sampling works well only when the proposal distribution is a good match for the target distribution. For the models considered in this paper, the (very broad) prior can be drastically different than the (highly concentrated) posterior, leading to inaccurate estimates of the likelihood.
|
| 77 |
+
|
| 78 |
+
Annealed importance sampling (AIS; Neal, 2001) is a Monte Carlo algorithm commonly used to estimate (ratios of) normalizing constants. Roughly speaking, it computes a sequence of importance sampling based estimates, each of which is stable because it involves two distributions which are very similar. In particular, suppose one is interested in estimating the normalizing constant $\begin{array} { r } { \mathcal { Z } = \int f ( \boldsymbol { z } ) \mathrm { d } \dot { \boldsymbol { z } } } \end{array}$ of an unnormalized distribution $f ( z )$ . (In the likelihood estimation setting, $f ( z ) = p ( z , x )$ and ${ \mathcal { Z } } = p ( x )$ .) One must specify a sequence of distributions $q _ { 1 } , . . . , q _ { T }$ , where $q _ { t } = f _ { t } / Z _ { t }$ , and $f _ { T } = f$ is the target distribution. It is required that one can obtain one or more exact samples from the initial distribution $q _ { 1 }$ . One must also specify a sequence of reversible MCMC transition operators $\mathcal { T } _ { 1 } , . . . , \mathcal { T } _ { T }$ , where $\mathcal { T } _ { t }$ leaves $q _ { t }$ invariant.
|
| 79 |
+
|
| 80 |
+
AIS produces a (nonnegative) unbiased estimate of the ratio $\mathcal { Z } _ { T } / \mathcal { Z } _ { 1 }$ as follows: first, we sample a random initial state $z _ { 1 } \sim q _ { 1 }$ and set the initial weight $w _ { 1 } = 1$ . For every stage $t \geq 2$ we update the weight $w$ and sample the state $z _ { t }$ according to
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
w _ { t } w _ { t - 1 } \frac { f _ { t } ( z _ { t - 1 } ) } { f _ { t - 1 } ( z _ { t - 1 } ) } \qquad z _ { t } \sim \mathcal { T } _ { t } ( z | z _ { t - 1 } )
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
As demonstrated by Neal (2001), this procedure produces a nonnegative weight $w _ { T }$ such that $\mathbb { E } [ w _ { T } ] = \mathcal { Z } _ { T } / \mathcal { Z } _ { 1 }$ . Typically, btains the un $\mathcal { Z } _ { 1 }$ is known,ed estimate le independent AIS weights. In the likelihood estimation $\{ w _ { T } ^ { ( K ) } \} _ { k = 1 } ^ { K }$ $\begin{array} { r } { \hat { \mathcal { Z } } _ { T } = \mathcal { Z } _ { 1 } \frac { 1 } { K } \sum _ { k = 1 } ^ { K } w _ { T } ^ { ( K ) } } \end{array}$
|
| 87 |
+
setting, $\mathcal { Z } _ { 1 } = 1$ and , so we denote this estimator as ${ \hat { p } } ( x )$ .
|
| 88 |
+
|
| 89 |
+
Typically, the unnormalized intermediate distributions are simply defined to be geometric averages $\dot { f _ { t } ( z ) } = \dot { \sp { \prime } } f _ { 1 } ( z ) \sp { 1 - \beta _ { t } } f _ { T } ( z ) \sp { \beta _ { t } }$ , where the $\beta _ { t }$ are monotonically increasing parameters with $\beta _ { 1 } = 0$ and $\beta _ { T } = 1$ . For $f _ { 1 } ( z ) = p ( z )$ and $f _ { T } ( z ) = p ( z , x )$ , this gives
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
f _ { t } ( z ) = p ( z ) p ( x | z ) ^ { \beta _ { t } } .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
As shown by Neal (2001), under certain regularity conditions, the variance of $\hat { \mathcal { Z } } _ { T }$ tends to zero as the number of intermediate distributions is increased. AIS is very effective in practice, and has been used to estimate normalizing constants of complex high-dimensional distributions (Salakhutdinov $\&$ Murray, 2008).
|
| 96 |
+
|
| 97 |
+
# 2.3 BIDIRECTIONAL MONTE CARLO
|
| 98 |
+
|
| 99 |
+
AIS provides a nonnegative unbiased estimate ${ \hat { p } } ( x )$ of $p ( x )$ . However, it is often more practical to estimate $p ( x )$ in the log space, i.e. $\log p ( x )$ , because of underflow problem of dealing with many products of probability measure. In general, we note that logarithm of a nonnegative unbiased estimate is a stochastic lower bound of the log estimand (Grosse et al., 2015). In particular, $\log { \hat { p } } ( x )$ is a stochastic lower bound on $\log p ( x )$ , satisfying $\mathbb { E } [ \log { \hat { p } ( x ) } ] \leq \log p ( x )$ and $\operatorname* { P r } ( \log { \hat { p } } ( x ) > \log p ( x ) +$ $b ) < e ^ { - b }$ .
|
| 100 |
+
|
| 101 |
+
Grosse et al. (2015) pointed out that if AIS is run in reverse starting from an exact posterior sample, it yields an unbiased estimate of $1 / p ( x )$ , which (by the above argument) can be seen as a stochastic upper bound on $\log p ( x )$ . The combination of lower and upper bounds from forward and reverse AIS is known as bidirectional Monte Carlo (BDMC). In many cases, the combination of bounds can pinpoint the true value quite precisely. While posterior sampling is just as hard as log-likelihood estimation (Jerrum et al., 1986), in the case of log-likelihood estimation for simulated data, one has available a single exact posterior sample: the parameters and/or latent variables which generated the data. Because this trick is only applicable to simulated data, BDMC is most useful for measuring the accuracy of a log-likelihood estimator on simulated data.
|
| 102 |
+
|
| 103 |
+
Grosse et al. (2016) observed that BDMC can also be used to validate posterior inference algorithms, as the gap between upper and lower bounds is itself a bound on the KL divergence of approximate samples from the true posterior distribution.
|
| 104 |
+
|
| 105 |
+
# 3 METHODOLOGY
|
| 106 |
+
|
| 107 |
+
For a given generative distribution $p ( x , z ) = p ( z ) p ( x | z )$ , our task is to measure the log-likelihood of test examples $\log p ( x _ { t e s t } )$ . We first discuss how we define the generative distribution for decoderbased networks. For VAE, the generative distribution is defined in the standard way, where $p ( z )$ is a standard normal distribution and $p ( x | z )$ is a normal distribution parametrized by mean $\mu _ { \boldsymbol { \theta } } ( z )$ and $\sigma _ { \theta } ( z )$ , predicted by the generator given the latent code. However, the observation distribution for GANs and GMMNs is typically taken to be a delta function, so that the model’s distribution covers only a submanifold of the space of observables. In order for the likelihood to be well-defined, we follow the same assumption made when evaluating using Kernel Density Estimator (Parzen, 1962): we assume a Gaussian observation model with a fixed variance hyperparameter $\sigma ^ { 2 }$ . We will refer to the distribution defined by this Gaussian observation model as $p _ { \sigma }$ .
|
| 108 |
+
|
| 109 |
+
Observe that the KDE estimate is given by
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\hat { p } _ { \sigma } ( x ) = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } p _ { \sigma } ( x | z ^ { ( k ) } ) ,
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
wher e {z(k)}K are samples from the prior $p ( z )$ . This is equivalent to likelihood weighting for the distribution $p _ { \sigma }$ , which is an instance of simple importance sampling (SIS). Because SIS is an unbiased estimator of the likelihood, $\log \hat { p } _ { \sigma } ( x )$ is a stochastic lower bound on $\log p _ { \sigma } ( x )$ (Grosse et al., 2015). Unfortunately, SIS can result in very poor estimates when the evidence has low prior probability (i.e. the posterior is very dissimilar to the prior). This suggests that AIS might be able to yield much more accurate log-likelihood estimates under $p _ { \sigma }$ . We note that KDE can be viewed as a special case of AIS where the number of intermediate distributions is set to 0.
|
| 116 |
+
|
| 117 |
+
We now describe specifically how we carry out evaluation using AIS. In most of our experiments, we choose the initial distribution of AIS to be $p ( z )$ , the same prior distribution used in training decoderbased models. If the model provides an encoder network (e.g., VAE), we can take the approximated distribution predicted by the encoder $q ( z | x )$ as the initial distribution of the AIS chain. For continuous data, we define the unnormalized density of target distribution to be the joint generative distribution with the Gaussian noise model, $p _ { \sigma } ( x , z ) = p _ { \sigma } ( x | z ) p ( z )$ . For the small subset of experiments done on the binary data, we define the observation model to be a Bernoulli model with mean predicted by the decoder. Our intermediate distributions are geometric averages of the prior and posterior, as in Eqn. 5. Since all of our experiments are done using continuous latent space, we use Hamiltonian Monte Carlo (Neal, 2010) as the transition operator for sampling latent samples along annealing. The evaluation code is provided at https://github.com/tonywu95/eval_gen.
|
| 118 |
+
|
| 119 |
+
# 4 RELATED WORK
|
| 120 |
+
|
| 121 |
+
AIS is known to be a powerful technique of estimating the partition function of the model. One influential example was the use of AIS to evaluate deep belief networks (Salakhutdinov & Murray, 2008). Although we used the same technique, the problem we consider is completely different. First of all, the model they consider is undirected graphical models, whereas decoder-based models are directed graphical models. Secondly, their model has a well-defined probabilistic density function in terms of energy function, whereas we need to consider different probabilistic model for one in which the the likelihood is ill-defined. In addition, we validate our estimates using BDMC.
|
| 122 |
+
|
| 123 |
+
Theis et al. (2016) give an in-depth analysis of issues that might come up in evaluating generative models. They also point out that a model that completely fails at modelling the proportion of modes of the distribution might still achieve a high likelihood score. Salimans et al. (2016) propose an image-quality measure which they find to be highly correlated with human visual judgement. They propose to feed the samples $x$ of the model to the “inception” model to obtain a conditional label distribution $p ( y | x )$ , and evaluate the score defined by exp $\mathbb { E } _ { x } \mathrm { K L } ( p ( y | x ) | | p ( y ) )$ , which is motivated by having a low entropy of $p ( y | x )$ but a large entropy of $p ( y )$ . However, the measure is largely based on visual quality of the sample, and we argue that the visual quality can be a misleading way to evaluate a model.
|
| 124 |
+
|
| 125 |
+
# 5 EXPERIMENTS
|
| 126 |
+
|
| 127 |
+
# 5.1 DATASETS
|
| 128 |
+
|
| 129 |
+
All of our experiments were performed on the MNIST dataset of images of handwritten digits (LeCun et al., 1998). For consistency with prior work on evaluating decoder-based models, most of our experiments used the continuous inputs. We dequantized the data following Uria et al. (2013), by adding a uniform noise of $\scriptstyle { \frac { 1 } { 2 5 6 } }$ to the data and rescaling it to be in $[ 0 , 1 ] ^ { D }$ after dequantization. We use the standard split of MNIST into 60,000 training and 10,000 test examples, and used 50,000 images from the training set for training, and remaining 10,000 images for validation. In addition, some of our experiments used the binarized MNIST dataset with a Bernoulli observation model (Salakhutdinov & Murray, 2008).
|
| 130 |
+
|
| 131 |
+
# 5.2 MODELS
|
| 132 |
+
|
| 133 |
+
For most of our experiments, we considered two decoder architectures: a small one with 10 latent dimensions, and a larger one with 50 latent dimensions. We use standard Normal distribution as prior for training all of our models. All layers were fully connected, and the number of units in each layer was 10–64–256–256-1024–784 for the smaller architecture and 50–1024–1024–1024–784 for the larger one. We trained both architectures using the VAE, GAN, and GMMN objectives, resulting in six networks which we refer to as VAE-10, VAE-50, etc. In general, the larger architecture performed substantially better on both the training and test sets, but we analyze the smaller architecture as well because it better highlights some of the differences between the training criteria. Additional architectural details are given in Appendix A.1.
|
| 134 |
+
|
| 135 |
+
In order to enable a direct comparison between training criteria, all models used a spherical Gaussian observation model with fixed variance. This is consistent with previous protocols for evaluating GANs and GMMNs. However, we note that this observation model is a nontrivial constraint on the VAEs, which could instead be trained with a more flexible diagonal Gaussian observation model where the variances depend on the latent state. Such observation models can easily achieve much higher log-likelihood scores, for instance by noticing that boundary pixels are always close to 0. (E.g., we trained a VAE with the more general observation model which achieved a log-likelihood of at least 2200 nats on continuous MNIST.) Therefore, the log-likelihood values we report should not be compared directly against networks which have a more flexible observation model.
|
| 136 |
+
|
| 137 |
+
# 5.3 VALIDATION OF LOG-LIKELIHOOD ESTIMATES
|
| 138 |
+
|
| 139 |
+
Before we analyze the performance of the trained networks, we must first determine the accuracy of the log-likelihood estimators. In this section, we validate the accuracy of our AIS-based estimates using BDMC. We then analyze the error in the KDE and IWAE estimates and highlight some cases where these measures miss important phenomena.
|
| 140 |
+
|
| 141 |
+
# 5.3.1 VALIDATION OF AIS
|
| 142 |
+
|
| 143 |
+
We used AIS to estimate log-likelihoods for all models under consideration. Except where otherwise specified, all AIS estimates were obtained using 16 independent chains, 10,000 intermediate distributions of the form in Eqn. 5, and a transition operator consisting of one proposed HMC trajectory with 10 leapfrog steps.1 Following Ranzato et al. (2010), the HMC stepsize was tuned to achieve an acceptance rate of 0.65 (as recommended by Neal (2010)).
|
| 144 |
+
|
| 145 |
+
For all six models, we evaluated the accuracy of this estimation procedure using BDMC on data sampled from the model’s distribution on 1000 simulated examples. The gap between the loglikelihood estimates produced by forward AIS (which gives a lower bound) and reverse AIS (which gives an upper bound) bounds the error of the AIS estimates on simulated data. We refer to this gap as the BDMC gap. For five of the six networks under consideration, we found the BDMC gap to be less than 1 nat. For the remaining model (GAN-50), the gap was about 10 nats. Both gaps are much smaller than our measured log-likelihood differences between models. If these gaps are representative of the true error in the estimates on the real data, then this indicates AIS is accurate enough to make fine-grained comparisons between models and to benchmark other log-likelihood estimators. (The BDMC gap is not guaranteed to hold for the real data, although Grosse et al. (2016) found the behavior of AIS to match closely between real and simulated data.)
|
| 146 |
+
|
| 147 |
+
# 5.3.2 HOW ACCURATE IS KERNEL DENSITY ESTIMATION?
|
| 148 |
+
|
| 149 |
+
Kernel density estimation (KDE) (Parzen, 1962) is widely used to evaluate decoder-based models (Goodfellow et al., 2014; Li & Swersky, 2015), and a variant was proposed in the setting of evaluating Boltzmann machines (Bengio et al., 2013). Papers reporting KDE estimates often caution that the
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
|
| 153 |
+
Figure 2: (a) Log-likelihood of GAN-50, under different choices of variance parameter. (b) Log-likelihood of GMMN-10 on 100 simulated examples evaluated by AIS and KDE vs. the corresponding running time. We show the BDMC gap converges to almost zero as we increase the running time. (c) Log-likelihood of IWAE on 10,000 test examples evaluated by AIS and IWAE bound vs. running time. (a), (b) are results on continuous MNIST, and (c) is on binarized MNIST. Note that AIS/AIS $^ +$ encoder dominates the other estimate in both estimation accuracy and running time
|
| 154 |
+
Table 1: AIS vs. IWAE bound on 10,000 test examples of binarized MNIST. “# dist” denotes the number of intermediate distributions used for evalution. We find AIS estimate is consistently 1 nat higher than IWAE bound; AIS+encoder can achieve about the same estimate as AIS, but with 1 order of magnitude less number of intermediate distributions.
|
| 155 |
+
|
| 156 |
+
<table><tr><td rowspan=2 colspan=2>(Nats)IWAE</td><td rowspan=1 colspan=1>AIS</td><td rowspan=1 colspan=1>AIS+encoder</td><td rowspan=1 colspan=1>IWAE bound</td><td rowspan=1 colspan=1># dist AIS</td><td rowspan=1 colspan=1># dist AIS+encoder</td><td rowspan=1 colspan=1># samples</td></tr><tr><td rowspan=1 colspan=1>IWAE</td><td rowspan=1 colspan=1>-85.679-85.619</td><td rowspan=1 colspan=1>-85.754-85.621</td><td rowspan=1 colspan=1>-86.902-86.464</td><td rowspan=1 colspan=1>100010000</td><td rowspan=1 colspan=1>1001000</td><td rowspan=1 colspan=1>10000100000</td></tr></table>
|
| 157 |
+
|
| 158 |
+
KDE is not meant to be applied in high-dimensional spaces and that the results might therefore be inaccurate. Nevertheless, KDE remains the standard protocol for evaluating decoder-based models. We analyzed the accuracy of the KDE estimates by comparing against AIS. Both estimates are stochastic lower bounds on the true log-likelihood (see Section 3), so larger values are guaranteed (with high probability) to be more accurate.
|
| 159 |
+
|
| 160 |
+
For each estimator, we varied one parameter influencing the computational budget; for AIS, this was the number of intermediate distributions (chosen from $\{ 1 0 0 , 5 \bar { 0 } 0 , 1 0 0 0 , 2 0 0 0 , \bar { 1 } 0 0 0 0 \} )$ , and for KDE, it was the number of samples (chosen from $\{ 1 0 0 0 0 , 1 0 0 0 0 0 , 5 0 0 0 0 0 , 1 0 0 0 0 0 0 , 2 0 0 0 0 0 \} )$ . Using GMMN-10 for illustration, we plot both log-likelihood estimates 100 simulated examples as a function of evaluation time in Fig. 2(b). We also plot the upper bound of likelihood given by running AIS in reverse direction. We see that the BDMC gap approaches to zero, validating the accuracy of AIS. We also see that the AIS estimator achieves much more accurate estimates during similar evaluation time. Furthermore, the KDE estimates appear to level off, suggesting one cannot obtain accurate results even using orders of magnitude more samples.
|
| 161 |
+
|
| 162 |
+
The KDE estimation error also impacts the estimate of the observation noise $\sigma$ , since a large value of $\sigma$ is needed for the samples to cover the full distribution. We compared the log-likelihoods estimated by AIS and KDE with varying choices of $\sigma$ on 100 training and validation examples of MNIST. We used 1 million simulated samples for KDE evaluation, which takes almost the same time as running AIS estimation. In Fig. 2(a), we show the log-likelihood of GAN-50 estimated by KDE and AIS as a function of $\sigma$ . Because the accuracy of KDE declines sharply for small $\sigma$ values, it creates a strong bias towards large $\sigma$ .
|
| 163 |
+
|
| 164 |
+
# 5.3.3 HOW ACCURATE IS THE IWAE BOUND?
|
| 165 |
+
|
| 166 |
+
In principle, one could estimate VAE likelihoods using the VAE objective function (which is a lower bound on the true log-likelihood). However, it is more common to use importance weighting, where the proposal distribution is computed by the recognition network. This is provably more accurate than the VAE bound (Burda et al., 2016). Because the importance weighted estimate corresponds to the objective function used by the Importance Weighted Autoencoder (IWAE) (Burda et al., 2016), we will refer to it as the IWAE bound.
|
| 167 |
+
|
| 168 |
+
On continuous MNIST, the IWAE bound underestimated the true log-likelihoods by at least 33.2 nats on the training set and 187.4 nats on the test set. While this is considerably more accurate than KDE, the error is still significant. Interestingly, this result also suggests that the recognition network overfits the training data.
|
| 169 |
+
|
| 170 |
+
<table><tr><td>(Nats)</td><td>AIS Test</td><td>AISTrain</td><td>BDMC gap</td><td>KDE Test</td><td>IWAE Test</td></tr><tr><td>VAE-50</td><td>991.435±6.477</td><td>1298.830±0.863</td><td>1.540</td><td>351.213</td><td>826.325</td></tr><tr><td>GAN-50</td><td>627.297±8.813</td><td>648.283±21.115</td><td>10.045</td><td>300.331</td><td>/</td></tr><tr><td>GMMN-50</td><td>593.472±8.591</td><td>607.272±1.451</td><td>1.146</td><td>277.193</td><td>/</td></tr><tr><td>VAE-10</td><td>705.375±7.411</td><td>791.029±0.810</td><td>0.832</td><td>408.659</td><td>486.466</td></tr><tr><td>GAN-10</td><td>328.772±5.538</td><td>346.640±4.260</td><td>0.934</td><td>259.673</td><td>/</td></tr><tr><td>GMMN-10</td><td>346.679±5.860</td><td>358.943±6.485</td><td>0.605</td><td>262.73</td><td>/</td></tr></table>
|
| 171 |
+
|
| 172 |
+
Table 2: Model comparisons on 1000 test and training examples of continuous MNIST. Confidence intervals reflect the variability from the choice of training or test examples (which appears to be the dominant source of error for the AIS values). AIS, KDE, and IWAE are all stochastic lower bounds on the log-likelihood.
|
| 173 |
+
|
| 174 |
+
Since VAE and IWAE results have customarily been reported on binarized MNIST, we additionally trained an IWAE in this setting. The training details are given in Appendix A.2. To show the practicality of our method, we evaluated the IWAE on the full 10000 test using AIS and IWAE bound, with different choices of intermediate distribution and number of simulated samples, shown in Table 1. We also evaluate AIS with the initial distribution defined by encoders of VAEs, denoted as AIS+encoder. We find that the IWAE bound underestimates the true value by at least 1 nat, which is a large difference by the standards of binarized MNIST. (E.g., it represents about half of the gap between a state-of-the-art permutation-invariant model (Tran et al., 2016) and one which exploits structure (van den Oord et al., 2016).) The AIS and IWAE estimates are compared in terms of evaluation time in Fig. 2 (c).
|
| 175 |
+
|
| 176 |
+
# 5.4 SCIENTIFIC FINDINGS
|
| 177 |
+
|
| 178 |
+
Having validated the accuracy of AIS, we now use it to analyze the effectiveness of various training criteria. We also highlight phenomena which would not be observable using existing log-likelihood estimators or by inspecting samples. For all experiments in this section, we used 10,000 intermediate distributions for AIS, 1 million simulated samples for KDE, and 200,000 importance samples for the IWAE bound. (These settings resulted in similar computation time for all three estimators.)
|
| 179 |
+
|
| 180 |
+
# 5.4.1 MODEL LIKELIHOOD COMPARISON
|
| 181 |
+
|
| 182 |
+
We evaluated the trained models using AIS and KDE on 1000 test examples of MNIST; results are shown in Table 2. We find that for all three training criteria, the larger architectures consistently outperformed the smaller ones. We also find that for both the 10- and 50-dimensional architectures, the VAEs achieved substantially higher log-likelihoods than GANs or GMMNs. It is not surprising that the VAEs achieved higher likelihood, because they were trained using a likelihood-based objective while the GANs and GMMNs were not. However, it is interesting that the difference in log-likelihoods was so large; in the rest of this section, we attempt to analyze what exactly is causing this large difference.
|
| 183 |
+
|
| 184 |
+
We note that the KDE errors were of the same order of magnitude as the differences between models, indicating that it cannot be used reliably to compare log-likelihoods. Furthermore, KDE did not identify the correct ordering of models; for instance, it estimated a lower log-likelihood for VAE50 than for VAE-10, even though its true log-likelihood was almost 300 nats higher. KDE also underestimated by an order of magnitude the log-likelihood improvements that resulted from using the larger architectures. (E.g., it estimated a 15 nat difference between GMMN-10 and GMMN-50, even though the true difference was 247 nats as estimated by AIS.)
|
| 185 |
+
|
| 186 |
+
These differences are also hard to observe simply by looking at samples; for instance, we were unable to visually distinguish the quality of samples for GAN-10 and GAN-50 (see Fig. 1), even though their log-likelihoods differed by almost 300 nats on both the training and test sets.
|
| 187 |
+
|
| 188 |
+
# 5.4.2 MEASURING THE DEGREE OF OVERFITTING
|
| 189 |
+
|
| 190 |
+
One question that arises in evaluation of decoder-based generative models is whether they memorize parts of the training dataset. One cannot test this by looking only at model samples. The commonly reported nearest-neighbors from the training set can be misleading (Theis et al., 2016), and interpolation in the latent space between different samples can be visually appealing, but does not provide a quantitative measure of the degree of generalization.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 3: Training curves for (a) GAN-50, (b) VAE-50, and (c) GMMN-10, as measured by AIS, KDE, and (if applicable) the IWAE lower bound. All estimates shown here are lower bounds. In (c), the gap between training and validation log-likelihoods is not fairly small (see Table 2).
|
| 194 |
+
|
| 195 |
+
To analyze the degree of overfitting, Fig. 3 shows training curves for three networks as measured by AIS, KDE, and the IWAE bound. We observe that GAN-50’s training and test log-likelihoods are nearly identical throughout training, disconfirming the hypothesis that it was memorizing training data. Both GAN-50 and GMMN-50 overfit less than VAE-50.
|
| 196 |
+
|
| 197 |
+
We also observed two phenomena which could not be measured using existing techniques. First, in the case of VAE-50, the IWAE lower bound starts to decline after 200 epochs, while the AIS estimates hold steady, suggesting it is the recognition network rather than the generative network which is overfitting most. Second, the GMMN-50 training and validation error continue to improve at 10,000 epochs, even though KDE erroneously indicates that performance has leveled off.
|
| 198 |
+
|
| 199 |
+
# 5.4.3 HOW APPROPRIATE IS THE OBSERVATION MODEL?
|
| 200 |
+
|
| 201 |
+
Appendix B addresses the questions of whether the spherical Gaussian observation model is a good fit and whether the log-likelihood differences could be an artifact of the observation model. We find that all of the models can be substantially improved by accounting for non-Gaussianity, but that this effect is insufficient to explain the gap between the VAEs and the other models.
|
| 202 |
+
|
| 203 |
+
# 5.4.4 ARE THE NETWORKS MISSING MODES?
|
| 204 |
+
|
| 205 |
+
It was previously observed that one of the potential failure modes of Boltzmann machines is to fail to generate one or more modes of a distribution or to drastically misallocate probability mass between modes (Salakhutdinov & Murray, 2008). Here we analyze this for decoder-based models.
|
| 206 |
+
|
| 207 |
+
First, we ask a coarse-grained version of this question: do the networks allocate probability mass correctly between the 10 digit classes, and if not, can this explain the difference in log-likelihood scores? In Fig. 1, we see that GAN-50’s distribution of digit classes was heavily skewed: out of 100 samples, it generated 37 images of 1’s, but only a single 2. This appears to be a large effect, but it does not explain the magnitude of the log-likelihood difference from VAEs. In particular, if the allocation of digit classes were off by a factor of 10, this effect by itself could cost at most l $\mathrm { 9 g 1 0 \approx 2 . 3 }$ nats of log-likelihood. Since VAE-50 outperformed GAN-50 by 364 nats, this effect cannot explain the difference.
|
| 208 |
+
|
| 209 |
+
However, MNIST has many factors of variability beyond simply the 10 digit classes. In order to determine whether any of the models missed more fine-grained modes, we visualized posterior samples for each model conditioned on training and test images. In particular, for each image $x$ under consideration, we used AIS to approximately sample $z$ from the posterior distribution $p ( \bar { z } | x )$ , and then ran the decoder on $z$ . While these samples are approximate, Grosse et al. (2016) point out that the BDMC gap also bounds the KL divergence of approximate samples from the true posterior. With the exception of GAN-50, our BDMC gaps were on the order of 1 nat, suggesting our approximate posterior samples are fairly representative. The results are shown in Fig. 4. Further posterior visualizations for digit class 2 (the most difficult for the models we considered) are shown in Appendix C.
|
| 210 |
+
|
| 211 |
+
Both VAEs’ posterior samples match the observations almost perfectly. (We observed a few poorly reconstructed examples on the test set, but not on the training set.) The GANs and GMMNs fail to reconstruct some of the examples on both the training and validation sets, suggesting that they failed to learn some modes of the distribution.
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 4: (a) and (b) show visualization of posterior samples of 10 training/validation examples. (c) shows visualization of posterior samples of 10 training examples of digit “2". Each column of 10 digits comes from true data and the six models. The order of visualization is: True data, GAN-10, VAE-10, GMMN-10, GAN-50, VAE-50, GMMN-50.
|
| 215 |
+
|
| 216 |
+
# ACKNOWLEDGMENTS
|
| 217 |
+
|
| 218 |
+
We like to thank Yujia Li for providing his original GMMN model and codebase, and thank Jimmy Ba for advice on training GANs. Ruslan Salakhutdinov is supported in part by Disney and ONR grant N000141310721. We also thank the developers of Lasagne (Battenberg et al., 2014) and Theano (Al-Rfou et al., 2016).
|
| 219 |
+
|
| 220 |
+
# REFERENCES
|
| 221 |
+
|
| 222 |
+
Rami Al-Rfou, Guillaume Alain, Amjad Almahairi, and et al. Theano: A python framework for fast computation of mathematical expressions, 2016.
|
| 223 |
+
|
| 224 |
+
Eric Battenberg, Sander Dieleman, Daniel Nouri, Eben Olson, Aäron van den Oord, Colin Raffel, Jan Schlüter, and Søren Kaae Sønderby. lasagne. https://github.com/Lasagne/Lasagne, 2014.
|
| 225 |
+
|
| 226 |
+
Y. Bengio, L. Yao, and K. Cho. Bounding the test log-likelihood of generative models. arXiv:1311.6184, 2013.
|
| 227 |
+
|
| 228 |
+
Wacha Bounliphone, Eugene Belilovsky, Matthew B. Blaschko, Ioannis Antonoglou, and Arthur Gretton. A test of relative similarity for model selection in generative models. In ICLR. 2016.
|
| 229 |
+
|
| 230 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In ICLR, 2016.
|
| 231 |
+
|
| 232 |
+
E. Denton, S. Chintala, A. Szlam, and R. Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. In NIPS, 2015.
|
| 233 |
+
|
| 234 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 235 |
+
|
| 236 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv:1605.08803, 2016.
|
| 237 |
+
|
| 238 |
+
Gintare Karolina Dziugaite, Daniel M. Roy, and Zoubin Ghahramani. Training generative neural networks via Maximum Mean Discrepancy optimization. In UAI. 2015.
|
| 239 |
+
|
| 240 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2672–2680. Curran Associates, Inc., 2014. URL http://papers.nips. cc/paper/5423-generative-adversarial-nets.pdf.
|
| 241 |
+
|
| 242 |
+
Roger Grosse, Siddharth Ancha, and Daniel M. Roy. Measuring the reliability of MCMC inference with bidirectional Monte Carlo. In NIPS, 2016.
|
| 243 |
+
|
| 244 |
+
Roger B. Grosse, Zoubin Ghahramani, and Ryan P. Adams. Sandwiching the marginal likelihood using bidirectional monte carlo. arXiv preprint arXiv:1511.02543, 2015.
|
| 245 |
+
|
| 246 |
+
Daniel Jiwoong Im, Chris Dongjoo Kim, Hui Jiang, and Roland Memisevic. Generating images with recurrent adversarial networks. arXiv preprint arXiv:1602.05110, 2016.
|
| 247 |
+
|
| 248 |
+
Mark R. Jerrum, Leslie G. Valiant, and Vijay V. Vazirani. Random generation of combinatorial structures from a uniform distribution. Theoretical Computer Science, 43:169–188, 1986.
|
| 249 |
+
|
| 250 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
|
| 251 |
+
|
| 252 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, November 1998.
|
| 253 |
+
|
| 254 |
+
Yujia Li and Kevin Swersky. Generative moment matching networks. In In ICML 32, 2015.
|
| 255 |
+
|
| 256 |
+
D. J. C. MacKay and M. N. Gibbs. Density networks. In J. W. Kay and D. M. Titterington (eds.), Statistics and Neural Networks, pp. 129–146. O.U.P., 1998.
|
| 257 |
+
|
| 258 |
+
Radford M. Neal. Annealed importance sampling. Statistics and Computing, 11(2):125–139, April 2001. ISSN 0960-3174. doi: 10.1023/A:1008923215028. URL http://dx.doi.org/10. 1023/A:1008923215028.
|
| 259 |
+
|
| 260 |
+
Radford M. Neal. MCMC using Hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, 54:113–162, 2010.
|
| 261 |
+
|
| 262 |
+
Emanuel Parzen. On estimation of a probability density function and mode. The Annals of Mathematical Statistics, 33(3):pp. 1065–1076, 1962. ISSN 00034851. URL http://www.jstor. org/stable/2237880.
|
| 263 |
+
|
| 264 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016.
|
| 265 |
+
|
| 266 |
+
Marc’Aurelio Ranzato, Alex Krizhevsky, and Geoffrey E Hinton. Factored 3-way restricted Boltzmann machines for modeling natural images. In International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 621–628, 2010.
|
| 267 |
+
|
| 268 |
+
Danilo J. Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Tony Jebara and Eric P. Xing (eds.), Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1278–1286. JMLR Workshop and Conference Proceedings, 2014. URL http://jmlr.org/proceedings/ papers/v32/rezende14.pdf.
|
| 269 |
+
|
| 270 |
+
Ruslan Salakhutdinov and Iain Murray. On the quantitative analysis of Deep Belief Networks. In Andrew McCallum and Sam Roweis (eds.), Proceedings of the 25th Annual International Conference on Machine Learning (ICML 2008), pp. 872–879. Omnipress, 2008.
|
| 271 |
+
|
| 272 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In NIPS, 2016.
|
| 273 |
+
|
| 274 |
+
Lucas Theis, Aäron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. In ICLR, 2016.
|
| 275 |
+
|
| 276 |
+
Dustin Tran, Rajesh Ranganath, and David M. Blei. The variational Gaussian process. In ICLR, 2016.
|
| 277 |
+
|
| 278 |
+
Benigno Uria, Iain Murray, and Hugo Larochelle. RNADE: The real-valued neural autoregressive density-estimator. In Advances in Neural Information Processing Systems 26, pp. 2175–2183. 2013. URL http://www.benignouria.com/en/research/papers/Uria2013.pdf.
|
| 279 |
+
|
| 280 |
+
Aäron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In ICML, 2016.
|
| 281 |
+
|
| 282 |
+
Martin J. Wainwright and Eero P. Simoncelli. Scale mixtures of Gaussians and the statistics of natural images. In NIPS, 1999.
|
| 283 |
+
|
| 284 |
+
Jun-Yan Zhu, Philipp Krähenbühl, Eli Shechtman, and Alexei A. Efros. Generative visual manipulation on the natural image manifold. In Proceedings of European Conference on Computer Vision (ECCV), 2016.
|
| 285 |
+
|
| 286 |
+
# A NETWORK ARCHITECTURES/TRAINING
|
| 287 |
+
|
| 288 |
+
# A.1 MODELS ON CONTINUOUS MNIST
|
| 289 |
+
|
| 290 |
+
The decoders have all fully connected layers, and the number of units in each layer was 10–64–256– 256-1024–784 for the smaller architecture and 50–1024–1024–1024–784 for the larger one. Other architecture details are summarized as follows.
|
| 291 |
+
|
| 292 |
+
• For GAN-10, we used a discriminator with the architecture 784-512-256-1, where each layer used dropout with parameter 0.5. For GAN-50, we used a discriminator with architecture 784-4096-4096-4096-4096-1. All hidden layers used dropout with parameter 0.8. All hidden layers in both networks used the tanh activation function, and the output layers used the logistic function. The larger model uses an encoder of an architecture 784-1024-1024-1024-100. We add dropout layer between each hidden layer, with a dropout rate of 0.2. The smaller model uses an encoder of an architecture 784-256-64-20. Generator’s hidden layers use tanh activation function, and the output layer uses sigmoid unit. Encoder’s hidden layers use tanh activation function, and the output layer uses linear activation.
|
| 293 |
+
• GMMN: The hidden layers use ReLU activation function, and the output layer uses sigomid unit.
|
| 294 |
+
|
| 295 |
+
For training GAN/VAE, we use our own implementation. We use Adam for optimization, and perform grid search of learning rate from $\{ 0 . 0 0 1 , 0 . 0 0 0 1 , 0 . 0 0 0 0 1 \}$ . For training GMMN, we take the implementation from https://github.com/yujiali/gmmn.git. Following the implementation, we use SGD with momentum for optimization, and perform grid search of learning rate from $\lbrace 0 . 1 , 0 . 5 , 1 , 2 \rbrace$ , with momentum 0.9.
|
| 296 |
+
|
| 297 |
+
# A.2 MODELS ON BINARIZED MNIST
|
| 298 |
+
|
| 299 |
+
Its decoder has the architecture 50-200-200-784 with all tanh hidden layers and sigmoid output layer, and its encoder is symmetric in architecture, with linear output layer. We take the implementation at https://github.com/yburda/iwae.git for training the IWAE model.The IWAE bound was computed with 50 samples during training. We keep all the hyperparameter choices the same as in the implementation.
|
| 300 |
+
|
| 301 |
+
B HOW PROBLEMATIC IS THE GAUSSIAN OBSERVATION MODEL?
|
| 302 |
+
Table 3: Optimal variance vs. Fixed variance
|
| 303 |
+
|
| 304 |
+
<table><tr><td>(Nats)</td><td colspan="3">Train</td><td colspan="3">Valid</td></tr><tr><td></td><td>Optimal</td><td>Fixed</td><td>Improvement</td><td>Optimal</td><td>Fixed</td><td>Improvement</td></tr><tr><td>GAN-50</td><td>711.405</td><td>620.498</td><td>90.907</td><td>702.699</td><td>623.492</td><td>79.207</td></tr><tr><td>GMMN-50</td><td>655.807</td><td>571.803</td><td>84.004</td><td>661.652</td><td>594.612</td><td>67.040</td></tr><tr><td>GAN-10</td><td>376.788</td><td>318.948</td><td>57.840</td><td>368.585</td><td>316.614</td><td>51.971</td></tr><tr><td>GMMN-10</td><td>393.976</td><td>345.177</td><td>48.799</td><td>371.325</td><td>332.360</td><td>38.965</td></tr></table>
|
| 305 |
+
|
| 306 |
+
In this section, we consider whether the difference in log-likelihood between models could be an artifact of the Gaussian noise model (which we know to be a poor fit). In principle, the Gaussian noise assumption could be unfair to the GANs and GMMNs, because the VAE training uses the correct observation model, while the GAN and GMMN objectives do not have any particular observation model built in.
|
| 307 |
+
|
| 308 |
+
To determine the size of this effect, we evaluated the models under a different regime where, instead of choosing a fixed value of the observation noise $\sigma$ on a validation set, $\sigma$ was tuned independently for each example.2 This is not a proper generative model, but it can be viewed as an upper bound on the log-likelihood that would be achievable with a heavy-tailed and radially symmetric noise model.3 Results are shown in Table 3. We see that adapting $\sigma$ for each example results in a log-likelihood improvement between 30 and 100 nats for all of the networks. In general, the examples which show the largest performance jump are images of 1’s (which prefer smaller $\sigma$ ) and 2’s (which prefer larger $\sigma _ { . }$ ). This is a significant effect, and suggests that one could significantly improve the log-likelihood scores by picking a better observation model. However, this effect is smaller in magnitude than the differences between VAE and GAN/GMMN log-likelihoods, so it fails to explain the likelihood difference.
|
| 309 |
+
|
| 310 |
+
# C POSTERIOR VISUALIZATION OF DIGIT “2"
|
| 311 |
+
|
| 312 |
+
According to the log-likelihood evaluation, we find digit “2" is the hardest digit for modelling. In this section we investigate the quality of modelling $" 2 "$ of each model. We randomly sampled a fixed set of 100 samples of digit “2" from training data and compare whether model capture this mode. We show the plots of “2" for GAN-10, GAN-50, VAE-10 and true data in the following figures for illustration. We see that GAN-10 fails at capturing many instances of digit “2" in the training data! We see instead of generating $" 2 "$ , it tries to generate digit “1", “7" “9", “4", “8" from reconstruction. GAN-50 does much better, its reconstruction are all digit “2" and there is only some style difference from the true data. VAE-10 totally dominates this competition, where it perfectly reconstructs all the samples of digit “2". We emphasize if directly sampling from each model, samples look visually indistinguishable (see Fig. 1), but we can clearly see differences in posterior samples.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 5: Posterior samples of digit “2" for GAN-10.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 6: Posterior samples of digit “2" for GAN-50.
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 7: Posterior samples of digit “2" for VAE-10.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 8: 100 digit “2" from training data.
|
md/train/BJfOXnActQ/BJfOXnActQ.md
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO LEARNWITH CONDITIONAL CLASS DEPENDENCIES
|
| 2 |
+
|
| 3 |
+
Xiang Jiang?†, Mohammad Havaei?, Farshid Varno?†, Gabriel Chartrand?,
|
| 4 |
+
Nicolas Chapados?, Stan Matwin†
|
| 5 |
+
?Imagia Inc., †Dalhousie University
|
| 6 |
+
{xiang.jiang,mohammad,farshid.varno,gabriel,nic}@imagia.com, stan@cs.dal.ca
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Neural networks can learn to extract statistical properties from data, but they seldom make use of structured information from the label space to help representation learning. For example “cat” and “dog” are closer than “cat” and “truck”. Although some label structure can implicitly be obtained when training on huge amounts of data, in a few-shot learning context where little data is available, making explicit use of the label structure can inform the model to reshape the representation space to reflect a global sense of class dependencies. We propose a meta-learning framework, Conditional class-Aware Meta-Learning (CAML), that conditionally transforms feature representations based on a metric space that is trained to capture inter-class dependencies. This enables a conditional modulation of the feature representations of the base-learner to impose regularities informed by the label space. Experiments show that the conditional transformation in CAML leads to more disentangled representations and achieves competitive results on the miniImageNet benchmark.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
In machine learning, the objective of classification is to train a model to categorize inputs into various classes. We usually assume a categorical distribution over the label space, and thus effectively ignore dependencies among them. However, class structure does exist in real world and is also present in most datasets. Although class structure can be implicitly obtained as a by-product during learning, it is not commonly exploited in an explicit manner to develop better learning systems. The use of label structure might not be of prime importance when having access to huge amounts of data, such the full ImageNet dataset. However, in the case of few-shot learning where little data is available, meta-information such as dependencies in the label space can be crucial.
|
| 15 |
+
|
| 16 |
+
In recent years, few-shot learning—learning from few examples across many tasks—has received considerable attention (Ravi & Larochelle, 2016; Snell et al., 2017; Finn et al., 2017; Vinyals et al., 2016). In particular, the concept of meta-learning has been shown to provide effective tools for few-shot learning tasks. In contrast to common transfer learning methods that aim to fine-tune a pre-trained model, meta-learning systems are trained by being exposed to a large number of tasks and evaluated in their ability to learn new tasks effectively. In meta-training, learning happens at two levels: a meta-learner that learns across many tasks, and a base-learner that optimizes for each task. Model-Agnostic Meta-Learning (MAML) is a gradient-based meta-learning algorithm that provides a mechanism for rapid adaptation by optimizing only for the initial parameters of the base-learner (Finn et al., 2017).
|
| 17 |
+
|
| 18 |
+
Our motivation stems from a core challenge in gradient-based meta-learning, wherein the quality of gradient information is key to fast generalization: it is known that gradient-based optimization fails to converge adequately when trained from only a few examples (Ravi & Larochelle, 2016), hampering the effectiveness of gradient-based meta-learning techniques. We hypothesize that under such circumstances, introducing a metric space trained to encode regularities of the label structure can impose global class dependencies on the model. This class structure can then provide a high-level view of the input examples, in turn leading to learning more disentangled representations.
|
| 19 |
+
|
| 20 |
+
We propose a meta-learning framework taking advantage of this class structure information, which is available in a number of applications. The Conditional class-Aware Meta-Learning (CAML) model is tasked with producing activations in a manner similar to a standard neural network, but with the additional flexibility to shift and scale those activations conditioned on some auxiliary meta-information. While there are no restrictions on the nature of the conditioning factor, in this work we model class dependencies by means of a metric space. We aim to learn a function mapping inputs to a metric space where semantic distances between instances follow an Euclidean geometry—classes that are semantically close lie in close proximity in an $\ell ^ { p }$ sense. The goal of the conditional class-aware transformation is to make explicit use of the label structure to inform the model to reshape the representation landscape in a manner that incorporates a global sense of class structure.
|
| 21 |
+
|
| 22 |
+
The contributions of this work are threefold: (i) We provide a meta-learning framework that makes use of structured class information in the form of a metric space to modulate representations in few-shot learning tasks; (ii) We introduce class-aware grouping to improve the statistical strength of few-shot learning tasks; (iii) We show experimentally that our proposed algorithm learns more disentangled representation and achieves competitive results on the miniImageNet benchmark.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND
|
| 25 |
+
|
| 26 |
+
We start by describing the meta-learning formulation proposed by Vinyals et al. (2016) and Ravi & Larochelle (2016), and review MAML (Finn et al., 2017), of which CAML is an instance.
|
| 27 |
+
|
| 28 |
+
# 2.1 META-LEARNING PROBLEM FORMULATION
|
| 29 |
+
|
| 30 |
+
The goal of meta-learning is to learn from a distribution of tasks. The learning happens on two levels: (i) a meta-level model, or meta-learner, that learns across many tasks, and (ii) a base-level model, or base-learner, that operates within each specific task. Meta-learning happens in task space, where each task can be treated as one meta-example. In the meta-learning formulation, we define a collection of regular tasks as meta-sets $\mathcal { D }$ , and each task $\mathcal { D } \in \mathcal { D }$ has its own $\mathcal { D } ^ { \mathrm { t r a i n } }$ and $\mathcal { D } ^ { \mathrm { t e s t } }$ split. $\mathcal { D } ^ { \mathrm { t r a i n } }$ is often denoted as the “support set” and $\mathcal { D } ^ { \mathrm { t e s t } }$ the “query set”. The resulting meta-learner objective is to choose parameters $\theta$ that minimize the expected loss $\mathcal { L } ( \cdot ; \theta )$ across all tasks in $\mathcal { D }$ ,
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
\begin{array} { r } { \theta ^ { * } = \mathrm { a r g m i n } _ { \theta } \mathbb { E } _ { \mathcal { D } \sim \mathcal { D } } [ \mathcal { L } ( \mathcal { D } ; \theta ) ] . } \end{array}
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
At the meta-level, the meta-sets $\mathcal { D }$ can be further split into disjoint meta-training set $\mathcal { D } _ { \mathrm { m e t a - t r a i n } }$ , meta-validation set $\mathcal { D } _ { \mathrm { m e t a - v a l i d } }$ and meta-test set $\mathcal { D } _ { \mathrm { m e t a - t e s t } }$ . The meta-learner is trained on $\mathcal { D } _ { \mathrm { m e t a - t r a i n } }$ , validated on $\mathcal { D } _ { \mathrm { m e t a - v a l i d } }$ and finally evaluated on $\mathcal { D } _ { \mathrm { m e t a - t e s t } }$ .
|
| 37 |
+
|
| 38 |
+
# 2.2 MODEL-AGNOSTIC META-LEARNING
|
| 39 |
+
|
| 40 |
+
Model-Agnostic Meta-Learning (Finn et al., 2017) is a meta-learning algorithm that aims to learn representations that encourage fast adaptation across different tasks. The meta-learner and base-learner share the same network structure, and the parameters learned by the meta-learner are used to initialize the base-learner on a new task.
|
| 41 |
+
|
| 42 |
+
To optimize the meta-learner, we first sample a set of tasks $\{ \mathcal { D } _ { 1 } , \mathcal { D } _ { 2 } , . . . , \mathcal { D } _ { S } \}$ from the meta-training set $\mathcal { D } _ { \mathrm { m e t a - t r a i n } }$ . For a meta-learner parameterized by $\theta$ , we compute its adapted parameters $\theta _ { i }$ for each sampled task $\mathcal { D } _ { i }$ . The adapted parameters $\theta _ { i }$ are task-specific and tell us the effectiveness of $\theta$ as to whether it can achieve generalization through one or a few additional gradient steps. The objective of the meta-learner is to optimize the representation $\theta$ such that it leads to good task-specific adaptations $\theta _ { i }$ with only a few gradient steps. The meta-learner performs slow learning at the meta-level across many tasks to support fast learning on new tasks. At meta-test time, we initialize the base-learner with the meta-learned representation $\theta ^ { * }$ followed by gradient-based fine-tuning.
|
| 43 |
+
|
| 44 |
+
# 3 METHOD
|
| 45 |
+
|
| 46 |
+
# 3.1 CONDITIONAL CLASS-AWARE META-LEARNING
|
| 47 |
+
|
| 48 |
+
As shown in Figure 1, the proposed Conditional class-Aware Meta-Learning (CAML) is composed of four components: an embedding function $f _ { \phi }$ that maps inputs to a metric space, a base-learner $f _ { \theta }$ that learns each individual task, an adaptation function $f _ { c }$ that conditionally modulates the representations of the base-learner, and a meta-learner that learns across different tasks. Figure 1 depicts a toy illustration of the task inference procedure where examples from three classes are mapped onto a metric space using $f _ { \phi }$ , which are further used to modulate the base-learner $f _ { \theta }$ through a conditional transformation function $f _ { c }$ .
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 1: Overview of Conditional class-Aware Meta-Learning. Inputs to the model are mapped onto an embedding space using $f _ { \phi }$ which are then used to modulate the base-learner $f _ { \theta }$ through a conditional transformation $f _ { c }$ . We use MAML (not shown) to meta-learn $f _ { c } , f _ { \theta }$ , and a metric loss to pre-train $f _ { \phi }$
|
| 52 |
+
|
| 53 |
+
The main contribution of this paper is to incorporate metric-based conditional transformations $( f _ { c } )$ into the meta-learning framework at the instance level. A notable feature of the proposed method is that the model has a global sense of the label space through the embedding function $f _ { \phi }$ by mapping examples onto the semantically meaningful metric space. The embeddings on the metric space inform the base-learner $f _ { \theta }$ about the label structure which in turn helps disentangle representations from different classes. This structured information can also provide a global view of the input examples to improve gradient-based meta-learning.
|
| 54 |
+
|
| 55 |
+
In a simplistic form, our proposed model makes predictions using
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\hat { y } = f _ { \theta } \Big ( x ; f _ { c } \big ( f _ { \phi } ( x ) \big ) \Big ) ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where the base-learner $f _ { \theta }$ is conditioned on the embedding space $f _ { \phi } \left( x \right)$ through the conditional transformation $f _ { c }$ . This is in contrast with a regular base-learner where $\hat { y } = f _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ . In our framework, we use MAML to meta-learn $f _ { c }$ and $f _ { \theta }$ . The metric space is pre-trained using distance-based loss function.
|
| 62 |
+
|
| 63 |
+
# 3.2 METRIC SPACE AS CONDITIONAL INFORMATION
|
| 64 |
+
|
| 65 |
+
We encode information of the label structure through $f _ { \phi }$ in the form of an $M$ -dimensional metric space, where each input example is reduced to a point in the metric space. The goal of the metric learning step is to optimize parameter $\phi$ such that distances between examples in the metric space are semantically meaningful. Given the parameters of the metric space $\phi$ , which is represented by a convolutional network, we calculate a centroid $\mathbf { c } _ { t }$ for each class $t$ ,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathbf { c } _ { t } = \frac { 1 } { K } \sum _ { ( \mathbf { x } _ { i } , y _ { i } ) \in \mathcal { D } ^ { \mathrm { t r a i n } } } \mathbb { 1 } _ { \{ y _ { i } = t \} } f _ { \phi } ( \mathbf { x } _ { i } ) ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $K$ denotes the number of examples for class $t$ , $\mathbb { 1 } _ { \{ y _ { i } = t \} }$ denotes an indicator function of $y _ { i }$ which takes value 1 when $y _ { i } = t$ and 0 otherwise. The centroid $\mathbf { c } _ { t }$ is the sample mean among all instances from the same class which is treated as a prototype representation of the class $t$ . The mapping function $f _ { \phi }$ is optimized to minimize the negative log-probability defined in Eq. (1) by minimizing the Euclidean distance $d$ between an example and its corresponding class centroid $\mathbf { c } _ { t }$ while maximizing its Euclidean distance to other class centroids $\mathbf { c } _ { t ^ { \prime } }$ :
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\underset { \phi } { \mathrm { a r g m i n } } \mathbb { E } \Bigg [ d ( f _ { \phi } ( \mathbf { x } _ { i } ) , \mathbf { c } _ { t } ) ) + \log \sum _ { t ^ { \prime } } \mathrm { e x p } ( - d ( f _ { \phi } ( \mathbf { x } _ { i } ) , \mathbf { c } _ { t ^ { \prime } } ) ) \Bigg ] .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
In relation to prototypical networks (Snell et al., 2017), we use the same loss function for metric learning. However, these frameworks differ in the test mode: we are not interested in example-centroid distances for label assignment, but rather in the projection $f _ { \phi } ( \mathbf { x } _ { i } )$ from the input space to the metric space that encapsulates inferred class regularities given the input example $\mathbf { x } _ { i }$ . In relation to other pre-training methods that use the meta-train classes to train a 64-way classifier, our use of the metric space imposes distance-based constraints to learn embeddings that follow semantically meaningful distance measures.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 2: Conditionally transformed convolutional block. The convolutional feature maps are conditionally scaled and shifted based on the input image’s representation in the pre-trained metric space.
|
| 81 |
+
|
| 82 |
+
We empirically find it difficult to optimize both the metric space and base-learner end-to-end. The metric space is pre-trained on the meta-train data and it is not updated during meta-learning. This also ensures the metric space is trained on a large number of classes to capture the global class dependencies.
|
| 83 |
+
|
| 84 |
+
# 3.3 CONDITIONALLY TRANSFORMED CONVOLUTIONAL BLOCK
|
| 85 |
+
|
| 86 |
+
We now turn to describing the conditionally transformed convolutional block, shown in Figure 2, which uses the metric space described in Section 3.2 to inform the base-learner about the label structure of a task. The conditional transformation $f _ { c }$ receives embeddings from the metric space and produces transformation operations to modulate convolutional representations of the base-learner $f _ { \theta }$ .
|
| 87 |
+
|
| 88 |
+
Our conditional transformation has close relation to Batch Normalization (BN) (Ioffe & Szegedy, 2015) that normalizes the input to every layer of a neural network. In order to conditionally modulate feature representations, we use Conditional Batch Normalization (CBN) (Dumoulin et al., 2017) to predict scale and shift operators from conditional input $\mathbf { s } _ { i }$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r } { \hat { \gamma } _ { c } = f _ { c , \gamma } ( \mathbf { s } _ { i } ) , \qquad \hat { \beta } _ { c } = f _ { c , \beta } ( \mathbf { s } _ { i } ) , } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $f _ { c , \gamma }$ and $f _ { c , \beta }$ can be any differentiable function. This gives our model the flexibility to shift or scale the intermediate representations based on some source information in $\mathbf { s } _ { i }$ . Since examples belonging to the same class are conceptually close, we exploit this inherent relationship in the metric space to modulate the feature maps at the example level in a way that encodes the label structure.
|
| 95 |
+
|
| 96 |
+
Once we obtained the embedding function $f _ { \phi }$ , we use two auxiliary networks, learned end-to-end together with the meta-learner, to predict the shift and scale factors of the convolutional feature map:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\hat { \gamma } _ { i , c } = f _ { c , \gamma } ( f _ { \phi } ( \mathbf { x } _ { i } ) ) , \hat { \beta } _ { i , c } = f _ { c , \beta } ( f _ { \phi } ( \mathbf { x } _ { i } ) ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Having computed $\hat { \gamma } _ { i , c }$ and $\hat { \beta } _ { i , c }$ , Conditional Batch Normalization (CBN) is applied as follows:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathrm { C B N } ( \mathbf { R } _ { i , c } | \hat { \gamma } _ { i , c } , \hat { \beta } _ { i , c } ) = \hat { \gamma } _ { i , c } \frac { { \mathbf { R } _ { i , c } - \mathbb { E } [ \mathbf { R } _ { c } ] } } { \sqrt { \mathrm { V a r } [ \mathbf { R } _ { c } ] + \epsilon } } + \hat { \beta } _ { i , c } ,
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\mathbf { R } _ { i , c }$ refers to the $c ^ { t h }$ feature map from the $i ^ { t h }$ example, $\epsilon$ is a small constant, $\beta _ { c }$ and $\gamma _ { c }$ are learnable parameters shared within a task. $\mathbb { E } [ \mathbf { R } _ { c } ]$ and $\mathrm { V a r } [ \mathbf { R } _ { c } ]$ are batch mean and variance of $\mathbf { R } _ { c }$ .
|
| 109 |
+
|
| 110 |
+
It is worthwhile to note the effect of conditional transformation. The conditional bias transformation with $\hat { \beta } _ { i , c }$ is analogous to concatenation-based conditioning where the conditional information is concatenated to the feature maps (Dumoulin et al., 2018). The conditional scaling factor provides multiplicative interactions between the metric space and the feature maps to aggregate information.
|
| 111 |
+
|
| 112 |
+
Furthermore, the goal of the conditionally transformed convolutional block is to simultaneously capture the two views of a classification task: a global view that is aware of the relationships among all classes, and a local views of the current N-way K-shot classification task. The metric space, or the global view, is pre-trained in a way that is independent of the current N-way K-shot task; while the base-learner, or the local view, attempts to develop representations for the current classification task. Although the metric space is never trained on the meta-test classes, we expect the learned metric space to generalize from the meta-train tasks to the meta-test tasks.
|
| 113 |
+
|
| 114 |
+
We further describe parameter sharing for CBN learning in Section 3.3.1, and class-aware grouping in Section 3.3.2 which provides more statistical strength for more effective few-shot learning.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 3: CBN shared architecture
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 4: Normalization methods. ‘C’ denotes channels, $\mathrm { ^ { 6 } H }$ , W’ spatial dimensions and $\mathbf { \Delta } ^ { \mathsf { } } \mathbf { N } ^ { \mathsf { \prime } }$ examples.
|
| 121 |
+
|
| 122 |
+
# 3.3.1 MULTITASK LEARNING OF CBN
|
| 123 |
+
|
| 124 |
+
Although one can predict $\hat { \gamma } _ { c }$ and $\hat { \boldsymbol \beta } _ { c }$ using two separate functions, we find it beneficial to use shared parameters as shown in Figure 3. The shared representations are more efficient at producing conditional transformations which also provide a strong inductive bias to help learning (Caruana, 1997).
|
| 125 |
+
|
| 126 |
+
# 3.3.2 CLASS-AWARE GROUPING
|
| 127 |
+
|
| 128 |
+
We propose class-aware grouping, as shown in Figure 4 (b), to further exploit properties of metric space. The motivation stems from a lack of statistical strength when learning from only a few examples. As an example, in $N .$ -way 1-shot learning, the model is required to find the most meaningful way to distinguish different classes. However, gradient-based optimization may lead to the discovery of irrelevant features which coincide with the class labels, such as background colors.
|
| 129 |
+
|
| 130 |
+
We address this problem by class-aware grouping that is guided by our metric space. This is related to “transduction”, which is a standard technique in MAML-based methods. Transduction as discussed in Nichol et al. (2018), makes use of the channel mean $\mathbb { E } [ \mathbf { R } _ { c } ]$ and variance $\mathrm { V a r } [ \mathbf { R } _ { c } ]$ , defined in Eq. (4), of query examples when evaluating a base-learner. In contrast to standard transduction methods that calculate mean and variance over all examples of the current batch, we introduce class-aware grouping that clusters examples into different groups and use group-based mean and variance to normalize different channels. The grouping is determined by distance measures in the metric space where examples are grouped together based on their nearest centroid $\mathbf { } c _ { t }$ defined in Section 3.2. Class-aware grouping is integrated into CBN as:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\mathrm { C B N } ( \mathbf { R } _ { i , c } | \hat { \gamma } _ { i , c } , \hat { \beta } _ { i , c } ) = \hat { \gamma } _ { i , c } \frac { \mathbf { R } _ { i , c } - \mathbb { E } [ \mathbf { R } _ { i , c } \cdot \mathbb { 1 } _ { \{ x _ { i } \in t \} } ] } { \sqrt { \mathrm { V a r } [ \mathbf { R } _ { i , c } \cdot \mathbb { 1 } _ { \{ x _ { i } \in t \} } ] + \epsilon } } + \hat { \beta } _ { i , c } ,
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where $\mathbb { 1 } _ { \{ x _ { i } \in t \} }$ indicates if an example $x _ { i }$ belongs to cluster $t$ , and $\mathbb { E } [ \mathbf { R } _ { i , c } { \cdot } \mathbb { 1 } _ { \{ x _ { i } \in t \} } ]$ represents the average of channel $\mathbf { R } _ { c }$ among examples clustered at $c _ { t }$ . This is depicted in Figure 4 where the channel mean and variance are calculated for every group.This approach informs the base-learner about what to expect from the query examples at the class level through channel mean and variance, which provides more explicit guidance to the meta-learning procedure.
|
| 137 |
+
|
| 138 |
+
# 3.4 TRAINING DETAILS
|
| 139 |
+
|
| 140 |
+
The base-learner $( f _ { \theta } )$ is composed of 4 layers of $3 \times 3$ convolutions with a $4 \times 4$ skip connections from the input to the final convolutional layer. The use of skip connections is to improve the gradient flow as MAML unfolds the inner loop into one computational graph. The use of skip connections is empirically important to the proposed model. Each convolutional layer has 30 channels and is followed by CBN, ReLU and $2 \times 2$ max-pooling operations. The output of the final convolution is flattened and fed to a 1-layer dense classifier. For learning the metric space $( f _ { \phi } )$ , we use the same residual network (ResNet-12) as Oreshkin et al. (2018). The metric space is pre-trained on the same meta-training dataset for 30,000 episodes and not updated while learning the base-learner. The meta-learner is trained for 50,000 episodes. We empirically observe that training the metric space and meta-learner end-to-end is overly complex and prone to over-fitting. For CBN functions $( f _ { c } )$ , we use 3 dense layers with 30 hidden units each. Every layer is followed by a ReLU except for the last layer where no activation is used. For the meta-learner, we use MAML with 1 gradient step for 1-shot learning and 5 gradient steps for 5-shot learning. We use the Adam (Kingma & Ba, 2014) optimizer and clip the L2 norm of gradients with an upper bound of 5. Similar to MAML, we use transduction where the statistics of the current batch is used for $\mathbb { E } ( . )$ and $\mathrm { V a r } ( . )$ in Eq. (4) for both training and testing.
|
| 141 |
+
|
| 142 |
+
# 4 RELATED WORK
|
| 143 |
+
|
| 144 |
+
# 4.1 META-LEARNING
|
| 145 |
+
|
| 146 |
+
Meta-learning or “learning-to-learn” (Schmidhuber, 1987; Bengio et al., 1992; Mitchell & Thrun, 1993; Vilalta & Drissi, 2002) has been studied as a means to acquire meta-knowledge across many tasks. In recent years, meta-learning has become an important approach for few-shot learning. A number of approaches aim to learn universal learning procedure approximators by supplying training examples to the meta-learner that outputs predictions on testing examples (Hochreiter et al., 2001; Vinyals et al., 2016; Santoro et al., 2016; Mishra et al., 2017). Other approaches learn to generate model parameters conditioned on training examples (Gomez & Schmidhuber, 2005; Munkhdalai & Yu, 2017; Ha et al., 2016; Gidaris & Komodakis, 2018), or learning optimization algorithms across different tasks (Ravi & Larochelle, 2016; Andrychowicz et al., 2016; Li & Malik, 2017).
|
| 147 |
+
|
| 148 |
+
# 4.1.1 GRADIENT-BASED META-LEARNING
|
| 149 |
+
|
| 150 |
+
Our work is more inline with gradient-based meta-learning that aims to learn representations that encourage fast adaptation on new tasks. These methods are based on model-agnostic meta-learning (MAML) introduced by Finn et al. (2017). While the original MAML requires second-order gradients in meta-optimization, REPTILE (Nichol et al., 2018) only uses first-order gradient information. Furthermore, Latent Embedding Optimization (LEO) (Rusu et al., 2018) is proposed to perform gradient-based optimization on a lowdimensional latent space instead of the original high-dimensional parameter space. We emphasize that all those methods do not make explicit use of structured label information, which is a main novelty in this paper.
|
| 151 |
+
|
| 152 |
+
# 4.1.2 METRIC-BASED META-LEARNING
|
| 153 |
+
|
| 154 |
+
Our work also relates closely to metric-based meta-learning that learns a metric space across different tasks. Siamese networks (Koch et al., 2015) learn a similarity measure between inputs using a shared network architecture that outputs high probability when paired examples are from the same class. Matching networks (Vinyals et al., 2016) use full context embeddings to encode examples to the metric space and use attention as a similarity measure for predictions. Prototypical networks (Snell et al., 2017) compute a centroid, or prototype, for every class that are later used for distance-based queries of new examples. Task dependent adaptive metric (TADAM) (Oreshkin et al., 2018) uses metric scaling based on tasks representations to learn a task-dependent metric space.
|
| 155 |
+
|
| 156 |
+
A notable difference between the metric-based methods and our approach is that, the metric space in our model is not aimed for distance-based classification. Rather, we use the metric space to represent class structure which facilitates the gradient-based meta learning towards better generalization. Another difference between our method and TADAM is that, TADAM scales the metric space at the task level where all examples within a task are scaled in the same manner. In contrast, our method provides instance-based conditioning that makes use of the precise representation of each example. Put another way, TADAM modulates the inference on a metric space from a task perspective, while CAML uses example-level representation to modulate the representation at the content level.
|
| 157 |
+
|
| 158 |
+
# 4.2 CONDITIONAL TRANSFORMATION
|
| 159 |
+
|
| 160 |
+
In style transfer, conditional instance normalization is proposed by Dumoulin et al. (2017) that transforms the content image conditioned on the domain of the style image. In visual question answering, De Vries et al. (2017) have shown that it is beneficial to modulate early visual signals of a pre-trained residual network by language in the form of conditional batch normalization. It was further shown that feature-wise linear modulation (Perez et al., 2017; Dumoulin et al., 2018) can efficiently select meaningful representations for visual reasoning.
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 5: t-SNE visualization of the learned metric space colored by category.
|
| 164 |
+
|
| 165 |
+
The notion that is common to all these methods is the use of an additional input source, e.g., style or language, to conditionally transform intermediate representations of a network. In few-shot learning, Zhou et al. (2018) suggested that it is easier to operate in the concept space in the form of a lower dimensional representation. This is compatible with our proposed approach that uses the metric space as concept-level representation to modulate intermediate features of the base-learner.
|
| 166 |
+
|
| 167 |
+
# 5 EXPERIMENTS
|
| 168 |
+
|
| 169 |
+
We use miniImageNet to evaluate the proposed Conditional class-Aware Meta-Learning algorithm. miniImageNet (Vinyals et al., 2016) is composed of $8 4 \times 8 4$ colored images from 100 classes, with 600 examples in each class. We adopt the class split by Ravi & Larochelle (2016) that uses 64 classes for training, 16 for validation, and 20 for test. For $N .$ -way $K$ -shot training, we randomly sample $N$ classes from the meta-train classes each containing $K$ examples for training and 20 examples for testing. At meta-testing time, we randomly sample 600 $N$ -way $K$ -shot tasks from the test classes.
|
| 170 |
+
|
| 171 |
+
# 5.1 RESULTS
|
| 172 |
+
|
| 173 |
+
The results presented in Table 1 show that our proposed algorithm has comparable performance on the state-of-the-art miniImageNet 5-way 1-shot classification task, and competitive results on the 5-way 5-shot task. Unlike LEO (Rusu et al., 2018) that applies meta-learning on pre-trained representations, our meta-learner is able to effectively operate on the high-dimensional parameter space. Our method also does not require co-training compared with TADAM (Oreshkin et al., 2018).
|
| 174 |
+
|
| 175 |
+
Figure 5 shows the t-SNE plot of the learned metric space for both meta-train and meta-validation classes. As seen in Figure 4b, examples from the meta-validation set form clusters consistent with their class membership, even though the metric space is not trained on these classes. For example, “mierkat”, “tundrarum” and “podenco” are all animals and they are clustered close together.
|
| 176 |
+
|
| 177 |
+
The first main baseline we report is MAML. CAML improves upon MAML by about $10 \%$ on both 1-shot and 5-shot tasks. This means incorporating class dependencies in the form of a metric space can greatly facilitate gradient-based meta-learning. We also compare with MAML using our base-learner architecture equipped with skip connections from the input to the last convolutional layer. MAML trained with our base-learner’s architecture yields similar performance as the original MAML, suggesting the improvement is resulted from the proposed CAML framework, rather than changes in the base-learner’s architecture.
|
| 178 |
+
|
| 179 |
+
Table 1: miniImageNet classification accuracy with $9 5 \%$ confidence intervals.
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Model</td><td>5-way 1-shot</td><td>5-way 5-shot</td></tr><tr><td>Meta-Learner LSTM (Ravi & Larochelle, 2016)</td><td>43.44% ± 0.77%</td><td>60.60% ± 0.71%</td></tr><tr><td>Matching Networks (Vinyals et al.,2016)</td><td>46.6%</td><td>60.0%</td></tr><tr><td>Prototypical Network with Soft k-Means (Ren et al., 2018)</td><td>50.41% ± 0.31%</td><td>69.88%± 0.20%</td></tr><tr><td>MetaNet (Munkhdalai & Yu, 2017)</td><td>49.21% ± 0.96%</td><td></td></tr><tr><td>TCML (Mishra et al., 2018)</td><td>55.71% ± 0.99%</td><td>68.88% ± 0.92%</td></tr><tr><td>adaResNet (Munkhdalai etal., 2018)</td><td>56.88% ± 0.62%</td><td>71.94 ± 0.57%</td></tr><tr><td>Cosine Classifier (Gidaris & Komodakis, 2018)</td><td>56.20% ± 0.86%</td><td>73.00% ± 0.64%</td></tr><tr><td>TADAM (Oreshkin et al., 2018)</td><td>58.5%</td><td>76.7%</td></tr><tr><td>LEO (Rusu et al., 2018)</td><td>61.76% ± 0.08%</td><td>77.59% ± 0.12%</td></tr><tr><td>MAML (Finn et al., 2017)</td><td>48.7% ±1.84%</td><td>63.11% ± 0.92%</td></tr><tr><td>MAML on our architecture</td><td>48.26% ±1.04%</td><td>64.25% ± 0.78%</td></tr><tr><td>Prototypical Network (Snell et al., 2017)</td><td>49.42% ± 0.78%</td><td>68.2% ± 0.66%</td></tr><tr><td>Prototypical Network on our metric space</td><td>55.96% ± 0.91%</td><td>71.64% ± 0.70%</td></tr><tr><td>CAML (with multitask learning alone)</td><td>52.56% ± 0.83%</td><td>71.35% ±1.13%</td></tr><tr><td>CAML (with class-aware grouping alone)</td><td>55.28% ±0.90%</td><td>71.14% ± 0.81%</td></tr><tr><td>CAML (full model)</td><td>59.23% ± 0.99%</td><td>72.35% ± 0.71%</td></tr></table>
|
| 182 |
+
|
| 183 |
+
The confidence intervals are constructed by sampling 600 evaluation tasks from the meta-test classes.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 6: PCA visualization of feature maps from the last convolutional layer colored by category.
|
| 187 |
+
|
| 188 |
+
The second baseline we use is prototypical network. We measure the classification ability of our metric space using prototypical network as a classifier, shown in Table 1 (Prototypical Network in our metric space). These results suggest that making predictions on the metric space alone is inferior to CAML.This can be explained by CAML’s ability to fast-adapt representations even when the metric space does not provide good separations. We also find that CAML has larger improvements in 1-shot tasks than 5-shot ones. This is because, in 1-shot learning, metric-based methods estimate class representations from a single example, making it difficult to provide a robust class estimation.
|
| 189 |
+
|
| 190 |
+
# 5.2 THE EFFECT OF CONDITIONAL TRANSFORMATION
|
| 191 |
+
|
| 192 |
+
We compare activations before and after the conditional transformation to better understand how conditional transformation modulates the feature representations. Figure 6 shows the PCA projections of the last convolutional layer in the base-learner. We observe in Figure 5a that, before conditional transformation, examples from three classes (“parallel bars”, “tile roof” and “reel”) are mixed together. In Figure 5b, after the conditional transformation is applied, one of the previously cluttered classes (“tile roof”) become separated from the rest classes. This confirms that metric space can alleviate the difficulty in few-shot learning by means of conditional transformations.
|
| 193 |
+
|
| 194 |
+
We undertake ablation studies to show the impact of multitask learning and class-aware grouping. Empirical results in Table 1 suggest that, while 1-shot learning is sensitive to multitask learning and class-aware grouping, 5-shot learning is not affected by those techniques. This is owing to a lack of statistical strength in 1-shot learning, which requires more explicit guidance in the training procedure. This means exploiting metric-based channel mean and variance can provide valuable information to improve meta-learning. More detailed ablation studies are included in Appendix A.
|
| 195 |
+
|
| 196 |
+
# 6 CONCLUSION
|
| 197 |
+
|
| 198 |
+
In this work, we propose Conditional class-Aware Meta-Learning (CAML) that incorporates class information by means of an embedding space to conditionally modulate representations of the base-learner. By conditionally transforming the intermediate representations of the base-learner, our goal is to reshape the representation with a global sense of class structure. Experiments reveal that the proposed conditional transformation can modulate the convolutional feature maps towards a more disentangled representation. We also introduce class-aware grouping to address a lack of statistical strength in few-shot learning. The proposed approach obtains competitive results with the current state-of-the-art performance on 5-way 1-shot and 5-shot miniImageNet benchmark.
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems, pp. 3981–3989, 2016.
|
| 203 |
+
|
| 204 |
+
Samy Bengio, Yoshua Bengio, Jocelyn Cloutier, and Jan Gecsei. On the optimization of a synaptic learning rule. In Preprints Conf. Optimality in Artificial and Biological Neural Networks, pp. 6–8. Univ. of Texas, 1992.
|
| 205 |
+
|
| 206 |
+
Rich Caruana. Multitask learning. Machine learning, 28(1):41–75, 1997.
|
| 207 |
+
|
| 208 |
+
Harm De Vries, Florian Strub, Jer´ emie Mary, Hugo Larochelle, Olivier Pietquin, and Aaron C Courville. ´ Modulating early visual processing by language. In Advances in Neural Information Processing Systems, pp. 6594–6604, 2017.
|
| 209 |
+
|
| 210 |
+
Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A LEARNED REPRESENTATION FOR ARTISTIC STYLE. ICLR, 2017. URL https://arxiv.org/pdf/1610.07629.pdf.
|
| 211 |
+
|
| 212 |
+
Vincent Dumoulin, Ethan Perez, Nathan Schucher, Florian Strub, Harm de Vries, Aaron Courville, and Yoshua Bengio. Feature-wise transformations. Distill, 3(7):e11, 2018.
|
| 213 |
+
|
| 214 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, pp. 1126–1135, 2017.
|
| 215 |
+
|
| 216 |
+
Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4367–4375, 2018.
|
| 217 |
+
|
| 218 |
+
Faustino Gomez and Jurgen Schmidhuber. Evolving modular fast-weight networks for control. In ¨ International Conference on Artificial Neural Networks, pp. 383–389. Springer, 2005.
|
| 219 |
+
|
| 220 |
+
David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
|
| 221 |
+
|
| 222 |
+
Sepp Hochreiter, A Steven Younger, and Peter R Conwell. Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, pp. 87–94. Springer, 2001.
|
| 223 |
+
|
| 224 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 225 |
+
|
| 226 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 227 |
+
|
| 228 |
+
Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Deep Learning Workshop, volume 2, 2015.
|
| 229 |
+
|
| 230 |
+
Ke Li and Jitendra Malik. Learning to optimize neural nets. arXiv preprint arXiv:1703.00441, 2017.
|
| 231 |
+
|
| 232 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. Meta-learning with temporal convolutions. arXiv preprint arXiv:1707.03141, 2017.
|
| 233 |
+
|
| 234 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive meta-learner. 2018.
|
| 235 |
+
|
| 236 |
+
Tom M Mitchell and Sebastian B Thrun. Explanation-based neural network learning for robot control. In Advances in neural information processing systems, pp. 287–294, 1993.
|
| 237 |
+
|
| 238 |
+
Tsendsuren Munkhdalai and Hong Yu. Meta networks. arXiv preprint arXiv:1703.00837, 2017.
|
| 239 |
+
|
| 240 |
+
Tsendsuren Munkhdalai, Xingdi Yuan, Soroush Mehri, and Adam Trischler. Rapid adaptation with conditionally shifted neurons. In International Conference on Machine Learning, pp. 3661–3670, 2018.
|
| 241 |
+
|
| 242 |
+
Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. CoRR, abs/1803.02999, 2018.
|
| 243 |
+
|
| 244 |
+
Boris N Oreshkin, Alexandre Lacoste, and Pau Rodriguez. Tadam: Task dependent adaptive metric for improved few-shot learning. arXiv preprint arXiv:1805.10123, 2018.
|
| 245 |
+
|
| 246 |
+
Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. arXiv preprint arXiv:1709.07871, 2017.
|
| 247 |
+
|
| 248 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. 2016.
|
| 249 |
+
|
| 250 |
+
Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B Tenenbaum, Hugo Larochelle, and Richard S Zemel. Meta-learning for semi-supervised few-shot classification. arXiv preprint arXiv:1803.00676, 2018.
|
| 251 |
+
|
| 252 |
+
Andrei A Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. arXiv preprint arXiv:1807.05960, 2018.
|
| 253 |
+
|
| 254 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Meta-learning with memory-augmented neural networks. In International conference on machine learning, pp. 1842–1850, 2016.
|
| 255 |
+
|
| 256 |
+
Jurgen Schmidhuber. Evolutionary principles in self-referential learning. on learning now to learn: The meta-meta-meta...-hook. Diploma thesis, Technische Universitat Munchen, Germany, 14 May 1987. URL http://www.idsia.ch/˜juergen/diploma.html.
|
| 257 |
+
|
| 258 |
+
Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning. CoRR, abs/1703.05175, 2017. URL http://arxiv.org/abs/1703.05175.
|
| 259 |
+
|
| 260 |
+
Ricardo Vilalta and Youssef Drissi. A perspective view and survey of meta-learning. Artificial Intelligence Review, 18(2):77–95, 2002.
|
| 261 |
+
|
| 262 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638, 2016.
|
| 263 |
+
|
| 264 |
+
Fengwei Zhou, Bin Wu, and Zhenguo Li. Deep meta-learning: Learning to learn in the concept space. arXiv preprint arXiv:1802.03596, 2018.
|
| 265 |
+
|
| 266 |
+
# A ADDITIONAL ABLATION STUDIES
|
| 267 |
+
|
| 268 |
+
# A.1 THE IMPACT OF MULTITASK LEARNING AND CLASS-AWARE GROUPING
|
| 269 |
+
|
| 270 |
+
To better understand the role of different components in the proposed conditional transformation, we undertake ablation studies to provide further insights into CBN. We study the impact of multitask learning detailed in Section 3.3.1 and class-aware grouping described in Section 3.3.2.
|
| 271 |
+
|
| 272 |
+
Table 2: Ablation study on the impact of multitask learning and class-aware grouping miniImageNet.
|
| 273 |
+
|
| 274 |
+
<table><tr><td>CBN</td><td>multitask</td><td>class-aware grouping</td><td>5-way 1-shot</td><td>5-way 5-shot</td></tr><tr><td>×</td><td>×</td><td>×</td><td>48.26% ± 1.04%</td><td>64.25% ± 0.78%</td></tr><tr><td>√</td><td>×</td><td>×</td><td>52.06% ± 1.12%</td><td>69.84% ± 1.28%</td></tr><tr><td>√</td><td>√</td><td>×</td><td>52.56% ± 0.83%</td><td>71.35% ± 1.13%</td></tr><tr><td>√</td><td>×</td><td>√</td><td>55.28% ± 0.90%</td><td>71.14% ± 0.81%</td></tr><tr><td>√</td><td>√</td><td>√</td><td>59.23% ± 0.99%</td><td>72.35% ± 0.71%</td></tr></table>
|
| 275 |
+
|
| 276 |
+
Table 3: Ablation study on the impact of conditional transformation operators for miniImageNet.
|
| 277 |
+
|
| 278 |
+
<table><tr><td>Model</td><td>BN</td><td>CBN with βc alone (</td><td> CBN with c alone</td><td>CBN</td></tr><tr><td>5-way 1-shot48.7% ± 1.84%</td><td></td><td>56.04% ± 0.99%</td><td>57.83% ± 1.04%</td><td>59.23% ± 0.99%</td></tr></table>
|
| 279 |
+
|
| 280 |
+
Empirical results from Table 2 suggest that, while 1-shot learning is sensitive to multitask learning and class-aware grouping, 5-shot learning is less sensitive those techniques. This is owing to a lack of sufficient training examples in 1-shot learning tasks, which requires more explicit guidance in the training procedure. We further note that, in 1-shot learning, using class-aware grouping alone can improve CBN’s performance by $3 \%$ . This means exploiting metric-based channel mean and variance can provide valuable information for gradient-based meta-learning.
|
| 281 |
+
|
| 282 |
+
# A.2 THE IMPACT OF SCALE AND SHIFT TRANSFORMATIONS
|
| 283 |
+
|
| 284 |
+
For CBN parameters, we observe that more than half of the predicted $\hat { \boldsymbol \beta } _ { c }$ are negative. This is inline with findings from Perez et al. (2017) that CBN selectively suppresses activations of a feature map when followed by a ReLU. To further examine the impact of the scale and shift operators, we train CBN with each operator alone. Table 3 shows CBN works the best when both $\hat { \gamma } _ { c }$ and $\hat { \boldsymbol \beta } _ { c }$ are used, and $\hat { \gamma } _ { c }$ contributes more than $\hat { \boldsymbol { \beta } } _ { c }$ , owing to its multiplicative interactions between the metric space and convolutional feature representations.
|
md/train/CO87OIEOGU8/CO87OIEOGU8.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Celebrating Diversity in Shared Multi-Agent Reinforcement Learning
|
| 2 |
+
|
| 3 |
+
Chenghao Li, Tonghan Wang, Chengjie Wu, Qianchuan Zhao, Jun Yang∗, Chongjie Zhang∗
|
| 4 |
+
|
| 5 |
+
Tsinghua University {lich18, wangth18, wucj19} $@$ mails.tsinghua.edu.cn, {zhaoqc, yangjun603, chongjie}@tsinghua.edu.cn
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Recently, deep multi-agent reinforcement learning (MARL) has shown the promise to solve complex cooperative tasks. Its success is partly because of parameter sharing among agents. However, such sharing may lead agents to behave similarly and limit their coordination capacity. In this paper, we aim to introduce diversity in both optimization and representation of shared multi-agent reinforcement learning. Specifically, we propose an information-theoretical regularization to maximize the mutual information between agents’ identities and their trajectories, encouraging extensive exploration and diverse individualized behaviors. In representation, we incorporate agent-specific modules in the shared neural network architecture, which are regularized by L1-norm to promote learning sharing among agents while keeping necessary diversity. Empirical results show that our method achieves state-of-the-art performance on Google Research Football and super hard StarCraft II micromanagement tasks†.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Cooperative multi-agent reinforcement learning (MARL) has drawn increasing interest in recent years, which provides a promise for solving many real-world challenging problems, such as sensor networks [1], traffic management [2], and coordination of robot swarms [3]. However, learning effective policies for such complex multi-agent systems remains challenging. One central problem is that the joint action-observation space grows exponentially with the number of agents, which imposes high demand on the scalability of learning algorithms.
|
| 14 |
+
|
| 15 |
+
To address this scalability challenge, policy decentralization with shared parameters (PDSP) is widely used, where agents share their neural network weights. Parameter sharing significantly improves learning efficiency because it dramatically reduces the total number of policy parameters, while experiences and gradients of one agent can be used to train others. Enjoying these advantages, many advanced deep MARL approaches adopt the PDSP paradigm, including value-based methods [4–8], policy gradients [9–13] and communication learning algorithms [14, 15]. These approaches achieve state-of-the-art performance on tasks such as StarCraft II micromanagement [16].
|
| 16 |
+
|
| 17 |
+
While parameter sharing has been proven to accelerate training [17], its drawbacks are also apparent in complex tasks. These tasks typically require substantial exploration and diversified strategies among agents. When parameters are shared, agents tend to acquire homogeneous behaviors because they typically adopt similar actions under similar observations, preventing efficient exploration and the emergence of sophisticated cooperative policies. This tendency becomes particularly problematic for many challenging multi-agent coordination tasks, hindering deep MARL from broader applications. For example, the unsatisfactory performance of state-of-the-art MARL algorithms on Google Research Football (Fig. 1, and [18]) highlights an urgent demand for diverse behaviors.
|
| 18 |
+
|
| 19 |
+
Notably, sacrificing the merits of parameter sharing for diversity is also unfavorable. Like humans, sharing necessary experience or understanding of tasks can broadly accelerate cooperation learning. Without parameter sharing, agents search in a much larger parameter space, which may be wasteful because they do not need to behave differently all the time. Therefore, the question is how to adaptively trade-off diversity and sharing. In this paper, we solve this dilemma by proposing several structural and learning novelties.
|
| 20 |
+
|
| 21 |
+
To encourage diversity, we propose a novel information-theoretical objective to maximize the mutual information between agents’ identi
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Shared parameters induce behaviors (left) and can hardly learn successful policies on the challenging Google Research Football task. Our method learns sophisticated cooperative strategies by trading off diversity and sharing (right).
|
| 25 |
+
|
| 26 |
+
ties and trajectories. This objective enables each agent to distinguish themselves from others and thus involves the contribution of all agents. Accordingly, we derive an intrinsic reward for motivating diversity and optimize it with the global environmental reward by learning the total Q-function as a combination of individual Q-functions. Structurally, we further decompose individual Q-functions as the sum of shared and non-shared local Q-functions for sharing experiences while maintaining representation diversity. We hope agents can use and expand shared knowledge whenever possible. Thus we introduce L1 regularization on each non-shared Q-function, encouraging agents to share and be diverse when necessary on several critical actions. Combining these novelties achieves a dynamic balance between diversity and homogeneity, efficiently catalyzing adaptive and sophisticated cooperation.
|
| 27 |
+
|
| 28 |
+
We benchmark our approach on Google Research Football (GRF) [18], and StarCraft II micromanagement tasks (SMAC) [16]. The extraordinary performance of our approach on challenging benchmarking tasks shows that our approach achieve significantly higher coordination capacity than baselines while using diversity as a catalyst for more robust and talent policies. To our best knowledge, our approach achieves state-of-the-art performance on SMAC super hard maps and challenging GRF multi-agent tasks like academy_3_vs_1_with_keeper, academy_counterattack_hard, and a full-field scenario 3_vs_1_with_keeper (full field).
|
| 29 |
+
|
| 30 |
+
# 2 Background
|
| 31 |
+
|
| 32 |
+
A fully cooperative multi-agent task can be formulated as a Dec-POMDP [19], which is defined as a tuple $\mathcal { G } = \left. N , S , A , P , R , \bar { O } , \Omega , n , \gamma \right.$ , where $N$ is a finite set of $n$ agents, $s \in S$ is the true state of the environment, $A$ is the set of actions, and $\gamma \in [ 0 , 1 )$ is a discount factor. At each time step, each agent $i \in N$ receives his own observation $o _ { i } \in \Omega$ according to the observation function $O ( s , i )$ , and selects an action $a _ { i } \in A$ , which results in a joint action vector $^ { a }$ . The environment then transitions to a new state $s ^ { \prime }$ based on the transition function $P ( s ^ { \prime } | s , \pmb { a } )$ , and inducing a global reward $r = R ( s , { \pmb a } )$ shared by all the agents. Each agent has its own action-observation history $\tau _ { i } \in \mathcal { T } _ { i } \doteq ( \Omega _ { i } \times A ) ^ { * }$ . Due to partial observability, each agent conditions its policy $\pi _ { i } ( a _ { i } | \tau _ { i } )$ on $\tau _ { i }$ . The joint policy $\pi$ induces the joint action-value function $\begin{array} { r } { Q _ { t o t } ^ { \pi } ( s , \pmb { a } ) = \mathbb { E } _ { s _ { 0 : \infty } , \pmb { a } _ { 0 : \infty } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } \ | \ s _ { 0 } = s , \pmb { a } _ { 0 } = \pmb { a } , \pi \right] , } \end{array}$ .
|
| 33 |
+
|
| 34 |
+
# 2.1 Centralized Training with Decentralized Execution
|
| 35 |
+
|
| 36 |
+
Our method adopts the framework of centralized training with decentralized execution (CTDE) [9, 20, 4, 5, 21, 22, 6, 11]. This framework tackles the exponentially growing joint action space by decentralizing the control policies while adopting centralized training to learn cooperation. Agents learn in a centralized manner with access to global information but execute based on their local action-observation history. One promising approach to implement the CTDE framework is value function factorization. The IGM (individual-global-max) principle [21] guarantees the consistency between the local and global greedy actions. When IGM is satisfied, agents can obtain the optimal global action by simply choosing the local greedy action that maximizes each agent’s individual utility function $Q _ { i }$ . Some algorithms have successfully used the IGM principle [5, 6, 23] to push forward the progress of MARL.
|
| 37 |
+
|
| 38 |
+
# 3 Method
|
| 39 |
+
|
| 40 |
+
In this section, we present a novel diversity-driven MARL framework (Fig. 2) that balances each agent’s individuality with group coordination, which is a general approach that can be combined with existing CDTE value factorization methods.
|
| 41 |
+
|
| 42 |
+
# 3.1 Identity-Aware Diversity
|
| 43 |
+
|
| 44 |
+
We first introduce how to encourage behavioral diversity by designing intrinsic motivations. Intuitively, to encourage the specialty of individual trajectories, agents need to behave differently to highlight themselves from others, taking different actions and visiting different local observations. To achieve this goal, we use an information-theoretic objective for maximizing the mutual information between individual trajectory and agents’ identity:
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: Schematics of our approach.
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
I ^ { \pi } ( \tau _ { T } ; i d ) = H ( \tau _ { T } ) - H ( \tau _ { T } | i d ) = E _ { i d , \tau _ { T } \sim \pi } \left[ \log \frac { p ( \tau _ { T } | i d ) } { p ( \tau _ { T } ) } \right] ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\tau _ { T }$ and $i d$ is the random variable for agent’s local trajectory and identity, respectively. $\pi$ is the joint policy. To optimize Eq. 1, we expand $p ( \tau _ { T } )$ as $\begin{array} { r } { p ( o _ { 0 } ) \prod _ { t = 0 } ^ { T - 1 } \dot { p } ( a _ { t } | \tau _ { t } ) p ( o _ { t + 1 } | \tau _ { t } , a _ { t } ) } \end{array}$ , and $p ( \tau _ { T } | i d )$ as $\begin{array} { r } { p ( o _ { 0 } | i d ) \prod _ { t = 0 } ^ { T - 1 } p ( a _ { t } | \tau _ { t } , i d ) p ( o _ { t + 1 } | \tau _ { t } , a _ { t } , i d ) } \end{array}$ . Therefore, the mutual information can be written as:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
I ^ { \pi } ( \tau _ { T } ; i d ) = E _ { i d , \tau } \underbrace { [ \log \frac { p ( o _ { 0 } | i d ) } { p ( o _ { 0 } ) } } _ { \textcircled { \backslash } } + \underbrace { \sum _ { t = 0 } ^ { T - 1 } \log \frac { p ( a _ { t } | \tau _ { t } , i d ) } { p ( a _ { t } | \tau _ { t } ) } } _ { \textcircled { \emptyset } } + \underbrace { \sum _ { t = 0 } ^ { T - 1 } \log \frac { p ( o _ { t + 1 } | \tau _ { t } , a _ { t } , i d ) } { p ( o _ { t + 1 } | \tau _ { t } , a _ { t } ) } } _ { \textcircled { \emptyset } } ] .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Term $\textcircled{1}$ is determined by the environment, and we can ignore it when optimizing the mutual information. The second term quantifies the information gain about agent’s action selection when the identity is given, which measures action-aware diversity as $I ( a ; i d | \tau )$ . However, $p ( a _ { t } | \tau _ { t } , i d )$ is typically the distribution induced by $\epsilon$ -greedy, which only distinguishes the action with the highest possibility. Therefore, directly optimizing this term conceals most information about the local Qfunctions. To solve this problem, we use the Boltzmann softmax distribution of local Q values to replace $p ( a _ { t } | \tau _ { t } , i d )$ , which forms a lower bound of term $\textcircled{2}$ :
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
E _ { i d , \tau } \left[ \log \frac { p ( a _ { t } | \tau _ { t } , i d ) } { p ( a _ { t } | \tau _ { t } ) } \right] \geq E _ { i d , \tau } \left[ \log \frac { \mathrm { S o f t M a x } ( \frac { 1 } { \alpha } Q ( a _ { t } | \tau _ { t } , i d ) ) } { p ( a _ { t } | \tau _ { t } ) } \right] .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
The inequity holds because the KL divergence $D _ { \mathrm { K L } } \big ( p ( \cdot | \tau _ { t } , i d ) \| \mathrm { S o f t M a x } ( \frac { 1 } { \alpha } Q ( \cdot | \tau _ { t } , i d ) ) \big )$ is nonnegative. We maximize this lower bound to optimize Term $\textcircled{2}$ . Inspired by variational inference approaches [24], we derive and optimize a tractable lower bound for Term $\textcircled{3}$ at each timestep by introducing a variational posterior estimator $q _ { \phi }$ parameterized by $\phi$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
E _ { i d , \tau } \left[ \log \frac { p ( o _ { t + 1 } | \tau _ { t } , a _ { t } , i d ) } { p ( o _ { t + 1 } | \tau _ { t } , a _ { t } ) } \right] \geq E _ { i d , \tau } \left[ \log \frac { q _ { \phi } ( o _ { t + 1 } | \tau _ { t } , a _ { t } , i d ) } { p ( o _ { t + 1 } | \tau _ { t } , a _ { t } ) } \right] ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Similar to the second term, the inequality holds because for any $q _ { \phi }$ , the $\mathrm { K L }$ divergence $D _ { \mathrm { K L } } ( p ( \cdot | \tau _ { t } , a _ { t } , i d ) | | q _ { \phi } ( \cdot | \tau _ { t } , a _ { t } , i d ) )$ is non-negative. Intuitively, optimizing Eq. 4 encourages agents
|
| 72 |
+
|
| 73 |
+
to have diverse observations that are distinguishable by agents’ identification and thus measures observation-aware diversity as $I ( o ^ { \prime } ; i d | \tau , \bar { a ) }$ . To tighten the this lower bound, we minimize the KL divergence with respect to the parameters $\phi$ . The gradient for updating $\phi$ is:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r l } & { \nabla _ { \phi } \mathcal { L } ( \phi ) = \nabla _ { \phi } \mathbb { E } _ { \tau , a , i d } \left[ D _ { \mathrm { K L } } \left( p \left( \cdot | \tau , a , i d \right) \| q _ { \phi } \left( \cdot | \tau , a , i d \right) \right) \right] = \nabla _ { \phi } \mathbb { E } _ { \tau , a , i d , o ^ { \prime } } \left[ \log \frac { p \left( o ^ { \prime } | \tau , a , i d \right) } { q _ { \phi } \left( o ^ { \prime } | \tau , a , i d \right) } \right] } \\ & { \quad \quad \quad = - \mathbb { E } _ { \tau , a , i d , o ^ { \prime } } \left[ \nabla _ { \phi } \log q _ { \phi } \left( o ^ { \prime } | \tau , a , i d \right) \right] . } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Based on the lower bounds shown in Eq. 3 and Eq. 4, we introduce intrinsic rewards to optimise the information-theoretic objective (Eq. 1) for encouraging diverse behaviors:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r } { r ^ { I } = E _ { i d } \left[ \beta _ { 2 } D _ { \mathrm { K L } } ( \mathrm { S o f t M a x } ( \beta _ { 1 } Q ( \cdot | \tau _ { t } , i d ) ) | | p ( \cdot | \tau _ { t } ) ) \right. } \\ { \left. + \beta _ { 1 } \log q _ { \phi } ( o _ { t + 1 } | \tau _ { t } , a _ { t } , i d ) - \log p ( o _ { t + 1 } | \tau _ { t } , a _ { t } ) \right] . } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
We introduce two scaling factors $\beta _ { 1 } , \beta _ { 2 } \geq 0$ when calculating intrinsic rewards. When $\beta _ { 1 }$ is $_ 0$ , we only optimize the entropy term $H ( \tau _ { T } )$ in the mutual information objective (Eq. 1). $\beta _ { 2 }$ is used to adjust the importance of policy diversity compared with transition diversity. In Appendix A, we discuss and compare two different approaches for estimating $p \left( \boldsymbol { a } _ { t } | \tau _ { t } \right)$ and $p \left( o _ { t + 1 } \vert \tau _ { t } , a _ { t } \right)$ .
|
| 86 |
+
|
| 87 |
+
# 3.2 Action-Value Learning for Balancing Diversity and Sharing
|
| 88 |
+
|
| 89 |
+
In the previous section, we introduce an information-theoretic objective for encouraging each agent to behave differently from general trajectories. However, the shared local Q-function does not have enough capacity to present different policies for each agent. For solving this problem, we additionally equip each agent $i$ with an individual local Q-function $Q _ { i } ^ { I }$ . Defining experiences that need to be shared or exclusively learned is inefficient and usually can not generalize. Therefore, we let agents adaptively decide whether to share experiences by decomposing $Q _ { i }$ as:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
Q _ { i } ( a _ { i } | \tau _ { i } ) = Q ^ { S } ( a _ { i } | \tau _ { i } ) + Q _ { i } ^ { I } ( a _ { i } | \tau _ { i } ) ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $Q ^ { S }$ is the shared Q-function among agents. In its current form, agents may learn to decompose their local Q-function arbitrarily. On the contrary, we expect that agents can share as much knowledge as possible so that we apply an L1 regularization on individual local Q-function $Q ^ { I }$ as shown in Fig.2. Such a regularization can also prevent agents from being too diverse and ignore cooperating to finish the task. In our experiments, we show that the L1 regularization is critical to achieving a balance between diversity and cooperation.
|
| 96 |
+
|
| 97 |
+
# 3.3 Overall Learning Objective
|
| 98 |
+
|
| 99 |
+
In this section, we discuss how to use the diversity-encouraging reward to train the proposed learning framework. Since the intrinsic rewards $r ^ { I }$ inevitably involves the influence from all agents, we add $r ^ { I }$ to environment rewards $r ^ { e }$ and use the following TD loss:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathcal { L } _ { T D } ( \theta ) = \left[ r ^ { e } + \beta r ^ { I } + \gamma \operatorname* { m a x } _ { a ^ { \prime } } Q _ { t o t } \left( s ^ { \prime } , a ^ { \prime } ; \theta ^ { - } \right) - Q _ { t o t } ( s , a ; \theta ) \right] ^ { 2 } ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\theta$ is the parameters in the whole framework, $\theta ^ { - }$ is periodically frozen parameters copied from $\theta$ for a stable update, and $\beta$ is a hyper-parameter adjusting the weight of intrinsic rewards compared with environment rewards. We use QPLEX to decompose $Q _ { t o t }$ as mixing of local Q-functions $Q _ { i }$ and train the framework end-to-end by minimizing the loss:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\mathcal { L } ( \boldsymbol { \theta } ) = \mathcal { L } _ { T D } ( \boldsymbol { \theta } ) + \lambda \sum _ { i } \mathcal { L } _ { L _ { 1 } } ( Q _ { i } ^ { I } ( \boldsymbol { \theta } _ { i } ^ { I } ) ) ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $\theta _ { i } ^ { I }$ is the parameters of $Q _ { i } ^ { I }$ $, \mathcal { L } _ { L _ { 1 } } ( Q _ { i } ^ { I } )$ is the L1 regularization term for independent Q-functions, and $\lambda$ is a scaling factor.
|
| 112 |
+
|
| 113 |
+
# 4 Case study: outperforming by being diverse only when necessary
|
| 114 |
+
|
| 115 |
+
We design Pac-Men shown in Fig. 3 to demonstrate how our approach works. In this task, four agents are initialized at the center room and can only observe a $5 \times 5$ grid around them. Three dots are initialized randomly in each edge room. To make this environment more challenging, paths to different rooms have different lengths, which are $\mathrm { d o w n : l e f t : u p : r i g h t } = 4 : 8 : 1 2 : 8$ . Three out of four paths are outside agents’ observation scope, which brings about the difficulty of exploration. Dots will refresh randomly after all rooms are empty. An ineffective competition between agents occurs when they come together in one room. The total environmental reward is the number of dots eaten in one step or -0.1 if no one eats dots. The time limit of this environment is set to 100 steps.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Why does our method work? The balance between identity-aware diversity and experience sharing encourages sophisticated strategies.
|
| 119 |
+
|
| 120 |
+
Fig. 3-middle demonstrates the learned strategies of our approach, with a heatmap showing the visitation number. Driven by the objective of mutual information between individual trajectory and identity, agents achieve diversity and scatter in different rooms to eat dots. We further analyze the role of independent and shared Q-functions during different stages in Fig. 3 right. We visualize the value of $S D \dot { ( } Q _ { i } ^ { I } ( \cdot ) ) / S D ( Q ^ { S } ( \cdot ) )$ , where SD denotes the standard deviation (SD) of Q values for different actions. A higher SD ratio indicates the independent Q-functions play a leading role, while a lower SD ratio indicates the shared Q function’s domination.
|
| 121 |
+
|
| 122 |
+
We notice that the SD ratio is considerably larger in the central room and four paths than in four edge rooms. This observation means that agents use independent Q networks to reach different rooms while use the shared Q network to search for dots in them. The result shows that our method achieves a good balance between diversity and knowledge sharing. Taking this advantage, our approach outperforms baselines (Fig. 3 left, baselines are introduced in Sec. 6). Other methods, such as variational exploration (MAVEN [25]) and individuality emergence (EOI [26]), are slower to learn optimal strategies.
|
| 123 |
+
|
| 124 |
+
# 5 Related Work
|
| 125 |
+
|
| 126 |
+
Deep multi-agent reinforcement learning algorithms have witnessed significant advances in recent years. COMA [20], MADDPG [9], PR2 [27], and DOP [10] study the problem of policy-based multi-agent reinforcement learning. They use a (decomposed) centralized critic to calculate gradients for decentralized actors. Value-based algorithms decompose the joint value function into individual utility functions in order to enable efficient optimization and decentralized execution. VDN [4], QMIX [5], and QTRAN [21] progressively expand the representation capabilities of the mixing network. QPLEX [6] implements the full IGM class [21] by encoding the IGM principle into a duplex dueling network architecture. Weighted QMIX [23] proposes weighted projection to decompose any joint action-value functions. There are other works that investigate into MARL from the perspective of coordination graphs [28–30], communication [31, 32, 15], and role-based learning [17, 33].
|
| 127 |
+
|
| 128 |
+
Knowledge sharing in MARL From IQL [34] to QPLEX, many works focus on designing mixing network structures and have provided promising empirical and theoretical results. For these works, experience sharing among agents has been an important component. Learning from others is one essential skill engraved in humans’ genes to survive in society. Based on the relationship between teachers and students in human society, a series of research work hopes each agent can learn from others or selectively share its knowledge with others [35–37]. But it is challenging to specify knowledge in practice, let alone deciding what to share or learn. SEAC [38] partially solves this problem by sharing trajectories only for off-policy training. NCC [32] maintains cognition consistency by representation alignment between neighbors. Roy et al. [39] force each agent to predict others’ local policies and adds a coach for group experience alignment. Christianos et al. [40] group agents during pre-training and force agents in the same group to use one policy. In this paper, we do not try to let agents choose whether to learn or share experiences. Our neural network structure shown in Fig. 2 can balance group coordination and diversity by gradient backpropagation.
|
| 129 |
+
|
| 130 |
+
Diversity In single-agent settings, diversity emerges for exploration or solving sparse reward problems. Existing methods such as curiosity-driven algorithms [41–44] or maximising mutual information [45–47] have shown great promise. When encouraging diversity in MARL settings, agents’ coordination must be considered. Several recent works study this problem, such as MAVEN [25], EITI & EDTI [48], and EOI [26]. MAVEN learns a diverse ensemble of monotonic approximations with the help of a latent space to explore. EITI and EDTI consider pairwise mutual influence to encourage the interdependence between agents. EOI combines the gradient from the intrinsic value function (IVF) and the total Q-function to train each agent’s local Q-function. In this paper, we encourage agents to explore unique trajectories by optimizing the mutual information between agent’s identity and trajectory. Moreover, we propose a novel network structure to enable experience sharing or consensus, which combines all agents’ rare ideas, while still maintain independent action-value functions for each agent to behave differently when necessary. Our approach considers the trade-off relationship between knowledge sharing and diversity, and learns to establish a balance and leverage their advantages for joint task solving.
|
| 131 |
+
|
| 132 |
+
# 6 Experiments
|
| 133 |
+
|
| 134 |
+
In Sec. 4, we use a toy game to illustrate how our approach adaptively balances experience sharing and identity-aware diversity. In this section, we use challenging tasks from GRF and SMAC benchmark to further demonstrate and illustrate the outperformance of our approach. We compare our approach against multi-agent value-based methods (QMIX [5], QPLEX [6]), variational exploration (MAVEN [25]), and individuality emergence (EOI [26]) methods. Different from baselines, we do not include agents’ identification in inputs when calculating local Q-functions. We show the average and variance of the performance for our method, baselines, and ablations tested with five random seeds.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
6.1 Performance on Google Research Football (GRF)
|
| 138 |
+
Figure 4: Comparison of our approach against baseline algorithms on Google Research Football.
|
| 139 |
+
|
| 140 |
+
We first benchmark our approach on three challenging Google Research Football (GRF) offensive scenarios academy_3_vs_1_with_keeper, academy_counterattack_hard, and our own designed full-field scenario 3_vs_1_with_keeper (full field). Agents’ initial locations for each scenario are shown in Appendix B.3. In GRF tasks, agents need to coordinate timing and positions for organizing offense to seize fleeting opportunities, and only scoring leads to rewards. In our experiments, we control left-side players (in yellow) except the goalkeeper. The right-side players are rule-based bots controlled by the game engine. Agents have a discrete action space of 19, including moving in eight directions, sliding, shooting, and passing. The observation contains the positions and moving directions of the ego-agent, other agents, and the ball. The $z$ -coordinate of the ball is also included.
|
| 141 |
+
|
| 142 |
+
We make a small and reasonable change to the half-court offensive scenarios: our players will lose if they or the ball returns to our half-court. All baselines and ablations are tested with this modification. Environmental reward only occurs at the end of the game. They will get $+ 1 0 0$ if they win, else get -1.
|
| 143 |
+
|
| 144 |
+
We show the performance comparison against baselines in Fig. 4. Our approach outperforms all the scenarios. MAVEN needs more time to explore sophisticated strategies, demonstrating that CDS incentives more efficient exploration. EOI lets each agent consider individuality and cooperation simultaneously by setting local learning objectives but without exclusive Q networks, making cooperation and individuality hard to be persistently coordinated. In comparison, taking advantage of the partially shared network structure, CDS agents learn diverse but coordinated strategies. For example, as shown in Fig. 1, three agents have different behaviors, with the first agent passing the ball, the second scoring, while the third running to threaten. These diverse behaviors closely coordinate, forming a perfect scoring strategy and leading to significant outperformance against EOI.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
6.2 Performance on StarCraft II
|
| 148 |
+
Figure 5: Comparison of our approach against baseline algorithms on four super hard SMAC maps: corridor, MMM2, 6h_vs_8z, and $3 { \bf s } 5 z \_ { \bf V } { \bf s } \_ 3 { \bf s } 6 z$ and two hard SMAC maps: 5m_vs_6m and 3s_vs_5z.
|
| 149 |
+
|
| 150 |
+
In this section, we test our approach on the StarCraft II micromanagement (SMAC) benchmarks [16]. This benchmark consists of various maps classified as easy, hard, and super hard. Here we test our method on four super hard maps: corridor, MMM2, 6h_vs_ $_ { 8 z }$ , and $3 { \bf s } 5 z \_ { \bf V } { \bf s } \_ 3 { \bf s } 6 z .$ , and two hard SMAC maps: 5m_vs_6m and 3s_vs_5z. For the four super hard maps, our approach outperforms all baselines with acceptable variance across random seeds, as shown in Fig. 5. The baselines QPLEX and QMIX can achieve satisfactory performance on some challenging benchmarks, such as $ { 3 \mathbf { s } } 5 { \mathbf { z } } _ { - } { \mathbf { v } } { \mathbf { s } } _ { - } 3 { \mathbf { s } } 6 { \mathbf { z } }$ and MMM2. But on other maps, they need the proposed diversity-celebrating method to get better performance. Compared with MAVEN and EOI, our approach maintains its out-performance with the balance between diversity and homogeneity for learning sophisticated cooperation. Our approach performs similarly with baselines for the two hard maps, indicating our balancing process may not improve the learning efficiency in environments that require pure homogeneity. But for challenging environments, where sophisticated strategies are laborious to explore, our approach can efficiently search for valuable strategies with stable updates.
|
| 151 |
+
|
| 152 |
+
# 6.3 Ablations and Visualization
|
| 153 |
+
|
| 154 |
+
To understand the contribution of each component in the proposed CDS framework, we carry out ablation studies to test the contribution of its three main components: Identity-aware diversity (A) encouragement and partially shared (B) neural network structure with $L I$ regularization (C) on non-shared Q-functions. To test component A, we ablate our intrinsic rewards to four different levels. (1) CDS-Raw ablates all intrinsic rewards by setting $\beta$ in Eq. 8 to zero. (2) CDS-No-Identity ablates
|
| 155 |
+
|
| 156 |
+
$H \left( \tau _ { T } | i d \right)$ and only optimize $H \left( \tau _ { T } \right)$ in Eq. 1 by setting $\beta _ { 1 }$ in Eq. 6 to zero. (3) CDS-No-Action ablates item $\textcircled{2}$ in Eq. 2 by setting $\beta _ { 2 }$ in Eq. 6 to zero. (4) CDS-No-Obs ablates item $\textcircled{3}$ in Eq. 2 by ablating $\beta _ { 1 } \log q _ { \phi } \left( o _ { t + 1 } | \tau _ { t } , a _ { t } , i d \right) - \log p \left( o _ { t + 1 } | \tau _ { t } , a _ { t } \right)$ in Eq. 6. To test component B, we design CDS-All-Shared, which ablates independent action-value functions together with the L1 loss and, like baselines, adds agents’ identification to the input. To test component C, we design CDS-No-L1, which ablates L1 regularization terms by setting $\lambda$ in Eq. 9 to zero.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 6: Left. Ablation studies on academy_counterattack_hard. Right. Visualization of trained policies, which achieve complex cooperation with impressive off-the-ball moving strategies.
|
| 160 |
+
|
| 161 |
+
We first carry out ablation studies on academy_counterattack_hard to analyze which part of our novelties lead to the outstanding performance as shown on the left side of Fig. 6. The ablation of each part of our intrinsic reward will bring a noticeable decrease in performance. Among them, the least impact on performance is the ablation of action-aware diversity. CDS-No-L1 performs similarly to MAVEN, which indicates that unlimited diversity is harmful to cooperation. CDS-All-Shared performs even worse than QPLEX, demonstrating that identity-aware diversity is difficult to emerge without our specially designed network structure.
|
| 162 |
+
|
| 163 |
+
We further visualize the final trained strategies on the right side of Fig. 6, which shows complex cooperation between agents. Our players first attack down the wing by dribbling and passing the ball. Then one of them draws the attention of the enemy defenders and the goalkeeper, while the ball being passed across the penalty area. Another player catches the ball and completes the shot. The most impressive part of our sophisticated strategies is off-the-ball moving strategies. All agents without the ball try to use their unique and valuable moves to create more scoring opportunities, which shows behavior and position diversity for finishing the goal.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 7: Left. Ablation studies in super hard map corridor. Right. Visualization of the final trained strategies, which achieves a hard-earned victory brought by the sacrifice of a warrior.
|
| 167 |
+
|
| 168 |
+
We also carry out ablation studies on the super hard map corridor as shown in Fig. 7 left. Same as results on academy_counterattack_hard, the ablation of action-aware diversity causes the least performance gap. Among all the ablations, CDS-No-L1 and CDS-No-Identity perform worst, whose performance is similar to QPLEX. This phenomenon indicates excessive diversity is harmful to the emerge of complex cooperation. CDS-All-Shared achieves acceptable performance, different from the GRF scenario, reflecting the different demand levels for the representation diversity of these two kinds of benchmarks.
|
| 169 |
+
|
| 170 |
+
To better explain why our approach performs well. On corridor, we also visualize the final strategies in Fig. 7 right. In this super hard map, six friendly Zealots are facing 24 enemy Zerglings. The disparity in quantity means our agents are doomed to lose if they attack together. One Zealot, whose route is highlighted blue, becomes a warrior leaving the team to attract the attention of most enemies in the blue oval. Although doomed to sacrifice, he brings enough time for the team to eliminate a small part of the enemies in the green oval. After that, another Zealot stands out to attract some enemies and enables teammates to eradicate them. These sophisticated strategies reflect the leverage between diversity and homogeneity by encouraging agents to be diverse only when necessary.
|
| 171 |
+
|
| 172 |
+
# 7 Closing Remarks
|
| 173 |
+
|
| 174 |
+
Observing that behavioral diversity among agents is essential for many challenging and complex multi-agent tasks, in this paper, we introduce a novel mechanism of being diverse when necessary into shared multi-agent reinforcement learning. The balance between individual diversity and group coordination induced by our CDS approach pushes forward state-of-the-art of deep MARL on challenging benchmark tasks while keeping parameter sharing benefits. We hope that our method can shed light on future works to motivate agents to cooperate with diversity to further explore complex multi-agent coordination problems.
|
| 175 |
+
|
| 176 |
+
# Acknowledgments
|
| 177 |
+
|
| 178 |
+
This work was funded by the National Key Research and Development Project of China under Grant 2017YFC0704100 and 2016YFB0901900, in part by the National Natural Science Foundation of China under Grant 61425027 and U1813216, in part by Science and Technology Innovation $2 0 3 0 -$ “New Generation Artificial Intelligence” Major Project (No. 2018AAA0100904), a grant from the Institute of Guo Qiang,Tsinghua University, and a grant from Turing AI Institute of Nanjing.
|
| 179 |
+
|
| 180 |
+
# References
|
| 181 |
+
|
| 182 |
+
[1] Chongjie Zhang and Victor Lesser. Coordinated multi-agent reinforcement learning in networked distributed pomdps. In Twenty-Fifth AAAI Conference on Artificial Intelligence, 2011.
|
| 183 |
+
[2] Arambam James Singh, Akshat Kumar, and Hoong Chuin Lau. Hierarchical multiagent reinforcement learning for maritime traffic management. In Proceedings of the 19th International Conference on Autonomous Agents and MultiAgent Systems, pages 1278–1286, 2020.
|
| 184 |
+
[3] Maximilian Hüttenrauch, Adrian Šošic, and Gerhard Neumann. Guided deep reinforcement ´ learning for swarm systems. arXiv preprint arXiv:1709.06011, 2017.
|
| 185 |
+
[4] Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Valuedecomposition networks for cooperative multi-agent learning based on team reward. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pages 2085–2087. International Foundation for Autonomous Agents and Multiagent Systems, 2018.
|
| 186 |
+
[5] Tabish Rashid, Mikayel Samvelyan, Christian Schroeder Witt, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. Qmix: Monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pages 4292–4301, 2018.
|
| 187 |
+
[6] Jianhao Wang, Zhizhou Ren, Terry Liu, Yang Yu, and Chongjie Zhang. Qplex: Duplex dueling multi-agent q-learning. International Conference on Learning Representations (ICLR), 2021.
|
| 188 |
+
[7] Yiqin Yang, Xiaoteng Ma, Chenghao Li, Zewu Zheng, Qiyuan Zhang, Gao Huang, Jun Yang, and Qianchuan Zhao. Believe what you see: Implicit constraint approach for offline multi-agent reinforcement learning. arXiv preprint arXiv:2106.03400, 2021.
|
| 189 |
+
[8] Shariq Iqbal, Christian A Schroeder De Witt, Bei Peng, Wendelin Böhmer, Shimon Whiteson, and Fei Sha. Randomized entity-wise factorization for multi-agent reinforcement learning. In International Conference on Machine Learning, pages 4596–4606. PMLR, 2021.
|
| 190 |
+
[9] Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. Multiagent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems, pages 6379–6390, 2017.
|
| 191 |
+
[10] Yihan Wang, Beining Han, Tonghan Wang, Heng Dong, and Chongjie Zhang. Dop: Off-policy multi-agent decomposed policy gradients. In Proceedings of the International Conference on Learning Representations (ICLR), 2021.
|
| 192 |
+
[11] Xiaoteng Ma, Yiqin Yang, Chenghao Li, Yiwen Lu, Qianchuan Zhao, and Jun Yang. Modeling the interaction between agents in cooperative multi-agent reinforcement learning. In Proceedings of the 20th International Conference on Autonomous Agents and MultiAgent Systems, pages 853–861, 2021.
|
| 193 |
+
[12] Kamal K Ndousse, Douglas Eck, Sergey Levine, and Natasha Jaques. Emergent social learning via multi-agent reinforcement learning. In International Conference on Machine Learning, pages 7991–8004. PMLR, 2021.
|
| 194 |
+
[13] Tianhao Zhang, Yueheng Li, Chen Wang, Guangming Xie, and Zongqing Lu. Fop: Factorizing optimal joint policy of maximum-entropy multi-agent reinforcement learning. In International Conference on Machine Learning, pages 12491–12500. PMLR, 2021.
|
| 195 |
+
[14] Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Advances in Neural Information Processing Systems, pages 2137–2145, 2016.
|
| 196 |
+
[15] Tonghan Wang, Jianhao Wang, Chongyi Zheng, and Chongjie Zhang. Learning nearly decomposable value functions with communication minimization. In Proceedings of the International Conference on Learning Representations (ICLR), 2020.
|
| 197 |
+
[16] Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim GJ Rudner, Chia-Man Hung, Philip HS Torr, Jakob Foerster, and Shimon Whiteson. The starcraft multi-agent challenge. arXiv preprint arXiv:1902.04043, 2019.
|
| 198 |
+
[17] Tonghan Wang, Heng Dong, Victor Lesser, and Chongjie Zhang. Roma: Multi-agent reinforcement learning with emergent roles. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 199 |
+
[18] Karol Kurach, Anton Raichuk, Piotr Stanczyk, Michał Zaj ˛ac, Olivier Bachem, Lasse Espeholt, ´ Carlos Riquelme, Damien Vincent, Marcin Michalski, Olivier Bousquet, et al. Google research football: A novel reinforcement learning environment. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 4501–4510, 2020.
|
| 200 |
+
[19] Frans A Oliehoek, Christopher Amato, et al. A concise introduction to decentralized POMDPs, volume 1. Springer, 2016.
|
| 201 |
+
[20] Jakob N Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 202 |
+
[21] Kyunghwan Son, Daewoo Kim, Wan Ju Kang, David Earl Hostallero, and Yung Yi. Qtran: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning, pages 5887–5896, 2019.
|
| 203 |
+
[22] Kyunghwan Son, Sungsoo Ahn, Roben Delos Reyes, Jinwoo Shin, and Yung Yi. Qtran $^ { + + }$ : Improved value transformation for cooperative multi-agent reinforcement learning, 2020.
|
| 204 |
+
[23] Tabish Rashid, Gregory Farquhar, Bei Peng, and Shimon Whiteson. Weighted qmix: Expanding monotonic value function factorisation for deep multi-agent reinforcement learning. Advances in Neural Information Processing Systems, 33, 2020.
|
| 205 |
+
[24] Martin J Wainwright, Michael I Jordan, et al. Graphical models, exponential families, and variational inference. Foundations and Trends® in Machine Learning, 1(1–2):1–305, 2008.
|
| 206 |
+
[25] Anuj Mahajan, Tabish Rashid, Mikayel Samvelyan, and Shimon Whiteson. Maven: Multiagent variational exploration. In Advances in Neural Information Processing Systems, pages 7611–7622, 2019.
|
| 207 |
+
[26] Jiechuan Jiang and Zongqing Lu. The emergence of individuality in multi-agent reinforcement learning. arXiv preprint arXiv:2006.05842, 2020.
|
| 208 |
+
[27] Ying Wen, Yaodong Yang, Rui Luo, Jun Wang, and Wei Pan. Probabilistic recursive reasoning for multi-agent reinforcement learning. In Proceedings of the International Conference on Learning Representations (ICLR), 2019.
|
| 209 |
+
[28] Carlos Guestrin, Michail Lagoudakis, and Ronald Parr. Coordinated reinforcement learning. In ICML, volume 2, pages 227–234. Citeseer, 2002.
|
| 210 |
+
[29] Carlos Guestrin, Daphne Koller, and Ronald Parr. Multiagent planning with factored mdps. In Advances in neural information processing systems, pages 1523–1530, 2002.
|
| 211 |
+
[30] Wendelin Böhmer, Vitaly Kurin, and Shimon Whiteson. Deep coordination graphs. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 212 |
+
[31] Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. Learning when to communicate at scale in multiagent cooperative and competitive tasks. In Proceedings of the International Conference on Learning Representations (ICLR), 2019.
|
| 213 |
+
[32] Hangyu Mao, Wulong Liu, Jianye Hao, Jun Luo, Dong Li, Zhengchao Zhang, Jun Wang, and Zhen Xiao. Neighborhood cognition consistent multi-agent reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7219–7226, 2020.
|
| 214 |
+
[33] Tonghan Wang, Tarun Gupta, Anuj Mahajan, Bei Peng, Shimon Whiteson, and Chongjie Zhang. Rode: Learning roles to decompose multi-agent tasks. In Proceedings of the International Conference on Learning Representations (ICLR), 2021.
|
| 215 |
+
[34] Ming Tan. Multi-agent reinforcement learning: Independent vs. cooperative agents. In Proceedings of the tenth international conference on machine learning, pages 330–337, 1993.
|
| 216 |
+
[35] Changxi Zhu, Ho-fung Leung, Shuyue Hu, and Yi Cai. A q-values sharing framework for multiple independent q-learners. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, pages 2324–2326, 2019.
|
| 217 |
+
[36] Yongyuan Liang and Bangwei Li. Parallel knowledge transfer in multi-agent reinforcement learning. arXiv preprint arXiv:2003.13085, 2020.
|
| 218 |
+
[37] Yonggan Fu, Zhongzhi Yu, Yongan Zhang, and Yingyan Lin. Auto-agent-distiller: Towards efficient deep reinforcement learning agents via neural architecture search. arXiv preprint arXiv:2012.13091, 2020.
|
| 219 |
+
[38] Filippos Christianos, Lukas Schäfer, and Stefano Albrecht. Shared experience actor-critic for multi-agent reinforcement learning. Advances in Neural Information Processing Systems, 33, 2020.
|
| 220 |
+
[39] Julien Roy, Paul Barde, Félix Harvey, Derek Nowrouzezahrai, and Chris Pal. Promoting coordination through policy regularization in multi-agent deep reinforcement learning. Advances in Neural Information Processing Systems, 33, 2020.
|
| 221 |
+
[40] Filippos Christianos, Georgios Papoudakis, Arrasy Rahman, and Stefano V Albrecht. Scaling multi-agent reinforcement learning with selective parameter sharing. arXiv preprint arXiv:2102.07475, 2021.
|
| 222 |
+
[41] Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning, pages 2778– 2787, 2017.
|
| 223 |
+
[42] Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
|
| 224 |
+
[43] Adrià Puigdomènech Badia, Pablo Sprechmann, Alex Vitvitskyi, Daniel Guo, Bilal Piot, Steven Kapturowski, Olivier Tieleman, Martín Arjovsky, Alexander Pritzel, Andew Bolt, et al. Never give up: Learning directed exploration strategies. arXiv preprint arXiv:2002.06038, 2020.
|
| 225 |
+
[44] Adrià Puigdomènech Badia, Bilal Piot, Steven Kapturowski, Pablo Sprechmann, Alex Vitvitskyi, Zhaohan Daniel Guo, and Charles Blundell. Agent57: Outperforming the atari human benchmark. In International Conference on Machine Learning, pages 507–517. PMLR, 2020.
|
| 226 |
+
[45] Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you need: Learning skills without a reward function. In International Conference on Learning Representations, 2018.
|
| 227 |
+
[46] Archit Sharma, Shixiang Gu, Sergey Levine, Vikash Kumar, and Karol Hausman. Dynamicsaware unsupervised discovery of skills. In International Conference on Learning Representations, 2020.
|
| 228 |
+
[47] Víctor Campos, Alexander Trott, Caiming Xiong, Richard Socher, Xavier Giro-i Nieto, and Jordi Torres. Explore, discover and learn: Unsupervised discovery of state-covering skills. In International Conference on Machine Learning, pages 1317–1327. PMLR, 2020.
|
| 229 |
+
[48] Tonghan Wang, Jianhao Wang, Wu Yi, and Chongjie Zhang. Influence-based multi-agent exploration. In Proceedings of the International Conference on Learning Representations (ICLR), 2020.
|
md/train/ErivP29kYnx/ErivP29kYnx.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ReSSL: Relational Self-Supervised Learning with Weak Augmentation
|
| 2 |
+
|
| 3 |
+
Mingkai Zheng1,2 Shan $\mathbf { Y o u } ^ { 2 , 4 * }$ Fei Wang3 Chen Qian2 Changshui Zhang4 Xiaogang Wang2,5 Chang Xu1
|
| 4 |
+
|
| 5 |
+
1School of Computer Science, Faculty of Engineering, The University of Sydney 2SenseTime Research 3University of Science and Technology of China 4Department of Automation, Tsinghua University, Institute for Artificial Intelligence, Tsinghua University (THUAI),
|
| 6 |
+
Beijing National Research Center for Information Science and Technology (BNRist) 5The Chinese University of Hong Kong
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Self-supervised Learning (SSL) including the mainstream contrastive learning has achieved great success in learning visual representations without data annotations. However, most of methods mainly focus on the instance level information (i.e., the different augmented images of the same instance should have the same feature or cluster into the same class), but there is a lack of attention on the relationships between different instances. In this paper, we introduced a novel SSL paradigm, which we term as relational self-supervised learning (ReSSL) framework that learns representations by modeling the relationship between different instances. Specifically, our proposed method employs sharpened distribution of pairwise similarities among different instances as relation metric, which is thus utilized to match the feature embeddings of different augmentations. Moreover, to boost the performance, we argue that weak augmentations matter to represent a more reliable relation, and leverage momentum strategy for practical efficiency. Experimental results show that our proposed ReSSL significantly outperforms the previous stateof-the-art algorithms in terms of both performance and training efficiency. Code is available at https://github.com/KyleZheng1997/ReSSL
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
Recently, self-supervised learning (SSL) has shown its superiority and achieved promising results for unsupervised visual representation learning in computer vision tasks [40, 27, 32, 6, 9, 47, 23, 24]. The purpose of a typical self-supervised learning algorithm is to learn general visual representations from a large amount of data without human annotations, which can be transferred or leveraged in downstream tasks (e.g., classification, detection, and segmentation). Some previous works [5, 23] even have proven that a good unsupervised pretraining can lead to a better downstream performance than supervised pretraining.
|
| 15 |
+
|
| 16 |
+
Among various SSL algorithms, contrastive learning [47, 45, 6] serves as a state-of-the-art framework, which mainly focuses on learning an invariant feature from different views. For example, instance discrimination is a widely adopted pre-text task as in [6, 24, 47], which utilizes the noisy contrastive estimation (NCE) to encourage two augmented views of the same image to be pulled closer on the embedding space but pushes apart all the other images away. Deep Clustering [4, 48, 5] is an alternative pre-text task that forces different augmented views of the same instance to be clustered into the same class. However, instance discrimination based methods will inevitably induce a class collision problem [1, 36, 10], where similar images should be pulled closer instead of being pushed away. Deep clustering based methods cooperated with traditional clustering algorithms to assign a label for each instance, which relaxed the constraint of instance discrimination, but most of these algorithms adopt a strong assumption, i.e., the labels must induce an equipartition of the data, which might introduce some noise and hurt the learned representations.
|
| 17 |
+
|
| 18 |
+
In this paper, we introduce a novel Relational Self-Supervised Learning framework (ReSSL), which does not encourage explicitly to push away different instances, but uses relation as a manner to investigate the inter-instance relationships and highlight the intra-instance invariance. Concretely, we aim to maintain the consistency of pairwise similarities among different instances for two different augmentations. For example, if we have three instances $\mathbf { x } ^ { 1 }$ , $\mathbf { x } ^ { 2 }$ , y and $\mathbf { z }$ where $\mathbf { x } ^ { 1 }$ , $\mathbf { x } ^ { 2 }$ are two different augmentations of $\mathbf { x }$ , $\mathbf { y }$ and $\mathbf { z }$ are different samples. Then, if $\mathbf { x } ^ { 1 }$ is similar to y but different to $\mathbf { z }$ , we wish $\bar { \mathbf { x } } ^ { 2 }$ can maintain such relationship and vice versa. In this way, the relation can be modelled as a similarity distribution between a set of augmented images, and then use it as a metric to align the same images with different augmentations, so that the relationship between different instances could be maintained across different views.
|
| 19 |
+
|
| 20 |
+
However, this simple manner induces unexpectedly horrible performance if we follow the same training recipe as other contrastive learning methods [6, 24]. We argue that construction of a proper relation matters for ReSSL; aggressive data augmentations as in [6, 7, 41] are usually leveraged by default to generate diverse positive pairs that increase the difficulty of the pre-text task. However, this hurts the reliability of the target relation. Views generated by aggressive augmentations might cause the loss of semantic information, so the target relation might be noisy and not that reliable. In this way, we propose to leverage weaker augmentations to represent the relation, since much lesser disturbances provide more stable and meaningful relationships between different instances. Besides, we also sharpen the target distribution to emphasize the most important relationship and utilize the memory buffer with a momentum-updated network to reduce the demand of large batch size for more efficiency. Experimental results on multiple benchmark datasets show the superiority of ReSSL in terms of both performance and efficiency. For example, with 200 epochs of pre-training, our ReSSL achieved $6 9 . 9 \%$ on ImageNet [14] linear evaluation protocol, which is $2 . 4 \%$ higher than our baseline method (MoCoV2 [8]). When working with the Multi-Crop strategy (200 epochs), ReSSL achieved new state-of-the-art $7 4 . 7 \%$ Top-1 accuracy, which is $1 . 4 \%$ higher than CLSA-Multi [46].
|
| 21 |
+
|
| 22 |
+
Our contributions can be summarized as follows.
|
| 23 |
+
|
| 24 |
+
• We proposed a novel SSL paradigm, which we term it as relational self-supervised learning (ReSSL). ReSSL maintains the relational consistency between the instances under different augmentations instead of explicitly pushing different instances away. • Our proposed weak augmentation and sharpening distribution strategy provide a stable and high quality target similarity distribution, which makes the framework works well. • ReSSL is a simple and effective SSL framework since it replaces the widely adopted contrastive loss with our proposed relational consistency loss. It achieved state-of-the-art performance under the same training cost.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
Self-Supervised Learning. Early works in self-supervised learning methods rely on all sorts of pretext to learn visual representations. For example, colorizing gray-scale images [50], image jigsaw puzzle [39], image super-resolution [34], image inpainting [19], predicting a relative offset for a pair of patches [16], predicting the rotation angle [35], and image reconstruction [2, 22, 3, 17]. Although these methods have shown their effectiveness, they lack the generality of the learned representations.
|
| 29 |
+
|
| 30 |
+
Instance Discrimination. The recent contrastive learning methods [32, 40, 6, 24, 41, 38, 29, 27, 30] have made a lot of progress in the field of self-supervised learning. Most of the previous contrastive learning methods are based on the instance discrimination [47] task in which positive pairs are defined as different views of the same image, while negative pairs are formed by sampling views from different images. SimCLR [6, 7] shows that image augmentation (e.g.Grayscale, Random Resized Cropping, Color Jittering, and Gaussian Blur), nonlinear projection head and large batch size plays a critical role in contrastive learning. Since large batch size usually requires a lot of GPU memory, which is not very friendly to most of researchers. MoCo [24, 8] proposed a momentum contrast mechanism that forces the query encoder to learn the representation from a slowly progressing key encoder and maintain a memory buffer to store a large number of negative samples. InfoMin [41] proposed a set of stronger augmentation that reduces the mutual information between views while keeping task-relevant information intact. AlignUniform [45] shows that alignment and uniformity are two critical properties of contrastive learning.
|
| 31 |
+
|
| 32 |
+
Deep Clustering. In contrast to instance discrimination which treats every instance as a distinct class, deep clustering [4] adopts the traditional clustering method (e.g.KMeans) to label each image iteratively. Eventually, similar samples will be clustered into the same class. Simply apply the KMeans algorithm might lead to a degenerate solution where all data points are mapped to the same cluster; SeLa [48] solved this issue by adding the constraint that the labels must induce equipartition of the data and proposed a fast version of the Sinkhorn-Knopp to achieve this. SwAV [5] further extended this idea and proposed a scalable online clustering framework. PCL [36] reveals the class collision problem and simply performed instance discrimination and unsupervised clustering simultaneously; although it gets the same linear classification accuracy with MoCoV2, it has better performance on downstream tasks.
|
| 33 |
+
|
| 34 |
+
Contrastive Learning Without Negatives. Most previous contrastive learning methods prevent the model collapse in an explicit manner (e.g. push different instances away from each other or force different instances to be clustered into different groups.) BYOL [23] can learn a high-quality representation without negatives. Specifically, it trains an online network to predict the target network representation of the same image under a different augmented view and using an additional predictor network on top of the online encoder to avoiding the model collapse. SimSiam [9] shows that simple Siamese networks can learn meaningful representations even without the use of negative pairs, large batch size, and momentum encoders.
|
| 35 |
+
|
| 36 |
+
# 3 Methodology
|
| 37 |
+
|
| 38 |
+
In this section, we will first revisit the preliminary work on contrastive learning; then, we will introduce our proposed relational self-supervised learning framework. After that, the algorithm and the implementation details will also be explained.
|
| 39 |
+
|
| 40 |
+
# 3.1 Preliminaries on Self-supervised Learning
|
| 41 |
+
|
| 42 |
+
Given $N$ unlabeled samples $\mathbf { x }$ , we randomly apply a composition of augmentation functions $T ( \cdot )$ to obtain two different views $\mathbf { x } ^ { 1 }$ and $\mathbf { x } ^ { 2 }$ through $T ( \mathbf { x } , \theta _ { 1 } ^ { \top } )$ and $T ( \mathbf { x } , \theta _ { 2 } )$ where $\theta$ is the random seed for $T$ . Then, a convolutional neural network based encoder $\mathcal F ( \cdot )$ is employed to extract the information from these samples, i.e., $\mathbf { h } = \mathcal { F } ( T ( \mathbf { x } , \theta ) )$ . Finally, a two-layer non-linear projection head $g ( \cdot )$ is utilized to map $\mathbf { h }$ into embedding space, which can be written as: ${ \mathbf z } = g ( { \mathbf h } )$ . SimCLR [6] and MoCo [24] style framework adopt the noise contrastive estimation (NCE) objective for discriminating different instances in the dataset. Suppose $\mathbf { z } _ { i } ^ { 1 }$ and $\mathbf { z } _ { i } ^ { 2 }$ are the representations of two augmented views of $\mathbf { x } _ { i }$ and $\mathbf { z } _ { k }$ is a different instance. The NCE objective can be expressed by Eq. (1), where the similarity function $s i m ( \cdot )$ represents the dot product between $L _ { 2 }$ normalized vectors $s i m ( \mathbf { u } , \mathbf { v } ) = \mathbf { u } ^ { T } \mathbf { v } / \| \mathbf { u } \| \| \mathbf { v } \|$ and $\tau$ is the temperature parameter.
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\mathcal { L } _ { N C E } = - \log \frac { \exp ( s i m ( \mathbf { z } ^ { 1 } , \mathbf { z } ^ { 2 } ) / \tau ) } { \exp ( s i m ( \mathbf { z } _ { i } ^ { 1 } , \mathbf { z } _ { i } ^ { 2 } ) / \tau ) + \sum _ { k = 1 } ^ { N } \exp ( s i m ( \mathbf { z } _ { i } ^ { 1 } , \mathbf { z } _ { k } ) / \tau ) } .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
BYOL [23] and SimSiam [9] style framework add an additional non-linear predictor head $q ( \cdot )$ which further maps $\mathbf { z }$ to $\mathbf { p }$ . The model will minimize the negative cosine similarity (equivalent to minimize the L2 distance) between $\mathbf { z }$ to $\mathbf { p }$ .
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathcal { L } _ { c o s } = - \frac { \mathbf { p } ^ { 1 } } { \Vert \mathbf { p } ^ { 1 } \Vert } \cdot \frac { \mathbf { z } ^ { 2 } } { \Vert \mathbf { z } ^ { 2 } \Vert } , \qquad \mathcal { L } _ { m s e } = \Vert \mathbf { p } ^ { 1 } - \mathbf { z } ^ { 2 } \Vert _ { 2 } ^ { 2 } .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
Tricks like stop-gradient and momentum teacher are often applied to avoid model collapsing.
|
| 55 |
+
|
| 56 |
+
# 3.2 Relational Self-Supervised Learning
|
| 57 |
+
|
| 58 |
+
In classical self-supervised learning, different instances are to be pushed away from each other, and augmented views of the same instance is expected to be of exactly the same features. However, both constrains are too restricted because of the existence of similar samples and the distorted semantic information if aggressive augmentation is adopted. In this way, we do not encourage explicit negative instances (those to be pushed away) for each instance; instead, we leverage the pairwise similarities as a manner to explore their relationships. And we pull the features of two different augmentations in this sense of relation metric. As a result, our method relaxes both (1) and (2), where different instances do not always need to be pushed away from each other; and augmented views of the same instance only need to share the similar but not exactly the same features.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 1: The overall framework of our proposed method. We adopt the student-teacher framework where the student is trained to predict the representation of the teacher, and the teacher is updated with a “momentum update” (exponential moving average) of the student. The relationship consistency is achieve by align the conditional distribution for student and teacher model. Please see more details in our method part.
|
| 62 |
+
|
| 63 |
+
Concretely, given a image $\mathbf { x }$ in a batch of samples , two different augmented views can be obtained by $\mathbf { x } ^ { 1 } = \mathbf { \check { \Gamma } } T ( \mathbf { x } , \theta _ { 1 } )$ , $\mathbf { x } ^ { 2 } = T ( \mathbf { x } , \theta _ { 2 } )$ and calculate the corresponds embedding $\mathbf { z } ^ { 1 } = g ( \mathcal { F } ( \mathbf { x } ^ { 1 } ) )$ , $\mathbf { z } ^ { 2 } = g ( \mathcal { F } ( \mathbf { x } ^ { 2 } ) )$ . Then, we calculate the similarities between the instances of the first augmented images. Which can be measured by $s i m ( \mathbf { z } ^ { 1 } , \mathbf { z } _ { i } )$ . A softmax layer can be adopted to process the calculated similarities, which then produces a relationship distribution:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
{ \bf p } _ { i } ^ { 1 } = \frac { \exp ( s i m ( { \bf z } ^ { 1 } , { \bf z } _ { i } ) / \tau _ { t } ) } { \sum _ { k = 1 } ^ { K } \exp ( s i m ( { \bf z } ^ { 1 } , { \bf z } _ { k } ) / \tau _ { t } , ) } .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\tau _ { t }$ is the temperature parameter. At the same time, we can calculate the relationship between $\mathbf { x } ^ { 2 }$ and the $i$ -th instance as $s i m ( \mathbf { z } ^ { 2 } , \mathbf { z } _ { i } )$ . The resulting relationship distribution can be written as:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
{ { \bf { p } } _ { i } ^ { 2 } } = \frac { { \exp ( { s i m ( { { \bf { z } } ^ { 2 } } , { \bf { z } } _ { i } ) / { \tau _ { s } } } ) } } { { \sum _ { k = 1 } ^ { K } { \exp ( { s i m ( { { \bf { z } } ^ { 2 } } , { \bf { z } } _ { k } ) / { \tau _ { s } } } , ) } } } .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\tau _ { s }$ is a different temperature parameter. We propose to push the relational consistency between $p _ { i } ^ { 1 }$ and $p _ { i } ^ { 2 }$ by minimizing the Kullback–Leibler divergence, which can be formulated as:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { L } _ { r e l a t i o n } = D _ { K L } ( \mathbf { p } ^ { 1 } | | \mathbf { p } ^ { 2 } ) = H ( \mathbf { p } ^ { 1 } , \mathbf { p } ^ { 2 } ) - H ( \mathbf { p } ^ { 1 } ) .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Since the $\mathbf { p } ^ { 1 }$ will only be used as a target, we only minimize $H ( \mathbf { p } ^ { 1 } , \mathbf { p } ^ { 2 } )$ in our implementation.
|
| 82 |
+
|
| 83 |
+
More efficiency with Momentum targets. However, the quality of the target similarity distribution $\mathbf { p } ^ { 1 }$ is crucial, to make the similarity distribution reliable and stable, we usually require a large batch size which is very unfriendly to GPU memories. To resolve this issue, we utilize a “momentum update" network as in [24, 8], and maintain a large memory buffer $\mathcal { Q }$ of $K$ past samples $\{ { \bf { z } } _ { k } | k = $ $1 , . . . , K \}$ (following the FIFO principle) for storing the feature embeddings from the past batches, which can then be used for simulating the large batch size relationship and providing a stable similarity distribution.
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathcal { F } _ { t } \gets m \mathcal { F } _ { t } + ( 1 - m ) \mathcal { F } _ { s } , \quad g _ { t } \gets m g _ { t } + ( 1 - m ) g _ { s } ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\mathcal { F } _ { s }$ and $g _ { s }$ denote the most latest encoder and head, respectively, so we name them as the student model with a subscript $s$ . On the other hand, $\mathcal { F } _ { t }$ and $g _ { t }$ stand for ensembles of the past encoder and head, respectively, so we name them as the teacher model with a subscript $t , m$ represents the momentum coefficient which controls how fast the teacher $\mathcal { F } _ { t }$ will be updated.
|
| 90 |
+
|
| 91 |
+
Sharper Distribution as Target. Note, the value of $\tau _ { t }$ has to be smaller than $\tau _ { s }$ since $\tau _ { t }$ will be used to generate the target distribution. A smaller $\tau$ will result in a “sharper" distribution which can be interpreted as highlight the most similar feature for $\mathbf { z } ^ { 1 }$ . Align $ { \mathbf { p } } ^ { 2 }$ with $\mathbf { p } ^ { 1 }$ can be regarded as pulling $\mathbf { z } ^ { 2 }$ towards the features that are similar with $\mathbf { z } ^ { 1 }$ .
|
| 92 |
+
|
| 93 |
+
Weak Augmentation Strategy for Teacher. To further improve the quality and stability of the target distribution, we adopt a weak augmentation strategy for the teacher model since the standard contrastive augmentation is too aggressive, which introduced too many disturbances and will mislead the student network. Please refer to more details in our empirical study.
|
| 94 |
+
|
| 95 |
+
Compare with SEED and CLSA. SEED [21] follows the standard Knowledge Distillation (KD) paradigm [26, 49, 18] where it aims to distill the knowledge from a larger network into a smaller architecture. The knowledge transfer happens in the same view but between different models. In our framework, we are trying to maintain the relational consistency between different augmentations; the knowledge transfer happens between different views but in the same network. CLSA [46] also introduced the concept of using weak augmentation to guide a stronger augmentation. However, the “weak" augmentation in CLSA is equivalent to the “strong" augmentation in our method (We do not use any stronger augmentations such as [12, 13]). On the other hand, CLSA still adopts the InfoNCE loss (1) for instance discrimination, where our proposed method only utilized the relational consistency loss (5). Finally, CLSA requires at least one additional sample during training, which will slow down the training speed.
|
| 96 |
+
|
| 97 |
+
# Algorithm 1: Relational Self-supervised Learning with Weak Augmentation (ReSSL)
|
| 98 |
+
|
| 99 |
+
<table><tr><td colspan="2">the non-linear projection head for teacher and student. Q: the memory buffer while network not converge do for i=1 to step do Fetch x from current batch B z1=gt(Ft(Tw(x,01)))); z²=gs(Fs(Tc(x,02));</td></tr><tr><td colspan="2">p1 = SoftMax(z1QT/ Tt); p² =SoftMax(z²QT / Ts); // Eq.(3)(4) Calculate Lrelation loss by CrossEntropy(p1,p²) ; // Eq.(5) Update Fs and gs with loss Lrelation Update Ft and gt by Ft ← mFt +(1-m)Fs,gt ←mgt+(1-m)gs ; // Eq.</td></tr></table>
|
| 100 |
+
|
| 101 |
+
# 4 Empirical Study
|
| 102 |
+
|
| 103 |
+
In this section, we will empirically study our proposed method on 4 popular self-supervised learning benchmarks and compare to previous state-of-the-art algorithms (SimCLR [6], BYOL [23], SimSiam [9], MoCoV2 [8]).
|
| 104 |
+
|
| 105 |
+
Small Dataset. CIFAR-10 and CIFAR-100 [31]. The CIFAR-10 dataset consists of $6 0 0 0 0 \ 3 2 { \mathrm { x } } 3 2$ colour images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images. CIFAR-100 is just like the CIFAR-10, except it has 100 classes containing 600 images each. There are 500 training images and 100 testing images per class.
|
| 106 |
+
|
| 107 |
+
Medium Dataset. STL-10 [11] and Tiny ImageNet [33]. STL10 [11] dataset is composed of $9 6 \mathbf { x } 9 6$ resolution images of 10 classes, 5K labeled training images, 8K validation images, and 100K unlabeled images. The Tiny ImageNet dataset is composed of $6 4 \mathrm { x } 6 4$ resolution images of 200 classes with 100K training images and 10k validation images.
|
| 108 |
+
|
| 109 |
+
Implementation Details We adopt the ResNet18 [25] as our backbone network. Because most of our dataset contains low-resolution images, we replace the first $7 \mathbf { x } 7$ Conv of stride 2 with $3 { \tt X } 3$ Conv of stride 1 and remove the first max pooling operation for a small dataset. For data augmentations, we use the random resized crops (the lower bound of random crop ratio is set to 0.2), color distortion (strength $= 0 . 5$ ) with a probability of 0.8, and Gaussian blur with a probability of 0.5. The images from the small and medium datasets will be resized to $3 2 \mathrm { x } 3 2 $ and 64x64 resolution respectively. Our method is based on MoCoV2 [8]; in order to simulate the shuffle BN trick on one GPU, we simply divide a batch of data into different groups and then calculate BN statistics within each group. The momentum value and memory buffer size are set to 0.99/0.996 and 4096/16384 for small and medium datasets respectively. Moreover, The model is trained using SGD optimizer with a momentum of 0.9 and weight decay of $5 e ^ { - 4 }$ . We linear warm up the learning rate for 5 epochs until it reaches $0 . 0 6 \times B a t c h S i z e / 2 5 6$ , then switch to the cosine decay scheduler [37].
|
| 110 |
+
|
| 111 |
+
Table 1: Compare to other SSL algorithms on small and medium dataset.
|
| 112 |
+
|
| 113 |
+
<table><tr><td>Method</td><td>BackProp</td><td>EMA</td><td>CIFAR-10</td><td>CIFAR-100</td><td>STL-10</td><td>Tiny ImageNet</td></tr><tr><td>Supervised</td><td>1</td><td>-</td><td>94.22</td><td>74.66</td><td>82.55</td><td>59.26</td></tr><tr><td>SimCLR [6]</td><td>2x</td><td>No</td><td>84.92</td><td>59.28</td><td>85.48</td><td>44.38</td></tr><tr><td>BYOL [23]</td><td>2x</td><td>Yes</td><td>85.82</td><td>57.75</td><td>87.45</td><td>42.70</td></tr><tr><td>SimSiam [9]</td><td>2x</td><td>No</td><td>88.51</td><td>60.00</td><td>87.47</td><td>37.04</td></tr><tr><td>MoCoV2 [8]</td><td>1x</td><td>Yes</td><td>86.18</td><td>59.51</td><td>85.88</td><td>43.36</td></tr><tr><td>ReSSL (Ours)</td><td>1x</td><td>Yes</td><td>90.20</td><td>63.79</td><td>88.25</td><td>46.60</td></tr></table>
|
| 114 |
+
|
| 115 |
+
Evaluation Protocol. All the models will be trained for 200 epochs. For testing the representation quality, we evaluate the pre-trained model on the widely adopted linear evaluation protocol - We will freeze the encoder parameters and train a linear classifier on top of the average pooling features for 100 epochs. To test the classifier, we use the center crop of the test set and computes accuracy according to predicted output. We train the classifier with a learning rate of 30, no weight decay, and momentum of 0.9. The learning rate will be times 0.1 in 60 and 80 epochs. Note, for STL-10; the pretraining will be applied on both labeled and unlabeled images. During the linear evaluation, only the labeled 5K images will be used.
|
| 116 |
+
|
| 117 |
+
Result. As we can see the result in Table 1, our proposed method outperforms the previous method on all four benchmarks. Reminder, most of the previous method requires twice back-propagation, which results in a much higher training cost than MoCoV2 and our method.
|
| 118 |
+
|
| 119 |
+
# 4.1 A Properly Sharpened Relation is A Better Target
|
| 120 |
+
|
| 121 |
+
The temperature parameter is very crucial in most contrastive learning algorithms. To verify the effective of $\tau _ { s }$ and $\tau _ { t }$ for our proposed method, we fixed $\tau _ { s } = 0 . 1$ or 0.2, and sweep over $\tau _ { t } =$ $\{ 0 . 0 1 , 0 . 0 2 , . . . , 0 . 0 7 \}$ . The result is shown in Table 2. For $\tau _ { t }$ , the optimal value is either 0.04 or 0.05 across all different datasets. As we can see, the performance is increasing when we increase $\tau _ { t }$ from 0 to 0.04 and 0.05. After that, the performance will start to decrease. Note, $\tau _ { t } \to 0$ correspond to the Top-1 or argmax operation which produce a one-hot distribution as the target. On the other hand, when $\tau _ { t } 0 . 1$ , the target will be a much flatter distribution that cannot highlight the most similar features for students. Hence, $\tau _ { t }$ can not be either too small or too large, but it has to be smaller than $\tau _ { s }$ $\mathbf { \bar { p } } ^ { 1 }$ has to be sharper than $ { \mathbf { p } } ^ { 2 }$ ) so that the target distribution can provide effective guidance to the student model.
|
| 122 |
+
|
| 123 |
+
Table 2: Effect of different $\tau _ { t }$ and $\tau _ { s }$ for ReSSL
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Dataset</td><td>Ts</td><td>Tt =0.01</td><td>Tt =0.02</td><td>Tt=0.03</td><td>Tt = 0.04</td><td>Tt=0.05</td><td>Tt =0.06</td><td>Tt = 0.07</td></tr><tr><td>CIFAR-10</td><td>0.1</td><td>89.35</td><td>89.74</td><td>90.09</td><td>90.04</td><td>90.20</td><td>90.18</td><td>88.67</td></tr><tr><td>CIFAR-10</td><td>0.2</td><td>89.52</td><td>89.67</td><td>89.24</td><td>89.50</td><td>89.22</td><td>89.40</td><td>89.50</td></tr><tr><td>CIFAR-100</td><td>0.1</td><td>62.34</td><td>62.79</td><td>62.71</td><td>63.79</td><td>63.46</td><td>63.20</td><td>61.31</td></tr><tr><td>CIFAR-100</td><td>0.2</td><td>60.37</td><td>60.05</td><td>60.24</td><td>60.09</td><td>59.09</td><td>59.12</td><td>59.76</td></tr><tr><td>STL-10</td><td>0.1</td><td>86.65</td><td>86.96</td><td>87.16</td><td>87.32</td><td>88.25</td><td>87.83</td><td>87.08</td></tr><tr><td>STL-10</td><td>0.2</td><td>85.17</td><td>86.12</td><td>85.01</td><td>85.67</td><td>85.21</td><td>85.51</td><td>85.28</td></tr><tr><td>Tiny ImageNet</td><td>0.1</td><td>45.20</td><td>45.40</td><td>46.30</td><td>46.60</td><td>45.08</td><td>45.24</td><td>44.18</td></tr><tr><td>Tiny ImageNet</td><td>0.2</td><td>43.28</td><td>42.98</td><td>43.58</td><td>42.12</td><td>42.70</td><td>42.76</td><td>42.60</td></tr></table>
|
| 126 |
+
|
| 127 |
+
For $\tau _ { t }$ , it is clearly to see that the result of $\tau _ { s } = 0 . 1$ can always result a much higher performance than $\tau _ { s } = 0 . 2$ , which is different to $\mathbf { M o C o V } 2$ where $\tau _ { s } = 0 . 2$ is the optimal value. According to [43, 44, 15], a greater temperature will result in a larger angular margin in the hypersphere. Since MoCoV2 adopts instance discrimination as the pretext task, a large temperature can enhance the compactness for the same instance and discrepancy for different instances. In contrast to instance discrimination, our method can be interpreted as pulling similar instances closer on the hypersphere; when the ground truth label is not available, the large angular margin might hurt the performance.
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 2: Visualization of the 10 nearest neighbour of the query image. The top half is the result when we apply the weak augmentation. The bottom half is the case when the typical contrastive augmentation is adopted. Note, we use the red square to highlight the images that has different ground truth label with the query image.
|
| 131 |
+
|
| 132 |
+
# 4.2 Weak Augmentation Makes Better Relation
|
| 133 |
+
|
| 134 |
+
As we have mentioned, the weaker augmentation strategy for the teacher model is the key to the success of our framework. Here, We implement the weak augmentation as a random resized crop (the random ratio is set to $( 0 . 2 , 1 )$ ) and a random horizontal flip. For temperature parameter, we simply adopt the same setting as in Table 2 and report the performance of the best setting. The result is shown in Table 3, as we can see that when we use the weak augmentation for the teacher model, the performance is significantly boosted across all datasets. We believe that this phenomenon is because relatively small disturbances in the teacher model can provide more accurate similarity guidance to the student model. To further verify this hypothesis, we random sampled three image from STL-10 training set as the query images, and then find the 10 nearest neighbour based on the weak / contrastive augmented query. We visualized the result in Figure 2,
|
| 135 |
+
|
| 136 |
+
Table 3: Effect of weak augmentation guided ReSSL
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Teacher Aug</td><td>Student Aug</td><td>CIFAR-10</td><td>CIFAR-100</td><td>STL-10</td><td>Tiny ImageNet</td></tr><tr><td>Contrastive</td><td>Contrastive</td><td>86.17</td><td>57.60</td><td>84.71</td><td>40.38</td></tr><tr><td>Weak</td><td>Contrastive</td><td>90.20</td><td>63.79</td><td>88.25</td><td>46.60</td></tr></table>
|
| 139 |
+
|
| 140 |
+
# 4.3 More Experiments on Weak Augmentation
|
| 141 |
+
|
| 142 |
+
Since the weak augmentation for the teacher model is one of the crucial points in ReSSL, we further analyze the effect of applying different augmentations on the teacher model. In this experiment, we simply set $\tau _ { t } = 0 . 0 4$ and report the linear evaluation performance on the Tiny ImageNet dataset. The results are shown in Table 4. The first row is the baseline, where we simply resize all images to the same resolution (no extra augmentation is applied). Then, we applied random resized crops, random flip, color jitter, grayscale, gaussian blur, and various combinations. We empirically find that if we use no augmentation (e.g., no random resized crops) for the teacher model, the performance tends to degrade. This might result from that the gap of features between two views is way too smaller, which undermines the learning of representations. However, too strong augmentations of teacher model will introduce too much noise and make the target distribution inaccurate (see Figure 2). Thus mildly weak augmentations are better option for the teacher, and random resized crops with random flip is the combination with the highest performance as Table 4 shows.
|
| 143 |
+
|
| 144 |
+
Table 4: Effect of different augmentation for teacher model (Tiny ImageNet)
|
| 145 |
+
|
| 146 |
+
<table><tr><td>Random Resized Crops</td><td>Random Flip</td><td>Color Jitter</td><td>GrayScale</td><td>Gaussian Blur</td><td>Acc</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>31.74</td></tr><tr><td>√</td><td></td><td></td><td></td><td></td><td>46.00</td></tr><tr><td></td><td>√</td><td></td><td></td><td></td><td>30.98</td></tr><tr><td></td><td></td><td>√</td><td></td><td></td><td>29.46</td></tr><tr><td></td><td></td><td></td><td>√</td><td></td><td>29.68</td></tr><tr><td></td><td></td><td></td><td></td><td>√</td><td>30.10</td></tr><tr><td>√</td><td>√</td><td></td><td></td><td></td><td>46.60</td></tr><tr><td>√</td><td></td><td>√</td><td></td><td></td><td>44.44</td></tr><tr><td>√</td><td></td><td></td><td>4</td><td></td><td>42.28</td></tr><tr><td>√</td><td></td><td></td><td></td><td>√</td><td>44.88</td></tr><tr><td>√</td><td>√</td><td>√</td><td></td><td></td><td>43.70</td></tr><tr><td>√</td><td>√</td><td></td><td></td><td></td><td>42.28</td></tr><tr><td>√</td><td>√</td><td></td><td></td><td>√</td><td>44.52</td></tr></table>
|
| 147 |
+
|
| 148 |
+
# 4.4 Dimension of the Relation
|
| 149 |
+
|
| 150 |
+
Since we also adopt the memory buffer as in MoCo [24], the buffer size will be equivalent to the dimension of the distribution $\mathbf { p } ^ { 1 } \mathbf { p } ^ { 2 }$ . Thus, it will be one of the crucial points in our framework. To verify the effect the memory buffer size, we simply keep $\tau _ { s } = 0 . 1$ and $\tau _ { t } = 0 . 0 4$ , then varying the memory buffer size from 256 to 32768. The result is shown in Table 5, as we can see that a larger memory buffer can significantly boost the performance. However, a further increase in the buffer size can only bring a marginal improvement when the buffer is large enough.
|
| 151 |
+
|
| 152 |
+
Table 5: Effect of different memory buffer size on small and medium dataset
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Dataset (Small) CIFAR-10</td><td>K=256 89.37</td><td>K=512 89.53</td><td>K= 1024 89.83</td><td>K= 4096 90.04</td><td>K=8192 90.15</td><td>K=16384 90.35</td></tr><tr><td>CIFAR-100 Dataset (Medium)</td><td>61.17 K=256</td><td>62.47 K=1024</td><td>63.20 K = 4096</td><td>63.79 K=8192</td><td>63.84 K=16384</td><td>64.06 K=32768</td></tr><tr><td>STL-10</td><td>85.88</td><td>87.23</td><td>87.72</td><td>87.42</td><td>87.32</td><td>87.47</td></tr><tr><td>Tiny ImageNet</td><td>43.08</td><td>45.32</td><td>45.78</td><td>45.42</td><td>46.60</td><td>46.48</td></tr></table>
|
| 155 |
+
|
| 156 |
+
# 4.5 Visualization of Learned Representations
|
| 157 |
+
|
| 158 |
+
We also show the t-SNE [42] visualizations of the representations learned by our proposed method and MoCov2 on the training set of CIFAR-10. Our proposed relational consistency loss leads to better class separation than the contrastive loss.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 3: t-SNE visualizations on CIFAR-10. Classes are indicated by colors.
|
| 162 |
+
|
| 163 |
+
# 5 Results on Large-scale Datasets
|
| 164 |
+
|
| 165 |
+
We also performed our algorithm on the large-scale ImageNet-1k dataset [14]. In the experiments, we adopt a learning rate of $0 . 0 5 * B a t c h S i z e / 2 5 6$ , a memory buffer size of $1 3 0 \mathrm { k }$ , and a 2-layer non-linear projection head with a hidden dimension 4096 and output dimension 512. For $\tau _ { t }$ and $\tau _ { s }$ , we simply adopt the best setting from Table 2 where $\tau _ { t } = 0 . 0 4$ and $\tau _ { s } = 0 . 1$ .
|
| 166 |
+
|
| 167 |
+
Linear Evaluation. For the linear evaluation of ImageNet-1k, we strictly follow the setting in SwAV [5]. The results are shown in Table 6. As we can see clearly that ReSSL consistently outperforms previous methods on both $1 \mathbf { x }$ and $2 \mathbf { x }$ backprop setting. (Please noted that the student network will be passed in one $2 2 4 \mathbf { x } 2 2 4$ augmented view and two $2 2 4 \mathbf { x } 2 2 4$ augmented views for 1x backprob and $2 \mathbf { x }$ backprob setting respectively.)
|
| 168 |
+
|
| 169 |
+
Table 6: Top-1 accuracy under the linear evaluation on ImageNet with the ResNet-50 backbone. The table compares the methods over 200 epochs of pretraining.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Method Supervised</td><td>Arch R50</td><td>Backprop 1x</td><td>EMA No</td><td>Batch Size 256</td><td>Param 24</td><td>Epochs 120</td><td>Top-1 76.5</td></tr><tr><td>1xBackpropMethods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>InstDisc [47]</td><td>R50</td><td>1x</td><td>No</td><td>256</td><td>24</td><td>200</td><td>58.5</td></tr><tr><td>LocalAgg [52]</td><td>R50</td><td>1x</td><td>No</td><td>128</td><td>24</td><td>200</td><td>58.8</td></tr><tr><td>MoCo v2 [8]</td><td>R50</td><td>1x</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>67.5</td></tr><tr><td>MoCHi [30]</td><td>R50</td><td>1x</td><td>Yes</td><td>512</td><td>24</td><td>200</td><td>68.0</td></tr><tr><td>CPC v2 [32]</td><td>R50</td><td>1x</td><td>No</td><td>512</td><td>24</td><td>200</td><td>63.8</td></tr><tr><td>PCL v2 [36]</td><td>R50</td><td>1x</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>67.6</td></tr><tr><td>AdCo [28]</td><td>R50</td><td>1x</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>68.6</td></tr><tr><td>ReSSL (Ours)</td><td>R50</td><td>1x</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>69.9</td></tr><tr><td>2xBackprop Methods</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CLSA-Single [46]</td><td>R50</td><td>2x</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>69.4</td></tr><tr><td>SimCLR [6]</td><td>R50</td><td>2x</td><td>No</td><td>4096</td><td>24</td><td>200</td><td>66.8</td></tr><tr><td>SwAV [5]</td><td>R50</td><td>2x</td><td>No</td><td>4096</td><td>24</td><td>200</td><td>69.1</td></tr><tr><td>SimSiam [23]</td><td>R50</td><td>2x</td><td>No</td><td>256</td><td>24</td><td>200</td><td>70.0</td></tr><tr><td>BYOL[23]</td><td>R50</td><td>2x</td><td>Yes</td><td>4096</td><td>24</td><td>200</td><td>70.6</td></tr><tr><td>WCL [51]</td><td>R50</td><td>2x</td><td>No</td><td>4096</td><td>24</td><td>200</td><td>70.3</td></tr><tr><td>ReSSL (Ours)</td><td>R50</td><td>2x</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>71.4</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Working with Multi-Crop Strategy. We also performed ReSSL with Multi-Crop strategy. The result is shown below in Table 7. Specifically, the result of 4 crops is trained with the resolution of $2 2 4 \times 2 2 4$ , $1 6 0 \times 1 6 0$ , $1 2 8 \times 1 2 8$ , $9 6 \times 9 6$ . For the result of 5 crops, we add an additional $1 9 2 \times 1 9 2$ image which is exactly the same with AdCo [28]. As we can see, our proposed ReSSL is significantly better than previous state-of-the-art methods.
|
| 174 |
+
|
| 175 |
+
Table 7: Working with Multi-Crop Strategy (Linear Evaluation on ImageNet)
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Method</td><td>Arch</td><td>EMA</td><td>Batch Size</td><td>Param</td><td>Epochs</td><td>Top-1</td></tr><tr><td>SwAV [5]</td><td>R50</td><td>No</td><td>256</td><td>24</td><td>200</td><td>72.7</td></tr><tr><td>AdCo [28]</td><td>R50</td><td>No</td><td>256</td><td>24</td><td>200</td><td>73.2</td></tr><tr><td>CLSA-Multi [46]</td><td>R50</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>73.3</td></tr><tr><td>ReSSL (4 crops)</td><td>R50</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>73.8</td></tr><tr><td>ReSSL (5 crops)</td><td>R50</td><td>Yes</td><td>256</td><td>24</td><td>200</td><td>74.7</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Working with Smaller Architecture. We also applied our proposed method on the smaller architecture (ResNet-18). The result is shown in Table 8. Following the same training recipe of the ResNet-50 in above, our proposed method has a higher performance than SEED [21] without a larger pretrained teacher network.
|
| 180 |
+
|
| 181 |
+
Table 8: Experiments on ResNet-18 (Linear Evaluation on ImageNet)
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Method</td><td>Epochs</td><td>Student</td><td>Teacher</td><td>Acc</td></tr><tr><td>MoCo v2</td><td>200</td><td>ResNet-18</td><td>EMA</td><td>52.2</td></tr><tr><td>SEED</td><td>200</td><td>ResNet-18</td><td>ResNet-50 (MoCoV2)</td><td>57.6</td></tr><tr><td>ReSSL (1x backprop)</td><td>200</td><td>ResNet-18</td><td>EMA</td><td>58.1</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Low-shot Classification. We further evaluate the quality of the learned representations by transferring them to other datasets. Following [36], we perform linear classification on the PASCAL
|
| 186 |
+
|
| 187 |
+
VOC2007 dataset [20]. Specifically, we resize all images to 256 pixels along the shorter side and taking a $2 2 4 \times 2 2 4$ center crop. Then, we train a linear SVM on top of corresponding global average pooled final representations. To study the transferability of the representations in few-shot scenarios, we vary the number of labeled examples $K$ and report the mAP. Table 9 shows the comparison between our method with previous works. We report the average performance over 5 runs (except for $\mathbf { k } =$ full).It’s clearly to see that our proposed method is consistently outperform MoCo v2 and PCL v2 across all different $K$ .
|
| 188 |
+
|
| 189 |
+
Table 9: Transfer learning on low-shot image classification
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Method Random</td><td>Epochs 1</td><td>ImageNet 1</td><td>K=16 10.10</td><td>K=32 11.34</td><td>K=64 11.96</td><td>Full 12.42</td></tr><tr><td>Supervised</td><td>90</td><td>76.1</td><td>82.26</td><td>84.00</td><td>85.13</td><td>87.27</td></tr><tr><td>MoCo V2 [8]</td><td>200</td><td>67.5</td><td>76.14</td><td>79.16</td><td>81.52</td><td>84.60</td></tr><tr><td>PCL V2 [36]</td><td>200</td><td>67.5</td><td>78.34</td><td>80.72 81.96</td><td>82.67</td><td>85.43</td></tr><tr><td>ReSSL (1x backprob)</td><td>200</td><td>69.9</td><td>79.17</td><td></td><td>83.81</td><td>86.31</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Semi-Supervised Learning. Next, we evaluate the performance obtained when fine-tuning the model representation using a small subset of labeled data. In this experiments, we adopt our 5 crops pre-trained model. The result is shown in Table 10. Notably, with just 200 epochs of pre-training, ReSSL outperforms all previous methods.
|
| 194 |
+
|
| 195 |
+
Table 10: Semi-supervised Learning
|
| 196 |
+
|
| 197 |
+
<table><tr><td>Method</td><td>Epochs</td><td>Linear Eval</td><td>1% Labels</td><td>10% Labels</td></tr><tr><td>SimCLR [6]</td><td>1000</td><td>69.3</td><td>48.3</td><td>65.6</td></tr><tr><td>BYOL[23]</td><td>1000</td><td>74.3</td><td>53.2</td><td>68.6</td></tr><tr><td>SwAV[5]</td><td>800</td><td>75.3</td><td>53.9</td><td>70.2</td></tr><tr><td>ReSSL (5 crops)</td><td>200</td><td>74.7</td><td>57.9</td><td>70.4</td></tr></table>
|
| 198 |
+
|
| 199 |
+
# 6 Conclusion
|
| 200 |
+
|
| 201 |
+
In this work, we propose relational self-supervised learning (ReSSL), a new paradigm for unsupervised visual representation learning framework that maintains the relational consistency between instances under different augmentations. Our proposed ReSSL relaxes the typical constraints in contrastive learning where different instances do not always need to be pushed away on the embedding space, and the augmented views do not need to share exactly the same feature. An extensive empirical study shows the effect of each component in our framework. The experiments on large-scaled datasets demonstrate the efficiency and state-of-the-art performance for unsupervised representation learning.
|
| 202 |
+
|
| 203 |
+
# Broader Impact
|
| 204 |
+
|
| 205 |
+
This work provides a technical advancement in the field of unsupervised visual representation learning. An immediate application of this work is to give a pre-trained model for the tasks where the data annotation is very hard to collect (e.g.medical images and fine-grained images.) Moreover, the most significant advantage of ReSSL is that we do not need to train the model for a long time as the previous method (generally 800 or 1000 epochs), which will cause a lot of carbon dioxide emissions. We believe ReSSL is a more environment-friendly method since it can achieve a competitive performance with much lesser training costs.
|
| 206 |
+
|
| 207 |
+
# Acknowledgment
|
| 208 |
+
|
| 209 |
+
This work is funded by the National Key Research and Development Program of China (No. 2018AAA0100701) and the NSFC 61876095. Chang Xu was supported in part by the Australian Research Council under Projects DE180101438 and DP210101859. Shan You is supported by Beijing Postdoctoral Research Foundation.
|
| 210 |
+
|
| 211 |
+
# References
|
| 212 |
+
|
| 213 |
+
[1] S. Arora, Hrishikesh Khandeparkar, M. Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. ArXiv, abs/1902.09229, 2019. 2 [2] Pierre Baldi. Autoencoders, unsupervised learning and deep architectures. In Proceedings of the 2011 International Conference on Unsupervised and Transfer Learning Workshop - Volume 27, UTLW’11, page 37–50. JMLR.org, 2011. 2 [3] A. Brock, J. Donahue, and K. Simonyan. Large scale gan training for high fidelity natural image synthesis. ArXiv, abs/1809.11096, 2019. 2 [4] Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In European Conference on Computer Vision, 2018. 1, 3 [5] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. 2020. 1, 3, 9, 10
|
| 214 |
+
[6] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. 1, 2, 3, 5, 6, 9, 10 [7] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big selfsupervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020. 2
|
| 215 |
+
[8] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020. 2, 4, 5, 6, 9, 10 [9] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15750–15758, 2021. 1, 3, 5, 6
|
| 216 |
+
[10] Ching-Yao Chuang, Joshua Robinson, Yen-Chen Lin, Antonio Torralba, and Stefanie Jegelka. Debiased contrastive learning. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 8765–8775. Curran Associates, Inc., 2020. 2
|
| 217 |
+
[11] Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. volume 15 of Proceedings of Machine Learning Research, pages 215–223, Fort Lauderdale, FL, USA, 11–13 Apr 2011. JMLR Workshop and Conference Proceedings. 5
|
| 218 |
+
[12] Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. arXiv preprint arXiv:1805.09501, 2018. 5
|
| 219 |
+
[13] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 702–703, 2020. 5
|
| 220 |
+
[14] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009. 2, 8
|
| 221 |
+
[15] Jiankang Deng, J. Guo, and S. Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 4685–4694, 2019. 6
|
| 222 |
+
[16] Carl Doersch, Abhinav Gupta, and Alexei A. Efros. Unsupervised visual representation learning by context prediction. In International Conference on Computer Vision (ICCV), 2015. 2
|
| 223 |
+
[17] J. Donahue and K. Simonyan. Large scale adversarial representation learning. In NeurIPS, 2019. 2
|
| 224 |
+
[18] Shangchen Du, Shan You, Xiaojie Li, Jianlong Wu, Fei Wang, Chen Qian, and Changshui Zhang. Agree to disagree: Adaptive ensemble knowledge distillation in gradient space. Advances in Neural Information Processing Systems, 33, 2020. 5
|
| 225 |
+
[19] Omar ElHarrouss, Noor Almaadeed, S. Al-Máadeed, and Y. Akbari. Image inpainting: A review. Neural Processing Letters, 51:2007–2028, 2019. 2
|
| 226 |
+
[20] Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. International journal of computer vision, 88(2):303–338, 2010. 10
|
| 227 |
+
[21] Zhiyuan Fang, Jianfeng Wang, Lijuan Wang, Lei Zhang, Yezhou Yang, and Zicheng Liu. {SEED}: Selfsupervised distillation for visual representation. In International Conference on Learning Representations, 2021. 5, 9
|
| 228 |
+
[22] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. Lawrence, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 27, pages 2672–2680. Curran Associates, Inc., 2014. 2
|
| 229 |
+
[23] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. 1, 3, 5, 6, 9, 10
|
| 230 |
+
[24] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019. 1, 2, 3, 4, 8
|
| 231 |
+
[25] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015. 5
|
| 232 |
+
[26] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. 5
|
| 233 |
+
[27] R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018. 1, 2
|
| 234 |
+
[28] Qianjiang Hu, Xiao Wang, Wei Hu, and Guo-Jun Qi. Adco: Adversarial contrast for efficient learning of unsupervised representations from self-trained negative adversaries. arXiv preprint arXiv:2011.08435, 2020. 9
|
| 235 |
+
[29] Lang Huang, Chao Zhang, and Hongyang Zhang. Self-adaptive training: Bridging the supervised and self-supervised learning. arXiv preprint arXiv:2101.08732, 2021. 2
|
| 236 |
+
[30] Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning. In Neural Information Processing Systems (NeurIPS), 2020. 2, 9
|
| 237 |
+
[31] A. Krizhevsky. Learning multiple layers of features from tiny images. 2009. 5
|
| 238 |
+
[32] Cheng-I Lai. Contrastive predictive coding based feature for automatic speaker verification. arXiv preprint arXiv:1904.01575, 2019. 1, 2, 9
|
| 239 |
+
[33] Ya Le and Xuan Yang. Tiny imagenet visual recognition challenge. CS 231N, 7(7):3, 2015. 5
|
| 240 |
+
[34] C. Ledig, L. Theis, Ferenc Huszár, J. Caballero, Andrew Aitken, Alykhan Tejani, J. Totz, Zehan Wang, and W. Shi. Photo-realistic single image super-resolution using a generative adversarial network. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 105–114, 2017. 2
|
| 241 |
+
[35] Hankook Lee, Sung Ju Hwang, and Jinwoo Shin. Self-supervised label augmentation via input transformations. In International Conference on Machine Learning, pages 5714–5724. PMLR, 2020. 2
|
| 242 |
+
[36] Junnan Li, Pan Zhou, Caiming Xiong, and Steven Hoi. Prototypical contrastive learning of unsupervised representations. In International Conference on Learning Representations, 2021. 2, 3, 9, 10
|
| 243 |
+
[37] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016. 6
|
| 244 |
+
[38] Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 2
|
| 245 |
+
[39] M. Noroozi and P. Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In ECCV, 2016. 2
|
| 246 |
+
[40] Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019. 1, 2
|
| 247 |
+
[41] Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning? arXiv preprint arXiv:2005.10243, 2020. 2, 3
|
| 248 |
+
[42] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. 8
|
| 249 |
+
[43] Feng Wang, Xiang Xiang, Jian Cheng, and A. Yuille. Normface: L2 hypersphere embedding for face verification. Proceedings of the 25th ACM international conference on Multimedia, 2017. 6
|
| 250 |
+
[44] H. Wang, Yitong Wang, Z. Zhou, Xing Ji, Zhifeng Li, Dihong Gong, Jingchao Zhou, and Wenyu Liu. Cosface: Large margin cosine loss for deep face recognition. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5265–5274, 2018. 6
|
| 251 |
+
[45] Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. arXiv preprint arXiv:2005.10242, 2020. 1, 3
|
| 252 |
+
[46] Xiao Wang and Guo-Jun Qi. Contrastive learning with stronger augmentations. arXiv preprint arXiv:2104.07713, 2021. 2, 5, 9
|
| 253 |
+
[47] Zhirong Wu, Yuanjun Xiong, X Yu Stella, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. 1, 2, 9
|
| 254 |
+
[48] Asano YM., Rupprecht C., and Vedaldi A. Self-labelling via simultaneous clustering and representation learning. In International Conference on Learning Representations, 2020. 1, 3
|
| 255 |
+
[49] Shan You, Chang Xu, Chao Xu, and Dacheng Tao. Learning from multiple teacher networks. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1285–1294, 2017. 5
|
| 256 |
+
[50] Richard Zhang, Phillip Isola, and Alexei A. Efros. Colorful image colorization. In ECCV, 2016. 2
|
| 257 |
+
[51] Mingkai Zheng, Fei Wang, Shan You, Chen Qian, Changshui Zhang, Xiaogang Wang, and Chang Xu. Weakly supervised contrastive learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 10042–10051, October 2021. 9
|
| 258 |
+
[52] Chengxu Zhuang, Alex Lin Zhai, and Daniel Yamins. Local aggregation for unsupervised learning of visual embeddings. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6002–6012, 2019. 9
|
md/train/H1eSS3CcKX/H1eSS3CcKX.md
ADDED
|
@@ -0,0 +1,704 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STOCHASTIC OPTIMIZATION OF SORTING NETWORKS VIA CONTINUOUS RELAXATIONS
|
| 2 |
+
|
| 3 |
+
Aditya Grover∗, Eric Wang∗, Aaron Zweig & Stefano Ermon Computer Science Department
|
| 4 |
+
Stanford University
|
| 5 |
+
{adityag,ejwang,azweig,ermon}@cs.stanford.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Sorting input objects is an important step in many machine learning pipelines. However, the sorting operator is non-differentiable with respect to its inputs, which prohibits end-to-end gradient-based optimization. In this work, we propose NeuralSort, a general-purpose continuous relaxation of the output of the sorting operator from permutation matrices to the set of unimodal row-stochastic matrices, where every row sums to one and has a distinct arg max. This relaxation permits straight-through optimization of any computational graph involve a sorting operation. Further, we use this relaxation to enable gradient-based stochastic optimization over the combinatorially large space of permutations by deriving a reparameterized gradient estimator for the Plackett-Luce family of distributions over permutations. We demonstrate the usefulness of our framework on three tasks that require learning semantic orderings of high-dimensional objects, including a fully differentiable, parameterized extension of the $k$ -nearest neighbors algorithm.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Learning to automatically sort objects is useful in many machine learning applications, such as top$k$ multi-class classification (Berrada et al., 2018), ranking documents for information retrieval (Liu et al., 2009), and multi-object target tracking in computer vision (Bar-Shalom & Li, 1995). Such algorithms typically require learning informative representations of complex, high-dimensional data, such as images, before sorting and subsequent downstream processing. For instance, the $k$ -nearest neighbors image classification algorithm, which orders the neighbors based on distances in the canonical pixel basis, can be highly suboptimal for classification (Weinberger et al., 2006). Deep neural networks can instead be used to learn representations, but these representations cannot be optimized end-to-end for a downstream sorting-based objective, since the sorting operator is not differentiable with respect to its input.
|
| 14 |
+
|
| 15 |
+
In this work, we seek to remedy this shortcoming by proposing NeuralSort, a continuous relaxation to the sorting operator that is differentiable almost everywhere with respect to the inputs. The output of any sorting algorithm can be viewed as a permutation matrix, which is a square matrix with entries in $\{ 0 , 1 \}$ such that every row and every column sums to 1. Instead of a permutation matrix, NeuralSort returns a unimodal row-stochastic matrix. A unimodal row-stochastic matrix is defined as a square matrix with positive real entries, where each row sums to 1 and has a distinct arg max. All permutation matrices are unimodal row-stochastic matrices. NeuralSort has a temperature knob that controls the degree of approximation, such that in the limit of zero temperature, we recover a permutation matrix that sorts the inputs. Even for a non-zero temperature, we can efficiently project any unimodal matrix to the desired permutation matrix via a simple row-wise arg max operation. Hence, NeuralSort is also suitable for efficient straight-through gradient optimization (Bengio et al., 2013), which requires “exact” permutation matrices to evaluate learning objectives.
|
| 16 |
+
|
| 17 |
+
As the second primary contribution, we consider the use of NeuralSort for stochastic optimization over permutations. In many cases, such as latent variable models, the permutations may be latent but directly influence observed behavior, e.g., utility and choice models are often expressed as distributions over permutations which govern the observed decisions of agents (Regenwetter et al.,
|
| 18 |
+
|
| 19 |
+
2006; Chierichetti et al., 2018). By learning distributions over unobserved permutations, we can account for the uncertainty in these permutations in a principled manner. However, the challenge with stochastic optimization over discrete distributions lies in gradient estimation with respect to the distribution parameters. Vanilla REINFORCE estimators are impractical for most cases, or necessitate custom control variates for low-variance gradient estimation (Glasserman, 2013).
|
| 20 |
+
|
| 21 |
+
In this regard, we consider the Plackett-Luce (PL) family of distributions over permutations (Plackett, 1975; Luce, 1959). A common modeling choice for ranking models, the PL distribution is parameterized by $n$ scores, with its support defined over the symmetric group consisting of $n !$ permutations. We derive a reparameterizable sampler for stochastic optimization with respect to this distribution, based on Gumbel perturbations to the $n$ (log-)scores. However, the reparameterized sampler requires sorting these perturbed scores, and hence the gradients of a downstream learning objective with respect to the scores are not defined. By using NeuralSort instead, we can approximate the objective and obtain well-defined reparameterized gradient estimates for stochastic optimization.
|
| 22 |
+
|
| 23 |
+
Finally, we apply NeuralSort to tasks that require us to learn semantic orderings of complex, highdimensional input data. First, we consider sorting images of handwritten digits, where the goal is to learn to sort images by their unobserved labels. Our second task extends the first one to quantile regression, where we want to estimate the median (50-th percentile) of a set of handwritten numbers. In addition to identifying the index of the median image in the sequence, we need to learn to map the inferred median digit to its scalar representation. In the third task, we propose an algorithm that learns a basis representation for the $k$ -nearest neighbors (kNN) classifier in an end-to-end procedure. Because the choice of the $k$ nearest neighbors requires a non-differentiable sorting, we use NeuralSort to obtain an approximate, differentiable surrogate. On all tasks, we observe significant empirical improvements due to NeuralSort over the relevant baselines and competing relaxations to permutation matrices.
|
| 24 |
+
|
| 25 |
+
# 2 PRELIMINARIES
|
| 26 |
+
|
| 27 |
+
An $n$ -dimensional permutation $\mathbf { z } = [ z _ { 1 } , z _ { 2 } , \ldots , z _ { n } ] ^ { T }$ is a list of unique indices $\{ 1 , 2 , \ldots , n \}$ . Every permutation $\mathbf { z }$ is associated with a permutation matrix $P _ { \mathbf { z } } \in \{ 0 , 1 \} ^ { n \times n }$ with entries given as:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
P _ { \mathbf { z } } [ i , j ] = { \Big \{ } _ { 0 } ^ { 1 { \mathrm { i f } } \ j } = z _ { i }
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
Let ${ \mathcal { Z } } _ { n }$ denote the set of all $n !$ possible permutations in the symmetric group. We define the sort : $\mathbb { R } ^ { n } \to { \mathcal Z } _ { n }$ operator as a mapping of $n$ real-valued inputs to a permutation corresponding to a descending ordering of these inputs. E.g., if the input vector $\mathbf { s } ~ = ~ [ 9 , 1 , 5 , 2 ] ^ { T }$ , then $\mathsf { s o r t } ( \mathbf { s } ) = [ 1 , 3 , \bar { 4 } , 2 ] ^ { T }$ since the largest element is at the first index, second largest element is at the third index and so on. In case of ties, elements are assigned indices in the order they appear. We can obtain the sorted vector simply via $P _ { \mathrm { s o r t } ( \mathbf { s } ) } \mathbf { s }$ .
|
| 34 |
+
|
| 35 |
+
# 2.1 PLACKETT-LUCE DISTRIBUTIONS
|
| 36 |
+
|
| 37 |
+
The family of Plackett-Luce distributions over permutations is best described via a generative process: Consider a sequence of $n$ items, each associated with a canonical index $i = 1 , 2 , \ldots , n$ . A common assumption in ranking models is that the underlying generating process for any observed permutation of $n$ items satisfies Luce’s choice axiom (Luce, 1959). Mathematically, this axiom defines the ‘choice’ probability of an item with index $i$ as: $q ( i ) \propto s _ { i }$ where $s _ { i } > 0$ is interpreted as the score of item with index i. The normalization constant is given by Z = Pi∈{1,2,...,n} si.
|
| 38 |
+
|
| 39 |
+
If we choose the $n$ items one at a time (without replacement) based on these choice probabilities, we obtain a discrete distribution over all possible permutations. This distribution is referred to as the Plackett-Luce (PL) distribution, and its probability mass function for any $\mathbf { z } \in \mathcal { Z } _ { n }$ is given by:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
q ( \mathbf { z } | \mathbf { s } ) = { \frac { s _ { z _ { 1 } } } { Z } } { \frac { s _ { z _ { 2 } } } { Z - s _ { z _ { 1 } } } } \cdot \cdot \cdot { \frac { s _ { z _ { n } } } { Z - \sum _ { i = 1 } ^ { n - 1 } s _ { z _ { i } } } }
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\mathbf { s } = \{ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } \}$ is the vector of scores parameterizing this distribution (Plackett, 1975).
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: Stochastic computation graphs with a deterministic node z corresponding to the output of a sort operator applied to the scores s.
|
| 49 |
+
|
| 50 |
+
# 2.2 STOCHASTIC COMPUTATION GRAPHS
|
| 51 |
+
|
| 52 |
+
The abstraction of stochastic computation graphs (SCG) compactly specifies the forward value and the backward gradient computation for computational circuits. An SCG is a directed acyclic graph that consists of three kinds of nodes: input nodes which specify external inputs (including parameters), deterministic nodes which are deterministic functions of their parents, and stochastic nodes which are distributed conditionally on their parents. See Schulman et al. (2015) for a review.
|
| 53 |
+
|
| 54 |
+
To define gradients of an objective function with respect to any node in the graph, the chain rule necessitates that the gradients with respect to the intermediate nodes are well-defined. This is not the case for the sort operator. In Section 3, we propose to extend stochastic computation graphs with nodes corresponding to a relaxation of the deterministic sort operator. In Section 4, we further use this relaxation to extend computation graphs to include stochastic nodes corresponding to distributions over permutations. The proofs of all theoretical results in this work are deferred to Appendix B.
|
| 55 |
+
|
| 56 |
+
# 3 NEURALSORT: THE RELAXED SORTING OPERATOR
|
| 57 |
+
|
| 58 |
+
Our goal is to optimize training objectives involving a sort operator with gradient-based methods. Consider the optimization of objectives written in the following form:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
L ( \boldsymbol { \theta } , \mathbf { s } ) = f ( P _ { \mathbf { z } } ; \boldsymbol { \theta } )
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Here, $\mathbf { s } \in \mathbb { R } ^ { n }$ denotes a vector of $n$ real-valued scores, $\mathbf { z }$ is the permutation that (deterministically) sorts the scores s, and $f ( \cdot )$ is an arbitrary function of interest assumed to be differentiable w.r.t a set of parameters $\theta$ and $\mathbf { z }$ . For example, in a ranking application, these scores could correspond to the inferred relevances of $n$ webpages and $f ( \cdot )$ could be a ranking loss. Figure 1 shows the stochastic computation graph corresponding to the objective in Eq. 2. We note that this could represent part of a more complex computation graph, which we skip for ease of presentation while maintaining the generality of the scope of this work.
|
| 65 |
+
|
| 66 |
+
While the gradient of the above objective w.r.t. $\theta$ is well-defined and can be computed via standard backpropogation, the gradient w.r.t. the scores s is not defined since the sort operator is not differentiable w.r.t. s. Our solution is to derive a relaxation to the sort operator that leads to a surrogate objective with well-defined gradients. In particular, we seek to use such a relaxation to replace the permutation matrix $P _ { \mathbf { z } }$ in Eq. 2 with an approximation $\widehat { P } _ { \mathbf { z } }$ such that the surrogate objective $f ( \widehat { P } _ { \mathbf { z } } ; \theta )$ is differentiable w.r.t. the scores s.
|
| 67 |
+
|
| 68 |
+
The general recipe to relax non-differentiable operators with discrete codomains $\mathcal { N }$ is to consider differentiable alternatives that map the input to a larger continuous codomain $\mathcal { M }$ with desirable properties. For gradient-based optimization, we are interested in two key properties:
|
| 69 |
+
|
| 70 |
+
1. The relaxation is continuous everywhere and differentiable (almost-)everywhere with respect to elements in the input domain. 2. There exists a computationally efficient projection from $\mathcal { M }$ back to $\mathcal { N }$ .
|
| 71 |
+
|
| 72 |
+
Relaxations satisfying the first requirement are amenable to automatic differentiation for optimizing stochastic computational graphs. The second requirement is useful for evaluating metrics and losses that necessarily require a discrete output akin to the one obtained from the original, non-relaxed operator. E.g., in straight-through gradient estimation (Bengio et al., 2013; Jang et al., 2017), the non-relaxed operator is used for evaluating the learning objective in the forward pass and the relaxed operator is used in the backward pass for gradient estimation.
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
Figure 2: Center: Venn Diagram relationships between permutation matrices $( \mathcal { P } )$ , doubly-stochastic matrices $( \mathcal { D } )$ , unimodal row stochastic matrices $( \mathcal { U } )$ , and row stochastic matrices $( { \mathcal { R } } )$ . Left: A doubly-stochastic matrix that is not unimodal. Right: A unimodal matrix that is not doublystochastic.
|
| 76 |
+
|
| 77 |
+
The canonical example is the $0 / 1$ loss used for binary classification. While the $0 / 1$ loss is discontinuous w.r.t. its inputs (real-valued predictions from a model), surrogates such as the logistic and hinge losses are continuous everywhere and differentiable almost-everywhere (property 1), and can give hard binary predictions via thresholding (property 2).
|
| 78 |
+
|
| 79 |
+
Note: For brevity, we assume that the arg max operator is applied over a set of elements with a unique maximizer and hence, the operator has well-defined semantics. With some additional bookkeeping for resolving ties, the results in this section hold even if the elements to be sorted are not unique. See Appendix C.
|
| 80 |
+
|
| 81 |
+
Unimodal Row Stochastic Matrices. The sort operator maps the input vector to a permutation, or equivalently a permutation matrix. Our relaxation to sort is motivated by the geometric structure of permutation matrices. The set of permutation matrices is a subset of doubly-stochastic matrices, i.e., a non-negative matrix such that the every row and column sums to one. If we remove the requirement that every column should sum to one, we obtain a larger set of row stochastic matrices. In this work, we propose a relaxation to sort that maps inputs to an alternate subset of row stochastic matrices, which we refer to as the unimodal row stochastic matrices.
|
| 82 |
+
|
| 83 |
+
Definition 1 (Unimodal Row Stochastic Matrices). An $n \times n$ matrix is Unimodal Row Stochastic if it satisfies the following conditions:
|
| 84 |
+
|
| 85 |
+
1. Non-negativity: $U [ i , j ] \geq 0 \quad \forall i , j \in \{ 1 , 2 , . . . , n \} .$ .
|
| 86 |
+
|
| 87 |
+
2. Row Affinity: $\begin{array} { r } { \sum _ { j = 1 } ^ { n } U [ i , j ] = 1 \quad \forall i \in \{ 1 , 2 , \ldots , n \} . } \end{array}$
|
| 88 |
+
|
| 89 |
+
3. Argmax Permutation: Let u denote an $n$ -dimensional vector with entries such that $u _ { i } =$ ar $\operatorname { g m a x } _ { j } U [ i , j ] \quad \forall i \in \{ 1 , 2 , \dots , n \}$ . Then, $\mathbf { u } \in \mathcal { Z } _ { n }$ , i.e., it is a valid permuation.
|
| 90 |
+
|
| 91 |
+
We denote $\mathcal { U } _ { n }$ as the set of $n \times n$ unimodal row stochastic matrices.
|
| 92 |
+
|
| 93 |
+
All row stochastic matrices satisfy the first two conditions. The third condition is useful for gradient based optimization involving sorting-based losses. The condition provides a straightforward mechanism for extracting a permutation from a unimodal row stochastic matrix via a row-wise arg max operation. Figure 2 shows the relationships between the different subsets of square matrices.
|
| 94 |
+
|
| 95 |
+
NeuralSort. Our relaxation to the sort operator is based on a standard identity for evaluating the sum of the $k$ largest elements in any input vector.
|
| 96 |
+
|
| 97 |
+
Lemma 2. [Lemma $I$ in Ogryczak & Tamir (2003)] For an input vector $\mathbf { s } = [ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } ] ^ { T }$ that is sorted as $s _ { [ 1 ] } \geq s _ { [ 2 ] } \geq . . . \geq s _ { [ n ] }$ , we have the sum of the $k$ -largest elements given as:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\sum _ { i = 1 } ^ { k } s _ { [ i ] } = \operatorname* { m i n } _ { \substack { \lambda \in \{ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } \} } } \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( s _ { i } - \lambda , 0 ) .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
The identity in Lemma 2 outputs the sum of the top- $k$ elements. The $k$ -th largest element itself can be recovered by taking the difference of the sum of top- $k$ elements and the top- $\left( k - 1 \right)$ elements.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 3: Stochastic computation graphs with stochastic nodes corresponding to permutations. Squares denote deterministic nodes and circles denote stochastic nodes.
|
| 107 |
+
|
| 108 |
+
Corollary 3. Let $\mathbf { s } = [ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } ] ^ { T }$ be a real-valued vector of length n. Let $A _ { \mathrm { s } }$ denote the matrix of absolute pairwise differences of the elements of s such that $A _ { \mathbf { s } } [ i , j ] = | s _ { i } - s _ { j } |$ . The permutation matrix $P _ { s o r t ( \mathbf { s } ) }$ corresponding to sort(s) is given by:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
P _ { s o r t ( \mathbf { s } ) } [ i , j ] = \left\{ { 1 i f j = \arg \operatorname* { m a x } [ ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { \mathbb { 1 } } ] } \right.
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where 1 denotes the column vector of all ones.
|
| 115 |
+
|
| 116 |
+
$E . g .$ , if we set $i = \lfloor ( n + 1 ) / 2 \rfloor$ then the non-zero entry in the $i$ -th row $P _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ]$ corresponds to the element with the minimum sum of (absolute) distance to the other elements. As desired, this corresponds to the median element. The relaxation requires $O ( n ^ { 2 } )$ operations to compute $A _ { \mathrm { s } }$ , as opposed to the $O ( n \log n )$ overall complexity for the best known sorting algorithms. In practice however, it is highly parallelizable and can be implemented efficiently on GPU hardware.
|
| 117 |
+
|
| 118 |
+
The arg max operator is non-differentiable which prohibits the direct use of Corollary 3 for gradient computation. Instead, we propose to replace the arg max operator with soft max to obtain a continuous relaxation $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } ( \tau )$ . In particular, the $i$ -th row of $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } ( \tau )$ is given by:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ] ( \tau ) = \mathrm { s o f t m a x } \left[ ( ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { 1 } ) / \tau \right]
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $\tau > 0$ is a temperature parameter. Our relaxation is continuous everywhere and differentiable almost everywhere with respect to the elements of s. Furthermore, we have the following result.
|
| 125 |
+
|
| 126 |
+
Theorem 4. Let $\widehat { P } _ { s o r t ( s ) }$ denote the continuous relaxation to the permutation matrix $P _ { s o r t ( \pmb { s } ) }$ for an arbitrary input vector s and temperature $\tau$ defined in Eq. 5. Then, we have:
|
| 127 |
+
|
| 128 |
+
1. Unimodality: $\forall \tau > 0$ , $\widehat { P } _ { s o r t ( s ) }$ is a unimodal row stochastic matrix. Further, let u denote the permutation obtained by applying arg max row-wise to $\widehat { P } _ { s o r t ( s ) }$ . Then, $\mathbf { u } = s o r t ( \pmb { s } )$
|
| 129 |
+
|
| 130 |
+
2. Limiting behavior: If we assume that the entries of s are drawn independently from a distribution that is absolutely continuous w.r.t. the Lebesgue measure in $\mathbb { R }$ , then the following convergence holds almost surely:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\operatorname* { l i m } _ { \tau 0 ^ { + } } \widehat { P } _ { s o r t ( \mathbf { s } ) } [ i , : ] ( \tau ) = P _ { s o r t ( \mathbf { s } ) } [ i , : ] \quad \forall i \in \{ 1 , 2 , \ldots , n \} .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
Unimodality allows for efficient projection of the relaxed permutation matrix $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) }$ to the hard matrix $P _ { \mathsf { s o r t } ( \mathbf { s } ) }$ via a row-wise arg max, e.g., for straight-through gradients. For analyzing limiting behavior, independent draws ensure that the elements of s are distinct almost surely. The temperature $\tau$ controls the degree of smoothness of our approximation. At one extreme, the approximation becomes tighter as the temperature is reduced. In practice however, the trade-off is in the variance of these estimates, which is typically lower for larger temperatures.
|
| 137 |
+
|
| 138 |
+
# 4 STOCHASTIC OPTIMIZATION OVER PERMUTATIONS
|
| 139 |
+
|
| 140 |
+
In many scenarios, we would like the ability to express our uncertainty in inferring a permutation e.g., latent variable models with latent nodes corresponding to permutations. Random variables that assume values corresponding to permutations can be represented via stochastic nodes in the
|
| 141 |
+
|
| 142 |
+
stochastic computation graph. For optimizing the parameters of such a graph, consider the following class of objectives:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
L ( \boldsymbol { \theta } , \mathbf { s } ) = \mathbb { E } _ { q ( \mathbf { z } | \mathbf { s } ) } \left[ f ( P _ { \mathbf { z } } ; \boldsymbol { \theta } ) \right]
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where $\theta$ and s denote sets of parameters, $P _ { \mathbf { z } }$ is the permutation matrix corresponding to the permutation $\mathbf { z }$ , $q ( \cdot )$ is a parameterized distribution over the elements of the symmetric group ${ \mathcal { Z } } _ { n }$ , and $f ( \cdot )$ is an arbitrary function of interest assumed to be differentiable in $\theta$ and $\mathbf { z }$ . The SCG is shown in Figure 3a. In contrast to the SCG considered in the previous section (Figure 1), here we are dealing with a distribution over permutations as opposed to a single (deterministically computed) one.
|
| 149 |
+
|
| 150 |
+
While such objectives are typically intractable to evaluate exactly since they require summing over a combinatorially large set, we can obtain unbiased estimates efficiently via Monte Carlo. Monte Carlo estimates of gradients w.r.t. $\theta$ can be derived simply via linearity of expectation. However, the gradient estimates w.r.t. s cannot be obtained directly since the sampling distribution depends on s. The REINFORCE gradient estimator (Glynn, 1990; Williams, 1992; Fu, 2006) uses the fact that $\nabla _ { \mathbf { s } } q ( \mathbf { z } | \mathbf { s } ) = q ( \mathbf { z } | \mathbf { s } ) \nabla _ { \mathbf { s } } \log q ( \mathbf { z } | \mathbf { s } )$ to derive the following Monte Carlo gradient estimates:
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\nabla _ { \mathbf { s } } L ( \theta , \mathbf { s } ) = \mathbb { E } _ { q ( \mathbf { z } | \mathbf { s } ) } \left[ f ( P _ { \mathbf { z } } ; \theta ) \nabla _ { \mathbf { s } } \log q ( \mathbf { z } | \mathbf { s } ) \right] + \mathbb { E } _ { q ( \mathbf { z } | \mathbf { s } ) } \left[ \nabla _ { \mathbf { s } } f ( P _ { \mathbf { z } } ; \theta ) \right] .
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
# 4.1 REPARAMETERIZED GRADIENT ESTIMATORS FOR PL DISTRIBUTIONS
|
| 157 |
+
|
| 158 |
+
REINFORCE gradient estimators typically suffer from high variance (Schulman et al., 2015; Glasserman, 2013). Reparameterized samplers provide an alternate gradient estimator by expressing samples from a distribution as a deterministic function of its parameters and a fixed source of randomness (Kingma & Welling, 2014; Rezende et al., 2014; Titsias & Lazaro-Gredilla, 2014). ´ Since the randomness is from a fixed distribution, Monte Carlo gradient estimates can be derived by pushing the gradient operator inside the expectation (via linearity). In this section, we will derive a reparameterized sampler and gradient estimator for the Plackett-Luce (PL) family of distributions.
|
| 159 |
+
|
| 160 |
+
Let the score $s _ { i }$ for an item $i \in \{ 1 , 2 , \ldots , n \}$ be an unobserved random variable drawn from some underlying score distribution (Thurstone, 1927). Now for each item, we draw a score from its corresponding score distribution. Next, we generate a permutation by applying the deterministic sort operator to these $n$ randomly sampled scores. Interestingly, prior work has shown that the resulting distribution over permutations corresponds to a PL distribution if and only if the scores are sampled independently from Gumbel distributions with identical scales.
|
| 161 |
+
|
| 162 |
+
Proposition 5. [adapted from Yellott Jr (1977)] Let s be a vector of scores for the n items. For each item $i$ , sample $g _ { i } \sim { \tt G u m b e l } ( 0 , \beta )$ independently with zero mean and a fixed scale $\beta$ . Let ˜s denote the vector of Gumbel perturbed log-scores with entries such that $\tilde { s } _ { i } = \beta \log s _ { i } + g _ { i }$ . Then:
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
q \bigl ( \tilde { s } _ { z _ { 1 } } \geq \cdot \cdot \cdot \geq \tilde { s } _ { z _ { n } } \bigr ) = \frac { s _ { z _ { 1 } } } { Z } \frac { s _ { z _ { 2 } } } { Z - s _ { z _ { 1 } } } \cdot \cdot \cdot \frac { s _ { z _ { n } } } { Z - \sum _ { i = 1 } ^ { n - 1 } s _ { z _ { i } } } .
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
For ease of presentation, we assume $\beta = 1$ in the rest of this work. Proposition 5 provides a method for sampling from PL distributions with parameters s by adding Gumbel perturbations to the logscores and applying the sort operator to the perturbed log-scores. This procedure can be seen as a reparameterization trick that expresses a sample from the PL distribution as a deterministic function of the scores and a fixed source of randomness (Figure 3b). Letting $\mathbf { g }$ denote the vector of i.i.d. Gumbel perturbations, we can express the objective in Eq. 7 as:
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
L ( \boldsymbol { \theta } , \mathbf { s } ) = \mathbb { E } _ { \mathbf { g } } \left[ f ( P _ { \mathrm { s o r t ( l o g \mathbf { s } + \mathbf { g } ) } } ; \boldsymbol { \theta } ) \right] .
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
While the reparameterized sampler removes the dependence of the expectation on the parameters s, it introduces a sort operator in the computation graph such that the overall objective is nondifferentiable in s. In order to obtain a differentiable surrogate, we approximate the objective based on the NeuralSort relaxation to the sort operator:
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\begin{array} { r } { \mathbb { E } _ { \mathbf { g } } \left[ f \left( P _ { \mathrm { s o r t } \left( \log \mathbf { s } + \mathbf { g } \right) } ; \theta \right) \right] \approx \mathbb { E } _ { \mathbf { g } } \left[ f \left( \widehat { P } _ { \mathrm { s o r t } \left( \log \mathbf { s } + \mathbf { g } \right) } ; \theta \right) \right] : = \widehat { L } ( \theta , \mathbf { s } ) . } \end{array}
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
Accordingly, we get the following reparameterized gradient estimates for the approximation:
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\nabla _ { \mathbf { s } } \widehat { L } ( \theta , \mathbf { s } ) = \mathbb { E } _ { \mathbf { g } } \left[ \nabla _ { \mathbf { s } } f ( \widehat { P } _ { \mathrm { s o r t ( l o g } \mathbf { s } + \mathbf { g } ) } ; \theta ) \right]
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
which can be estimated efficiently via Monte Carlo because the expectation is with respect to a distribution that does not depend on s.
|
| 187 |
+
|
| 188 |
+
# 5 DISCUSSION AND RELATED WORK
|
| 189 |
+
|
| 190 |
+
The problem of learning to rank documents based on relevance has been studied extensively in the context of information retrieval. In particular, listwise approaches learn functions that map objects to scores. Much of this work concerns the PL distribution: the RankNet algorithm (Burges et al., 2005) can be interpreted as maximizing the PL likelihood of pairwise comparisons between items, while the ListMLE ranking algorithm in Xia et al. (2008) extends this with a loss that maximizes the PL likelihood of ground-truth permutations directly. The differentiable pairwise approaches to ranking, such as Rigutini et al. (2011), learn to approximate the comparator between pairs of objects. Our work considers a generalized setting where sorting based operators can be inserted anywhere in computation graphs to extend traditional pipelines e.g., kNN.
|
| 191 |
+
|
| 192 |
+
Prior works have proposed relaxations of permutation matrices to the Birkhoff polytope, which is defined as the convex hull of the set of permutation matrices a.k.a. the set of doubly-stochastic matrices. A doubly-stochastic matrix is a permutation matrix iff it is orthogonal and continuous relaxations based on these matrices have been used previously for solving NP-complete problems such as seriation and graph matching (Fogel et al., 2013; Fiori et al., 2013; Lim & Wright, 2014). Adams & Zemel (2011) proposed the use of the Sinkhorn operator to map any square matrix to the Birkhoff polytope. They interpret the resulting doubly-stochastic matrix as the marginals of a distribution over permutations. Mena et al. (2018) propose an alternate method where the square matrix defines a latent distribution over the doubly-stochastic matrices themselves. These distributions can be sampled from by adding elementwise Gumbel perturbations. Linderman et al. (2018) propose a rounding procedure that uses the Sinkhorn operator to directly sample matrices near the Birkhoff polytope. Unlike Mena et al. (2018), the resulting distribution over matrices has a tractable density. In practice, however, the approach of Mena et al. (2018) performs better and will be the main baseline we will be comparing against in our experiments in Section 6.
|
| 193 |
+
|
| 194 |
+
As discussed in Section 3, NeuralSort maps permutation matrices to the set of unimodal rowstochastic matrices. For the stochastic setting, the PL distribution permits efficient sampling, exact and tractable density estimation, making it an attractive choice for several applications, e.g., variational inference over latent permutations. Our reparameterizable sampler, while also making use of the Gumbel distribution, is based on a result unique to the PL distribution (Proposition 5).
|
| 195 |
+
|
| 196 |
+
The use of the Gumbel distribution for defining continuous relaxations to discrete distributions was first proposed concurrently by Jang et al. (2017) and Maddison et al. (2017) for categorical variables, referred to as Gumbel-Softmax. The number of possible permutations grow factorially with the dimension, and thus any distribution over $n$ -dimensional permutations can be equivalently seen as a distribution over $n !$ categories. Gumbel-softmax does not scale to a combinatorially large number of categories (Kim et al., 2016; Mussmann et al., 2017), necessitating the use of alternate relaxations, such as the one considered in this work.
|
| 197 |
+
|
| 198 |
+
# 6 EXPERIMENTS
|
| 199 |
+
|
| 200 |
+
We refer to the two approaches proposed in Sections 3, 4 as Deterministic NeuralSort and Stochastic NeuralSort, respectively. For additional hyperparameter details and analysis, see Appendix D.
|
| 201 |
+
|
| 202 |
+
# 6.1 SORTING HANDWRITTEN NUMBERS
|
| 203 |
+
|
| 204 |
+
Dataset. We first create the large-MNIST dataset, which extends the MNIST dataset of handwritten digits. The dataset consists of multi-digit images, each a concatenation of 4 randomly selected individual images from MNIST, e.g., is one such image in this dataset. Each image is associated with a real-valued label, which corresponds to its concatenated MNIST labels, e.g., the label of is 1810. Using the large-MNIST dataset, we finally create a dataset of sequences. Every sequence is this dataset consists of $n$ randomly sampled large-MNIST images.
|
| 205 |
+
|
| 206 |
+
Setup. Given a dataset of sequences of large-MNIST images, our goal is to learn to predict the permutation that sorts the labels of the sequence of images, given a training set of ground-truth permutations. Figure 4 (Task 1) illustrates this task on an example sequence of $n = 5$ large-MNIST images. This task is a challenging extension of the one considered by Mena et al. (2018) in sorting scalars, since it involves learning the semantics of high-dimensional objects prior to sorting. A good model needs to learn to dissect the individual digits in an image, rank these digits, and finally, compose such rankings based on the digit positions within an image. The available supervision, in the form of the ground-truth permutation, is very weak compared to a classification setting that gives direct access to the image labels.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 4: Sorting and quantile regression. The model is trained to sort sequences of $n = 5$ largeMNIST images $\mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { 5 }$ (Task 1) and regress the median value (Task 2). In the above example, the ground-truth permutation that sorts the input sequence from largest to smallest is $[ 3 , 5 , \bar { 1 } , 4 , 2 ] ^ { T }$ , 9803 being the largest and 1270 the smallest. Blue illustrates the true median image $\mathbf { x } _ { 1 }$ with ground-truth sorted index 3 and value 2960.
|
| 210 |
+
|
| 211 |
+
Table 1: Average sorting accuracy on the test set. First value is proportion of permutations correctly identified; value in parentheses is the proportion of individual element ranks correctly identified.
|
| 212 |
+
|
| 213 |
+
<table><tr><td>Algorithm</td><td>n=3</td><td>n=5</td><td>n=7</td><td>n=9</td><td>n=15</td></tr><tr><td>Vanilla RS</td><td>0.467 (0.801)</td><td>0.093 (0.603)</td><td>0.009 (0.492)</td><td>0. (0.113)</td><td>0. (0.067)</td></tr><tr><td>Sinkhorn</td><td>0.462 (0.561)</td><td>0.038 (0.293)</td><td>0.001 (0.197)</td><td>0. (0.143)</td><td>0.(0.078)</td></tr><tr><td>Gumbel-Sinkhorn</td><td>0.484 (0.575)</td><td>0.033 (0.295)</td><td>0.001 (0.189)</td><td>0. (0.146)</td><td>0. (0.078)</td></tr><tr><td>Deterministic NeuralSort</td><td>0.930 (0.951)</td><td>0.837 (0.927)</td><td>0.738 (0.909)</td><td>0.649 (0.896)</td><td>0.386 (0.857)</td></tr><tr><td>Stochastic NeuralSort</td><td>0.927 (0.950)</td><td>0.835 (0.926)</td><td>0.741 (0.909)</td><td>0.646 (0.895)</td><td>0.418 (0.862)</td></tr></table>
|
| 214 |
+
|
| 215 |
+
Baselines. All baselines use a CNN that is shared across all images in a sequence to map each large-MNIST image to a feature space. The vanilla row-stochastic (RS) baseline concatenates the CNN representations for $n$ images into a single vector that is fed into a multilayer perceptron that outputs $n$ multiclass predictions of the image probabilities for each rank. The Sinkhorn and GumbelSinkhorn baselines, as discussed in Section 5, use the Sinkhorn operator to map the stacked CNN representations for the $n$ objects into a doubly-stochastic matrix. For all methods, we minimized the cross-entropy loss between the predicted matrix and the ground-truth permutation matrix.
|
| 216 |
+
|
| 217 |
+
Results. Following Mena et al. (2018), our evaluation metric is the the proportion of correctly predicted permutations on a test set of sequences. Additionally, we evaluate the proportion of individual elements ranked correctly. Table 1 demonstrates that the approaches based on the proposed sorting relaxation significantly outperform the baseline approaches for all $n$ considered. The performance of the deterministic and stochastic variants are comparable. The vanilla RS baseline performs well in ranking individual elements, but is not good at recovering the overall square matrix.
|
| 218 |
+
|
| 219 |
+
We believe the poor performance of the Sinkhorn baselines is partly because these methods were designed and evaluated for matchings. Like the output of sort, matchings can also be represented as permutation matrices. However, distributions over matchings need not satisfy Luce’s choice axiom or imply a total ordering, which could explain the poor performance on the tasks considered.
|
| 220 |
+
|
| 221 |
+
# 6.2 QUANTILE REGRESSION
|
| 222 |
+
|
| 223 |
+
Setup. In this experiment, we extend the sorting task to regression. Again, each sequence contains $n$ large-MNIST images, and the regression target for each sequence is the 50-th quantile (i.e., the median) of the $n$ labels of the images in the sequence. Figure 4 (Task 2) illustrates this task on an example sequence of $n = 5$ large-MNIST images, where the goal is to output the third largest label. The design of this task highlights two key challenges since it explicitly requires learning both a suitable representation for sorting high-dimensional inputs and a secondary function that approximates the label itself (regression). Again, the supervision available in the form of the label of only a single image at an arbitrary and unknown location in the sequence is weak.
|
| 224 |
+
|
| 225 |
+
Table 2: Test mean squared error $( \times 1 0 ^ { - 4 } )$ ) and $R ^ { 2 }$ values (in parenthesis) for quantile regression.
|
| 226 |
+
|
| 227 |
+
<table><tr><td>Algorithm</td><td>n=5</td><td>n=9</td><td>n=15</td></tr><tr><td>Constant (Simulated)</td><td>356.79 (0.00)</td><td>227.31 (0.00)</td><td>146.94 (0.00)</td></tr><tr><td>Vanilla NN</td><td>1004.70 (0.85)</td><td>699.15 (0.82)</td><td>562.97 (0.79)</td></tr><tr><td>Sinkhorn</td><td>343.60 (0.25)</td><td>231.87 (0.19)</td><td>156.27 (0.04)</td></tr><tr><td>Gumbel-Sinkhorn</td><td>344.28 (0.25)</td><td>232.56 (0.23)</td><td>157.34 (0.06)</td></tr><tr><td>Deterministic NeuralSort</td><td>45.50 (0.95)</td><td>34.98 (0.94)</td><td>34.78 (0.92)</td></tr><tr><td>Stochastic NeuralSort</td><td>33.80 (0.94)</td><td>31.43 (0.93)</td><td>29.34 (0.90)</td></tr></table>
|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
Figure 5: Differentiable kNN. The model is trained such that the representations $\mathbf { e } _ { i }$ for the training points $\left\{ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { n } \right\}$ that have the same label $y _ { 0 }$ as $\mathbf { x } _ { \mathrm { 0 } }$ are closer to $\mathbf { e } _ { 0 }$ (included in top- $k$ ) than others.
|
| 231 |
+
|
| 232 |
+
Baselines. In addition to Sinkhorn and Gumbel-Sinkhorn, we design two more baselines. The Constant baseline always returns the median of the full range of possible outputs, ignoring the input sequence. This corresponds to 4999.5 since we are sampling large-MNIST images uniformly in the range of four-digit numbers. The vanilla neural net (NN) baseline directly maps the input sequence of images to a real-valued prediction for the median.
|
| 233 |
+
|
| 234 |
+
Results. Our evaluation metric is the mean squared error (MSE) and $R ^ { 2 }$ on a test set of sequences. Results for $n = \{ 5 , 9 , 1 5 \}$ images are shown in Table 2. The Vanilla NN baseline while incurring a large MSE, is competitive on the $R ^ { 2 }$ metric. The other baselines give comparable performance on the MSE metric. The proposed NeuralSort approaches outperform the competing methods on both the metrics considered. The stochastic NeuralSort approach is the consistent best performer on MSE, while the deterministic NeuralSort is slightly better on the $R ^ { 2 }$ metric.
|
| 235 |
+
|
| 236 |
+
# 6.3 END-TO-END, DIFFERENTIABLE $k$ -NEAREST NEIGHBORS
|
| 237 |
+
|
| 238 |
+
Setup. In this experiment, we design a fully differentiable, end-to-end $k$ -nearest neighbors (kNN) classifier. Unlike a standard kNN classifier which computes distances between points in a predefined space, we learn a representation of the data points before evaluating the $k$ -nearest neighbors.
|
| 239 |
+
|
| 240 |
+
We are given access to a dataset $\mathcal { D }$ of $( \mathbf { x } , y )$ pairs of standard input data and their class labels respectively. The differentiable kNN algorithm consists of two hyperparameters: the number of training neighbors $n$ , the number of top candidates $k$ , and the sorting temperature $\tau$ . Every sequence of items here consists of a query point $\mathbf { x }$ and a randomly sampled subset of $n$ candidate nearest neighbors from the training set, say $\left\{ \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { n } \right\}$ . In principle, we could use the entire training set (excluding the query point) as candidate points, but this can hurt the learning both computationally and statistically. The query points are randomly sampled from the train/validation/test sets as appropriate but the nearest neighbors are always sampled from the training set. The loss function optimizes for a representation space $h _ { \phi } ( \cdot )$ (e.g., CNN) such that the top- $k$ candidate points with the minimum Euclidean distance to the query point in the representation space have the same label as the query point. Note that at test time, once the representation space $h _ { \phi }$ is learned, we can use the entire training set as the set of candidate points, akin to a standard kNN classifier. Figure 5 illustrates the proposed algorithm.
|
| 241 |
+
|
| 242 |
+
Formally, for any datapoint $\mathbf { x }$ , let $_ { z }$ denote a permutation of the $n$ candidate points. The uniformlyweighted kNN loss, denoted as $\ell _ { \mathrm { k N N } } ( \cdot )$ , can be written as follows:
|
| 243 |
+
|
| 244 |
+
$$
|
| 245 |
+
\ell _ { \mathrm { k N N } } ( \widehat { P } _ { \mathbf { z } } , y , y _ { 1 } , y _ { 2 } , \ldots , y _ { n } ) = - \frac { 1 } { k } \sum _ { j = 1 } ^ { k } \sum _ { i = 1 } ^ { n } \mathbb { 1 } ( y _ { i } = y ) \widehat { P } _ { \mathbf { z } } [ i , j ]
|
| 246 |
+
$$
|
| 247 |
+
|
| 248 |
+
Table 3: Average test kNN classification accuracies from $n$ neighbors for best value of $k$ .
|
| 249 |
+
|
| 250 |
+
<table><tr><td>Algorithm</td><td>MNIST</td><td>Fashion-MNIST</td><td>CIFAR-10</td></tr><tr><td>kNN</td><td>97.2%</td><td>85.8%</td><td>35.4%</td></tr><tr><td>kNN+PCA</td><td>97.6%</td><td>85.9%</td><td>40.9%</td></tr><tr><td>kNN+AE</td><td>97.6%</td><td>87.5%</td><td>44.2%</td></tr><tr><td>kNN + Deterministic NeuralSort</td><td>99.5%</td><td>93.5%</td><td>90.7%</td></tr><tr><td>kNN + Stochastic NeuralSort</td><td>99.4%</td><td>93.4%</td><td>89.5%</td></tr><tr><td>CNN (w/o kNN)</td><td>一 99.4%</td><td>93.4%</td><td>95.1%</td></tr></table>
|
| 251 |
+
|
| 252 |
+
where $\left\{ y _ { 1 } , y _ { 2 } , \ldots , y _ { n } \right\}$ are the labels for the candidate points. Note that when $\widehat { P } _ { \mathbf { z } }$ is an exact permutation matrix (i.e., temperature $\tau 0$ ), this expression is exactly the negative of the fraction of $k$ nearest neighbors that have the same label as $\mathbf { x }$ .
|
| 253 |
+
|
| 254 |
+
Using Eq. 13, the training objectives for Deterministic and Stochastic NeuralSort are given as:
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
\operatorname* { m i n } _ { \phi } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , y ) \in \mathcal { D } } \ell _ { \mathrm { k N N } } \big ( \widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } , y , y _ { 1 } , \dots , y _ { n } \big )
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\operatorname* { m i n } _ { \phi } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , y ) \in \mathcal { D } } \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { s } ) } \left[ \ell _ { \mathrm { k N N } } ( \widehat { P } _ { \mathbf { z } } , y , y _ { 1 } , y _ { 2 } , \dots , y _ { n } ) \right]
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
where each entry of $\mathbf { s }$ is given as $s _ { j } = - \| h _ { \phi } ( \mathbf x ) - h _ { \phi } ( \mathbf x _ { j } ) \| _ { 2 } ^ { 2 }$ .
|
| 265 |
+
|
| 266 |
+
Datasets. We consider three benchmark datasetes: MNIST dataset of handwritten digits, FashionMNIST dataset of fashion apparel, and the CIFAR-10 dataset of natural images (no data augmentation) with the canonical splits for training and testing.
|
| 267 |
+
|
| 268 |
+
Baselines. We consider kNN baselines that operate in three standard representation spaces: the canonical pixel basis, the basis specified by the top 50 principal components (PCA), an autonencoder (AE). Additionally, we experimented with $k = 1 , 3 , 5 , 9$ nearest neighbors and across two distance metrics: uniform weighting of all $k$ -nearest neighbors and weighting nearest neighbors by the inverse of their distance. For completeness, we trained a CNN with the same architecture as the one used for NeuralSort (except the final layer) using the cross-entropy loss.
|
| 269 |
+
|
| 270 |
+
Results. We report the classification accuracies on the standard test sets in Table 3. On both datasets, the differentiable kNN classifier outperforms all the baseline kNN variants including the convolutional autoencoder approach. The performance is much closer to the accuracy of a standard CNN.
|
| 271 |
+
|
| 272 |
+
# 7 CONCLUSION
|
| 273 |
+
|
| 274 |
+
In this paper, we proposed NeuralSort, a continuous relaxation of the sorting operator to the set of unimodal row-stochastic matrices. Our relaxation facilitates gradient estimation on any computation graph involving a sort operator. Further, we derived a reparameterized gradient estimator for the Plackett-Luce distribution for efficient stochastic optimization over permutations. On three illustrative tasks including a fully differentiable $k$ -nearest neighbors, our proposed relaxations outperform prior work in end-to-end learning of semantic orderings of high-dimensional objects.
|
| 275 |
+
|
| 276 |
+
In the future, we would like to explore alternate relaxations to sorting as well as applications that extend widely-used algorithms such as beam search (Goyal et al., 2018). Both deterministic and stochastic NeuralSort are easy to implement. We provide reference implementations in Tensorflow (Abadi et al., 2016) and PyTorch (Paszke et al., 2017) in Appendix A. The full codebase for this work is open-sourced at https://github.com/ermongroup/neuralsort.
|
| 277 |
+
|
| 278 |
+
# ACKNOWLEDGEMENTS
|
| 279 |
+
|
| 280 |
+
This research was supported by NSF (#1651565, #1522054, #1733686), ONR, AFOSR (FA9550- 19-1-0024), FLI, and Amazon AWS. AG is supported by MSR fellowship and Stanford Data Science scholarship. We are thankful to Jordan Alexander, Kristy Choi, Adithya Ganesh, Karan Goel, Neal Jean, Daniel Levy, Jiaming Song, Yang Song, Serena Yeung, and Hugh Zhang for feedback.
|
| 281 |
+
|
| 282 |
+
# REFERENCES
|
| 283 |
+
|
| 284 |
+
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 largescale machine learning. In Operating Systems Design and Implementation, 2016.
|
| 285 |
+
|
| 286 |
+
Ryan Prescott Adams and Richard S Zemel. Ranking via Sinkhorn propagation. arXiv preprint arXiv:1106.1925, 2011.
|
| 287 |
+
|
| 288 |
+
Matej Balog, Nilesh Tripuraneni, Zoubin Ghahramani, and Adrian Weller. Lost relatives of the Gumbel trick. In International Conference on Machine Learning, 2017.
|
| 289 |
+
|
| 290 |
+
Yaakov Bar-Shalom and Xiao-Rong Li. Multitarget-multisensor tracking: principles and techniques. 1995.
|
| 291 |
+
|
| 292 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients ´ through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 293 |
+
|
| 294 |
+
Leonard Berrada, Andrew Zisserman, and M Pawan Kumar. Smooth loss functions for deep top- $\mathbf { \nabla } \cdot \mathbf { k }$ classification. In International Conference on Learning Representations, 2018.
|
| 295 |
+
|
| 296 |
+
Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. Learning to rank using gradient descent. In International Conference on Machine learning, 2005.
|
| 297 |
+
|
| 298 |
+
Flavio Chierichetti, Ravi Kumar, and Andrew Tomkins. Discrete choice, permutations, and reconstruction. In Symposium on Discrete Algorithms, 2018.
|
| 299 |
+
|
| 300 |
+
Marcelo Fiori, Pablo Sprechmann, Joshua Vogelstein, Pablo Muse, and Guillermo Sapiro. Robust ´ multimodal graph matching: Sparse coding meets graph matching. In Advances in Neural Information Processing Systems, 2013.
|
| 301 |
+
|
| 302 |
+
Fajwel Fogel, Rodolphe Jenatton, Francis Bach, and Alexandre d’Aspremont. Convex relaxations for permutation problems. In Advances in Neural Information Processing Systems, 2013.
|
| 303 |
+
|
| 304 |
+
Michael C Fu. Gradient estimation. Handbooks in operations research and management science, 13:575–616, 2006.
|
| 305 |
+
|
| 306 |
+
Bolin Gao and Lacra Pavel. On the properties of the softmax function with application in game theory and reinforcement learning. arXiv preprint arXiv:1704.00805, 2017.
|
| 307 |
+
|
| 308 |
+
Paul Glasserman. Monte Carlo methods in financial engineering, volume 53. Springer Science & Business Media, 2013.
|
| 309 |
+
|
| 310 |
+
Peter W Glynn. Likelihood ratio gradient estimation for stochastic systems. Communications of the ACM, 33(10):75–84, 1990.
|
| 311 |
+
|
| 312 |
+
Kartik Goyal, Graham Neubig, Chris Dyer, and Taylor Berg-Kirkpatrick. A continuous relaxation of beam search for end-to-end training of neural sequence models. In AAAI Conference on Artificial Intelligence, 2018.
|
| 313 |
+
|
| 314 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-softmax. In International Conference on Learning Representations, 2017.
|
| 315 |
+
|
| 316 |
+
Carolyn Kim, Ashish Sabharwal, and Stefano Ermon. Exact sampling with integer linear programs and random perturbations. In AAAI Conference on Artificial Intelligence, 2016.
|
| 317 |
+
|
| 318 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In International Conference on Learning Representations, 2014.
|
| 319 |
+
|
| 320 |
+
Cong Han Lim and Stephen J Wright. Sorting network relaxations for vector permutation problems. arXiv preprint arXiv:1407.6609, 2014.
|
| 321 |
+
|
| 322 |
+
Scott W Linderman, Gonzalo E Mena, Hal Cooper, Liam Paninski, and John P Cunningham. Reparameterizing the birkhoff polytope for variational permutation inference. In International Conference on Artificial Intelligence and Statistics, 2018.
|
| 323 |
+
|
| 324 |
+
Tie-Yan Liu et al. Learning to rank for information retrieval. Foundations and Trends $\textsuperscript { \textregistered }$ in Information Retrieval, 3(3):225–331, 2009.
|
| 325 |
+
|
| 326 |
+
R Duncan Luce. Individual choice behavior: A theoretical analysis. Courier Corporation, 1959.
|
| 327 |
+
|
| 328 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. In International Conference on Learning Representations, 2017.
|
| 329 |
+
|
| 330 |
+
Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. Learning latent permutations with gumbel-sinkhorn networks. In International Conference on Learning Representations, 2018.
|
| 331 |
+
|
| 332 |
+
Stephen Mussmann, Daniel Levy, and Stefano Ermon. Fast amortized inference and learning in log-linear models with randomly perturbed nearest neighbor search. In Uncertainty in Artificial Intelligence, 2017.
|
| 333 |
+
|
| 334 |
+
Wlodzimierz Ogryczak and Arie Tamir. Minimizing the sum of the $k$ largest functions in linear time. Information Processing Letters, 85(3):117–122, 2003.
|
| 335 |
+
|
| 336 |
+
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.
|
| 337 |
+
|
| 338 |
+
Robin L Plackett. The analysis of permutations. Applied Statistics, pp. 193–202, 1975.
|
| 339 |
+
|
| 340 |
+
Michel Regenwetter, Bernard Grofman, Ilia Tsetlin, and AAJ Marley. Behavioral social choice: probabilistic models, statistical inference, and applications. Cambridge University Press, 2006.
|
| 341 |
+
|
| 342 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014.
|
| 343 |
+
|
| 344 |
+
Leonardo Rigutini, Tiziano Papini, Marco Maggini, and Franco Scarselli. Sortnet: Learning to rank by a neural preference function. IEEE transactions on neural networks, 22(9):1368–1380, 2011.
|
| 345 |
+
|
| 346 |
+
John Schulman, Nicolas Heess, Theophane Weber, and Pieter Abbeel. Gradient estimation using stochastic computation graphs. In Advances in Neural Information Processing Systems, 2015.
|
| 347 |
+
|
| 348 |
+
Louis L Thurstone. A law of comparative judgment. Psychological review, 34(4):273, 1927.
|
| 349 |
+
|
| 350 |
+
Michalis Titsias and Miguel Lazaro-Gredilla. Doubly stochastic variational Bayes for non-conjugate ´ inference. In International Conference on Machine Learning, 2014.
|
| 351 |
+
|
| 352 |
+
Kilian Q Weinberger, John Blitzer, and Lawrence K Saul. Distance metric learning for large margin nearest neighbor classification. In Advances in Neural Information Processing Systems, 2006.
|
| 353 |
+
|
| 354 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 355 |
+
|
| 356 |
+
Fen Xia, Tie-Yan Liu, Jue Wang, Wensheng Zhang, and Hang Li. Listwise approach to learning to rank: theory and algorithm. In International Conference on Machine Learning, 2008.
|
| 357 |
+
|
| 358 |
+
John I Yellott Jr. The relationship between luce’s choice axiom, thurstone’s theory of comparative judgment, and the double exponential distribution. Journal of Mathematical Psychology, 15(2): 109–144, 1977.
|
| 359 |
+
|
| 360 |
+
# APPENDICES
|
| 361 |
+
|
| 362 |
+
# A SORTING OPERATOR
|
| 363 |
+
|
| 364 |
+
A.1 TENSORFLOW
|
| 365 |
+
|
| 366 |
+
Sorting Relaxation for Deterministic NeuralSort:
|
| 367 |
+
|
| 368 |
+
import tensorflow as tf
|
| 369 |
+
|
| 370 |
+
def deterministic_NeuralSort(s, tau): """ s: input elements to be sorted. Shape: batch_size x n x 1 tau: temperature for relaxation. Scalar. """ $\begin{array} { r l } { \boldsymbol { \mathrm { n } } } & { { } = } \end{array}$ tf.shape(s)[1] one $=$ tf.ones((n, 1), dtype $=$ tf.float32) $\begin{array} { r l } { \mathbb { A } \_ s } & { { } = } \end{array}$ tf.abs(s - tf.transpose(s, perm $1 =$ [0, 2, 1])) $\begin{array} { r l } { \mathrm { \large ~ B ~ } } & { { } = } \end{array}$ tf.matmul(A_s, tf.matmul(one, tf.transpose(one))) scaling $=$ tf.cast(n + 1 - 2 $\star$ (tf.range(n) + 1), dtype $=$ tf.float32) ${ \mathrm { ~ \small ~ \mathscr ~ { ~ C ~ } ~ } } =$ tf.matmul(s, tf.expand_dims(scaling, 0)) P_max $=$ tf.transpose(C-B, perm ${ \_ }$ [0, 2, 1]) P_hat $=$ tf.nn.softmax(P_max / tau, $^ { - 1 }$ )
|
| 371 |
+
|
| 372 |
+
return P_hat
|
| 373 |
+
|
| 374 |
+
# Reparameterized Sampler for Stochastic NeuralSort:
|
| 375 |
+
|
| 376 |
+
def sample_gumbel(samples_shape, eps = 1e-10):
|
| 377 |
+
|
| 378 |
+
U $=$ tf.random_uniform(samples_shape, minval ${ } = 0$ , maxval $^ { = 1 }$ ) return -tf.log(-tf.log(U $^ +$ eps) $^ +$ eps)
|
| 379 |
+
|
| 380 |
+
def stochastic_NeuralSort(s, n_samples, tau):
|
| 381 |
+
|
| 382 |
+
s: parameters of the PL distribution. Shape: batch_size x n x 1. n_samples: number of samples from the PL distribution. Scalar. tau: temperature for the relaxation. Scalar.
|
| 383 |
+
"""
|
| 384 |
+
batch_size $=$ tf.shape(s)[0]
|
| 385 |
+
$\begin{array} { r l } { \boldsymbol { \mathrm { n } } } & { { } = } \end{array}$ tf.shape(s)[1]
|
| 386 |
+
log_s_perturb $=$ s $^ +$ sample_gumbel([n_samples, batch_size, n, 1])
|
| 387 |
+
log_s_perturb $=$ tf.reshape(log_s_perturb, [n_samples $\star$ batch_size, n, 1])
|
| 388 |
+
|
| 389 |
+
P_hat $=$ deterministic_NeuralSort(log_s_perturb, tau) P_hat $=$ tf.reshape(P_hat, [n_samples, batch_size, n, n])
|
| 390 |
+
|
| 391 |
+
return P_hat
|
| 392 |
+
|
| 393 |
+
# A.2 PYTORCH
|
| 394 |
+
|
| 395 |
+
Sorting Relaxation for Deterministic NeuralSort:
|
| 396 |
+
|
| 397 |
+
# import torch
|
| 398 |
+
|
| 399 |
+
def deterministic_NeuralSort(s, tau): """ s: input elements to be sorted. Shape: batch_size x n x 1 tau: temperature for relaxation. Scalar. """ $\mathrm { ~ \scriptsize ~ n ~ } = \mathrm { ~ \scriptsize ~ s ~ }$ .size()[1] one $=$ torch.ones((n, 1), dtype $=$ torch.float32) $\begin{array} { r l } { \mathbb { A } \_ s } & { { } = } \end{array}$ torch.abs(s - s.permute(0, 2, 1)) $\begin{array} { r l } { \mathrm { \large ~ B ~ } } & { { } = } \end{array}$ torch.matmul(A_s, torch.matmul(one, torch.transpose(one, 0, 1))) scali $\begin{array} { r } { \mathbf { { \nabla } } \cdot \boldsymbol { \nabla } \mathrm { ~ ~ \psi ~ } = \mathrm { ~ ~ \psi ~ } ( \mathrm { ~ n ~ \xi ~ } + \mathrm { ~ ~ \xi ~ } ] } \end{array}$ - 2 \* (torch.arange(n) $^ { + } ~ \bot )$ ).type(torch.float32) ${ \mathrm { ~ \small ~ \mathscr ~ { ~ C ~ } ~ } } =$ torch.matmul(s, scaling.unsqueeze(0)) P_max $=$ (C-B).permute(0, 2, 1) sm $=$ torch.nn.Softmax(-1) P_hat $=$ sm(P_max / tau) return P_hat
|
| 400 |
+
|
| 401 |
+
# Reparamterized Sampler for Stochastic NeuralSort:
|
| 402 |
+
|
| 403 |
+
def sample_gumbel(samples_shape, eps $=$ 1e-10): U $=$ torch.rand(samples_shape) return -torch.log(-torch.log(U + eps) + eps)
|
| 404 |
+
def stochastic_NeuralSort(s, n_samples, tau): """ s: parameters of the PL distribution. Shape: batch_size x n x 1. n_samples: number of samples from the PL distribution. Scalar. tau: temperature for the relaxation. Scalar. """ batch_size $=$ s.size()[0] $\mathrm { ~ \scriptsize ~ n ~ } = \mathrm { ~ \scriptsize ~ s ~ }$ .size()[1] log_s_perturb $=$ torch.log(s) $^ +$ sample_gumbel([n_samples, batch_size, n, 1]) log_s_perturb $=$ log_s_perturb.view(n_samples $\star$ batch_size, n, 1) P_hat $=$ deterministic_NeuralSort(log_s_perturb, tau) P_hat $=$ P_hat.view(n_samples, batch_size, n, n) return P_hat
|
| 405 |
+
|
| 406 |
+
# B PROOFS OF THEORETICAL RESULTS
|
| 407 |
+
|
| 408 |
+
B.1 LEMMA 2
|
| 409 |
+
|
| 410 |
+
Proof. For any value of $\lambda$ , the following inequalities hold:
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\begin{array} { l } { \displaystyle \sum _ { i = 1 } ^ { k } s _ { [ i ] } = \lambda k + \sum _ { i = 1 } ^ { k } ( s _ { [ i ] } - \lambda ) } \\ { \displaystyle \qquad \leq \lambda k + \sum _ { i = 1 } ^ { k } \operatorname* { m a x } ( s _ { [ i ] } - \lambda , 0 ) } \\ { \displaystyle \qquad \leq \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( s _ { i } - \lambda , 0 ) . } \end{array}
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
Furthermore, for $\lambda = s _ { [ k ] }$ :
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\begin{array} { l } { { \displaystyle \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } \bigl ( s _ { i } - \lambda , 0 \bigr ) = s _ { [ k ] } k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } \bigl ( s _ { i } - s _ { [ k ] } , 0 \bigr ) } } \\ { ~ } \\ { { \displaystyle ~ = s _ { [ k ] } k + \sum _ { i = 1 } ^ { k } ( s _ { [ i ] } - s _ { [ k ] } ) } } \\ { { \displaystyle ~ = \sum _ { i = 1 } ^ { k } s _ { [ i ] } . } } \end{array}
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
This finishes the proof.
|
| 423 |
+
|
| 424 |
+
# B.2 COROLLARY 3
|
| 425 |
+
|
| 426 |
+
Proof. We first consider at exactly what values of $\lambda$ the sum in Lemma 2 is minimized. For simplicity we will only prove the case where all values of s are distinct.
|
| 427 |
+
|
| 428 |
+
The equality Lemma 2, the $\begin{array} { r } { \sum _ { i = 1 } ^ { k } s _ { [ i ] } = \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( s _ { i } - \lambda , 0 ) } \end{array}$ holds only when he equality. $s _ { [ k ] } \leq \lambda \leq s _ { [ k + 1 ] }$ . By $\lambda$
|
| 429 |
+
|
| 430 |
+
Symmetrically, if one considers the score vector $\mathbf { t } = - \mathbf { s }$ , then $\begin{array} { r } { \lambda ( n - k + 1 ) + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( t _ { i } - \lambda , 0 ) } \end{array}$ is minimized at t[n−k+1] ≤ λ ≤ t[n−k+2].
|
| 431 |
+
|
| 432 |
+
Replacing $\lambda$ by $- \lambda$ and using the definition of $\mathbf { t }$ implies that $\begin{array} { r } { \lambda ( k - 1 - n ) + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( \lambda - s _ { i } , 0 ) } \end{array}$ is minimized at s[k−1] ≤ λ ≤ s[k].
|
| 433 |
+
|
| 434 |
+
It follows that:
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\begin{array} { l } { { \displaystyle s _ { [ k ] } = \arg \operatorname* { m i n } _ { \lambda \in \mathbf { s } } \left( \lambda k + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( s _ { i } - \lambda , 0 ) \right) + \left( \lambda ( k - 1 - n ) + \sum _ { i = 1 } ^ { n } \operatorname* { m a x } ( \lambda - s _ { i } , 0 ) \right) } } \\ { { \displaystyle \quad = \arg \operatorname* { m i n } _ { \lambda \in \mathbf { s } } \lambda ( 2 k - 1 - n ) + \sum _ { i = 1 } ^ { n } \vert s _ { i } - \lambda \vert . } } \end{array}
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
Thus, if $s _ { i } = s _ { [ k ] }$ , then $i = \arg \operatorname* { m i n } ( 2 k - 1 - n ) \mathbf { s } + A _ { \mathbf { s } } \mathbf { 1 }$ . This finishes the proof.
|
| 441 |
+
|
| 442 |
+
# B.3 THEOREM 4
|
| 443 |
+
|
| 444 |
+
We prove the two properties in the statement of the theorem independently:
|
| 445 |
+
|
| 446 |
+
# 1. Unimodality
|
| 447 |
+
|
| 448 |
+
Proof. By definition of the softmax function, the entries ef $\widehat { P }$ are positive and sum to 1. To show that $\widehat { P }$ satisfies the argmax permutation property, . Formally, for any given row $i$ , we construct the argmax permutation vector $\mathbf { u }$ as:
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\begin{array} { l } { u _ { i } = \arg \operatorname* { m a x } [ \operatorname { s o f t } \operatorname* { m a x } ( ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { \mathbb { 1 } } ) ] } \\ { \quad = \arg \operatorname* { m a x } [ ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { \mathbb { 1 } } ] } \\ { \quad = [ i ] } \end{array}
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
where the square notation $[ i ]$ denotes the index of the $i$ -th largest element. The first step follows from the fact that the softmax function is monotonically increasing and hence, it preserves the argmax. The second equality directly follows from Corollary 3. By definition, $\mathsf { \bar { s o r t } } ( \mathbf { s } ) = \{ [ 1 ] , [ 2 ] , \dots , [ n ] \}$ , finishing the proof. □
|
| 455 |
+
|
| 456 |
+
# 2. Limiting behavior
|
| 457 |
+
|
| 458 |
+
Proof. As shown in Gao & Pavel (2017), the softmax function may be equivalently defined as soft $\begin{array} { r } { \mathrm { m a x } ( z / \tau ) ~ = ~ \mathrm { a r g } \mathrm { m a x } _ { x \in \Delta ^ { n - 1 } } \langle x , z \rangle - \tau \sum _ { i = 1 } ^ { n } x _ { i } \log \dot { x } _ { i } } \end{array}$ . In particular, $\mathrm { l i m } _ { \tau \to 0 }$ soft $\operatorname* { m a x } ( z / \tau ) = \arg \operatorname* { m a x } x$ . The distributional assumptions ensure that the elements of s are distinct a.s., so plugging in $z = ( n + 1 - 2 k ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { 1 }$ completes the proof. □
|
| 459 |
+
|
| 460 |
+
# B.4 PROPOSITION 5
|
| 461 |
+
|
| 462 |
+
This result follows from an earlier result by Yellott Jr (1977). We give the proof sketch below and refer the reader to Yellott Jr (1977) for more details.
|
| 463 |
+
|
| 464 |
+
Sketch. Consider random variables $\{ X _ { i } \} _ { i = 1 } ^ { n }$ such that $X _ { i } \sim \mathrm { E x p } ( s _ { z _ { i } } ) )$ .
|
| 465 |
+
|
| 466 |
+
We may prove by induction a generalization of the memoryless property:
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\begin{array} { r l } { { q ( X _ { 1 } \leq \cdots \leq X _ { n } | x \leq \operatorname* { m i n } X _ { i } ) } } \\ & { = \int _ { 0 } ^ { \infty } q ( x \leq X _ { 1 } \leq x + t | x \leq \operatorname* { m i n } _ { i } X _ { i } ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | x + t \leq \operatorname* { m i n } _ { i \geq 2 } X _ { i } ) \mathrm { d } t } \\ & { = \displaystyle \int _ { 0 } ^ { \infty } q ( 0 \leq X _ { 1 } \leq t ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | x + t \leq \operatorname* { m i n } _ { i \geq 2 } X _ { i } ) \mathrm { d } t . } \end{array}
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
If we assume as inductive hypothesis that $q ( X _ { 2 } \leq \cdots \leq X _ { n } | x + t \leq \operatorname* { m i n } _ { i \geq 2 } X _ { i } ) = q ( X _ { 2 } \leq \cdots \leq$ $X _ { n } | t \leq \operatorname* { m i n } _ { i \geq 2 } X _ { i } )$ , we complete the induction as:
|
| 473 |
+
|
| 474 |
+
$$
|
| 475 |
+
\begin{array} { l } { \displaystyle q ( X _ { 1 } \leq \cdots \leq X _ { n } | x \leq \operatorname* { m i n } X _ { i } ) } \\ { \displaystyle = \int _ { 0 } ^ { \infty } q ( 0 \leq X _ { 1 } \leq t ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | t \leq \operatorname* { m i n } X _ { i } ) \mathrm { d } t } \\ { \displaystyle = q ( X _ { 1 } \leq X _ { 2 } \leq \cdots \leq X _ { n } | 0 \leq \operatorname* { m i n } X _ { i } ) . } \end{array}
|
| 476 |
+
$$
|
| 477 |
+
|
| 478 |
+
It follows from a familiar property of argmin of exponential distributions that:
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\begin{array} { r l } { q ( X _ { 1 } \leq X _ { 2 } \leq \cdots \leq X _ { n } ) = q ( X _ { 1 } \leq \operatorname* { m i n } X _ { i } ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | X _ { 1 } \leq \operatorname* { m i n } X _ { i } ) } & { } \\ { \quad } & { = \frac { s _ { z _ { 1 } } } { Z } q ( X _ { 2 } \leq \cdots \leq X _ { n } | X _ { 1 } \leq \operatorname* { m i n } X _ { i } ) } \\ { \quad } & { = \frac { s _ { z _ { 1 } } } { Z } \displaystyle \int _ { 0 } ^ { \infty } q ( X _ { 1 } = x ) q ( X _ { 2 } \leq \cdots \leq X _ { n } | x \leq \operatorname* { m i n } X _ { i } ) \mathrm { d } x } \\ { \quad } & { = \frac { s _ { z _ { 1 } } } { Z } q ( X _ { 2 } \leq \cdots \leq X _ { n } ) , } \end{array}
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
and by another induction, we have q(X1 ≤ · · · ≤ Xn) = Qni=1 sziZ−Pi−1k=1 szk .
|
| 485 |
+
|
| 486 |
+
Finally, following the argument of Balog et al. (2017), we apply the strictly decreasing function $g ( x ) = - \beta \log x$ to this identity, which from the definition of the Gumbel distribution implies:
|
| 487 |
+
|
| 488 |
+
$$
|
| 489 |
+
q ( \tilde { s } _ { z _ { 1 } } \geq \cdot \cdot \cdot \geq \tilde { s } _ { z _ { n } } ) = \prod _ { i = 1 } ^ { n } { \frac { s _ { z _ { i } } } { Z - \sum _ { k = 1 } ^ { i - 1 } s _ { z _ { k } } } } .
|
| 490 |
+
$$
|
| 491 |
+
|
| 492 |
+
# C ARG MAX SEMANTICS FOR TIED MAX ELEMENTS
|
| 493 |
+
|
| 494 |
+
While applying the arg max operator to a vector with duplicate entries attaining the max value, we need to define the operator semantics for arg max to handle ties in the context of the proposed relaxation.
|
| 495 |
+
|
| 496 |
+
Definition 6. For any vector with ties, let arg max set denote the operator that returns the set of all indices containing the max element. We define the arg max of the i-th in a matrix M recursively:
|
| 497 |
+
|
| 498 |
+
1. If there exists an index $j \in \{ 1 , 2 , \dots , n \}$ that is a member of arg max $\mathrm { s e t } ( M [ i , : ] )$ and has not been assigned as an arg max of any row $k < i ,$ , then the arg max is the smallest such index.
|
| 499 |
+
|
| 500 |
+
2. Otherwise, the arg max is the smallest index that is a member of the arg max $\mathrm { s e t } ( M [ i , : ] )$
|
| 501 |
+
|
| 502 |
+
This function is efficiently computable with additional bookkeeping.
|
| 503 |
+
|
| 504 |
+
Lemma 7. For an input vector s with the sort permutation matrix given as $P _ { s o r t ( \mathbf { s } ) }$ , we have $s _ { j _ { 1 } } =$ $s _ { j _ { 2 } }$ if and only if there exists a row $i$ such that $\widehat { P } [ i , j _ { 1 } ] = \widehat { P } [ i , j _ { 2 } ]$ for all $j _ { 1 } , j _ { 2 } \in \{ 1 , 2 , . . . , n \}$ .
|
| 505 |
+
|
| 506 |
+
Proof. From Eq. 5, we have the $i$ -th row of ${ \widehat P } [ i , : ]$ given as:
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\widehat { P } [ i , : ] = \mathrm { s o f t } \operatorname* { m a x } \left[ ( ( n + 1 - 2 i ) \mathbf { s } - A _ { \mathbf { s } } \mathbf { 1 } ) / \tau \right]
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
. Therefore, we have the equations:
|
| 513 |
+
|
| 514 |
+
$$
|
| 515 |
+
{ \widehat { P } } [ i , j _ { 1 } ] = { \frac { \exp ( ( ( n + 1 - 2 i ) s _ { j _ { 1 } } - ( A _ { { \mathbf { s } } } \mathbb { 1 } ) _ { i } ) / \tau ) } { Z } }
|
| 516 |
+
$$
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
= \widehat { P } [ i , j _ { 2 } ] = \frac { \exp ( ( ( n + 1 - 2 i ) s _ { j _ { 2 } } - ( A _ { \mathbf { s } } \mathbf { 1 } ) _ { i } ) / \tau ) } { Z }
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
for some fixed normalization constant Z. As the function f (x) = exp(((n+1−2i)x−(As1)i)/τ)Z is invertible, both directions of the lemma follow immediately.
|
| 523 |
+
|
| 524 |
+
Lemma 8. If arg max $\mathrm { s e t } ( \widehat { P } [ i _ { 1 } , : ] )$ and arg max $\mathrm { s e t } ( \widehat { P } [ i _ { 2 } , : ] )$ have a non-zero intersection, then arg max $\begin{array} { r } { \mathrm { s e t } ( \widehat { P } [ i _ { 1 } , : ] ) = \arg \operatorname* { m a x } \mathrm { s e t } ( \widehat { P } [ i _ { 2 } , : ] ) } \end{array}$ .
|
| 525 |
+
|
| 526 |
+
Proof. Assume without loss of generality that | arg max $\mathrm { s e t } ( \widehat { P } [ i _ { 1 } , : ] ) | \ > \ 1$ for some $i$ . Let $j _ { 1 } , j _ { 2 }$ be two members of $| \arg \operatorname* { m a x } \sec ( \widehat { P } [ i _ { 1 } , : ] ) |$ . By Lemma 7, $\begin{array} { r l r } { s _ { j _ { 1 } } } & { { } = } & { s _ { j _ { 2 } } } \end{array}$ , and therefore $\widehat { P } [ i _ { 2 } , j _ { 1 } ] = \widehat { P } [ i _ { 2 } , j _ { 2 } ]$ . Hence if $j _ { 1 } \in \arg \operatorname* { m a x } \mathrm { s e t } ( \widehat { P } [ i _ { 2 } , : ] )$ , then $j _ { 2 }$ is also an element. A symmetric argument implies that if $j _ { 2 } \in \arg \operatorname* { m a x } \mathrm { s e t } ( \widehat { P } [ i _ { 2 } , : ] )$ , then $j _ { 1 }$ is also an element for arbitrary $j _ { 1 } , j _ { 2 } \in | \arg \operatorname* { m a x } \mathrm { s e t } ( \widehat { P } [ i _ { 1 } , : ] ) |$ . This completes the proof. □
|
| 527 |
+
|
| 528 |
+
Proposition 9. (Argmax Permutation with Ties) For $\mathbf { s } ~ = ~ [ s _ { 1 } , s _ { 2 } , \ldots , s _ { n } ] ^ { T } ~ \in ~ \mathbb { R } ^ { n }$ , the vector $\mathbf { z }$ defined by $z _ { i } = \arg \operatorname* { m a x } _ { j } \widehat { P } _ { s o r t ( \mathbf { s } ) } [ i , j ]$ is such that $\mathbf { z } \in \mathcal { Z } _ { n }$ .
|
| 529 |
+
|
| 530 |
+

|
| 531 |
+
Figure 6: A stochastic computation graph for an arbitrary input $x$ , intermediate node $y$ , and a single parameter $\theta$ . Squares denote deterministic nodes and circles denote stochastic nodes.
|
| 532 |
+
|
| 533 |
+
Proof. From Corollary 3, we know that the row $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ]$ attains its maximum (perhaps nonuniquely) at some $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , j ]$ where $s _ { j } = s _ { [ i ] }$ . Note that $s _ { [ i ] }$ is well-defined even in the case of ties.
|
| 534 |
+
|
| 535 |
+
Consider an arbitrary row $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ]$ and let arg max $\sec ( { \widehat { P } } _ { \mathrm { s o r t } ( \mathbf { s } ) } [ i , : ] ) = \{ j _ { 1 } , \dots , j _ { m } \}$ . It follows from Lemma 7 that there are exactly $m$ scores in s that are equal to $s _ { [ i ] }$ : $: s _ { j _ { 1 } } , \ldots , s _ { j _ { m } }$ . These scores corresponds to $m$ values of $s _ { [ i ^ { \prime } ] }$ such that $s _ { [ i ^ { \prime } ] } = s _ { [ i ] }$ , and consequently to $m$ rows $P [ i ^ { \prime } , : ]$ that are maximized with values $s _ { [ i ^ { \prime } ] } = s _ { [ i ] }$ and consequently (by Lemma 8) at indices $j _ { 1 } , \dots , j _ { m }$ .
|
| 536 |
+
|
| 537 |
+
Suppose we now chose an $i ^ { \prime }$ such that $s _ { [ i ^ { \prime } ] } \neq s _ { [ i ] }$ . Then $\widehat { P } [ i ^ { \prime } , : ]$ attains its maximum at some $\widehat { P } \mathrm { s o r t } ( \mathbf { s } ) [ i ^ { \prime } , j ^ { \prime } ]$ where $s _ { j ^ { \prime } } = s _ { [ i ^ { \prime } ] }$ . Because $s _ { j ^ { \prime } } = s _ { [ i ^ { \prime } ] } \neq s _ { [ i ] } = s _ { j }$ , Lemma 7 tells us that $\widehat { P } [ i ^ { \prime } , : ]$ does not attain its maximum at any of $j _ { 1 } , \dots , j _ { m }$ . Therefore, only $m$ rows have a non-zero arg max set intersection with arg max se $\mathrm { t } ( P [ i , : ] )$ .
|
| 538 |
+
|
| 539 |
+
Because $P [ i , : ]$ is one of these rows, there can be up to $m - 1$ such rows above it. Because each row above only has one arg max assigned via the tie-breaking protocol, it is only possible for up to $m - 1$ elements of arg max $\mathrm { s e t } ( P [ i , : ] )$ to have been an arg max of a previous row $k < i$ . As | arg max $\mathrm { s e t } ( P [ i , : ] ) | = { \bar { m } }$ , there exists at least one element that has not been specified as the arg max of a previous row (pigeon-hole principle). Thus, the arg max of each row are distinct. Because each argmax is also an element of $\{ 1 , \ldots , n \}$ , it follows that $\mathbf { z } \in \mathcal { Z } _ { n }$ . □
|
| 540 |
+
|
| 541 |
+
# D EXPERIMENTAL DETAILS AND ANALYSIS
|
| 542 |
+
|
| 543 |
+
We used Tensorflow (Abadi et al., 2016) and PyTorch (Paszke et al., 2017) for our experiments. In Appendix A, we provide “plug-in” snippets for implementing our proposed relaxations in both Tensorflow and PyTorch. The full codebase for reproducing the experiments can be found at https://github.com/ermongroup/neuralsort.
|
| 544 |
+
|
| 545 |
+
For the sorting and quantile regression experiments, we used standard training/validation/test splits of $5 0 , 0 0 0 / 1 0 \bar { , } 0 0 0 / \bar { 1 0 } , 0 0 0$ images of MNIST for constructing the large-MNIST dataset. We ensure that only digits in the standard training/validation/test sets of the MNIST dataset are composed together to generate the corresponding sets of the large-MNIST dataset. For CIFAR-10, we used a split of 45, 000/5000/10, 000 examples for training/validation/test. With regards to the baselines considered, we note that the REINFORCE based estimators were empirically observed to be worse than almost all baselines for all our experiments.
|
| 546 |
+
|
| 547 |
+
# D.1 SORTING HANDWRITTEN NUMBERS
|
| 548 |
+
|
| 549 |
+
Architectures. We control for the choice of computer vision models by using the same convolutional network architecture for each sorting method. This architecture is as follows:
|
| 550 |
+
|
| 551 |
+
Conv[Kernel: 5x5, Stride: 1, Output: 140x28x32, Activation: Relu]
|
| 552 |
+
Pool[Stride: 2, Output: 70x14x32]
|
| 553 |
+
Conv[Kernel: 5x5, Stride: 1, Output: 70x14x64, Activation: Relu]
|
| 554 |
+
Pool[Stride: 2, Output: 35x7x64]
|
| 555 |
+
FC[Units: 64, Activation: Relu]
|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
Figure 7: Running average of the log-variance in gradient estimates during training for varying temperatures $\tau$ .
|
| 559 |
+
|
| 560 |
+
Note that the dimension of a 5-digit large-MNIST image is $1 4 0 \times 2 8$ . The primary difference between our methods is how we combine the scores to output a row-stochastic prediction matrix.
|
| 561 |
+
|
| 562 |
+
For NeuralSort-based methods, we use another fully-connected layer of dimension 1 to map the image representations to $n$ scalar scores. In the case of Stochastic NeuralSort, we then sample from the PL distribution by perturbing the scores multiple times with Gumbel noise. Finally, we use the NeuralSort operator to map the set of $n$ scores (or each set of $n$ perturbed scores) to its corresponding unimodal row-stochastic matrix.
|
| 563 |
+
|
| 564 |
+
For Sinkhorn-based methods, we use a fully-connected layer of dimension $n$ to map each image to an $n$ -dimensional vector. These vectors are then stacked into an $n \times n$ matrix. We then either map this matrix to a corresponding doubly-stochastic matrix (Sinkhorn) or sample directly from a distribution over permutation matrices via Gumbel perturbations (Gumbel-Sinkhorn). We implemented the Sinkhorn operator based on code snippets obtained from the open source implementation of Mena et al. (2018) available at https://github.com/google/gumbel sinkhorn.
|
| 565 |
+
|
| 566 |
+
For the Vanilla RS baseline, we ran each element through a fully-connected $n$ dimensional layer, concatenated the representations of each element and then fed the results through three fullyconnected $n ^ { 2 }$ -unit layers to output multiclass predictions for each rank.
|
| 567 |
+
|
| 568 |
+
All our methods yield row-stochastic $n \times n$ matrices as their final output. Our loss is the row-wise cross-entropy loss between the true permutation matrix and the row-stochastic output.
|
| 569 |
+
|
| 570 |
+
Hyperparameters. For this experiment, we used an Adam optimizer with an initial learning rate of $1 0 ^ { - 4 }$ and a batch size of 20. Continuous relaxations to sorting also introduce another hyperparameter: the temperature $\tau$ for the Sinkhorn-based and NeuralSort-based approaches. We tuned this hyperparameter on the set $\{ 1 , 2 , 4 , 8 , 1 6 \}$ by picking the model with the best validation accuracy on predicting entire permutations (as opposed to predicting individual maps between elements and ranks).
|
| 571 |
+
|
| 572 |
+
Effect of temperature. In Figure 7, we report the log-variance in gradient estimates as a function of the temperature $\tau$ . Similar to the effect of temperature observed for other continuous relaxations to discrete objects such as Gumbel-softmax (Jang et al., 2017; Maddison et al., 2017), we note that higher temperatures lead to lower variance in gradient estimates. The element-wise mean squared difference between unimodal approximations Pbsort(s) and the projected hard permutation matrices $P _ { \mathsf { s o r t } ( \mathbf { s } ) }$ for the best $\tau$ on the test set is shown in Table 4.
|
| 573 |
+
|
| 574 |
+
Table 4: Element-wise mean squared difference between unimodal approximations and the projected hard permutation matrices for the best temperature $\tau$ , averaged over the test set.
|
| 575 |
+
|
| 576 |
+
<table><tr><td>Algorithm</td><td>|n=3</td><td>n=5</td><td>n=7</td><td>n=9</td><td>n=15</td></tr><tr><td>Deterministic NeuralSort</td><td>0.0052</td><td>0.0272</td><td>0.0339</td><td>0.0105</td><td>0.0220</td></tr><tr><td>Stochastic NeuralSort</td><td>0.0095</td><td>0.0327</td><td>0.0189</td><td>0.0111</td><td>0.0179</td></tr></table>
|
| 577 |
+
|
| 578 |
+

|
| 579 |
+
Figure 8: True vs. predicted medians for quantile regression on the large-MNIST dataset.
|
| 580 |
+
|
| 581 |
+
# D.2 QUANTILE REGRESSION
|
| 582 |
+
|
| 583 |
+
Architectures. Due to resource constraints, we ran the quantile regression experiment on 4-digit numbers instead of 5-digit numbers. We use the same neural network architecture as previously used in the sorting experiment.
|
| 584 |
+
|
| 585 |
+
Conv[Kernel: 5x5, Stride: 1, Output: 112x28x32, Activation: Relu]
|
| 586 |
+
Pool[Stride: 2, Output: 56x14x32]
|
| 587 |
+
Conv[Kernel: 5x5, Stride: 1, Output: 56x14x64, Activation: Relu]
|
| 588 |
+
Pool[Stride: 2, Output: 28x7x64]
|
| 589 |
+
FC[Units: 64, Activation: Relu]
|
| 590 |
+
|
| 591 |
+
The vanilla NN baseline for quantile regression was generated by feeding the CNN representations into a series of three fully-connected layers of ten units each, the last of which mapped to a singleunit estimate of the median. In the other experiments, one copy of this network was used to estimate each element’s rank through a method like Gumbel-Sinkhorn or NeuralSort that produces a rowstochastic matrix, while another copy was used to estimate each element’s value directly. Point predictions are obtained by multiplying the center row of the matrix with the column vector of estimated values, and we minimize the $\ell _ { 2 }$ loss between these point predictions and the true median, learning information about ordering and value simultaneously.
|
| 592 |
+
|
| 593 |
+
Hyperparameters. We used the Adam optimizer with an initial learning rate of $1 0 ^ { - 4 }$ and a batch size of 5. The temperature $\tau$ was tuned on the set $\{ 1 , 2 , 4 , 8 , 1 6 \}$ based on the validation loss.
|
| 594 |
+
|
| 595 |
+
Further Analysis. In Figure 8, we show the scatter plots for the true vs. predicted medians on 2000 test points from the large-MNIST dataset as we vary $n$ . For stochastic NeuralSort, we average the predictions across 5 samples. As we increase $n$ , the distribution of true medians concentrates, leading to an easier prediction problem (at an absolute scale) and hence, we observe lower MSE for larger $n$ in Table 2. However, the relatively difficulty of the problem increases with increasing $n$ , as the model is trying to learn a semantic sorting across a larger set of elements. This is reflected in the $R ^ { 2 }$ values in Table 2 which show a slight dip as $n$ increases.
|
| 596 |
+
|
| 597 |
+
D.3 END-TO-END, DIFFERENTIABLE $k$ -NEAREST NEIGHBORS
|
| 598 |
+
|
| 599 |
+
Architectures. The baseline kNN implementation for the pixel basis, PCA basis and the autoencoder basis was done using sklearn. For the autoencoder baselines for kNN, we used the following standard architectures.
|
| 600 |
+
|
| 601 |
+
MNIST and Fashion-MNIST: The dimension of the encoding used for distance computation in kNN is 50.
|
| 602 |
+
|
| 603 |
+
$$
|
| 604 |
+
\begin{array} { r l } & { \mathrm { F C [ U n i t s : ~ 5 0 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ \mathrm { F C [ U n i t s : ~ 5 0 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ \mathrm { F C [ U n i t s : ~ 5 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ = ( e m b e d d i n g ) } \\ & { ~ \mathrm { F C [ U n i t s : ~ 5 0 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ \mathrm { F C [ U n i t s : ~ 5 0 0 , ~ A c t i v a t i o n : ~ R e l u ] } } \\ & { ~ \mathrm { F C [ U n i t s : ~ 7 8 4 , ~ A c t i v a t i o n : ~ S i g m o i d } } \end{array}
|
| 605 |
+
$$
|
| 606 |
+
|
| 607 |
+
CIFAR-10: The dimension of the encoding used for distance computation in kNN is 256. The architecture and training procedure follows the one available at https://github.com/shibuiwilliam/Keras Autoencoder.
|
| 608 |
+
|
| 609 |
+
Conv[Kernel: 3x3, Stride: 1, Output: 32x32x64, Activation: Relu]
|
| 610 |
+
Pool[Stride: 2, Output: 16x16x64]
|
| 611 |
+
Conv[Kernel: 3x3, Stride: 1, Output: 16x16x32, Normalization: BatchNorm, Activation: Relu]
|
| 612 |
+
Pool[Stride: 2, Output: 8x8x32]
|
| 613 |
+
Conv[Stride: 3, Output: 8x8x16, Normalization: BatchNorm, Activation: Relu]
|
| 614 |
+
MaxPool[Stride: 2, Output: 4x4x16]
|
| 615 |
+
$=$ (embedding)
|
| 616 |
+
Conv[Kernel: 3x3, Stride: 1, Output: 4x4x16, Normalization: BatchNorm, Activation: Relu]
|
| 617 |
+
UpSampling[Size: 2x2, Output: 8x8x16]
|
| 618 |
+
Conv[Kernel: 3x3, Stride: 1, Output: 8x8x32, Normalization: BatchNorm, Activation: Relu]
|
| 619 |
+
UpSampling[Size: 2x2, Output: 16x16x32]
|
| 620 |
+
Conv[Kernel: 3x3, Output: 16x16x64, Normalization: BatchNorm, Activation: Relu]
|
| 621 |
+
UpSampling[Size: 2x2, Output: 32x32x64]
|
| 622 |
+
Conv[Kernel: 3x3, Stride: 1, Output: 32x32x3, Normalization: BatchNorm, Activation: Sigmoid
|
| 623 |
+
|
| 624 |
+
Table 5: Accuracies of Deterministic and Stochastic NeuralSort for differentiable $k$ -nearest neighbors, broken down by $k$ .
|
| 625 |
+
|
| 626 |
+
<table><tr><td>Dataset</td><td>k</td><td>Deterministic NeuralSort</td><td>Stochastic NeuralSort</td></tr><tr><td rowspan="4">MNIST</td><td>1</td><td>99.2%</td><td>99.1%</td></tr><tr><td>35</td><td>99.5%</td><td>99.3%</td></tr><tr><td></td><td>99.3%</td><td>99.4%</td></tr><tr><td>9</td><td>99.3%</td><td>99.4%</td></tr><tr><td rowspan="4">Fashion-MNIST</td><td></td><td>92.6%</td><td>92.2%</td></tr><tr><td></td><td>93.2%</td><td>93.1%</td></tr><tr><td></td><td>93.5%</td><td>93.3%</td></tr><tr><td>1359</td><td>93.0%</td><td>93.4%</td></tr><tr><td rowspan="4">CIFAR-10</td><td>1</td><td>88.7%</td><td>85.1%</td></tr><tr><td>1359</td><td>90.0%</td><td>87.8%</td></tr><tr><td></td><td>90.2%</td><td>88.0%</td></tr><tr><td></td><td>90.7%</td><td>89.5%</td></tr></table>
|
| 627 |
+
|
| 628 |
+
For the MNIST experiments with NeuralSort, we used a network similar to the large-MNIST network used in the previous experiments:
|
| 629 |
+
|
| 630 |
+
Conv[Kernel: 5x5, Stride: 1, Output: $2 4 \mathrm { x } 2 4 \mathrm { x } 2 0$ , Activation: Relu]
|
| 631 |
+
Pool[Stride: 2, Output: $1 2 \mathrm { x } 1 2 \mathrm { x } 2 0 $ ]
|
| 632 |
+
Conv[Kernel: 5x5, Stride: 1, Output: 8x8x50, Activation: Relu]
|
| 633 |
+
Pool[Stride: 2, Output: 4x4x50]
|
| 634 |
+
FC[Units: 500, Activation: Relu]
|
| 635 |
+
|
| 636 |
+
For the Fashion-MNIST and CIFAR experiments with NeuralSort, we use the ResNet18 architecture as described in https://github.com/kuangliu/pytorch-cifar.
|
| 637 |
+
|
| 638 |
+
Hyperparameters. For this experiment, we used an SGD optimizer with a momentum parameter of 0.9, with a batch size of 100 queries and 100 neighbor candidates at a time. We chose the temperature hyperparameter from the set $\{ 1 , 1 6 , 6 4 \}$ , the constant learning rate from $\lbrace 1 0 ^ { - 4 } , 1 0 ^ { - 5 } \rbrace$ , and the number of nearest neighbors $k$ from the set $\{ 1 , 3 , 5 , 9 \}$ . The model with the best evaluation loss was evaluated on the test set. We suspect that accuracy improvements can be made by a more expensive hyperparameter search and a more fine-grained learning rate schedule.
|
| 639 |
+
|
| 640 |
+
Accuracy for different $k$ . In Table 5, we show the performance of Deterministic and Stochastic NeuralSort for different choice of the hyperparameter $k$ for the differentiable $k$ -nearest neighbors algorithm.
|
| 641 |
+
|
| 642 |
+
# E LOSS FUNCTIONS
|
| 643 |
+
|
| 644 |
+
For each of the experiments in this work, we assume we have access to a finite dataset $\mathcal { D } =$ $\{ ( { \bf x } ^ { ( 1 ) } , { \bf y } ^ { ( 1 ) } ) , ( { \bf x } ^ { ( 2 ) } , { \bf \bar { y } } ^ { ( 2 ) } ) , \dots \}$ . Our goal is to learn a predictor for $\mathbf { y }$ given $\mathbf { x }$ , as in a standard supervised learning (classification/regression) setting. Below, we state and elucidate the semantics of the training objective optimized by Deterministic and Stochastic NeuralSort for the sorting and quantile regression experiments.
|
| 645 |
+
|
| 646 |
+
# E.1 SORTING HANDWRITTEN NUMBERS
|
| 647 |
+
|
| 648 |
+
We are given a dataset $\mathcal { D }$ of sequences of large-MNIST images and the permutations that sort the sequences. That is, every datapoint in $\mathcal { D }$ consists of an input $\mathbf { x }$ , which corresponds to a sequence containing $n$ images, and the desired output label $\mathbf { y }$ , which corresponds to the permutation that sorts this sequence (as per the numerical values of the images in the input sequence). For example, Figure 4 shows one input sequence of $n = 5$ images, and the permutation $\mathbf { \bar { y } } = [ 3 , 5 , 1 , 4 , 2 ]$ that sorts this sequence.
|
| 649 |
+
|
| 650 |
+
For any datapoint $\mathbf { x }$ , let $\ell _ { \mathrm { C E } } ( \cdot )$ denote the average multiclass cross entropy (CE) error between the rows of the true permutation matrix $P _ { \mathbf { y } }$ and a permutation matrix $P _ { \widehat { \mathbf { y } } }$ corresponding to a predicted permutation, say $\widehat { \mathbf { y } }$ .
|
| 651 |
+
|
| 652 |
+
$$
|
| 653 |
+
\ell _ { \mathrm { { C E } } } ( P _ { \mathbf { y } } , P _ { \widehat { \mathbf { y } } } ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { n } \mathbb { 1 } ( P _ { \mathbf { y } } [ i , j ] = 1 ) \log P _ { \widehat { \mathbf { y } } } [ i , j ]
|
| 654 |
+
$$
|
| 655 |
+
|
| 656 |
+
where $\mathbb { 1 } ( \cdot )$ denotes the indicator function. Now, we state the training objective functions for the Deterministic and Stochastic NeuralSort approaches respectively.
|
| 657 |
+
|
| 658 |
+
1. Deterministic NeuralSort
|
| 659 |
+
|
| 660 |
+
$$
|
| 661 |
+
\operatorname* { m i n } _ { \phi } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { D } } \ell _ { \mathrm { C E } } ( P _ { \mathbf { y } } , \widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } )
|
| 662 |
+
$$
|
| 663 |
+
|
| 664 |
+
where each entry of $\mathbf { s }$ is given as $s _ { j } = h _ { \phi } ( \mathbf { x } _ { j } )$
|
| 665 |
+
|
| 666 |
+
2. Stochastic NeuralSort
|
| 667 |
+
|
| 668 |
+
$$
|
| 669 |
+
\operatorname* { m i n } _ { \phi } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { D } } \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { s } ) } \left[ \ell _ { \mathrm { C E } } ( P _ { \mathbf { y } } , \widehat { P } _ { \mathbf { z } } ) ) \right]
|
| 670 |
+
$$
|
| 671 |
+
|
| 672 |
+
where each entry of $\mathbf { s }$ is given as $s _ { j } = h _ { \phi } ( \mathbf { x } _ { j } )$ .
|
| 673 |
+
|
| 674 |
+
To ground this in our experimental setup, the score $s _ { j }$ for each large-MNIST image $\mathbf { x } _ { j }$ in any input sequence $\mathbf { x }$ of $n = 5$ images is obtained via a CNN $h _ { \phi } ( )$ with parameters $\phi$ . Note that the CNN parameters $\phi$ are shared across the different images $\mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { n }$ in the sequence for efficient learning.
|
| 675 |
+
|
| 676 |
+
# E.2 QUANTILE REGRESSION
|
| 677 |
+
|
| 678 |
+
In contrast to the previous experiment, here we are given a dataset $\mathcal { D }$ of sequences of large-MNIST images and only the numerical value of the median element for each sequence. For example, the desired label corresponds to $y = 2 9 6 0$ (a real-valued scalar) for the input sequence of $n = 5$ images in Figure 4.
|
| 679 |
+
|
| 680 |
+
For any datapoint $\mathbf { x }$ , let $\ell _ { \mathrm { M S E } } ( \cdot )$ denote the mean-squared error between the true median $y$ and the prediction, say $\widehat { y }$ .
|
| 681 |
+
|
| 682 |
+
$$
|
| 683 |
+
\ell _ { \mathrm { M S E } } ( y , \widehat { y } ) = \| y - \widehat { y } \| _ { 2 } ^ { 2 }
|
| 684 |
+
$$
|
| 685 |
+
|
| 686 |
+
For the NeuralSort approaches, we optimize the following objective functions.
|
| 687 |
+
|
| 688 |
+
1. Deterministic NeuralSort
|
| 689 |
+
|
| 690 |
+
$$
|
| 691 |
+
\operatorname* { m i n } _ { \phi , \theta } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , y ) \in \mathcal { D } } \ell _ { \mathrm { M S E } } \big ( y , g _ { \theta } \big ( \widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) } \mathbf { x } \big ) \big )
|
| 692 |
+
$$
|
| 693 |
+
|
| 694 |
+
where each entry of $\mathbf { s }$ is given as $s _ { j } = h _ { \phi } ( \mathbf { x } _ { j } )$ .
|
| 695 |
+
|
| 696 |
+
2. Stochastic NeuralSort
|
| 697 |
+
|
| 698 |
+
$$
|
| 699 |
+
\operatorname* { m i n } _ { \phi , \theta } \frac { 1 } { | \mathcal { D } | } \sum _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { D } } \mathbb { E } _ { \mathbf { z } \sim q ( \mathbf { z } | \mathbf { s } ) } \left[ \ell _ { \mathrm { M S E } } ( y , g _ { \theta } ( \widehat { P } _ { \mathbf { z } } \mathbf { x } ) ) \right]
|
| 700 |
+
$$
|
| 701 |
+
|
| 702 |
+
where each entry of $\mathbf { s }$ is given as $s _ { j } = h _ { \phi } ( \mathbf { x } _ { j } )$ .
|
| 703 |
+
|
| 704 |
+
As before, the score $s _ { j }$ for each large-MNIST image $\mathbf { x } _ { j }$ in any input sequence $\mathbf { x }$ of $n$ images is obtained via a $\mathrm { C N N } h _ { \phi } ( )$ with parameters $\phi$ . Once we have a predicted permutation matrix $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) }$ (or $\widehat { P } _ { \mathbf { z } }$ ) for deterministic (or stochastic) approaches, we extract the median image via $\widehat { P } _ { \mathrm { s o r t } ( \mathbf { s } ) \mathbf { x } }$ (or $\widehat { P } _ { \mathbf { z } } \mathbf { x } )$ . Finally, we use a neural network $g _ { \boldsymbol { \theta } } ( \cdot )$ with parameters $\theta$ to regress this image to a scalar prediction for the median.
|
md/train/H1ecDoR5Y7/H1ecDoR5Y7.md
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LOCAL STABILITY AND PERFORMANCE OF SIMPLE GRADIENT PENALTY $\mu$ -WASSERSTEIN GAN
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Wasserstein GAN(WGAN) is a model that minimizes the Wasserstein distance between a data distribution and sample distribution. Recent studies have proposed stabilizing the training process for the WGAN and implementing the Lipschitz constraint. In this study, we prove the local stability of optimizing the simple gradient penalty $\mu$ -WGAN(SGP $\mu$ -WGAN) under suitable assumptions regarding the equilibrium and penalty measure $\mu$ . The measure valued differentiation concept is employed to deal with the derivative of the penalty terms, which is helpful for handling abstract singular measures with lower dimensional support. Based on this analysis, we claim that penalizing the data manifold or sample manifold is the key to regularizing the original WGAN with a gradient penalty. Experimental results obtained with unintuitive penalty measures that satisfy our assumptions are also provided to support our theoretical results.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep generative models reached a turning point after generative adversarial networks (GANs) were proposed by Goodfellow et al. (2014). GANs are capable of modeling data with complex structures. For example, DCGAN can sample realistic images using a convolutional neural network (CNN) structure(Radford et al., 2015). GANs have been implemented in many applications in the field of computer vision with good results, such as super-resolution, image translation, and text-to-image generation(Ledig et al., 2017; Isola et al., 2017; Zhang et al., 2017; Reed et al., 2016).
|
| 12 |
+
|
| 13 |
+
However, despite these successes, GANs are affected by training instability and mode collapse problems. GANs often fail to converge, which can result in unrealistic fake samples. Furthermore, even if GANs successfully synthesize realistic data, the fake samples exhibit little variability.
|
| 14 |
+
|
| 15 |
+
A common solution to this instability problem is injecting an instance noise and finding different divergences. The injection of instance noise into real and fake samples during the training procedure was proposed by Sønderby et al. (2017), where its positive impact on the low dimensional support for the data distribution was shown to be a regularizing factor based on the Wasserstein distance, as demonstrated analytically by Arjovsky & Bottou (2017). In $f$ -GAN, $f$ -divergence between the target and generator distributions was suggested which generalizes the divergence between two distributions(Nowozin et al., 2016). In addition, a gradient penalty term which is related with Sobolev IPM(Integral Probability Metric) between data distribution and sample distribution was suggested by Mroueh et al. (2018).
|
| 16 |
+
|
| 17 |
+
The Wasserstein GAN (WGAN) is known to resolve the problems of generic GANs by selecting the Wasserstein distance as the divergence(Arjovsky et al., 2017). However, WGAN often fails with simple examples because the Lipschitz constraint on discriminator is rarely achieved during the optimization process and weight clipping. Thus, mimicking the Lipschitz constraint on the discriminator by using a gradient penalty was proposed by Gulrajani et al. (2017).
|
| 18 |
+
|
| 19 |
+
Noise injection and regularizing with a gradient penalty appear to be equivalent. The addition of instance noise in $f$ -GAN can be approximated to adding a zero centered gradient penalty(Roth et al., 2017). Thus, regularizing GAN with a simple gradient penalty term was suggested by Mescheder et al. (2018) who provided a proof of its stability.
|
| 20 |
+
|
| 21 |
+
Based on a theoretical analysis of the dynamic system, Nagarajan & Kolter (2017) proved the local exponential stability of the gradient-based optimization dynamics in GANs by treating the simultaneous gradient descent algorithm with a dynamic system approach. These previous studies were useful because they showed that the local behavior of GANs can be explained using dynamic system tools and the related Jacobian’s eigenvalues.
|
| 22 |
+
|
| 23 |
+
In this study, we aim to prove the convergence property of the simple gradient penalty $\mu$ -Wasserstein GAN(SGP $\mu$ -WGAN) dynamic system under general gradient penalty measures $\mu$ . To the best of our knowledge, our study is the first theoretical approach to GAN stability analysis which deals with abstract singular penalty measure. In addition, measure valued differentiation(Heidergott & Vazquez-Abad, 2008) is applied to take the derivative on the integral with a parametric measure, ´ which is helpful for handling an abstract measure and its integral in our proof.
|
| 24 |
+
|
| 25 |
+
The main contributions of this study are as follows.
|
| 26 |
+
|
| 27 |
+
• We prove the regularized effect and local stability of the dynamic system for a general penalty measure under suitable assumptions. The assumptions are written as both a tractable strong version and intractable weak version. To prove the main theorem, we also introduce the measure valued differentiation concept to handle the parametric measure. Based on the proof of the stability, we explain the reason for the success of previous penalty measures. We claim that the support of a penalty measure will be strongly related to the stability, where the weight on the limiting penalty measure might affect the speed of convergence. • We experimentally examined the general convergence results by applying two test penalty measures to several examples. The proposed test measures are unintuitive but they still satisfy the assumptions and similar convergence results were obtained in the experiment.
|
| 28 |
+
|
| 29 |
+
# 2 PRELIMINARIES
|
| 30 |
+
|
| 31 |
+
First, we introduce our notations and basic measure-theoretic concepts. Second, we define our SGP $\mu$ -WGAN optimization problem and treat this problem as a continuous dynamic system. Preliminary measure theoretic concepts are required to justify that the dynamic system changes in a sufficiently smooth manner as the parameter changes, so it is possible to use linearization theorem. They are also important for dealing with the parametric measure and its derivative. The problem setting with a simple gradient term is also discussed. The squared gradient size and simple gradient penalty term are used to build a differentiable dynamic system and to apply soft regularization as a resolving constraint, respectively. The continuous dynamic system approach, which is a so-called ODE method, is used to analyze the GAN optimization problem with the simultaneous gradient descent algorithm, as described by Nagarajan & Kolter (2017).
|
| 32 |
+
|
| 33 |
+
# 2.1 NOTATIONS AND PRELIMINARIES REGARDING MEASURE THEORY
|
| 34 |
+
|
| 35 |
+
$D ( x ; \psi ) : \mathcal { X } \to \mathbb { R }$ is a discriminator function with its parameter $\psi$ and $G ( z ; \theta ) : \mathcal { Z } \to \mathcal { X }$ is a generator function with its parameter $\theta$ . $p _ { d }$ is the distribution of real data and $p _ { g } ~ = ~ p _ { \theta }$ is the distribution of the generated samples in $\mathcal { X }$ , which is induced from the generator function $G ( z ; \theta )$ and a known initial distribution $p _ { l a t e n t } ( z )$ in the latent space $\mathcal { Z } . \ \Vert \cdot \Vert$ denotes the $L ^ { 2 }$ Euclidean norm if no special subscript is present.
|
| 36 |
+
|
| 37 |
+
The concept of weak convergence for finite measures is used to ensure the continuity of the integral term over the measure in the dynamic system, which must be checked before applying the theorems related to stability. Throughout this study, we assume that the measures in the sample space are all finite and bounded.
|
| 38 |
+
|
| 39 |
+
Definition 1. For a set of finite measures $\{ \mu _ { i } \} _ { i \in \mathcal { I } }$ in $( \mathbb { R } ^ { n } , d )$ with euclidean distance $d _ { \mathrm { { z } } }$ , $\{ \mu _ { i } \} _ { i \in \mathbb { Z } }$ is referred to as bounded if there exists some $M > 0$ such that for all $i \in \mathcal { Z }$ ,
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\mu _ { i } ( \mathbb { R } ^ { n } ) \leq M
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
For instance, $M$ can be set as 1 if $\{ \mu _ { i } \}$ are probability measures on $\mathbb { R } ^ { n }$ . Assuming that the penalty measures are bounded, Portmanteau theorem offers the equivalent definition of the weak convergence for finite measures. This definition is important for ensuring that the integrals over $p _ { \theta }$ and $\mu$ in the dynamic system change continuously.
|
| 46 |
+
|
| 47 |
+
Definition 2. (Portmanteau Theorem) For a bounded sequence of finite measures $\{ \mu _ { n } \} _ { n \in \mathbb { N } }$ on the Euclidean space $\mathbb { R } ^ { n }$ with a $\sigma$ -field of Borel subsets $B ( \mathbb { R } ^ { n } )$ , $\mu _ { n }$ converges weakly to $\mu$ if and only $i f$ for every continuous bounded function $\phi$ on $\mathbb { R } ^ { n }$ , its integrals with respect to $\mu _ { n }$ converge to $\int \phi \dot { d \mu }$ , i.e.,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mu _ { n } \mu \Longleftrightarrow \int \phi d \mu _ { n } \int \phi d \mu
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
The most challenging problem in our analysis with the general penalty measure is taking the derivative of the integral, where the measure depends on the variable that we want to differentiate. If our penalty measure is either absolutely continuous or discrete, then it is easy to deal with the integral. However, in the case of singular penalty measure, dealing with the integral term is not an easy task. Therefore, we introduce the concept of a weak derivative of a probability measure in the following(Heidergott & Vazquez-Abad, 2008). The weak derivative of a measure is useful for handling a ´ parametric measure that is not absolutely continuous with low dimensional support.
|
| 54 |
+
|
| 55 |
+
Definition 3. (Weak Derivatives of a Probability Measure) Consider the Euclidean space and its $\sigma$ -field of Borel subsets $( \mathbb { R } ^ { d } , B ( \mathbb { R } ^ { d } ) )$ . The probability measure $P _ { \theta }$ is called weakly differentiable at $\theta$ if a signed finite measure $P _ { \theta } ^ { \prime }$ exists where
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\frac { d } { d \theta } \int \phi ( x ) d P _ { \theta } = \operatorname * { l i m } _ { \Delta 0 } \frac { 1 } { \Delta } \{ \int \phi ( x ) d P _ { \theta + \Delta } - \int \phi ( x ) d P _ { \theta } \} = \int \phi ( x ) d P _ { \theta } ^ { \prime }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
is satisfied for every continuous bounded function $\phi$ on $\mathbb { R } ^ { n }$ . For the multidimensional parameter $\theta$ , this can be defined similar manner.
|
| 62 |
+
|
| 63 |
+
We can show that the positive part and negative part of $P _ { \theta } ^ { \prime }$ have the same mass by putting $\phi ( x ) = 1$ and the Hahn–Jordan decomposition on $P _ { \theta } ^ { \prime }$ . Therefore, the following triple $( c _ { \theta } , P _ { \theta } ^ { + } , P _ { \theta } ^ { - } )$ is called a weak derivative of $P _ { \theta }$ , where $P _ { \theta } ^ { \pm }$ are probability measures and $P _ { \theta } ^ { \prime }$ is rewritten as:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
P _ { \theta } ^ { \prime } = c _ { \theta } P _ { \theta } ^ { + } - c _ { \theta } P _ { \theta } ^ { - }
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Therefore,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\frac { d } { d \theta } \int \phi ( x ) d P _ { \theta } = \int \phi ( x ) d P _ { \theta } ^ { \prime } = c _ { \theta } ( \int \phi ( x ) d P _ { \theta } ^ { + } - \int \phi ( x ) d P _ { \theta } ^ { - } )
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
holds for every continuous bounded function $\phi$ on $\mathbb { R } ^ { n }$ . It is known that the representation of $( c _ { \theta } , P _ { \theta } ^ { + } , P _ { \theta } ^ { - } )$ for $P _ { \theta } ^ { \prime }$ is not unique because $( c _ { \theta } + C _ { \theta } , P _ { \theta } ^ { + } + q _ { \theta } , P _ { \theta } ^ { - } + q _ { \theta } )$ is also another representation of $P _ { \theta } ^ { \prime }$ .
|
| 76 |
+
|
| 77 |
+
For the general finite measure $Q _ { \theta }$ , a normalizing coefficient $M ( \theta ) < \infty$ can be introduced. The product rule for differentiating can also be applied in a similar manner to calculus.
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\frac { d } { d \theta } \int \phi ( x ; \theta ) d P _ { \theta } = \int \nabla _ { \theta } \phi ( x ; \theta ) d P _ { \theta } + \int \phi ( x ; \theta ) d P _ { \theta } ^ { \prime }
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Therefore, for the general finite measure $Q _ { \theta } = M ( \theta ) P _ { \theta }$ , its derivative $Q _ { \theta } ^ { \prime }$ can be represented as below.
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
Q _ { \theta } ^ { \prime } = M ^ { \prime } ( \theta ) P _ { \theta } + M ( \theta ) P _ { \theta } ^ { \prime } = M ^ { \prime } ( \theta ) P _ { \theta } + c _ { \theta } M ( \theta ) P _ { \theta } ^ { + } - c _ { \theta } M ( \theta ) P _ { \theta } ^ { - }
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
# 2.2 PROBLEM SETTING AS A DYNAMIC SYSTEM
|
| 90 |
+
|
| 91 |
+
Previous work of Mescheder et al. (2018) showed that the dynamic system of WGAN-GP is not necessarily stable at equilibrium by demonstrating that the sequence of parameters is not Cauchy sequence. This is mainly due to the term $\| x \|$ in the dynamic system which has a derivative $\frac { x } { \| x \| }$ that is not defined at $x = 0$ . WGAN-GP has a penalty term $\mathbb { E } _ { \mu _ { G P } } [ ( \| \nabla _ { x } D ( x ; \psi ) \| - 1 ) ^ { 2 } ]$ that can lead to a discontinuity in its dynamic system.
|
| 92 |
+
|
| 93 |
+
These problems can be avoided by using the squared value of the gradient’s norm $\| \nabla _ { x } D \| ^ { 2 }$ , which is a differentiable function. In contrast to the WGAN-GP, recent methods based on a gradient penalty such as the simple gradient penalty employed by Mescheder et al. (2018) and the Sobolev GAN used the average of the squared values for the penalty area, whereas the WGAN-GP penalizes the size of the discriminator’s gradient $\lVert \nabla _ { x } D \rVert$ away from 1 in a pointwise manner.
|
| 94 |
+
|
| 95 |
+
This advantage of squared gradient term1, $\mathbb { E } _ { \mu } [ \| \nabla _ { x } D \| ^ { 2 } ]$ , makes the dynamic system differentiable and we define the WGAN problem with the square of the gradient’s norm as a simple gradient penalty. This simple gradient penalty can be treated as soft regularization based on the size of the discriminator’s gradient, especially in case where $\mu$ is the probability measure (Roth et al., 2017). It is convenient to determine whether the system is stable by observing the spectrum of the Jacobian matrix. In the following, $( D ( x ; \psi ) , p _ { d } , p _ { \theta } , \mu )$ is defined as an SGP $\mu$ -WGAN optimization problem (SGP-form) with a simple gradient penalty term on the penalty measure $\mu$ .
|
| 96 |
+
|
| 97 |
+
Definition 4. The WGAN optimization problem with a simple gradient penalty term $\| \nabla _ { x } D \| ^ { 2 }$ , penalty measure $\mu _ { ; }$ , and penalty weight hyperparameter $\rho > 0$ is given as follows, where the penalty term is only introduced to update the discriminator.
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r l } & { \displaystyle \operatorname* { m a x } _ { \psi } : \mathbb { E } _ { p _ { d } } [ D ( x ; \psi ) ] - \mathbb { E } _ { p _ { \theta } } [ D ( x ; \psi ) ] - \frac { \rho } { 2 } \mathbb { E } _ { \mu } [ \| \nabla _ { x } D ( x ; \psi ) \| ^ { 2 } ] } \\ & { \displaystyle \operatorname* { m i n } _ { \theta } : \mathbb { E } _ { p _ { d } } [ D ( x ; \psi ) ] - \mathbb { E } _ { p _ { \theta } } [ D ( x ; \psi ) ] } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
According to Nagarajan & Kolter (2017) and many other optimization problem studies, the simultaneous gradient descent algorithm for GAN updating can be viewed as an autonomous dynamic system of discriminator parameters and generator parameters, which we denote as $\psi$ and $\theta$ . As a result, the related dynamic system is given as follows.
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { r l } & { \dot { \boldsymbol { \psi } } = \mathbb { E } _ { \boldsymbol { p } _ { d } } [ \nabla _ { \boldsymbol { \psi } } D ] - \mathbb { E } _ { \boldsymbol { p } _ { \boldsymbol { \theta } } } [ \nabla _ { \boldsymbol { \psi } } D ] - \frac { \rho } { 2 } \nabla _ { \boldsymbol { \psi } } \mathbb { E } _ { \boldsymbol { \mu } } [ \nabla _ { \boldsymbol { x } } ^ { T } D \nabla _ { \boldsymbol { x } } D ] } \\ & { \dot { \boldsymbol { \theta } } = \nabla _ { \boldsymbol { \theta } } \mathbb { E } _ { \boldsymbol { p } _ { \boldsymbol { \theta } } } [ D ] } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
# 3 TOY EXAMPLES
|
| 110 |
+
|
| 111 |
+
We investigate two examples considered in previous studies by Mescheder et al. (2018) and Nagarajan & Kolter (2017). We then generalize the results to a finite measure case. The first example is the univariate Dirac GAN, which was introduced by Mescheder et al. (2018).
|
| 112 |
+
|
| 113 |
+
Definition 5. (Dirac GAN) The Dirac GAN comprises a linear discriminator $D ( x ; \psi ) = \psi x$ , data distribution $p _ { d } = \delta _ { 0 }$ , and sample distribution $p _ { \theta } = \delta _ { \theta }$ .
|
| 114 |
+
|
| 115 |
+
The Dirac GAN with a gradient penalty with an arbitrary probability measure is known to be globally convergent(Mescheder et al., 2018). We argue that this result can be generalized to a finite penalty measure case.
|
| 116 |
+
|
| 117 |
+
Lemma 1. Consider the Dirac GAN problem with SGP form $\begin{array} { r } { ( D ( x ; \psi ) = \psi x , \delta _ { 0 } , \delta _ { \theta } , \mu _ { \psi , \theta } ) } \end{array}$ . Suppose that some small $\eta > 0$ exists such that its finite penalty measure $\mu _ { \psi , \theta }$ with mass $M ( \psi , \theta ) =$ $\mathbf { \bar { \rho } } _ { \int 1 d \mu _ { \psi , \theta } } \geq 0$ satisfies either
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
M ( \psi , \theta ) > 0 f o r \left( \psi , \theta \right) \in B _ { \eta } ( ( 0 , 0 ) ) o
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
^ { \prime } \psi \nabla _ { \psi } M ( \psi , \theta ) \geq 0 f o r ( \psi , \theta ) \in B _ { \eta } ( ( 0 , 0 ) ) .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
Then, the SGP $\mu$ -WGAN optimization dynamics with $\begin{array} { r } { ( D ( x ; \psi ) = \psi x , \delta _ { 0 } , \delta _ { \theta } , \mu _ { \psi , \theta } ) } \end{array}$ are locally stable at the origin and the basin of attraction $B = B _ { R } ( ( 0 , 0 ) )$ is open ball with radius $R$ . Its radius is given as follows.
|
| 128 |
+
|
| 129 |
+
Motivated by this example, we can extend this idea to the other toy example given by Nagarajan & Kolter (2017), where WGAN fails to converge to the equilibrium points $( \psi , \theta ) = ( 0 , \pm 1 )$ .
|
| 130 |
+
|
| 131 |
+
Lemma 2. Consider the toy example $\begin{array} { r c l } { ( D ( x ; \psi ) } & { = } & { \psi x ^ { 2 } , U ( - 1 , 1 ) , U ( - | \theta | , | \theta | ) , \mu _ { \theta } ) } \end{array}$ where $U ( 0 , 0 ) = \delta _ { 0 }$ and the ideal equilibrium points are given by $( \psi ^ { * } , \theta ^ { * } ) = ( 0 , \pm 1 )$ . For a finite measure $\mu = \mu _ { \theta }$ on $\mathbb { R }$ which is independent of $\psi$ , suppose that $\mu _ { \boldsymbol { \theta } } \to \mu ^ { * }$ with $\mu ^ { * } \neq C \delta _ { 0 }$ for $C \geq 0$ . The dynamic system is locally stable near the desired equilibrium $( 0 , \pm 1 )$ , where the spectrum of the
|
| 132 |
+
|
| 133 |
+
Jacobian at $( 0 , \pm 1 )$ is given by $\begin{array} { r } { \lambda = - 2 \rho \mathbb { E } _ { \mu ^ { * } } [ x ^ { 2 } ] \pm \sqrt { 4 \rho ^ { 2 } \mathbb { E } _ { \mu ^ { * } } [ x ^ { 2 } ] ^ { 2 } - \frac { 4 } { 9 } } } \end{array}$
|
| 134 |
+
|
| 135 |
+
# 4 MAIN CONVERGENCE THEOREM
|
| 136 |
+
|
| 137 |
+
We propose the convergence property of WGAN with a simple gradient penalty on an arbitrary penalty measure $\mu$ for a realizable case: $\theta = \theta ^ { * }$ with $p _ { d } = p _ { \theta ^ { \ast } }$ exists. In subsection 4.1, we provide the necessary assumptions, which comprise our main convergence theorem. In subsection 4.2, we give the main convergence theorem with a sketch of the proof. A more rigorous analysis is given in the Appendix.
|
| 138 |
+
|
| 139 |
+
# 4.1 ASSUMPTIONS
|
| 140 |
+
|
| 141 |
+
The first assumption is made regarding the equilibrium condition for GANs, where we state the ideal conditions for the discriminator parameter and generator parameter. As the parameters converge to the ideal equilibrium, the sample distribution $\left( p _ { \theta } \right)$ converges to the real data distribution $\left( p _ { d } \right)$ and the discriminator cannot distinguish the generated sample and the real data.
|
| 142 |
+
|
| 143 |
+
Assumption 1. $p _ { \theta } p _ { d }$ as $\theta ~ \to ~ \theta ^ { * }$ and $D ( x ; \psi ^ { * } ) ~ = ~ 0$ on supp $\left( p _ { d } \right)$ and its small open neighborhood, i.e., $x \in \cup _ { x ^ { \prime } \in s u p p ( p _ { d } ) } B _ { \epsilon _ { x ^ { \prime } } } ( x ^ { \prime } )$ implies $D ( x ; \psi ^ { * } ) = 0$ . For simplicity, we denote $\cup _ { x ^ { \prime } \in s u p p ( p _ { d } ) } B _ { \epsilon _ { x ^ { \prime } } } ( x ^ { \prime } )$ as $B ( s u p p ( p _ { d } ) )$ .
|
| 144 |
+
|
| 145 |
+
The second assumption ensures that the higher order terms cannot affect the stability of the SGP $\mu$ -WGAN. In the Appendix, we consider the case where the WGAN fails to converge when Assumption 2 is not satisfied. Compared with the previous study by Nagarajan & Kolter (2017), the conditions for the discriminator parameter are slightly modified.
|
| 146 |
+
|
| 147 |
+
# Assumption 2.
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\begin{array} { r } { g ( \theta ) = \| \mathbb { E } _ { p _ { d } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } ) ] - \mathbb { E } _ { p _ { \theta } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } ) ] \| ^ { 2 } , h ( \psi ) = \mathbb { E } _ { \mu _ { \psi , \theta ^ { * } } } [ \| \nabla _ { x } D ( x ; \psi ) \| ^ { 2 } ] } \end{array}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
are locally constant along the nullspace of the Hessian matrix.
|
| 154 |
+
|
| 155 |
+
The third assumption allows us to extend our results to discrete probability distribution cases, as described by Mescheder et al. (2018).
|
| 156 |
+
|
| 157 |
+
Assumption 3. $\exists \epsilon _ { g } > 0$ such that $D ( x ; \psi ^ { * } ) = 0$ on $\cup _ { | \theta - \theta ^ { * } | < \epsilon _ { g } } s u p p ( p _ { \theta } ) .$ .
|
| 158 |
+
|
| 159 |
+
The fourth assumption indicates that there are no other “bad” equilibrium points near $( \psi ^ { * } , \theta ^ { * } )$ , which justifies the projection along the axis perpendicular to the null space.
|
| 160 |
+
|
| 161 |
+
Assumption 4. A bad equilibrium does not exist near the desired equilibrium point. Thus, $( \psi ^ { * } , \theta ^ { * } )$ is an isolated equilibrium or there exist $\delta _ { d } , \delta _ { g } > 0$ such that all equilibrium points in $B _ { \delta _ { d } } ( \psi ^ { * } ) \times$ $B _ { \delta _ { g } } ( \theta ^ { * } )$ satisfy the other assumptions.
|
| 162 |
+
|
| 163 |
+
The last assumption is related to the necessary conditions for the penalty measure. A calculation of the gradient penalty based on samples from the data manifold and generator manifold or the interpolation of both was introduced in recent studies (Gulrajani et al., 2017; Roth et al., 2017; Mescheder et al., 2018). First, we propose strong conditions for the penalty measure.
|
| 164 |
+
|
| 165 |
+
Assumption 5. The finite penalty measure $\mu = \mu _ { \theta }$ satisfies the followings:
|
| 166 |
+
|
| 167 |
+
a $\mu _ { \theta } \to \mu _ { \theta ^ { * } } = \mu ^ { * }$ and $\mu _ { \theta }$ is independent of the discriminator parameter $\psi$ . $\begin{array} { r l } & { b \ s u p p ( p _ { d } ) \subset s u p p ( \mu ^ { * } ) } \\ & { c \ \exists \epsilon _ { \mu } > 0 \ s u c h \ t h a t \ s u p p ( \mu _ { \theta } ) \subset B ( s u p p ( p _ { d } ) ) f o r \vert \theta - \theta ^ { * } \vert < \epsilon _ { \mu } . } \end{array}$
|
| 168 |
+
|
| 169 |
+
The assumption given above means that the support of the penalty measure $\mu _ { \theta }$ should approach the data manifolds smoothly as $\theta \to \theta ^ { * }$ . However, the penalty measure from WGAN-GP with a simple gradient penalty still reaches equilibrium without satisfying Assumption 5c. Therefore, we suggest Assumption 6, which is a weak version of Assumption 5. Assumption $6 \mathrm { a } ^ { 2 }$ is technically required to take the derivative of the integral $\mathbb { E } _ { \mu _ { \psi , \theta } } [ \| \nabla _ { x } D ( x ; \psi ) \| ^ { 2 } ]$ with respect to $\psi$ .
|
| 170 |
+
|
| 171 |
+
Assumption 6. (Weak version of Assumption 5) The finite penalty measure $\mu = \mu _ { \psi , \theta }$ satisfies the following.
|
| 172 |
+
|
| 173 |
+
a $\mu _ { \psi , \theta } \mu _ { \psi ^ { * } , \theta ^ { * } } = \mu ^ { * }$ , where supp $( \mu _ { \psi , \theta } )$ only depends on $\theta$ . Near the equilibrium, $\mu _ { \psi , \theta }$ can be weakly differentiated twice with respect to $\psi$ . In addition, its mass $M ( \psi , \theta ) \stackrel { \cdot } { = }$ $\int 1 d \mu _ { \psi , \theta }$ is a twice-differentiable function of $\psi$ and bounded near the equilibrium.
|
| 174 |
+
|
| 175 |
+
b $E _ { \mu ^ { * } } [ \nabla _ { \psi x } D \nabla _ { \psi x } ^ { T } D ]$ is positive definite or $s u p p ( p _ { d } ) \subset s u p p ( \mu ^ { * } ) .$
|
| 176 |
+
|
| 177 |
+
c $\ : \exists \epsilon _ { \mu } > 0 \ :$ such that $\operatorname { s u p p } ( \mu _ { \theta } ) \subset V$ for $| \theta - \theta ^ { * } | < \epsilon _ { \mu }$ , where $V = \{ x | \nabla _ { x } D ( x ; \psi ^ { * } ) = 0 \}$ .
|
| 178 |
+
|
| 179 |
+
The assumption above implies the following situations; The penalty measure’s support approaches to data manifold and its weight changes smoothly with respect to $\psi$ and $\theta$ . At the equilibrium, penalty measure’s support contains data manifold. Also, ideal discriminator will remain flat on the penalty area.
|
| 180 |
+
|
| 181 |
+
In summary, the gradient penalty regularization term with any penalty measure where the support approaches $B ( s u p p ( p _ { d } ) )$ in a smooth manner works well and this main result can explain the regularization effect of previously proposed penalty measures such as $\mu _ { G P } , p _ { d } , p _ { \ell }$ , and their mixtures.
|
| 182 |
+
|
| 183 |
+
# 4.2 MAIN CONVERGENCE THEOREM
|
| 184 |
+
|
| 185 |
+
According to the modified assumptions given above, we prove that the related dynamic system is locally stable near the equilibrium. The tools used for analyzing stability are mainly based on those described by Nagarajan & Kolter (2017). Our main contributions comprise proposing the necessary conditions for the penalty measure and proving the local stability for all penalty measures that satisfy Assumption 6.
|
| 186 |
+
|
| 187 |
+
Theorem 1. Suppose that our SGP $\mu$ -WGAN optimization problem $( D , p _ { d } , p _ { \theta } , \mu )$ with equilibrium point $( \psi ^ { * } , \theta ^ { * } )$ satisfies the assumptions given above. Then, the related dynamic system is locally stable at the equilibrium.
|
| 188 |
+
|
| 189 |
+
A detailed proof of the main convergence theorem is given in the Appendix. A sketch of the proof is given in three steps. First, the undesired terms in the Jacobian matrix of the system at the equilibrium are cancelled out. Next, the Jacobian matrix at equilibrium is given by $\left[ \begin{array} { c c } { \therefore } & { \mathbf { 0 } } \\ { R ^ { T } } & { 0 } \end{array} \right]$ , where $Q =$ $\mathbb { E } _ { \mu ^ { * } } [ \nabla _ { \psi x } D \nabla _ { \psi x } ^ { T } D ]$ and $R = \nabla _ { \theta } \mathbb { E } _ { p _ { \theta } } [ \nabla _ { \psi } D ] | _ { \theta = \theta ^ { * } }$ . The system is locally stable when both $Q$ and $R ^ { T } R$ are positive definite. We can complete the proof by dealing with zero eigenvalues by showing that ${ \cal N } ( Q ^ { \hat { T } } ) \subset { \cal N } ( R ^ { T } )$ and the projected system’s stability implies the original system’s stability.
|
| 190 |
+
|
| 191 |
+
Our analysis mainly focuses on WGAN, which is the simplest case of general GAN minimax optimization
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
\begin{array} { r l } & { \underset { \psi } { \operatorname* { m a x } } : \mathbb { E } _ { p _ { d } } [ f ( D ( x ; \psi ) ) ] + \mathbb { E } _ { p _ { \theta } } [ f ( - D ( x ; \psi ) ) ] - \frac { \rho } { 2 } \mathbb { E } _ { \mu } [ \| \nabla _ { x } D ( x ; \psi ) \| ^ { 2 } ] } \\ & { \underset { \theta } { \operatorname* { m i n } } : \mathbb { E } _ { p _ { d } } [ f ( D ( x ; \psi ) ) ] + \mathbb { E } _ { p _ { \theta } } [ f ( - D ( x ; \psi ) ) ] } \end{array}
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
with $f ( x ) = x$ . Similar approach is still valid for general GANs with concave function $f$ with $f ^ { \prime \prime } ( x ) < 0$ and $f ^ { \prime } ( 0 ) \neq 0$ .
|
| 198 |
+
|
| 199 |
+
# 5 EXPERIMENTAL RESULTS
|
| 200 |
+
|
| 201 |
+
We claim that every penalty measure that satisfies the assumptions can regularize the WGAN and generate similar results to the recently proposed gradient penalty methods. Several penalty measures were tested based on two-dimensional problems (mixture of 8 Gaussians, mixture of 25 Gaussians, and swissroll), MNIST and CIFAR-10 datasets using a simple gradient penalty term. In the comparisons with WGAN, the recently proposed penalty measures and our test penalty measures used the same network settings and hyperparameters. The penalty measures and its detailed sampling methods are listed in Table 1, where $x _ { d } \sim p _ { d } , x _ { g } \sim p _ { \theta }$ , and $\alpha \sim U ( 0 , 1 )$ . $\mathcal { A }$ indicates fixed anchor point in $\mathcal { X }$ .
|
| 202 |
+
|
| 203 |
+
Table 1: List of benchmark WGANs (WGAN and WGAN-GP with non-zero centered gradient penalty) and 5 penalty measures with a simple gradient penalty term. In this table, WGAN-GP represents the previous model proposed by (Gulrajani et al., 2017), which penalizes the WGAN with non-zero centered gradient penalty terms, whereas $\mu _ { G P }$ represents the simple method. In our experiment, no additional weights are applied on 5 penalty measures and they are all probability distributions.
|
| 204 |
+
|
| 205 |
+
<table><tr><td>Penalty</td><td>Penalty term</td><td>Penalty measure, sampling method</td></tr><tr><td>WGAN WGAN-GP</td><td>None(Weight Clipping) Eμ[(IVxD|-1)2]</td><td>None x=axd+(1-α)xg</td></tr><tr><td></td><td>Eμ[VxD|2]</td><td></td></tr><tr><td>Pg Pd</td><td>Eμ[VxDii2]</td><td>x=xg x=xd</td></tr><tr><td>μGP</td><td>EμVDii2]</td><td>x=axd+(1-α)xg</td></tr><tr><td>μmid</td><td>Eμ[VxDii2]</td><td>x= 0.5xd+0.5xg</td></tr><tr><td>μg,anc</td><td>EμVDii2]</td><td>x=αA+(1-α)xg</td></tr></table>
|
| 206 |
+
|
| 207 |
+
By setting the previously proposed WGAN with weight-clipping(Arjovsky et al., 2017) and WGANGP(Gulrajani et al., 2017) as the baseline models, $\operatorname { S G P } \mu$ -WGAN was examined with various penalty measures comprising three recently proposed measures and two artificially generated measures. $p _ { \theta }$ and $p _ { d }$ were suggested by Mescheder et al. (2018) and $\mu _ { G P }$ was introduced from the WGAN-GP. We analyzed the artificial penalty measures $\mu _ { m i d }$ and $\mu _ { g , a n c }$ as the test penalty measures.
|
| 208 |
+
|
| 209 |
+
The experiments were conducted based on the implementation of the Gulrajani et al. (2017). The hyperparameters, generator/discriminator structures, and related TensorFlow implementations can be found at https://github.com/igul222/improved_wgan_training (Gulrajani et al., 2017). Only the loss function was modified slightly from a non-zero centered gradient penalty to a simple penalty. For the CIFAR-10 image generation tasks, the inception score(Salimans et al., 2016) and FID(Heusel et al., 2017) were used as benchmark scores to evaluate the generated images.
|
| 210 |
+
|
| 211 |
+
# 5.1 2D EXAMPLES AND MNIST
|
| 212 |
+
|
| 213 |
+
We checked the convergence of $p _ { \theta }$ for the 2D examples (8 Gaussians, swissroll data, and 25 Gaussians) and MNIST digit generation for the SGP-WGANs with five penalty measures. MNIST and 25 Gaussians were trained over 200K iterations, the 8 Gaussians were trained for 30K iterations, and the Swiss Roll data were trained for 100K iterations. The anchor $\mathcal { A }$ for $\mu _ { g , a n c }$ was set as $( 2 , - 1 )$ for the 2D examples and 784 gray pixels for MNIST. We only present the results obtained for the MNIST dataset with the penalty measures comprising $\mu _ { m i d }$ and $\mu _ { g , a n c }$ in Figure 1. The others are presented in the Appendix.
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
Figure 1: MNIST example. Images generated with $\mu _ { m i d }$ (left) and $\mu _ { g , a n c } ( \mathrm { r i g h t } )$ .
|
| 217 |
+
|
| 218 |
+
# 5.2 CIFAR-10
|
| 219 |
+
|
| 220 |
+
DCGAN and ResNet architectures were tested on the CIFAR-10 dataset. The generators were trained for 200K iterations. The anchor $\mathcal { A }$ for $\mu _ { g , a n c }$ during CIFAR-10 generation was set as fixed random pixels. The WGAN, WGAN-GP, and five penalty measures were evaluated based on the inception score and FID, as shown in Table 2, which are useful tools for scoring the quality of generated images. The images generated from $\mu _ { m i d }$ and $\mu _ { g , a n c }$ with ResNet are shown in Figure 2. The others are presented in the Appendix.
|
| 221 |
+
|
| 222 |
+
Table 2: Benchmark score results obtained based on the CIFAR-10 dataset under DCGAN and ResNet architectures. The higher inception score and lower FID indicate the good quality of the generated images.
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Penalty</td><td>DCGAN Inception FID</td><td>ResNet Inception</td><td>FID</td></tr><tr><td>WGAN 3</td><td>5.64 ± 0.09 48.7</td><td>=</td><td>=</td></tr><tr><td>WGAN-GP</td><td>6.48 ± 0.10 35.0</td><td>7.82 ± 0.09</td><td>18.1</td></tr><tr><td>Pg</td><td>6.46 ± 0.09 38.0</td><td>7.63 ± 0.10</td><td>20.9</td></tr><tr><td>pd</td><td>6.33 ± 0.07</td><td>38.9 7.63 ± 0.09</td><td>20.3</td></tr><tr><td>μGP</td><td>6.40 ±0.08</td><td>35.4 7.60 ± 0.09</td><td>18.3</td></tr><tr><td>μmid</td><td>6.60 ± 0.07</td><td>33.9 7.86 ± 0.07</td><td>16.4</td></tr><tr><td>μg,anc</td><td>6.45 ± 0.07</td><td>33.7 7.36 ± 0.09</td><td>22.4</td></tr></table>
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
Figure 2: CIFAR-10 example. Images generated with $\mu _ { m i d }$ (left) and $\mu _ { g , a n c }$ (right) under the ResNet architecture.
|
| 228 |
+
|
| 229 |
+
# 6 CONCLUSION
|
| 230 |
+
|
| 231 |
+
In this study, we proved the local stability of simple gradient penalty $\mu$ -WGAN optimization for a general class of finite measure $\mu$ . This proof provides insight into the success of regularization with previously proposed penalty measures. We explored previously proposed analyses based on various gradient penalty methods. Furthermore, our theoretical approach was supported by experiments using unintuitive penalty measures. In future research, our works can be extended to alternative gradient descent algorithm and its related optimal hyperparameters. Stability at non-realizable equilibrium points is one of the important topics on stability of GANs. Optimal penalty measure for achieving the best convergence speed can be also investigated using a spectral theory, which provides the mathematical analysis on stability of GAN with a precise information on the convergence theory.
|
| 232 |
+
|
| 233 |
+
# REFERENCES
|
| 234 |
+
|
| 235 |
+
Mart´ın Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial ´ networks. In International Conference on Learning Representations, 2017.
|
| 236 |
+
|
| 237 |
+
Mart´ın Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In Proceedings of the 34th International Conference on Machine Learning, pp. 214–223, 2017.
|
| 238 |
+
|
| 239 |
+
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C. Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2672–2680, 2014.
|
| 240 |
+
|
| 241 |
+
Ishaan Gulrajani, Faruk Ahmed, Mart´ın Arjovsky, Vincent Dumoulin, and Aaron C. Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems, pp. 5769–5779, 2017.
|
| 242 |
+
|
| 243 |
+
B. Heidergott and F. J. Vazquez-Abad. Measure-valued differentiation for markov chains. ´ Journal of Optimization Theory and Applications, 136:187–209, 2008. ISSN 1573-2878. doi: 10.1007/ s10957-007-9297-7.
|
| 244 |
+
|
| 245 |
+
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. 6629–6640, 2017.
|
| 246 |
+
|
| 247 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros. Image-to-image translation with conditional adversarial networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 5967–5976, 2017.
|
| 248 |
+
|
| 249 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro Acosta, Andrew P. Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, and Wenzhe Shi. Photorealistic single image super-resolution using a generative adversarial network. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pp. 105–114, 2017.
|
| 250 |
+
|
| 251 |
+
Lars M. Mescheder, Andreas Geiger, and Sebastian Nowozin. Which training methods for gans do actually converge? In Proceedings of the 35th International Conference on Machine Learning, pp. 3478–3487, 2018.
|
| 252 |
+
|
| 253 |
+
Youssef Mroueh, Chun-Liang Li, Tom Sercu, Anant Raj, and Yu Cheng. Sobolev GAN. In International Conference on Learning Representations, 2018.
|
| 254 |
+
|
| 255 |
+
Vaishnavh Nagarajan and J. Zico Kolter. Gradient descent GAN optimization is locally stable. In Advances in Neural Information Processing Systems, pp. 5591–5600, 2017.
|
| 256 |
+
|
| 257 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, pp. 271–279, 2016.
|
| 258 |
+
|
| 259 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015. URL http:// arxiv.org/abs/1511.06434.
|
| 260 |
+
|
| 261 |
+
Scott E. Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pp. 1060– 1069, 2016. URL http://jmlr.org/proceedings/papers/v48/reed16.html.
|
| 262 |
+
|
| 263 |
+
Kevin Roth, Aurelien Lucchi, Sebastian Nowozin, and Thomas Hofmann. Stabilizing training of ´ generative adversarial networks through regularization. In Advances in Neural Information Processing Systems, pp. 2015–2025, 2017.
|
| 264 |
+
|
| 265 |
+
Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pp. 2226–2234, 2016.
|
| 266 |
+
|
| 267 |
+
Casper Kaae Sønderby, Jose Caballero, Lucas Theis, Wenzhe Shi, and Ferenc Huszar. Amortised ´ MAP inference for image super-resolution. International Conference on Learning Representations, 2017.
|
| 268 |
+
|
| 269 |
+
Han Zhang, Tao Xu, and Hongsheng Li. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 5908–5916, 2017.
|
| 270 |
+
|
| 271 |
+
# APPENDIX A : PROOF OF LEMMAS BASED ON TOY EXAMPLES
|
| 272 |
+
|
| 273 |
+
Proof of Lemma 1. The related dynamic system of $\begin{array} { r } { ( D ( x ; \psi ) = \psi x , \delta _ { 0 } , \delta _ { \theta } , \mu _ { \psi , \theta } ) } \end{array}$ can be written as follows.
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
\begin{array} { l } { \displaystyle \dot { \psi } = - \theta - \frac { \rho } { 2 } \nabla \psi \mathbb { E } _ { \mu _ { \psi , \theta } } [ \psi ^ { 2 } ] } \\ { \displaystyle \dot { \theta } = \psi } \end{array}
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
First, the only equilibrium point is given by $( \psi ^ { * } , \theta ^ { * } ) = ( 0 , 0 )$ from
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
\begin{array} { l } { 0 = - \theta - 2 \psi M ( \psi , \theta ) - \psi ^ { 2 } \nabla _ { \psi } M ( \psi , \theta ) } \\ { \quad 0 = \psi } \end{array}
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
The corresponding Jacobian matrix for the dynamic system is written as:
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
J = \left[ { \begin{array} { r r } { Z } & { - 1 } \\ { 1 } & { 0 } \end{array} } \right]
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
where
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
Z = - \frac { \rho } { 2 } \nabla _ { \psi \psi } \mathbb { E } _ { \mu _ { \psi , \theta } } [ \psi ^ { 2 } ] \bigg | _ { \psi = 0 , \theta = 0 }
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
$\nabla _ { \psi } D ( x ; \psi ) = \psi$ does not depend on $x$ , so this can be rewritten as:
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
Z = - \frac { \rho } { 2 } \nabla _ { \psi \psi } ( \psi ^ { 2 } \mathbb { E } _ { \mu _ { \psi } , \theta } [ 1 ] ) = - \frac { \rho } { 2 } ( 2 M ( \psi , \theta ) + 4 \psi \nabla _ { \psi } M ( \psi , \theta ) + \psi ^ { 2 } M _ { \psi \psi } ( \psi , \theta ) ) \bigg | _ { \psi = 0 , \theta = 0 }
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
Therefore, if $M ( 0 , 0 ) > 0$ , then the given system is locally stable because the eigenvalues of its linearized system have negative real parts. If $M ( 0 , 0 ) = 0$ , then the stability of the system cannot be proved by the linearization theorem. In this case, we consider the following Lyapunov function.
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
L ( \psi ( t ) , \theta ( t ) ) = \psi ( t ) ^ { 2 } + \theta ( t ) ^ { 2 }
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
By differentiating with $t$ , we obtain
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\begin{array} { r l } & { \dot { L } = 2 ( \psi \psi ^ { \prime } + \theta \theta ^ { \prime } ) = - \rho \psi \nabla _ { \psi } ( \psi ^ { 2 } M ( \psi , \theta ) ) = - \rho \psi ( 2 \psi M ( \psi , \theta ) + \psi ^ { 2 } \nabla _ { \psi } M ( \psi , \theta ) ) } \\ & { \quad = - \rho \psi ^ { 2 } ( 2 M ( \psi , \theta ) + \psi \nabla _ { \psi } M ( \psi , \theta ) ) \leq 0 } \end{array}
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
Clearly, $L ( \psi , \theta ) \geq 0$ and the equality holds iff $\psi = \theta = 0$ . In addition, $\dot { L } \leq 0$ since $M ( \psi , \theta ) \geq$ 0 and $\psi \nabla _ { \psi } M ( \psi , \theta ) \geq 0$ from the assumption. Furthermore, it is clear that if $( \psi ( 0 ) , \theta ( 0 ) ) \ \in \qquad $ $B _ { \eta } ( ( 0 , 0 ) )$ , then $( \psi ( \tau ) , \theta ( \tau ) ) \in B _ { \eta } ( ( 0 , 0 ) )$ for all $\tau \geq 0$ because the Lyapunov function (square of the distance between the origin and $( \psi ( \tau ) , \theta ( \tau ) ) )$ always decreases as $\tau \infty$ . Therefore, the given system is stable according to the Lyapunov stability theorem.
|
| 316 |
+
|
| 317 |
+
Again, we can check that if $\mu _ { \psi , \theta }$ is a probability measure, then the system is globally stable, as shown by Mescheder et al. (2018). The basin of attraction is given by the whole $\mathbb { R } ^ { 2 }$ plane since $M ( \psi , \theta ) = 1$ , so $\dot { L } = - \rho \psi ^ { 2 } ( 2 M + \psi \nabla _ { \psi } M ) = - 2 \rho \psi ^ { 2 } \leq 0$ for every $( \psi , \theta ) \in \mathbb { R } ^ { 2 }$ . □
|
| 318 |
+
|
| 319 |
+
Proof of Lemma 2. From the general setup of the $\operatorname { S G P } \mu$ -WGAN optimization problem, the dynamic system corresponding to the simple-GAN in Definition 6 can be written as follows.
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
\begin{array} { l } { { \displaystyle { \dot { \psi } = \frac { 1 } { 3 } - \frac { \theta ^ { 2 } } { 3 } - 4 \rho \psi \mathbb { E } _ { \mu } [ x ^ { 2 } ] } } } \\ { { \displaystyle { \dot { \theta } = \frac { 2 \psi \theta } { 3 } } } } \end{array}
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
If we let $\mathbb { E } _ { \mu ^ { * } } [ x ^ { 2 } ] = A ^ { 2 }$ , then the Jacobian matrix at the equilibrium $( 0 , \pm 1 )$ is given by ${ \boldsymbol { J } } =$ $\left[ { \begin{array} { c c } { - 4 \rho A ^ { 2 } } & { { \mp } { \frac { 2 } { 3 } } } \\ { \pm { \frac { 2 } { 3 } } } & { 0 } \end{array} } \right]$ Therefore, the given system is locally stable when $A \neq 0$ .
|
| 326 |
+
|
| 327 |
+
# APPENDIX B : PROOF OF LEMMA RELATED WITH ASSUMPTION 2
|
| 328 |
+
|
| 329 |
+
Lemma 3. Consider the Dirac-GAN setup and SGP $\mu$ -WGAN optimization system with a slightly changed discriminator function $D _ { 2 } ( x ; \psi ) \stackrel { \textstyle - } { = } \psi x ^ { 2 }$ . The system $( D _ { 2 } , \delta _ { 0 } , \delta _ { \theta } , \mu _ { G P } )$ does not converge to $( 0 , 0 )$ but for any point $( a , 0 )$ with $a < 0$ , the system has equilibrium points on the whole $\psi$ -axis and it violates Assumption 2.
|
| 330 |
+
|
| 331 |
+
Proof of Lemma 3. For the SGP $\mu$ -WGAN optimization problem $( D _ { 2 } , \delta _ { 0 } , \delta _ { \theta } , \mu _ { G P } )$ , the dynamic system can be written as follows.
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { l } { { \dot { \psi } = - \theta ^ { 2 } - \frac { 4 } { 3 } \rho \psi \theta ^ { 2 } } } \\ { { \dot { \theta } = 2 \psi \theta } } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
$2 \psi \theta = 0$ and $\begin{array} { r } { \theta ^ { 2 } ( 1 + \frac { 4 } { 3 } \rho \psi ) = 0 } \end{array}$ implies that $\theta = 0$ , so the $\psi$ -axis is the set of all equilibrium points. By drawing the nullclines $\psi = 0$ and $\begin{array} { r } { \psi = - \frac { 3 } { 4 \rho } } \end{array}$ in the $\psi \theta$ -plane, it is clear that no solution curve converges to $( b , 0 )$ with $b \geq 0$ , as shown in Figure 3. □
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 3: Phase portrait of the SGP $\mu$ -WGAN optimization problem $( D _ { 2 } , \delta _ { 0 } , \delta _ { \theta } , \mu _ { G P } )$ with $\textstyle \rho = { \frac { 3 } { 8 } }$ . Along the line $\theta = 0$ , the system is stable so no updating will occur. Every solution curve that passes the nullcline $\psi = 0$ has $\dot { \theta } = 0$ . For the nullcline $\begin{array} { r } { \psi = - \frac { 3 } { 4 \rho } = - 2 } \end{array}$ , no updating on $\psi$ will occur and only $\theta$ will be updated. Given that the solution curves do not intersect with each other, every solution curve is exactly one of the followinstays in area A. (2) Solution curve converges to $\begin{array} { r } { \bar { ( \psi , \theta ) } \overset { * } { = } ( - \frac { 3 } { 4 \rho } , 0 ) } \end{array}$ trivial cases; (1) Solalong the nullcline $\begin{array} { r } { \psi = - \frac { 3 } { 4 \rho } } \end{array}$ e. (3) Solution curve stays in area B. (4) Solution curve starts from area C, crosses the nullcline $\psi = 0$ perpendicularly, and converges to $( b , 0 )$ with $b < 0$ . Therefore, no solution curve converges to $( 0 , 0 )$ .
|
| 341 |
+
|
| 342 |
+
# APPENDIX C : PROOF OF THE MAIN CONVERGENCE THEOREM
|
| 343 |
+
|
| 344 |
+
Proof. Let us consider the Jacobian matrix $J = \left[ \begin{array} { l l } { K _ { D D } } & { K _ { D G } } \\ { K _ { G D } } & { K _ { G G } } \end{array} \right]$ at the first equilibrium $( \psi ^ { * } , \theta ^ { * } ) ^ { 4 }$
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\begin{array} { r l } { J = \left[ \mathbb { E } _ { p _ { d } } [ \nabla _ { \psi \psi } D ] - \mathbb { E } _ { p _ { \theta ^ { \star } } } [ \nabla _ { \psi \psi } D ] - \frac { \rho } { 2 } \nabla _ { \psi \psi } \mathbb { E } _ { \mu } [ \| \nabla _ { x } D \| ^ { 2 } ] } & { - \nabla _ { \theta \psi } \mathbb { E } _ { p _ { \theta } } [ D ] - \frac { \rho } { 2 } \nabla _ { \theta \psi } \mathbb { E } _ { \mu } [ \| \nabla _ { x } D \| ^ { 2 } ] \right] } \\ & { \qquad \nabla _ { \psi \theta } \mathbb { E } _ { p _ { \theta } } [ D ] ^ { 2 } } \end{array}
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
First, Assumption 1 implies that $\mathbb { E } _ { p _ { d } } [ \nabla _ { \psi \psi } D ] - \mathbb { E } _ { p _ { \theta ^ { * } } } [ \nabla _ { \psi \psi } D ] = 0$ since $p _ { \theta } p _ { d }$ as $\theta \to \theta ^ { * }$ . From Assumption 3, $\mathbb { E } _ { p _ { \theta } } [ D ( x ; \psi ^ { * } ) ]$ is locally zero near the equilibrium $\theta ^ { * }$ , which implies that
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
K _ { G G } = \nabla _ { \theta \theta } \mathbb { E } _ { p _ { \theta } } [ D ( x ; \psi ^ { * } ) ] \bigg \rvert _ { \theta = \theta ^ { * } } = 0
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
We still need to evaluate $\nabla _ { \psi \psi } \mathbb { E } _ { \mu } [ \| \nabla _ { x } D \| ^ { 2 } ]$ and $\nabla _ { \theta \psi } \mathbb { E } _ { \mu } [ \| \nabla _ { x } D \| ^ { 2 } ]$ . According to Assumption 6a, finite signed measures $\mu _ { \psi , \theta } ^ { \prime }$ and $\mu _ { \psi , \theta } ^ { \prime \prime }$ exist5, so they are the first and second weak derivatives of $\mu _ { \psi , \theta }$ with respect to the parameter $\psi$ at $\left( \psi ^ { * } , \theta ^ { * } \right)$ . Therefore, the expectations given above can be rewritten as below.
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\begin{array} { l } { I = \nabla _ { \psi \psi } \displaystyle \int _ { s u p p ( \mu _ { \psi } , \theta ) } \| \nabla _ { x } D \| ^ { 2 } d \mu _ { \psi , \theta } } \\ { = \displaystyle \int _ { s u p p ( \mu _ { \psi , \theta } ) } ( 2 \nabla _ { \psi x } ^ { T } D \nabla _ { \psi x } D + 2 K _ { 0 } ) d \mu _ { \psi , \theta } + \displaystyle \int _ { s u p p ( \mu _ { \psi , \theta } ) } 2 ( \nabla _ { \psi x } ^ { T } D \nabla _ { x } D ) d \mu _ { \psi , \theta } ^ { \prime } + \displaystyle \int _ { s u p p ( \mu _ { \psi , \theta } ) } \| \nabla _ { x } \nabla _ { \psi } D \nabla _ { x } \| ^ { 2 } d \mu _ { \psi , \theta } ^ { \prime } } \\ { \cdot I = \nabla _ { \theta \psi } \displaystyle \int _ { s u p p ( \mu _ { \psi , \theta } ) } \| \nabla _ { x } D \| ^ { 2 } d \mu _ { \psi , \theta } } \\ { = \nabla _ { \theta } ( \displaystyle \int _ { s u p p ( \mu _ { \psi , \theta } ) } 2 ( \nabla _ { \psi x } ^ { T } D \nabla _ { x } D ) d \mu _ { \psi , \theta } + \displaystyle \int _ { s u p p ( \mu _ { \psi , \theta } ) } \| \nabla _ { x } D \| ^ { 2 } d \mu _ { \psi , \theta } ^ { \prime } ) } \end{array}
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
where
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\begin{array} { r } { K _ { 0 } ( x ; \psi ) = \left[ \sum _ { k } \frac { \partial ^ { 3 } } { \partial \psi _ { i } \partial \psi _ { j } \partial x _ { k } } D ( x ; \psi ) \frac { \partial } { \partial x _ { k } } D ( x ; \psi ) \right] _ { i j } } \end{array}
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
From Assumption 6c and the fact that the weak derivative of $\mu _ { \psi , \theta }$ vanishes outside of $s u p p ( \mu _ { \psi , \theta } )$ , $\nabla _ { x } D ( x ; \psi ^ { * } ) = 0$ on $s u p p ( \mu _ { \psi , \theta } ) \subset V$ for all $\theta$ with $\left| \theta - \theta ^ { * } \right| < \epsilon _ { \mu }$ and $\mu _ { \psi , \theta } ^ { \prime } = \mu _ { \psi , \theta } ^ { \prime \prime } = 0$ on the outside of $s u p p ( \mu _ { \psi , \theta } )$ , which leads to the desired results:
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\begin{array} { c } { \displaystyle { I = \int _ { s u p p ( \mu ^ { * } ) } 2 ( \nabla _ { \psi x } ^ { T } D ( x ; \psi ^ { * } ) \nabla _ { \psi x } D ( x ; \psi ^ { * } ) ) d \mu ^ { * } } } \\ { \displaystyle { I I = 0 } } \end{array}
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
After cancelling the undesired terms, the Jacobian matrix at the equilibrium $( \psi ^ { * } , \theta ^ { * } )$ is given as:
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
J = \left[ \begin{array} { c c } { - \rho Q } & { - R } \\ { R ^ { T } } & { 0 } \end{array} \right]
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
where
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
\begin{array} { r } { Q = \mathbb { E } _ { \mu ^ { * } } [ \nabla _ { \psi x } ^ { T } D \nabla _ { \psi x } D ] } \\ { \boldsymbol { R } = \nabla _ { \theta } \mathbb { E } _ { p _ { \theta } } [ \nabla _ { \psi } D ] \bigg | _ { \theta = \theta ^ { * } } } \end{array}
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
From the definition of $Q$ , it is easy to check that $Q$ is at least positive semi-definite. It is known that for a negative definite matrix $A$ and full column rank matrix $B$ , the block matrix $\left[ \begin{array} { l l } { A } & { B } \\ { - B ^ { T } } & { 0 } \end{array} \right]$ is Hurwitz, i.e., all eigenvalues of the matrix have a negative real part. Therefore, if $\bar { Q }$ is positive definite and $R$ is full column rank, the proof is complete. We consider the complementary case.
|
| 387 |
+
|
| 388 |
+
Suppose that $Q$ or $R ^ { T } R$ have some zero eigenvalues. Let $Q = U _ { D } \Lambda _ { D } U _ { D } ^ { T }$ and $R ^ { T } R = U _ { G } \Lambda _ { G } U _ { G } ^ { T }$ with $U _ { D } ~ = ~ \lbrack T _ { D } ~ S _ { D } \rbrack$ and $U _ { G } ~ = ~ [ T _ { G } ^ { ~ - } ~ S _ { G } ]$ , where $T _ { D }$ and $T _ { G }$ are the eigenvectors of $\bar { Q }$ and $R ^ { T } R$ that correspond to non-zero eigenvalues. First, we assume that $T _ { D }$ and $T _ { G }$ are not empty. We can show that $( \psi ^ { * } + \xi v , \theta ^ { * } \overset { \cdot } { + } \nu w )$ is also an equilibrium point for a sufficiently small $\xi , \nu$ and $v \in N ( Q ) , w \in N ( R ^ { T } R )$ by using the techniques given by Nagarajan & Kolter (2017). If the system does not update at the equilibrium point $( \psi ^ { * } , \theta ^ { * } )$ and its small neighborhood $\left( \psi ^ { * } + \xi v , \theta ^ { * } + \nu w \right)$ is perturbed along $N ( Q )$ and $N ( \bar { R } ^ { T } R )$ , then it is reasonable to project the system orthogonal to $N ( Q )$ and $N ( R ^ { T } { \bar { R } } )$ .
|
| 389 |
+
|
| 390 |
+
First, we assume that $v \in N ( Q )$ . By Assumption 2, $h ( \psi ^ { * } + \xi v ) = h ( \psi ^ { * } ) = 0$ for $| \xi | < \xi _ { d }$ , which implies that $\nabla _ { \boldsymbol { x } } D ( \boldsymbol { x } ; \psi ^ { * } + \xi \boldsymbol { v } ) = 0$ for $x \in s u p p ( \mu _ { \psi ^ { * } + \xi v , \theta ^ { * } } ) = s u p p ( \mu ^ { * } )$ and $| \xi | < \xi _ { d }$ . Thus, we obtain
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\mathbb { E } _ { \mu _ { \psi ^ { * } + \xi v , \theta ^ { * } } } [ \nabla _ { \psi x } ^ { T } D ( x ; \psi ^ { * } + \xi v ) \nabla _ { x } D ( x ; \psi ^ { * } + \xi v ) ] = 0
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
and
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\int _ { s u p p ( \mu ^ { * } ) } \left\| \nabla _ { x } D ( x ; \psi ^ { * } + \xi v ) \right\| ^ { 2 } d \mu _ { \psi ^ { * } + \xi v , \theta ^ { * } } ^ { \prime } = 0
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
By Assumption 4, $\begin{array} { r } { \mathbb { E } _ { p _ { d } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } + \xi v ) ] - \mathbb { E } _ { p _ { \theta ^ { * } } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } + \xi v ) ] = 0 } \end{array}$ since $p _ { d } = p _ { \theta ^ { \ast } }$ . By adding these equations, we obtain
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { l } { \displaystyle \dot { \psi } = \mathbb { E } _ { p _ { d } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } + \xi v ) ] - \mathbb { E } _ { p _ { \theta ^ { * } } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } + \xi v ) ] } \\ { \displaystyle - \frac { \rho } { 2 } \int _ { s u p p ( \mu _ { \psi ^ { * } + \xi v , \theta ^ { * } } ) } 2 \nabla _ { \psi x } ^ { T } D ( x ; \psi ^ { * } + \xi v ) \nabla _ { x } D ( x ; \psi ^ { * } + \xi v ) d \mu _ { \psi ^ { * } + \xi v , \theta ^ { * } } } \\ { \displaystyle - \frac { \rho } { 2 } \int _ { s u p p ( \mu _ { \psi ^ { * } + \xi v , \theta ^ { * } } ) } \| \nabla _ { x } D ( x ; \psi ^ { * } + \xi v ) \| ^ { 2 } d \mu _ { \psi ^ { * } + \xi v , \theta ^ { * } } ^ { \prime } } \\ { \displaystyle = 0 } \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
In addition,
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array} { l } { \displaystyle \dot { \theta } = \frac { \partial } { \partial \theta } \int _ { \mathcal X } D ( x ; \psi ^ { * } + \xi v ) d p _ { \theta } \bigg \vert _ { \theta = \theta ^ { * } } } \\ { \displaystyle = \int _ { \mathcal Z } \nabla _ { \theta } ^ { T } G ( z ; \theta ^ { * } ) \nabla _ { x } D ( G ( z ; \theta ^ { * } ) ; \psi ^ { * } + \xi v ) p _ { l a t e n t } ( z ) d z = 0 . } \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
Therefore, the point $( \psi ^ { * } + \xi v , \theta ^ { * } )$ with $| \xi | < \xi _ { d }$ is an equilibrium point. According to Assumption 4, $D ( x ; \psi ^ { * } + \xi v )$ is an equilibrium discriminator for $| \xi | < \delta _ { d }$ , and thus $D ( x ; \psi ^ { * } + \bar { \xi } v )$ is already an optimal discriminator for $| \xi | < \operatorname* { m i n } ( \xi _ { d } , \delta _ { d } )$ .
|
| 415 |
+
|
| 416 |
+
Suppose that $w \ \in \ N ( R ^ { T } R )$ . By Assumption 2, $g ( \theta ^ { * } ) ~ = ~ g ( \theta ^ { * } + \nu w ) ~ = ~ 0$ for $| \nu | < \nu _ { g }$ , and thus $\begin{array} { r l } { \mathbb { E } _ { p _ { d } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } ) ] - \mathbb { E } _ { p _ { \theta ^ { * } + \nu w } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } ) ] ~ = ~ 0 } \end{array}$ for $| \nu | ~ < ~ \nu _ { g }$ . Furthermore, Assumption 3 gives $\mathbb { E } _ { p _ { \theta ^ { * } + \nu w } } [ D ( x ; \psi ^ { * } ) ] = 0$ for a sufficiently close $| \nu | < \epsilon _ { g }$ , which implies that $\begin{array} { r } { \dot { \theta } = \nabla _ { \theta } \mathbb { E } _ { p _ { \theta } } [ D ( x ; \psi ^ { * } ) ] \bigg \rvert _ { \theta = \theta ^ { * } + \nu w } = 0 } \end{array}$ for $| \nu | < \epsilon _ { g }$ . Finally,
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\int _ { s u p p ( \mu _ { \psi ^ { * } , \theta ^ { * } + s w } ) } 2 \nabla _ { \psi x } ^ { T } D ( x ; \psi ^ { * } ) \nabla _ { x } D ( x ; \psi ^ { * } ) d \mu _ { i \psi ^ { * } , \theta ^ { * } + \nu w } + \int _ { s u p p ( \mu _ { \psi ^ { * } , \theta ^ { * } + s w } ) } \| \nabla _ { x } D ( x ; \psi ^ { * } ) \| ^ { 2 } d \mu _ { i \psi ^ { * } , \theta ^ { * } + \nu w } ^ { \prime }
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
since $s u p p ( \mu _ { \psi ^ { * } , \theta ^ { * } + \nu w } ) \subset V$ and $\nabla _ { x } D ( x ; \psi ^ { * } ) = 0$ on $V$ for a sufficiently small $| \nu | < \epsilon _ { \mu }$ (Assumption 6c). By adding these results, we obtain
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\begin{array} { l } { \displaystyle \dot { \psi } = \mathbb { E } _ { p _ { d } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } ) ] - \mathbb { E } _ { p _ { \theta ^ { * } + \nu w } } [ \nabla _ { \psi } D ( x ; \psi ^ { * } ) ] } \\ { \displaystyle \quad - \frac { \rho } { 2 } \int _ { s u p p ( \mu _ { \psi ^ { * } , \theta ^ { * } + \nu w } ) } 2 \nabla _ { \psi x } ^ { T } D ( x ; \psi ^ { * } ) \nabla _ { x } D ( x ; \psi ^ { * } ) d \mu _ { \psi ^ { * } , \theta ^ { * } + \nu w } } \\ { \displaystyle \quad - \frac { \rho } { 2 } \int _ { s u p p ( \mu _ { \psi ^ { * } , \theta ^ { * } + \nu w } ) } \left\| \nabla _ { x } D ( x ; \psi ^ { * } ) \right\| ^ { 2 } d \mu _ { \psi ^ { * } , \theta ^ { * } + \nu w } ^ { \prime } } \\ { \displaystyle = 0 } \end{array}
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
Therefore, the point $( \psi ^ { * } , \theta ^ { * } + \nu w )$ with $| \nu | < \operatorname* { m i n } ( \epsilon _ { \mu } , \epsilon _ { g } , \nu _ { g } , \delta _ { g } )$ is an equilibrium point, which implies that $p _ { \theta ^ { * } + \nu w } = p _ { d }$ according to Assumption 4.
|
| 429 |
+
|
| 430 |
+
If we consider the projected system $( \alpha , \beta ) \ : = \ : ( T _ { D } ^ { T } \psi , T _ { G } ^ { T } \theta )$ , then the projected dynamic system’s Jacobian at $( T _ { D } ^ { T } \psi ^ { * } , T _ { G } ^ { T } \theta ^ { * } )$ is given as follows.
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
J ^ { \prime } = \left[ \begin{array} { c c } { { - \rho T _ { D } ^ { T } Q T _ { D } } } & { { - T _ { D } ^ { T } R T _ { G } } } \\ { { T _ { G } ^ { T } R ^ { T } T _ { D } } } & { { 0 } } \end{array} \right] = \left[ \begin{array} { c c } { { - \rho \Lambda _ { D } ^ { ( + ) } } } & { { - T _ { D } ^ { T } R T _ { G } } } \\ { { T _ { G } ^ { T } R ^ { T } T _ { D } } } & { { 0 } } \end{array} \right]
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
Therefore, we only need to prove that $T _ { D } ^ { T } R T _ { G }$ is of full column rank. Suppose that $u \in N ( Q ^ { T } ) =$ $N ( Q )$ . According to Assumption 2, $h ( \psi )$ is locally constant at $\psi ^ { * }$ along the direction $u$ . Therefore, for a sufficiently small scalar $\xi$ with $| \xi | < \xi _ { u }$ ,
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
h ( \psi ^ { * } + \xi u ) = h ( \psi ^ { * } ) = 0
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
where the last equality comes from the Assumption 6. This implies that $\nabla _ { x } D ( x ; \psi ^ { * } + \xi u ) = 0$ on $x \in s u p p ( \mu ^ { * } )$ for a small value of $| \xi | < \epsilon _ { u }$ . By taking directional derivative w.r.t. $\psi$ along the direction $u$ , we obtain:
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
u ^ { T } \nabla _ { \psi x } ^ { T } D ( x ; \psi ^ { * } ) = 0 , x \in s u p p ( \mu _ { \psi ^ { * } + \xi u , \theta ^ { * } } ) = s u p p ( \mu ^ { * } )
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
and thus
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
u ^ { T } \nabla _ { \psi x } ^ { T } D ( x ; \psi ^ { * } ) = u ^ { T } \nabla _ { x \psi } D ( x ; \psi ^ { * } ) = 0 , x \in s u p p ( p _ { \theta ^ { + } } ) = s u p p ( p _ { d } )
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
according to Assumption $^ \mathrm { 6 b }$ (the inclusion condition that $s u p p ( p _ { d } ) = s u p p ( p _ { \theta ^ { * } } ) \subset s u p p ( \mu ^ { * } )$ is required). By calculating $u ^ { T } R$ directly, we obtain
|
| 455 |
+
|
| 456 |
+
$$
|
| 457 |
+
\begin{array} { r l } & { \displaystyle \boldsymbol { u } ^ { T } \boldsymbol { R } = u ^ { T } \frac { \partial } { \partial \boldsymbol { \theta } } \int _ { \mathcal { X } } \nabla _ { \boldsymbol { \psi } } D ( \boldsymbol { x } ; \boldsymbol { \psi } ^ { * } ) d p _ { \boldsymbol { \theta } } \bigg \rvert _ { \boldsymbol { \theta = \theta } ^ { = } } } \\ & { \qquad = u ^ { T } \frac { \partial } { \partial \boldsymbol { \theta } } \int _ { \mathcal { X } } \nabla _ { \boldsymbol { \psi } } D ( G ( \boldsymbol { z } ; \boldsymbol { \theta } ) ; \boldsymbol { \psi } ^ { * } ) p _ { l a t e n t } ( \boldsymbol { z } ) d \boldsymbol { z } \bigg \rvert _ { \boldsymbol { \theta = \theta } ^ { * } } } \\ & { \quad = \int _ { \mathcal { X } } u ^ { T } \nabla _ { \boldsymbol { x } \boldsymbol { \psi } } D ( G ( \boldsymbol { z } ; \boldsymbol { \theta } ^ { * } ) ; \boldsymbol { \psi } ^ { * } ) \nabla _ { \boldsymbol { \theta } } G ( \boldsymbol { z } ; \boldsymbol { \theta } ^ { * } ) p _ { l a t e n t } ( \boldsymbol { z } ) d \boldsymbol { z } = 0 } \end{array}
|
| 458 |
+
$$
|
| 459 |
+
|
| 460 |
+
Thus, we obtain $u \in N ( R ^ { T } )$ , which implies that $N ( Q ^ { T } ) \subset N ( R ^ { T } )$ and $C ( R ) \subset C ( Q )$ . Now, we can check that $R T _ { G }$ is of full column rank since $T _ { G } ^ { T } R ^ { T } R T _ { G } = \Lambda _ { G } ^ { ( + ) }$ is positive definite. Therefore,
|
| 461 |
+
|
| 462 |
+
$$
|
| 463 |
+
R T _ { G } w = 0 \Rightarrow w = 0
|
| 464 |
+
$$
|
| 465 |
+
|
| 466 |
+
We note that the projection matrix on $C ( Q )$ is given by $T _ { D } ( T _ { D } ^ { T } T _ { D } ) ^ { - 1 } T _ { D } ^ { T } = T _ { D } T _ { D } ^ { T }$ . In addition, we know that $C ( R T _ { G } ) \subset C ( R ) \subset C ( Q )$ . Therefore,
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\begin{array} { r l } & { T _ { D } ^ { T } R T _ { G } w = 0 } \\ & { \Rightarrow T _ { D } T _ { D } ^ { T } R T _ { G } w = 0 } \\ & { \Rightarrow T _ { D } T _ { D } ^ { T } w ^ { \prime } = 0 , w ^ { \prime } = R T _ { G } w \in C ( R T _ { G } ) } \end{array}
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
\begin{array} { l } { { \Rightarrow w ^ { \prime } = R T _ { G } w = 0 } } \\ { { \Rightarrow w = 0 } } \end{array}
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
which completes the proof that $T _ { D } ^ { T } R T _ { G }$ is a full column rank matrix.
|
| 477 |
+
|
| 478 |
+
Now, we only need to obtain proofs for the trivial cases where either one of $T _ { D }$ or $T _ { G }$ is empty. First, suppose that $T _ { G }$ is empty. Similar to the analysis given above, we can find that the point $( \psi ^ { * } , \theta )$ with $| \theta - \theta ^ { * } | < \mathrm { m i n } ( \epsilon _ { \mu } , \epsilon _ { g } , \delta _ { g } , \nu )$ is an equilibrium point, where $g ( \theta ^ { * } ) = g ( \theta )$ for a sufficiently small $\lvert \theta - \theta ^ { * } \rvert < \nu$ . We conclude that $p _ { \theta } = p _ { d }$ for $| \theta - \theta ^ { * } | < \operatorname * { m i n } ( \epsilon _ { \mu } , \epsilon _ { g } , \delta _ { g } , \nu )$ . Under the generator initialization that is sufficiently close according to $\theta ^ { * }$ , we can only observe the discriminator update
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\dot { \psi } = - \frac { \rho } { 2 } \nabla _ { \psi } \mathbb { E } _ { \mu _ { \psi , \theta } } [ \| \nabla _ { x } D ( x ; \psi ) \| ^ { 2 } ]
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
since $\mathbb { E } _ { p _ { d } } [ D ( x ; \psi ) ] - \mathbb { E } _ { p _ { \theta } } [ D ( x ; \psi ) ] = 0$ for any $\psi$ and $| \theta - \theta ^ { * } | < \mathrm { m i n } ( \epsilon _ { \mu } , \epsilon _ { g } , \delta _ { g } , \nu )$ . The discriminator update described above is locally stable system near the equilibrium $\psi = \psi ^ { * }$ since the Jacobian of the update on $\psi$ is given as $- \rho Q$ and the zero eigenvalues can be ignored in a similar manner to the previous step. Therefore, the given system is stable near the equilibrium.
|
| 485 |
+
|
| 486 |
+
Suppose that $T _ { D }$ is empty. Given that $N ( Q ^ { T } ) \subset N ( R ^ { T } ) .$ , $R = 0$ , then the results are similar to those presented above, but our goal is to show that $( \psi , \theta )$ is an equilibrium point, where $( \psi , \theta )$ is sufficiently close to the original equilibrium point. We note that $( \psi ^ { * } , \theta )$ is also an equilibrium point that satisfies the assumptions.
|
| 487 |
+
|
| 488 |
+
By Assumption 2, $h ( \psi ) = h ( \psi ^ { * } ) = 0$ for $| \psi - \psi ^ { * } | < \xi$ , which implies that $\nabla _ { x } D ( x ; \psi ) = 0$ for $x \in s u p p ( \mu _ { \psi , \theta ^ { * } } ) = s u p p ( \mu ^ { * } )$ and $| \psi - \psi ^ { * } | < \xi$ . Thus, we obtain
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { \mu _ { \psi , \theta ^ { * } } } \big [ \nabla _ { \psi x } ^ { T } D ( \boldsymbol { x } ; \psi ) \nabla _ { x } D ( \boldsymbol { x } ; \psi ) \big ] = 0 } \\ { \displaystyle \frac { \rho } { 2 } \int _ { s u p p ( \mu ^ { * } ) } \big \| \nabla _ { x } D \big \| ^ { 2 } d \mu _ { \psi , \theta ^ { * } } ^ { \prime } d \boldsymbol { x } = 0 } \end{array}
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
By Assumption 4, $\mathbb { E } _ { p _ { d } } [ \nabla _ { \psi } D ( x ; \psi ) ] - \mathbb { E } _ { p _ { \theta ^ { * } } } [ \nabla _ { \psi } D ( x ; \psi ) ] = 0$ since $p _ { d } = p _ { \theta ^ { \ast } }$ . In addition,
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\dot { \theta } = \frac { \partial } { \partial \theta } \int _ { \mathcal { X } } D ( x ; \psi ) d p _ { \theta } \bigg | _ { \theta = \theta ^ { * } } = \int _ { \mathcal { Z } } \nabla _ { \theta } ^ { T } G ( z ; \theta ^ { * } ) \nabla _ { x } D ( G ( z ; \theta ^ { * } ) ; \psi ) p _ { l a t e n t } ( z ) d z = 0
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
Therefore, the point $( \psi , \theta ^ { * } )$ with $| \psi - \psi ^ { * } | < \operatorname* { m i n } ( \xi , \delta _ { d } )$ is an equilibrium point. From Assumption 4, $D ( x ; \psi )$ is an equilibrium discriminator, and thus $D ( x ; \psi )$ is already an optimal discriminator for $| \psi - \psi ^ { * } | < \operatorname* { m i n } ( \xi , \delta _ { d } )$ and $p _ { \theta }$ coincides with the data distribution $p _ { d }$ for $| \theta - \bar { \theta } ^ { * } | < \operatorname* { m i n } ( \epsilon _ { \mu } , \epsilon _ { g } , \delta _ { g } )$ , which indicates that every discriminator and generator near $( \psi ^ { * } , \theta ^ { * } )$ is an equilibrium point and this completes the proof of the main theorem. □
|
| 501 |
+
|
| 502 |
+
# APPENDIX D : DETAILED EXPERIMENTAL RESULTS
|
| 503 |
+
|
| 504 |
+

|
| 505 |
+
|
| 506 |
+
Figure 4: 2D example on 8 Gaussians, swissroll, 25 Gaussians datasets. Images generated with 5 penalty measures: $\mu _ { G P } , \mu _ { m i d } , p _ { g } , p _ { d } , \mu _ { g , a n c }$ .
|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
Figure 5: MNIST example. Images generated with $\mu _ { G P } , \mu _ { m i d } , p _ { g } , p _ { d } , \mu _ { g , a n c }$
|
| 510 |
+
|
| 511 |
+

|
| 512 |
+
Figure 6: CIFAR-10 example. Images generated with WGAN, WGAN-GP, $\mu _ { G P } , \mu _ { m i d } , p _ { g } , p _ { d } , \mu _ { g , a n c }$ under the DCGAN architecture.
|
| 513 |
+
|
| 514 |
+

|
| 515 |
+
Figure 7: CIFAR-10 example. Images generated with WGAN, WGAN-GP, $\mu _ { G P } , \mu _ { m i d } , p _ { g } , p _ { d } , \mu _ { g , a n c }$ under the ResNet architecture.
|
md/train/HJWLfGWRb/HJWLfGWRb.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MATRIX CAPSULES WITH EM ROUTING
|
| 2 |
+
|
| 3 |
+
Geoffrey Hinton, Sara Sabour, Nicholas Frosst
|
| 4 |
+
Google Brain
|
| 5 |
+
Toronto, Canada
|
| 6 |
+
{geoffhinton, sasabour, frosst}@google.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
A capsule is a group of neurons whose outputs represent different properties of the same entity. Each layer in a capsule network contains many capsules. We describe a version of capsules in which each capsule has a logistic unit to represent the presence of an entity and a $4 \mathbf { x } 4$ matrix which could learn to represent the relationship between that entity and the viewer (the pose). A capsule in one layer votes for the pose matrix of many different capsules in the layer above by multiplying its own pose matrix by trainable viewpoint-invariant transformation matrices that could learn to represent part-whole relationships. Each of these votes is weighted by an assignment coefficient. These coefficients are iteratively updated for each image using the Expectation-Maximization algorithm such that the output of each capsule is routed to a capsule in the layer above that receives a cluster of similar votes. The transformation matrices are trained discriminatively by backpropagating through the unrolled iterations of EM between each pair of adjacent capsule layers. On the smallNORB benchmark, capsules reduce the number of test errors by $45 \%$ compared to the state-of-the-art. Capsules also show far more resistance to white box adversarial attacks than our baseline convolutional neural network.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Convolutional neural nets are based on the simple fact that a vision system needs to use the same knowledge at all locations in the image. This is achieved by tying the weights of feature detectors so that features learned at one location are available at other locations. Convolutional capsules extend the sharing of knowledge across locations to include knowledge about the part-whole relationships that characterize a familiar shape. Viewpoint changes have complicated effects on pixel intensities but simple, linear effects on the pose matrix that represents the relationship between an object or object-part and the viewer. The aim of capsules is to make good use of this underlying linearity, both for dealing with viewpoint variations and for improving segmentation decisions.
|
| 15 |
+
|
| 16 |
+
Capsules use high-dimensional coincidence filtering: a familiar object can be detected by looking for agreement between votes for its pose matrix. These votes come from parts that have already been detected. A part produces a vote by multiplying its own pose matrix by a learned transformation matrix that represents the viewpoint invariant relationship between the part and the whole. As the viewpoint changes, the pose matrices of the parts and the whole will change in a coordinated way so that any agreement between votes from different parts will persist.
|
| 17 |
+
|
| 18 |
+
Finding tight clusters of high-dimensional votes that agree in a mist of irrelevant votes is one way of solving the problem of assigning parts to wholes. This is non-trivial because we cannot grid the high-dimensional pose space in the way the low-dimensional translation space is gridded to facilitate convolutions. To solve this challenge, we use a fast iterative process called “routingby-agreement” that updates the probability with which a part is assigned to a whole based on the proximity of the vote coming from that part to the votes coming from other parts that are assigned to that whole. This is a powerful segmentation principle that allows knowledge of familiar shapes to derive segmentation, rather than just using low-level cues such as proximity or agreement in color or velocity. An important difference between capsules and standard neural nets is that the activation of a capsule is based on a comparison between multiple incoming pose predictions whereas in a standard neural net it is based on a comparison between a single incoming activity vector and a learned weight vector.
|
| 19 |
+
|
| 20 |
+
# 2 HOW CAPSULES WORK
|
| 21 |
+
|
| 22 |
+
Neural nets typically use simple non-linearities in which a non-linear function is applied to the scalar output of a linear filter. They may also use softmax non-linearities that convert a whole vector of logits into a vector of probabilities. Capsules use a much more complicated non-linearity that converts the whole set of activation probabilities and poses of the capsules in one layer into the activation probabilities and poses of capsules in the next layer.
|
| 23 |
+
|
| 24 |
+
A capsule network consists of several layers of capsules. The set of capsules in layer $L$ is denoted as $\Omega _ { L }$ . Each capsule has a 4x4 pose matrix, $M$ , and an activation probability, $a$ . These are like the activities in a standard neural net: they depend on the current input and are not stored. In between each capsule $i$ in layer $L$ and each capsule $j$ in layer $L + 1$ is a 4x4 trainable transformation matrix, $W _ { i j }$ . These $W _ { i j } { \bf s }$ (and two learned biases per capsule) are the only stored parameters and they are learned discriminatively. The pose matrix of capsule $i$ is transformed by $W _ { i j }$ to cast a vote $V _ { i j } = M _ { i } W _ { i j }$ for the pose matrix of capsule $j$ . The poses and activations of all the capsules in layer $L + 1$ are calculated by using a non-linear routing procedure which gets as input $V _ { i j }$ and $a _ { i }$ for all $i \in \Omega _ { L } , j \in \Omega _ { L + 1 }$ .
|
| 25 |
+
|
| 26 |
+
The non-linear procedure is a version of the Expectation-Maximization procedure. It iteratively adjusts the means, variances, and activation probabilities of the capsules in layer $L + 1$ and the assignment probabilities between all $i \in \Omega _ { L } , j \in \Omega _ { L + 1 }$ . In appendix 1, we give a gentle intuitive introduction to routing-by-agreement and describe in detail how it relates to the EM algorithm for fitting a mixture of Gaussians.
|
| 27 |
+
|
| 28 |
+
# 3 USING EM FOR ROUTING-BY-AGREEMENT
|
| 29 |
+
|
| 30 |
+
Let us suppose that we have already decided on the poses and activation probabilities of all the capsules in a layer and we now want to decide which capsules to activate in the layer above and how to assign each active lower-level capsule to one active higher-level capsule. Each capsule in the higher-layer corresponds to a Gaussian and the pose of each active capsule in the lower-layer (converted to a vector) corresponds to a data-point (or a fraction of a data-point if the capsule is partially active).
|
| 31 |
+
|
| 32 |
+
Using the minimum description length principle we have a choice when deciding whether or not to activate a higher-level capsule. Choice 0: if we do not activate it, we must pay a fixed cost of $- \beta _ { u }$ per data-point for describing the poses of all the lower-level capsules that are assigned to the higher-level capsule. This cost is the negative log probability density of the data-point under an improper uniform prior. For fractional assignments we pay that fraction of the fixed cost. Choice 1: if we do activate the higher-level capsule we must pay a fixed cost of $- \beta _ { a }$ for coding its mean and variance and the fact that it is active and then pay additional costs, pro-rated by the assignment probabilities, for describing the discrepancies between the lower-level means and the values predicted for them when the mean of the higher-level capsule is used to predict them via the inverse of the transformation matrix. A much simpler way to compute the cost of describing a datapoint is to use the negative log probability density of that datapoint’s vote under the Gaussian distribution fitted by whatever higher-level capsule it gets assigned to. This is incorrect for reasons explained in appendix 1, but we use it because it requires much less computation (also explained in the appendix). The difference in cost between choice 0 and choice 1, is then put through the logistic function on each iteration to determine the higher-level capsule’s activation probability. Appendix 1 explains why the logistic is the correct function to use.
|
| 33 |
+
|
| 34 |
+
Using our efficient approximation for choice 1 above, the incremental cost of explaining a whole data-point $i$ by using an active capsule $j$ that has an axis-aligned covariance matrix is simply the sum over all dimensions of the cost of explaining each dimension, $h$ , of the vote $V _ { i j }$ . This is simply $- l n ( P _ { i | j } ^ { h } )$ where $P _ { i | j } ^ { h }$ is the probability density of the $h ^ { t h }$ component of the vectorized vote $V _ { i j }$ under $j$ ’s Gaussian model for dimension $h$ which has variance $( \sigma _ { j } ^ { h } ) ^ { 2 }$ and mean $\mu _ { j } ^ { h }$ where $\mu _ { j }$ is the vectorized version of $j$ ’s pose matrix $M _ { j }$ .
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
{ \bf \Phi } _ { i \vert j } ^ { o h } = \frac { 1 } { \sqrt { 2 \pi ( \sigma _ { j } ^ { h } ) ^ { 2 } } } \exp \left( - \frac { ( V _ { i j } ^ { h } - \mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \sigma _ { j } ^ { h } ) ^ { 2 } } \right) , \quad \quad \quad l n ( P _ { i \vert j } ^ { h } ) = - \frac { ( V _ { i j } ^ { h } - \mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \sigma _ { j } ^ { h } ) ^ { 2 } } - l n ( \sigma _ { j } ^ { h } ) - l n ( 2 \pi ) / 2
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
Summing over all lower-level capsules for a single dimension, $h$ , of $j$ we get:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\begin{array} { l } { { c o s t _ { j } ^ { h } = \displaystyle \sum _ { i } - r _ { i j } l n ( P _ { i | j } ^ { h } ) } } \\ { { = \displaystyle \frac { \sum _ { i } r _ { i j } ( V _ { i j } ^ { h } - \mu _ { j } ^ { h } ) ^ { 2 } } { 2 ( \sigma _ { j } ^ { h } ) ^ { 2 } } + \left( l n ( \sigma _ { j } ^ { h } ) + \displaystyle \frac { l n ( 2 \pi ) } { 2 } \right) \sum _ { i } r _ { i j } } } \\ { { = \left( l n ( \sigma _ { j } ^ { h } ) + \displaystyle \frac { 1 } { 2 } + \frac { l n ( 2 \pi ) } { 2 } \right) \sum _ { i } r _ { i j } } } \end{array}
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\sum _ { i } r _ { i j }$ is the amount of data assigned to $j$ and $V _ { i j } ^ { h }$ is the value on dimension $h$ of $V _ { i j }$ . Turningon capsule $j$ increases the description length for the means of the lower-level capsules assigned to $j$ from $- \beta _ { u }$ per lower-level capsule to $- \beta _ { a }$ plus the sum of the cost over all dimensions so we define the activation function of capsule $j$ to be:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
a _ { j } = l o g i s t i c \left( \lambda \left( \beta _ { a } - \beta _ { u } \sum _ { i } r _ { i j } - \sum _ { h } c o s t _ { j } ^ { h } \right) \right)
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\beta _ { a }$ is the same for all capsules and $\lambda$ is an inverse temperature parameter. We learn $\beta _ { a }$ and $\beta _ { u }$ discriminatively and set a fixed schedule for $\lambda$ as a hyper-parameter.
|
| 53 |
+
|
| 54 |
+
For finalizing the pose parameters and activations of the capsules in layer $L + 1$ we run the EM algorithm for few iterations (normally 3) after the pose parameters and activations have already been finalized in layer $L$ . The non-linearity implemented by a whole capsule layer is a form of cluster finding using the EM algorithm, so we call it EM Routing.
|
| 55 |
+
|
| 56 |
+
Procedure 1 Routing algorithm returns activation and pose of the capsules in layer $L + 1$ given the activations and votes of capsules in layer $L$ . $V _ { i j } ^ { h }$ is the $h ^ { t h }$ dimension of the vote from capsule $i$ with activation $a _ { i }$ in layer $L$ to capsule $j$ in layer $\boldsymbol { L } + 1$ . $\beta _ { a }$ , $\beta _ { u }$ are learned discriminatively and the inverse temperature $\lambda$ increases at each iteration with a fixed schedule.
|
| 57 |
+
|
| 58 |
+
<table><tr><td colspan="2">1: procedure EM RoUTING(a, V)</td></tr><tr><td>2:</td><td>∀i∈ΩL,j∈ΩL+1:Rij←1/|ΩL+1l</td></tr><tr><td>3:</td><td>for t iterations do</td></tr><tr><td>4:</td><td>∀j ∈ ΩL+1: M-STEP(a,R,V,j)</td></tr><tr><td>5: return a, M</td><td>∀i∈ΩL:E-STEP(μ,σ,a,V,i)</td></tr><tr><td>1: procedure M-sTEP(a,R, V, j)</td><td>for one higher-level capsule, j</td></tr><tr><td>2:</td><td>∀i∈ΩL:Rij ←Rij *ai</td></tr><tr><td>3:</td><td>Ah:←RV ∑Rij</td></tr><tr><td>4:</td><td>Vh:(o)²∑Rij(V-μ)²</td></tr><tr><td>5:</td><td>∑Rij costh ←(βu+log(o))∑Rij</td></tr><tr><td>6:</td><td>aj ← logistic(λ(βa -∑ncostʰ))</td></tr><tr><td>1: procedure E-STEP(μ,σ,a,V,i)</td><td></td></tr><tr><td>1</td><td>>for one lower-level capsule, i H exp £h</td></tr><tr><td>2: ∀j ∈ΩL+1: Pj ← √II 2π()2</td><td>2()</td></tr><tr><td>3:</td><td>j ∈ΩL+1: Rij ← ∑κeΩL+1 ajpj akPk</td></tr></table>
|
| 59 |
+
|
| 60 |
+
# 4 THE CAPSULES ARCHITECTURE
|
| 61 |
+
|
| 62 |
+
The general architecture of our model is shown in Fig. 1. The model starts with a 5x5 convolutional layer with 32 channels $\scriptstyle ( \mathrm { A } = 3 2 )$ and a stride of 2 with a ReLU non-linearity. All the other layers are capsule layers starting with the primary capsule layer. The 4x4 pose of each of the $\scriptstyle \mathbf { B } = 3 2$ primary capsule types is a learned linear transformation of the output of all the lower-layer ReLUs centered at that location. The activations of the primary capsules are produced by applying the sigmoid function to the weighted sums of the same set of lower-layer ReLUs.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 1: A network with one ReLU convolutional layer followed by a primary convolutional capsule layer and two more convolutional capsule layers.
|
| 66 |
+
|
| 67 |
+
The primary capsules are followed by two $3 { \bf x } 3$ convolutional capsule layers $\left( \mathrm { K } \mathrm { = } 3 \right)$ , each with 32 capsule types $\mathrm { ( C = D } { = } 3 2$ ) with strides of 2 and one, respectively. The last layer of convolutional capsules is connected to the final capsule layer which has one capsule per output class.
|
| 68 |
+
|
| 69 |
+
When connecting the last convolutional capsule layer to the final layer we do not want to throw away information about the location of the convolutional capsules but we also want to make use of the fact that all capsules of the same type are extracting the same entity at different positions. We therefore share the transformation matrices between different positions of the same capsule type and add the scaled coordinate (row, column) of the center of the receptive field of each capsule to the first two elements of the right-hand column of its vote matrix. We refer to this technique as Coordinate Addition. This should encourage the shared final transformations to produce values for those two elements that represent the fine position of the entity relative to the center of the capsule’s receptive field.
|
| 70 |
+
|
| 71 |
+
The routing procedure is used between each adjacent pair of capsule layers. For convolutional capsules, each capsule in layer $L + 1$ sends feedback only to capsules within its receptive field in layer $L$ . Therefore each convolutional instance of a capsule in layer $L$ receives at most kernel size X kernel size feedback from each capsule type in layer $L + 1$ . The instances closer to the border of the image receive fewer feedbacks with corner ones receiving only one feedback per capsule type in layer $L + 1$ .
|
| 72 |
+
|
| 73 |
+
# 4.1 SPREAD LOSS
|
| 74 |
+
|
| 75 |
+
In order to make the training less sensitive to the initialization and hyper-parameters of the model, we use “spread loss” to directly maximize the gap between the activation of the target class $\left( { { a } _ { t } } \right)$ and the activation of the other classes. If the activation of a wrong class, $a _ { i }$ , is closer than the margin, $m$ , to $a _ { t }$ then it is penalized by the squared distance to the margin:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
L _ { i } = ( m a x ( 0 , m - ( a _ { t } - a _ { i } ) ) ^ { 2 } , L = \sum _ { i \neq t } L _ { i }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
By starting with a small margin of 0.2 and linearly increasing it during training to 0.9, we avoid dead capsules in the earlier layers. Spread loss is equivalent to squared Hinge loss with $m = 1$ . Guermeur & Monfrini (2011) studies a variant of this loss in the context of multi class SVMs.
|
| 82 |
+
|
| 83 |
+
# 5 EXPERIMENTS
|
| 84 |
+
|
| 85 |
+
The smallNORB dataset (LeCun et al. (2004)) has gray-level stereo images of 5 classes of toys: airplanes, cars, trucks, humans and animals. There are 10 physical instances of each class which are painted matte green. 5 physical instances of a class are selected for the training data and the other 5 for the test data. Every individual toy is pictured at 18 different azimuths (0-340), 9 elevations and 6 lighting conditions, so the training and test sets each contain 24,300 stereo pairs of 96x96 images. We selected smallNORB as a benchmark for developing our capsules system because it is carefully designed to be a pure shape recognition task that is not confounded by context and color, but it is much closer to natural images than MNIST.
|
| 86 |
+
|
| 87 |
+
Table 1: The effect of varying different components of our capsules architecture on smallNORB.
|
| 88 |
+
|
| 89 |
+
<table><tr><td>Routing iterations</td><td>Pose structure</td><td>Loss</td><td>Coordinate Addition</td><td>Test error rate</td></tr><tr><td>1</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>9.7%</td></tr><tr><td>2</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>2.2%</td></tr><tr><td>3</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>1.8%</td></tr><tr><td>5</td><td>Matrix</td><td>Spread</td><td>Yes</td><td>3.9%</td></tr><tr><td>3</td><td>Vector</td><td>Spread</td><td>Yes</td><td>2.9%</td></tr><tr><td>3</td><td>Matrix</td><td>Spread</td><td>No</td><td>2.6%</td></tr><tr><td>3</td><td>Vector</td><td>Spread</td><td>No</td><td>3.2%</td></tr><tr><td>3</td><td>Matrix</td><td>Margin1</td><td>Yes</td><td>3.2%</td></tr><tr><td>3</td><td>Matrix</td><td>CrossEnt</td><td>Yes</td><td>5.8%</td></tr><tr><td colspan="3">Baseline CNN with 4.2M parameters</td><td></td><td>5.2%</td></tr><tr><td colspan="4">CNN of Ciresan et al. (2O11) with extra input images & deformations</td><td>2.56%</td></tr><tr><td colspan="3">Our Best model (third row), with multiple crops during testing</td><td></td><td>1.4%</td></tr></table>
|
| 90 |
+
|
| 91 |
+
We downsample smallNORB to $4 8 \times 4 8$ pixels and normalize each image to have zero mean and unit variance. During training, we randomly crop $3 2 \times 3 2$ patches and add random brightness and contrast to the cropped images. During test, we crop a $3 2 \times 3 2$ patch from the center of the image and achieve $\mathbf { 1 . 8 \% }$ test error on smallNORB. If we average the class activations over multiple crops at test time we achieve $1 . 4 \%$ . The best reported result on smallNORB without using meta data is $2 . 5 6 \%$ (Cires¸an et al. (2011)). To achieve this, they added two additional stereo pairs of input images that are created by using an on-center off-surround filter and an off-center on-surround filter. They also applied affine distortions to the images. Our work also beats the Sabour et al. (2017) capsule work which achieves $2 . 7 \%$ on smallNORB. We also tested our model on NORB which is a jittered version of smallNORB with added background and we achieved a $2 . 6 \%$ error rate which is on par with the state-of-the-art of $2 . 7 \%$ (Ciresan et al. (2012)).
|
| 92 |
+
|
| 93 |
+
As the baseline for our experiments on generalization to novel viewpoints we train a CNN which has two convolutional layers with 32 and 64 channels respectively. Both layers have a kernel size of 5 and a stride of 1 with a $2 \times 2$ max pooling. The third layer is a 1024 unit fully connected layer with dropout and connects to the 5-way softmax output layer. All hidden units use the ReLU non-linearity. We use the same image preparation for the CNN baseline as described above for the capsule network. Our baseline CNN was the result of an extensive hyperparameter search over filter sizes, numbers of channels and learning rates.
|
| 94 |
+
|
| 95 |
+
The CNN baseline achieves $5 . 2 \%$ test error rate on smallNORB and has $4 . 2 \mathbf { M }$ parameters. We deduce that the Cires¸an et al. (2011) network has $2 . 7 \mathbf { M }$ parameters. By using small matrix multiplies, we reduced the number of parameters by a factor of 15 to 310K compared with our baseline CNN (and a factor of 9 w.r.t Cires¸an et al. (2011)). A smaller capsule network of $A = 6 4 , B = 8 , C =$ $D = 1 6$ with only 68K trainable parameters achieves $2 . 2 \%$ test error rate which also beats the prior state-of-the-art.
|
| 96 |
+
|
| 97 |
+
Fig. 2 shows how EM routing adjusts the vote assignments and the capsule means to find the tight clusters in the votes. The histograms show the distribution of vote distances to the mean (pose) of each class capsule during routing iterations. At the first iteration, votes are distributed equally between 5 final layer capsules. Therefore, all capsules receive votes closer than 0.05 to their calculated mean. In the second iteration, the assignment probability for agreeing votes increases. Therefore, most of the votes are assigned to the detected clusters, the animal and human class in the middle row, and the other capsules only receive scattered votes which are further than 0.05 from the calculated mean. The zoomed-out version of Fig. 2 in the Appendix shows the full distribution of vote distances at each routing iteration.
|
| 98 |
+
|
| 99 |
+
Instead of using our MDL-derived capsule activation term which computes a separate activation probability per capsule, we could view the capsule activations like the mixing proportions in a mixture of Gaussians and set them to be proportional to the sum of the assignment probabilities of a capsule and to sum to 1 over all the capsules in a layer. This increases the test error rate on smallNORB to $4 . 5 \%$ . Tab. 1 summarizes the effects of the number of routing iterations, the type of loss, and the use of matrices rather than vectors for the poses.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 2: Histogram of distances of votes to the mean of each of the 5 final capsules after each routing iteration. Each distance point is weighted by its assignment probability. All three images are selected from the smallNORB test set. The routing procedure correctly routes the votes in the truck and the human example. The plane example shows a rare failure case of the model where the plane is confused with a car in the third routing iteration. The histograms are zoomed-in to visualize only votes with distances less than 0.05. Fig. B.2 shows the complete histograms for the ”human” capsule without clipping the $\mathbf { X } ^ { } -$ -axis or fixing the scale of the y-axis.
|
| 103 |
+
|
| 104 |
+
Table 2: A comparison of the smallNORB test error rate of the baseline CNN and the capsules model on novel viewpoints when both models are matched on error rate for familiar viewpoints.
|
| 105 |
+
|
| 106 |
+
<table><tr><td rowspan="2">Test set</td><td colspan="2">Azimuth</td><td colspan="2">Elevation</td></tr><tr><td>CNN</td><td>Capsules</td><td>1 CNN</td><td>Capsules</td></tr><tr><td>Novel viewpoints</td><td>20%</td><td>13.5%</td><td>17.8%</td><td>12.3%</td></tr><tr><td>Familiar viewpoints</td><td>3.7%</td><td>3.7%</td><td>4.3%</td><td>4.3%</td></tr></table>
|
| 107 |
+
|
| 108 |
+
The same capsules architecture as Fig. 1 achieves $0 . 4 4 \%$ test error rate on MNIST. If the number of channels in the first hidden layer is increased to 256, it achieves $1 1 . 9 \%$ test error rate on Cifar10 (Krizhevsky & Hinton (2009)).
|
| 109 |
+
|
| 110 |
+
# 5.1 GENERALIZATION TO NOVEL VIEWPOINTS
|
| 111 |
+
|
| 112 |
+
A more severe test of generalization is to use a limited range of viewpoints for training and to test on a much wider range. We trained both our convolutional baseline and our capsule model on one-third of the training data containing azimuths of (300, 320, 340, 0, 20, 40) and tested on the two-thirds of the test data that contained azimuths from 60 to 280. In a separate experiment, we trained on the 3 smaller elevations and tested on the 6 larger elevations.
|
| 113 |
+
|
| 114 |
+
It is hard to decide if the capsules model is better at generalizing to novel viewpoints because it achieves better test accuracy on all viewpoints. To eliminate this confounding factor, we stopped training the capsule model when its performance matched the baseline CNN on the third of the test set that used the training viewpoints. Then, we compared these matched models on the twothirds of the test set with novel viewpoints. Results in Tab. 2 show that compared with the baseline CNN capsules with matched performance on familiar viewpoints reduce the test error rate on novel viewpoints by about $3 0 \%$ for both novel azimuths and novel elevations.
|
| 115 |
+
|
| 116 |
+
# 6 ADVERSARIAL ROBUSTNESS
|
| 117 |
+
|
| 118 |
+
There is growing interest in the vulnerability of neural networks to adversarial examples; inputs that have been slightly changed by an attacker to trick a neural net classifier into making the wrong classification. These inputs can be created in a variety of ways, but straightforward strategies such as FGSM (Goodfellow et al. (2014)) have been shown to drastically decrease accuracy in convolutional neural networks on image classification tasks. We compare our capsule model and a traditional convolutional model on their ability to withstand such attacks.
|
| 119 |
+
|
| 120 |
+
FGSM computes the gradient of the loss w.r.t. each pixel intensity and then changes the pixel intensity by a fixed amount $\epsilon$ in the direction that increases the loss. So the changes only depend on the sign of the gradient at each pixel. This can be extended to a targeted attack by updating the input to maximize the classification probability of a particular wrong class. We generated adversarial attacks using FGSM because it has only one hyper-parameter and it is easy to compare models that have very different gradient magnitudes. To test the robustness of our model, we generated adversarial images from the test set using a fully trained model. We then reported the accuracy of the model on these images.
|
| 121 |
+
|
| 122 |
+
We found that our model is significantly less vulnerable to both general and targeted FGSM adversarial attacks; a small $\epsilon$ can be used to reduce a convolutional model’s accuracy much more than an equivalent $\epsilon$ can on the capsule model (Fig. 3). It should also be noted that the capsule model’s accuracy after the untargeted attack never drops below chance $( 2 0 \% )$ whereas the convolutional model’s accuracy is reduced to significantly below chance with an $\epsilon$ as small as 0.2.
|
| 123 |
+
|
| 124 |
+
We also tested our model on the slightly more sophisticated adversarial attack of the Basic Iterative Method (Kurakin et al. (2016)), which is simply the aforementioned attack except it takes multiple smaller steps when creating the adversarial image. Here too we find that our model is much more robust to the attack than the traditional convolutional model.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 3: Accuracy against $\epsilon$ after an adversarial attack (left) and Success Rate after a targeted adversarial attack (right). The targeted attack results were evaluated by averaging the success rate after the attack for each of the 5 possible classes.
|
| 128 |
+
|
| 129 |
+
It has been shown that some robustness to adversarial attacks in models can be due to simple numerical instability in the calculation of the gradient Brendel & Bethge (2017). To ensure that this was not the sole cause of our model’s robustness, we calculated the percentage of zero values in the gradient with respect to the image in the capsule model and found it to be smaller than that of the CNN. Furthermore, the capsule gradients, although smaller that those of the CNN, are only smaller by 2 orders of magnitude, as opposed to 16 orders of magnitude seen in Brendel & Bethge (2017)’s work.
|
| 130 |
+
|
| 131 |
+
Finally we tested our model’s robustness to black box attacks by generating adversarial examples with a CNN and testing them on both our capsule model and a different CNN. We found that the capsule model did not perform noticeably better at this task than the CNN.
|
| 132 |
+
|
| 133 |
+
# 7 RELATED WORK
|
| 134 |
+
|
| 135 |
+
Among the multiple recent attempts at improving the ability of neural networks to deal with viewpoint variations, there are two main streams. One stream attempts to achieve viewpoint invariance and the other aims for viewpoint equivariance. The work presented by Jaderberg et al. (2015)), Spatial Transformer Networks, seeks viewpoint invariance by changing the sampling of CNNs according to a selection of affine transformations. De Brabandere et al. (2016) extends spatial transformer networks where the filters are adapted during inference depending on the input. They generate different filters for each locality in the feature map rather than applying the same transformation to all filters. Their approach is a step toward input covariance detection from traditional pattern matching frameworks like standard CNNs (LeCun et al. (1990)). Dai et al. (2017) improves upon spatial transformer networks by generalizing the sampling method of filters. Our work differs substantially in that a unit is not activated based on the matching score with a filter (either fixed or dynamically changing during inference). In our case, a capsule is activated only if the transformed poses coming from the layer below match each other. This is a more effective way to capture covariance and leads to models with many fewer parameters that generalize better.
|
| 136 |
+
|
| 137 |
+
The success of CNNs has motivated many researchers to extend the translational equivariance built in to CNNs to include rotational equivariance (Cohen & Welling (2016), Dieleman et al. (2016), Oyallon & Mallat (2015)). The recent approach in Harmonic Networks (Worrall et al. (2017)) achieves rotation equivariant feature maps by using circular harmonic filters and returning both the maximal response and orientation using complex numbers. This shares the basic representational idea of capsules: By assuming that there is only one instance of the entity at a location, we can use several different numbers to represent its properties. They use a fixed number of streams of rotation orders. By enforcing the equality of the sum of rotation orders along any path, they achieve patch-wise rotation equivariance. This approach is more parameter-efficient than data augmentation approaches, duplicating feature maps, or duplicating filters (Fasel & Gatica-Perez (2006), Laptev et al. (2016)). Our approach encodes general viewpoint equivariance rather than only affine 2D rotations. Symmetry networks (Gens & Domingos (2014)) use iterative Lucas-Kanade optimization to find poses that are supported by the most low-level features. Their key weakness is that the iterative algorithm always starts at the same pose, rather than the mean of the bottom-up votes.
|
| 138 |
+
|
| 139 |
+
Lenc & Vedaldi (2016) proposes a feature detection mechanism (DetNet) that is equivariant to affine transformations. DetNet is designed to detect the same points in the image under different viewpoint variations. This effort is orthogonal to our work but DetNet might be a good way to implement the de-rendering first-stage that activates the layer of primary capsules.
|
| 140 |
+
|
| 141 |
+
Our routing algorithm can be seen as an attention mechanism. In this view, it is related to the work of Gregor et al. (2015), where they improved the decoder performance in a generative model by using Gaussian kernels to attend to different parts of the feature map generated by the encoder. Vaswani et al. (2017) uses a softmax attention mechanism to match parts of the query sequence to parts of the input sequence for the translation task and when generating an encoding for the query. They show improvement upon previous translation efforts using recurrent architectures. Our algorithm has attention in the opposite direction. The competition is not between the lower-level capsules that a higher-level capsule might attend to. It is between the higher-level capsules that a lower-level capsule might send its vote to.
|
| 142 |
+
|
| 143 |
+
# 7.1 PREVIOUS WORK ON CAPSULES
|
| 144 |
+
|
| 145 |
+
Hinton et al. (2011) used a transformation matrix in a transforming autoencoder that learned to transform a stereo pair of images into a stereo pair from a slightly different viewpoint. However, that system requires the transformation matrix to be supplied externally. More recently, routing-byagreement was shown to be effective for segmenting highly overlapping digits (Sabour et al. (2017)), but that system has several deficiencies that we have overcome in this paper:
|
| 146 |
+
|
| 147 |
+
1. It uses the length of the pose vector to represent the probability that the entity represented by a capsule is present. To keep the length less than 1, requires an unprincipled non-linearity and this prevents the existence of any sensible objective function that is minimized by the iterative routing procedure.
|
| 148 |
+
2. It uses the cosine of the angle between two pose vectors to measure their agreement. Unlike the negative log variance of a Gaussian cluster, the cosine saturates at 1, which makes it insensitive to the difference between a quite good agreement and a very good agreement.
|
| 149 |
+
3. It uses a vector of length $n$ rather than a matrix with $n$ elements to represent a pose, so its transformation matrices have $n ^ { 2 }$ parameters rather than just $n$ .
|
| 150 |
+
|
| 151 |
+
# 8 CONCLUSION
|
| 152 |
+
|
| 153 |
+
Building on the work of Sabour et al. (2017), we have proposed a new type of capsule system in which each capsule has a logistic unit to represent the presence of an entity and a 4x4 pose matrix to represent the pose of that entity. We also introduced a new iterative routing procedure between capsule layers, based on the EM algorithm, which allows the output of each lower-level capsule to be routed to a capsule in the layer above in such a way that active capsules receive a cluster of similar pose votes. This new system achieves significantly better accuracy on the smallNORB data set than the state-of-the-art CNN, reducing the number of errors by $45 \%$ . We have also shown it to be significantly more robust to white box adversarial attacks than a baseline CNN.
|
| 154 |
+
|
| 155 |
+
SmallNORB is an ideal data-set for developing new shape-recognition models precisely because it lacks many of the additional features of images in the wild. Now that our capsules model works well on NORB, we plan to implement an efficient version to test much larger models on much larger data-sets such as ImageNet.
|
| 156 |
+
|
| 157 |
+
ACKNOWLEDGMENTS Thanks to Robert Gens, Eric Langlois, Taco Cohen and anonymous commentators for helpful discussions and to everyone who made TensorFlow.
|
| 158 |
+
|
| 159 |
+
# REFERENCES
|
| 160 |
+
|
| 161 |
+
Wieland Brendel and Matthias Bethge. Comment on” biologically inspired protection of deep networks from adversarial attacks”. arXiv preprint arXiv:1704.01547, 2017.
|
| 162 |
+
|
| 163 |
+
Dan Ciresan, Ueli Meier, and Jurgen Schmidhuber. Multi-column deep neural networks for image ¨ classification. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pp. 3642–3649. IEEE, 2012.
|
| 164 |
+
|
| 165 |
+
Dan C Cires¸an, Ueli Meier, Jonathan Masci, Luca M Gambardella, and Jurgen Schmidhuber. High- ¨ performance neural networks for visual object classification. arXiv preprint arXiv:1102.0183, 2011.
|
| 166 |
+
|
| 167 |
+
Taco Cohen and Max Welling. Group equivariant convolutional networks. In International Conference on Machine Learning, pp. 2990–2999, 2016.
|
| 168 |
+
|
| 169 |
+
Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. arXiv preprint arXiv:1703.06211, 2017.
|
| 170 |
+
|
| 171 |
+
Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. In Neural Information Processing Systems (NIPS), 2016.
|
| 172 |
+
|
| 173 |
+
Sander Dieleman, Jeffrey De Fauw, and Koray Kavukcuoglu. Exploiting cyclic symmetry in convolutional neural networks. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pp. 1889–1898. JMLR.org, 2016. URL http://dl.acm.org/citation.cfm?id=3045390.3045590.
|
| 174 |
+
|
| 175 |
+
Beat Fasel and Daniel Gatica-Perez. Rotation-invariant neoperceptron. In Pattern Recognition, 2006. ICPR 2006. 18th International Conference on, volume 3, pp. 336–339. IEEE, 2006.
|
| 176 |
+
|
| 177 |
+
Robert Gens and Pedro M Domingos. Deep symmetry networks. In Advances in neural information processing systems, pp. 2537–2545, 2014.
|
| 178 |
+
|
| 179 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 180 |
+
|
| 181 |
+
Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. In International Conference on Machine Learning, pp. 1462–1471, 2015.
|
| 182 |
+
|
| 183 |
+
Yann Guermeur and Emmanuel Monfrini. A quadratic loss multi-class svm for which a radius– margin bound applies. Informatica, 22(1):73–96, 2011.
|
| 184 |
+
|
| 185 |
+
Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
|
| 186 |
+
|
| 187 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In Advances in Neural Information Processing Systems, pp. 2017–2025, 2015.
|
| 188 |
+
|
| 189 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 190 |
+
|
| 191 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 192 |
+
|
| 193 |
+
Dmitry Laptev, Nikolay Savinov, Joachim M Buhmann, and Marc Pollefeys. Ti-pooling: transformation-invariant pooling for feature learning in convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 289–297, 2016.
|
| 194 |
+
|
| 195 |
+
Yann LeCun, Bernhard E Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne E Hubbard, and Lawrence D Jackel. Handwritten digit recognition with a back-propagation network. In Advances in neural information processing systems, pp. 396–404, 1990.
|
| 196 |
+
|
| 197 |
+
Yann LeCun, Fu Jie Huang, and Leon Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In Computer Vision and Pattern Recognition, 2004. CVPR 2004. Proceedings of the 2004 IEEE Computer Society Conference on, volume 2, pp. II–104. IEEE, 2004.
|
| 198 |
+
|
| 199 |
+
Karel Lenc and Andrea Vedaldi. Learning covariant feature detectors. In Computer Vision–ECCV 2016 Workshops, pp. 100–117. Springer, 2016.
|
| 200 |
+
|
| 201 |
+
Edouard Oyallon and Stephane Mallat. Deep roto-translation scattering for object classification. ´ In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2865– 2873, 2015.
|
| 202 |
+
|
| 203 |
+
Sara Sabour, Nicholas Fross, and Geoffrey E Hinton. Dynamic routing between capsules. In Neural Information Processing Systems (NIPS), 2017.
|
| 204 |
+
|
| 205 |
+
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 (NIPS), 2017.
|
| 206 |
+
|
| 207 |
+
Daniel E. Worrall, Stephan J. Garbin, Daniyar Turmukhambetov, and Gabriel J. Brostow. Harmonic networks: Deep translation and rotation equivariance. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
|
| 208 |
+
|
| 209 |
+
# A APPENDIX 1: AN INTUITIVE EXPLANATION OF THE COST FUNCTION THATIS MINIMIZED DURING DYNAMIC ROUTING
|
| 210 |
+
|
| 211 |
+
Dynamic routing is performed between two adjacent layers of capsules. We will refer to these layers as the higher-level and the lower-level. We complete the routing between one pair of layers before starting the routing between the next pair of layers. The routing process has a strong resemblance to fitting a mixture of Gaussians using EM, where the higher-level capsules play the role of the Gaussians and the means of the activated lower-level capsules for a single input image play the role of the datapoints.
|
| 212 |
+
|
| 213 |
+
We start by explaining the cost function that is minimized when using the EM procedure to fit a mixture of Gaussians. We then derive our dynamic routing procedure by making two modifications to the procedure for fitting a mixture of Gaussians.
|
| 214 |
+
|
| 215 |
+
# A.1 THE COST FUNCTION FOR FITTING A MIXTURE OF GAUSSIANS
|
| 216 |
+
|
| 217 |
+
The EM algorithm for fitting a mixture of Gaussians alternates between an E-step and an M-step. The E-step is used to determine, for each datapoint, the probability with which it is assigned to each of the Gaussians. These assignment probabilities act as weights and the M-step for each Gaussian consists of finding the mean of these weighted datapoints and the variance about that mean. If we are also fitting mixing proportions for each Gaussian, they are set to the fraction of the data assigned to the Gaussian.
|
| 218 |
+
|
| 219 |
+
The M-step holds the assignment probabilities constant and adjusts each Gaussian to maximize the sum of the weighted log probabilities that the Gaussian would generate the datapoints assigned to it. The negative log probability density of a datapoint under a Gaussian can be treated like the energy of a physical system and the M-step is minimizing the expected energy where the expectations are taken using the assignment probabilities.
|
| 220 |
+
|
| 221 |
+
The E-step adjusts the assignment probabilities for each datapoint to minimize a quantity called “free energy” which is the expected energy minus the entropy. We can minimize the expected energy by assigning each datapoint with probabilty 1 to whichever Gaussian gives it the lowest energy (i. e. the highest probability density). We can maximize the entropy by assigning each datapoint with equal probability to every Gaussian ignoring the energy. The best trade-off is to make the assignment probabilities be proportional to $e x p ( - E )$ . This is known as the Boltzmann distribution in physics or the posterior distribution in statistics. Since the $\mathrm { E }$ -step minimizes the free energy w.r.t. the assignment distribution and the M-step leaves the entropy term unchanged and minimizes the expected energy w.r.t. the parameters of the Gaussians, the free energy is an objective function for both steps.
|
| 222 |
+
|
| 223 |
+
The softmax function computes the distribution that minimizes free energy when the logits are viewed as negative energies. So when we use a softmax in our routing procedure to recompute assignment probabilities we are minimizing a free energy. When we refit the Gaussian model of each capsule we are minimizing the same free energy provided the logits of the softmax are based on the same energies as are optimized when refitting the Gaussians. The energies we use are the negative log probabilities of the votes coming from a lower-level capsule under the Gaussian model of a higher-level capsule. These are not the correct energies for maximizing the log probability of the data (see the discussion of determinants below) but this does not matter for convergence so long as we use the same energies for fitting the Gaussians and for revising the assignment probabilities.
|
| 224 |
+
|
| 225 |
+
The objective function minimizes Eq. 4 which consists of:
|
| 226 |
+
|
| 227 |
+
• MDL cost $- \beta _ { a }$ scaled by the probability of presence of capsules in layer $L + 1 ( a _ { j } , j \in$ $\Omega _ { L + 1 } )$ .
|
| 228 |
+
• Negative entropy of activations $a _ { j } , j \in \Omega _ { L + 1 }$ .
|
| 229 |
+
• The expected energy minimized in M-step: sum of the weighted log probabilities $( c o s t _ { j } ^ { h } )$ .
|
| 230 |
+
• Negative entropy of routing softmax assignments $( R _ { i j } )$ ) scaled by the probability of presence of the datapoint $( a _ { i } , i \in \Omega _ { L } )$ .
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
\sum _ { j \in \Omega _ { L + 1 } } { a _ { j } ( - \beta _ { a } ) } + a _ { j } l n ( a _ { j } ) + ( 1 - a _ { j } ) l n ( 1 - a _ { j } ) + \sum _ { h } { c o s t _ { j } ^ { h } } + \beta _ { u } \sum _ { i \in \Omega _ { L } } { r _ { i j } } + \sum _ { i \in \Omega _ { L } } { a _ { i } * r _ { i j } } * l n ( { r _ { i j } } )
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
# A.2 MODIFICATION 1: MIXTURES OF TRANSFORMING GAUSSIANS
|
| 237 |
+
|
| 238 |
+
In a standard mixture of Gaussians, each Gaussian only has a subset of the datapoints assigned to it but all of the Gaussians see the same data. If we view the capsules in the higher-layer as the Gaussians and the means of the active capsules in the lower-layer as the dataset, each Gaussian sees a dataset in which the datapoints have been transformed by transformation matrices and these matrices are different for different Gaussians. For one higher-level capsule, two transformed datapoints may be close together and for another higher-level capsule the same two datapoints may be transformed into points that are far apart. Every Gaussian has a different view of the data. This is a far more effective way to break symmetry than simply initializing the Gaussians with different means and it generally leads to much faster convergence.
|
| 239 |
+
|
| 240 |
+
If the fitting procedure is allowed to modify the transformation matrices, there is a trivial solution in which the transformation matrices all collapse to zero and the transformed data points are all identical. We avoid this problem by learning the transformation matrices discriminatively in an outer loop and we restrict the dynamic routing to modifying the means and variances of the Gaussians and the probabilities with which the datapoints are assigned to the Gaussians.
|
| 241 |
+
|
| 242 |
+
There is a more subtle version of the collapse problem that arises when different transformation matrices have different determinants. Suppose that the datapoints in a particular subset are transformed into a cluster of points in the pose space of higher-level capsule $j$ and they are transformed into a different but equally tight cluster of points in the pose space of higher-level capsule $k$ . It may seem that $j$ and $k$ provide equally good models of this subset of the datapoints, but this is not correct from a generative modeling perspective. If the transformation matrices that map the datapoints into the pose space used by capsule $j$ have bigger determinants, then $j$ provides a better model. This is because the probability density of a point in the pose space of a lower-level capsule gets diluted by the determinant of the relevant transformation matrix when it is mapped to the pose of a higherlevel capsule. This would be a serious issue if we wanted to learn the transformation matrices by maximizing the probability of the observed datapoints, but we are learning the transformation matrices discriminatively so it does not matter. It does, however, mean that when the dynamic routing maximizes the probability of the transformed datapoints it cannot be viewed as also maximizing the probability of the untransformed points.
|
| 243 |
+
|
| 244 |
+
The obvious way to avoid the determinant issue is to take the mean in pose space of a higher-level capsule and to map this mean back into the pose space of each lower-level capsule using the inverses of the transformation matrices. A mean in a higher-level pose space will generally map to different points in the pose spaces of different lower-level capsules because the pose of a whole will generally make different predictions for the poses of the different parts of that whole. If we use the lowerlevel pose space when measuring the misfit between the actual pose of a lower-level capsule and the top-down prediction of that pose obtained by applying the inverse transformation matrix to the mean of the higher-level capsule, the collapse problem disappears and we can base decisions about routing on a fair comparison of how well two different top-down predictions fit the actual pose of the lower-level capsule. We do not use this correct method for two reasons. First, it involves inverting the transformation matrices. Second, it requires a new multiplication by the inverse transformation matrices every time the higher-level mean is modified during the dynamic routing. By measuring misfits in the higher-level pose space we avoid matrix inversions and, more importantly, we avoid having to multiply by the inverses in each iteration of the dynamic routing. This allows us to do many iterations of dynamic routing for the same computational cost as one forward propagation through the transformation matrices.
|
| 245 |
+
|
| 246 |
+
# A.3 MODIFICATION 2: MIXTURES OF SWITCHABLE TRANSFORMING GAUSSIANS
|
| 247 |
+
|
| 248 |
+
In a standard mixture of Gaussians, the modifiable parameters are the means, (co)variances, and mixing proportions and the only thing that distinguishes different Gaussians is the values of these parameters. In a mixture of transforming Gaussians, however, Gaussians also differ in the transformation matrices they use. If these transformation matrices are fixed during the fitting of the other parameters, it makes sense to have a large set of transforming Gaussians available but to only use the small subset of them that have appropriate transformation matrices for explaining the data at hand. Fitting to a dataset will then involve deciding which of the transforming Gaussians should be “switched on”. We therefore give each transforming Gaussian an additional activation parameter which is its probability of being switched on for the current dataset. The activation parameters are not mixing proportions because they do not sum to 1.
|
| 249 |
+
|
| 250 |
+
To set the activation probability for a particular higher-level capsule, $j$ , we compare the description lengths of two different ways of coding the poses of the activated lower-level capsules assigned to $j$ by the routing, as described in section 3. “Description length” is just another term for energy. The difference in the two description lengths (in nats) is put through a logistic function to determine the activation probability of capsule $j$ . The logistic function computes the distribution $( p , 1 - p )$ that minimizes free energy when the difference in the energies of the two alternatives is the argument of the logistic function. The energies we use for determining the activation probabilities are the same energies as we use for fitting the Gaussians and computing the assignment probabilities. So all three steps minimize the same free energy but with respect to different parameters for each step.
|
| 251 |
+
|
| 252 |
+
In some of the explanations above we have implicitly assumed that the lower-level capsules have activities of 1 or 0 and the assignment probabilities computed during the dynamic routing are also 1 or 0. In fact, these numbers are both probabilities and we use the product of these two probabilities as a multiplier on both the baseline description length of each lower-level mean and its alternative description length obtained by making use of the Gaussian fitted by a higher-level capsule.
|
| 253 |
+
|
| 254 |
+
# B SUPPLEMENTARY FIGURES
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
Figure B.1: Sample smallNORB images at different viewpoints. All images in first row are at azimuth 0 and elevation 0. The second row shows a set of images at a higher-elevation and different azimuth.
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure B.2: Log scale histogram of distances between the receiving votes and the center of each of the 5 final capsules. The three rows show the 5 histograms for iterations 1, 2 and 3. Unlike Fig. 2 the histograms are independently log scaled so that small and large counts can both be seen. Also, the considered distance range is 60 and the number of bins is much larger.
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
Figure B.3: Adverserial images generated with FGSM with $\epsilon = 0 . 1$ and $\epsilon = 0 . 4$ on the CNN model and the Capsule model.
|
| 264 |
+
(a) $\epsilon = 0 . 1$ on CNN (b) $\epsilon = 0 . 4$ on CNN (c) $\epsilon = 0 . 1$ on Capsules (d) $\epsilon = 0 . 4$ on Capsules
|
md/train/HkSZyinVG/HkSZyinVG.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMPROVED LEARNING IN CONVOLUTIONAL NEURAL NETWORKS WITH SHIFTED EXPONENTIAL LINEAR UNITS (SHELUS)
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The Exponential Linear Unit (ELU) has been proven to speed up learning and improve the classification performance over activation functions such as ReLU and Leaky ReLU for convolutional neural networks. The reasons behind the improved behavior are that ELU reduces the bias shift, it saturates for large negative inputs and it is continuously differentiable. However, it remains open whether ELU has the optimal shape and we address the quest for a superior activation function.
|
| 8 |
+
|
| 9 |
+
We use a new formulation to tune a piecewise linear activation function during training, to investigate the above question, and learn the shape of the locally optimal activation function. With this tuned activation function, the classification performance is improved and the resulting, learned activation function shows to be ELU-shaped irrespective if it is initialized as a RELU, LReLU or ELU. Interestingly, the learned activation function does not exactly pass through the origin indicating that a shifted ELU-shaped activation function is preferable. This observation leads us to introduce the Shifted Exponential Linear Unit (ShELU) as a new activation function.
|
| 10 |
+
|
| 11 |
+
Experiments on Cifar-100 show that the classification performance is further improved when using the ShELU activation function in comparison with ELU. The improvement is achieved when learning an individual bias shift for each neuron.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
The classification accuracy of Convolutional Neural Networks (CNNs) has improved remarkably over the last years. The reason for the improvement is manifold: more sophisticated layer designs (Lin et al., 2013; He et al., 2016), effective regularization techniques reducing overfitting such as dropout (Srivastava et al., 2014) and batch normalization (Ioffe & Szegedy, 2015), new nonlinear activation functions (Clevert et al., 2015; Trottier et al., 2016), improved weight initialization methods (Glorot & Bengio, 2010; He et al., 2016), data augmentation and large scale data as ImageNet (Deng et al., 2009).
|
| 16 |
+
|
| 17 |
+
In this work, we focus on the nonlinear activation function and its effect on the network learning behavior. Since the introduction of the Rectified Linear Unit (ReLU) (Glorot et al., 2011), it is generally accepted that the activation should be noncontractive to avoid the vanishing gradient problem. The vanishing gradient hampered the learning for the sigmoid and tanh activations. As ReLU is not symmetric, its mean response will be non-negative and will introduce a bias shift for the units in the next layer. The Leaky Rectified Linear Unit (LReLU) (Maas et al., 2013) was proposed to alleviate this bias shift. The LReLU introduces a small linear activation for negative inputs controlled by a constant hyperparameter $\alpha$ .
|
| 18 |
+
|
| 19 |
+
Centering the activation, i.e. reducing the bias shift, is claimed to speed up learning (Le Cun et al., 1991). When the Exponential Linear Unit (ELU) was introduced by Clevert et al. (2015), one of the reason for its success and fast learning capability was claimed to be that the activation saturates for large negative inputs. ELU is also controlled by a hyperparameter that determines the saturation level. Another activation that is saturated for negative inputs is the Shifted ReLU (SReLU). Its shape is similar to ReLU, but the ”kink” is at -1 instead of 0. This reduces the bias shift while being saturated for negative inputs. ELU learns both faster and better than SReLU (Clevert et al.,
|
| 20 |
+
|
| 21 |
+
Table 1: Activation functions.
|
| 22 |
+
|
| 23 |
+
<table><tr><td>Activation</td><td>x>0</td><td>x≤0</td></tr><tr><td rowspan="3">ReLU LReLU SReLU</td><td>X</td><td>0</td></tr><tr><td>X</td><td>αx</td></tr><tr><td>X</td><td>max(x,-1)</td></tr><tr><td rowspan="3">ELU PELU</td><td>X</td><td>α(exp(x)-1)</td></tr><tr><td>X</td><td>α(exp(β x)-1)</td></tr><tr><td></td><td></td></tr></table>
|
| 24 |
+
|
| 25 |
+
2015), but it is not obvious which properties of ELU that actually create this improvement. It may be the smooth exponential decay for small negative inputs and/or the fact that it is continuously differentiable. The question also remains whether the shape of ELU is truly the optimal activation function or if there are other shapes, not yet found, that would further speed up and improve learning. And if they exist, how are they to be found. These were the type of issues that we wanted to explore when starting this work.
|
| 26 |
+
|
| 27 |
+
To improve the learning capabilities for the above mentioned activation functions, tuneable variants of them have been published where the control parameters are tuneable and learned instead of being set as a constant parameter according to their original publications. The Parametric ReLU (PReLU) was introduced by He et al. (2016) where the single control parameter $\alpha$ for LReLU is now learned during training. The Parametric ELU (PELU) was introduced by Trottier et al. (2016), also tuning the control parameters for ELU. Classification results were shown to improve with parameter tuning in both papers. The Scaled ELU (SELU)1 was defined by Klambauer et al. (2017) and is essentially a more simple variant of PELU. The activation functions mentioned so far are defined in Table 1.
|
| 28 |
+
|
| 29 |
+
Piecewise linear activation functions have previously been used by Agostinelli et al. (2014) to improve the performance compared to LReLU. In this work, we use the same concept with tuneable piecewise linear activation functions, but now with the additional objective to investigate the shape of the learned activation function. We apply this approach for nonlinear regression of the optimal activation function. We initialized the activation as linearized versions of ReLU, LReLU and ELU, and they all resulted in the same shape after tuning the network. The ReLU and LReLU activation functions are tuned into an ELU-shaped function whereas the ELU activation function retains its shape. However, we also noted that the tuned ELU-shaped activation function does not exactly pass through the origin. There is a small shift introduced around the origin while retaining the overall shape of the activation function.
|
| 30 |
+
|
| 31 |
+
Based on this observation, we introduce a shifted variant of the ELU activation function. In our experiments, we found that a horizontal shift is favorable and we call this new activation function Shifted Exponential Linear Unit (ShELU). The shift is tuneable during training and the shift is individual for each neuron. Experiments show that the classification performance is improved when allowing this shift in the activation function.
|
| 32 |
+
|
| 33 |
+
Our main contribution is the introduction of the shifted activation function ShELU. The second contribution is a new formulation of a tuneable piecewise linear activation function with constraints to make it continuous. This formulation can be used to explore for other, up to now unseen, shapes of activation functions. The third contribution is experimental support that an ELU-shaped activation function is favorable for learning; the tuneable piecewise linear activation function adapts to an ELU-shape during training, but with a small shift around the origin.
|
| 34 |
+
|
| 35 |
+
# 2 PIECEWISE LINEAR ACTIVATION FUNCTIONS
|
| 36 |
+
|
| 37 |
+
Piecewise linear activation functions were first introduced by Agostinelli et al. (2014). In this work, we use the same idea but now with the additional objective to investigate the shape of the learned activation function. If we initialize the activation function as a linearized version of ReLU, LReLU or ELU, how will the shape be changed during training?
|
| 38 |
+
|
| 39 |
+
Our formulation of a piecewise linear and continuous activation function is different from the one in Agostinelli et al. (2014) and consists of two steps: first a soft histogram is formed as in Felsberg & Granlund (2006), second, a weighted sum of the histogram outputs is computed. The piecewise linear activation functions are learned individually for each neuron.
|
| 40 |
+
|
| 41 |
+
# 2.1 SOFT HISTOGRAM
|
| 42 |
+
|
| 43 |
+
As it has been shown by Felsberg & Granlund (2006), a soft histogram can be represented by two components; one offset component and one histogram component. We use $N$ bins for positive input values and another $N$ bins for negative input values. All bins in the histogram have constant and unity width. The bin limits take integer values and the bin centers are at -0.5, 0.5, 1.5 etc. The concept of the soft histogram is illustrated in Figure 1. In the figure, $N$ is equal to 4, but in the experiments we also used more bins like $N = 8$ and 16. Within a certain activation layer, we extract the maximum and the minimum input over a minibatch. We then linearly scale the positive input values to lie in the range $[ 0 \mathrm { N } ]$ and the negative input values to lie in the range $[ - \mathbf { N } \mathbf { \Lambda } 0 ]$ . Now, as an example, consider two units with scaled input values of 2.68 and -1.80, respectively. For the first unit, the histogram component will be 1 for the bin centered at 2.5 and 0 for all other bins. The corresponding offset component will be 0.18, i.e. the signed distance from the bin center. For the second unit, the histogram component will be 1 for the bin centered at -1.5 and 0 for all other bins. The corresponding offset component will be -0.30. The output from the soft histogram for the two units will be
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
y ( 2 . 6 8 ) = { \left[ \begin{array} { l l l l l l l l l } { 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { 0 . 1 8 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { 1 } & { 0 } \end{array} \right] }
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
y ( - 1 . 8 0 ) = { \left[ \begin{array} { l l l l l l l l l } { 0 } & { 0 } & { - 0 . 3 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { 0 } \\ { 0 } & { 0 } & { 1 } & { 0 } & { 0 } & { 0 } & { 0 } & { 0 } \end{array} \right] }
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
An analytical formulation of the soft histogram can be given as
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
y ( x ) = \left[ { \begin{array} { c } { \left( x - { \mathrm { \mathrm { H o o r } } } ( x ) - 0 . 5 \right) m _ { \nu } ( x ) } \\ { m _ { \nu } ( x ) } \end{array} } \right] _ { 2 \times 2 \mathrm { N } } = \left[ { \begin{array} { c c c c } { o _ { 0 } } & { o _ { 1 } } & { \cdots } & { o _ { 2 \mathrm { N } - 1 } } \\ { h _ { 0 } } & { h _ { 1 } } & { \cdots } & { h _ { 2 \mathrm { N } - 1 } } \end{array} } \right] ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $m _ { \nu } ( x )$ denotes the membership of the respective bins. The membership is 1 if the unit belongs to that bin and 0 for all other bins. The soft histogram output can alternatively be expressed with the offset and histogram components as in the right hand side of (2).
|
| 60 |
+
|
| 61 |
+
For backpropagation we need to compute the derivative of the soft histogram. In our formulation, we consider the membership $m _ { \nu } ( x )$ to be locally constant. This leads to a particular choice of subgradient that is also used in most implementations of max pooling, and it works well in practice. The derivative is computed as
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
{ \frac { d y } { d x } } = \left[ { m _ { \nu } ( x ) } \right] _ { 2 \times 2 \mathrm { N } }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
The output from the soft histogram is independent of the activation function, but any activation function can be represented or approximated by a weighted sum of the histogram output.
|
| 68 |
+
|
| 69 |
+
# 2.2 WEIGHTED SUM
|
| 70 |
+
|
| 71 |
+
Different piecewise linear activation functions can now be realized by varying the weights applied to the soft histogram outputs. For each activation layer, we define a matrix $W$ with weights for the
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 1: Soft histogram decomposed into rectangular and linear basis functions.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 2: Weighted sum examples, ReLU activation (left) and LReLU activation (right).
|
| 78 |
+
|
| 79 |
+
offset components and the histogram components
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
W = \left[ { \begin{array} { l l l l } { w _ { o _ { 0 } } } & { w _ { o _ { 1 } } } & { \cdot \cdot \cdot } & { w _ { o _ { 2 \mathrm { N } - 1 } } } \\ { w _ { h _ { 0 } } } & { w _ { h _ { 1 } } } & { \cdot \cdot \cdot } & { w _ { h _ { 2 \mathrm { N } - 1 } } } \end{array} } \right] \quad .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
To obtain a ReLU activation function, we set all weights to 1 for the offset components on the positive side and 0 for all offset components on the negative side. The weights for the offset components correspond to the slope of the activation function for each linear piece. Further, for a ReLU, we set the weights for the histogram components to 0.5, 1.5, 2.5, etc. on the positive side and to 0 on the negative side. The weights for the histogram components correspond to the bias level at the bin centers of the activation function for each linear piece.
|
| 86 |
+
|
| 87 |
+
To obtain a LReLU activation function, the weights (slopes) for the negative offset components are set to the value for the hyperparameter $\alpha$ , e.g. to 0.1. The weights for the offset components on the positive side are the same as for ReLU. For $\alpha = 0 . 1$ , the weights for the histogram components on the negative side are set to -0.35, -0.25, -0.15 and -0.05, i.e. the bias level at the bin centers.
|
| 88 |
+
|
| 89 |
+
To summarize, the weight matrices for the ReLU and LReLU activation functions are defined as
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
W _ { \mathrm { R e L U } } = \left[ { \begin{array} { c c c c c c c c } { 0 } & { 0 } & { 0 } & { 0 } & { 1 } & { 1 } & { 1 } & { 1 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { 0 . 5 } & { 1 . 5 } & { 2 . 5 } & { 3 . 5 } \end{array} } \right]
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
W _ { \mathrm { L R e L U } } = \left[ \begin{array} { c c c c c c c c } { { 0 . 1 } } & { { 0 . 1 } } & { { 0 . 1 } } & { { 0 . 1 } } & { { 1 } } & { { 1 } } & { { 1 } } & { { 1 } } \\ { { - 0 . 3 5 } } & { { - 0 . 2 5 } } & { { - 0 . 1 5 } } & { { - 0 . 0 5 } } & { { 0 . 5 } } & { { 1 . 5 } } & { { 2 . 5 } } & { { 3 . 5 } } \end{array} \right] .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
The output for the weighted sum is the sum of an elementwise multiplication of the soft histogram with the weight matrix
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
y = \sum _ { \nu } w _ { o _ { \nu } } o _ { \nu } + w _ { h _ { \nu } } h _ { \nu } .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
The weighted sum output for the two example units is illustrated in Figure 2. For the ReLU activation, the outputs will be $2 . 5 \times 1 + 1 \times 0 . 1 8 = 2 . 6 8$ and $0 \times 1 + 0 \times ( - 0 . 3 0 ) = 0$ , respectively. For the LReLU activation, the output for the unit with input value -1.80 will be $- 0 . 1 5 \times 1 + 0 . 1 \times ( - 0 . 3 0 ) =$ -0.18, as desired.
|
| 106 |
+
|
| 107 |
+
Our formulation will generate a piecewise linear activation function for any values chosen as weights for the offset and histogram components. However, it is obvious that constraints need to be put on the weights if a continuous activation function is to be obtained. The weights (slopes) for the offset components can be set independently but only one weight for the histogram component is independent from the other weights. Assume that $w _ { h _ { 0 } }$ is set as desired. To obtain a continuous linear function, the remaining histogram weights then need to be set as
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r c l } { { w _ { h _ { 1 } } } } & { { = } } & { { w _ { h _ { 0 } } + 0 . 5 ( w _ { o _ { 0 } } + w _ { o _ { 1 } } ) } } \\ { { w _ { h _ { 2 } } } } & { { = } } & { { w _ { h _ { 0 } } + 0 . 5 ( w _ { o _ { 0 } } + 2 w _ { o _ { 1 } } + w _ { o _ { 2 } } ) } } \\ { { \vdots } } & { { } } & { { } } \\ { { w _ { h _ { 2 N - 1 } } } } & { { = } } & { { w _ { h _ { 0 } } + 0 . 5 ( w _ { o _ { 0 } } + 2 w _ { o _ { 1 } } + \cdots + 2 w _ { o _ { 2 N - 2 } } + w _ { o _ { 2 N - 1 } } ) . } } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
The constraints in (7) must be enforced when updating the weights in the backpropagation step.
|
| 114 |
+
|
| 115 |
+
# 3 SHIFTED ACTIVATION FUNCTIONS
|
| 116 |
+
|
| 117 |
+
The results presented in section 4.1 show that an ELU-shaped activation function which is shifted around the origin seems favorable to improve learning. Hence, we introduce the ShELU activation function with horizontal shift and the SvELU activation function with vertical shift and define them as in Table 2. The hyperparameter $\alpha$ is considered to be a pre-set constant and it is not tuned during training. In our experiments, we set $\alpha = 1$ . We also define PShELU, a variant of PELU with horizontal shift. The parameters $\alpha$ and $\beta$ for PShELU are learned during training. In the experiments, they were initialized as $\alpha = \beta = 1 . 0$ , i.e. as an original ELU activation.
|
| 118 |
+
|
| 119 |
+
Table 2: Shifted activation functions.
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan=1 colspan=1>Activation</td><td rowspan=1 colspan=1>Value</td><td rowspan=1 colspan=1>Region 1</td><td rowspan=1 colspan=1>Value</td><td rowspan=1 colspan=1>Region 2</td></tr><tr><td rowspan=1 colspan=1>ShELUSvELUPShELU</td><td rowspan=1 colspan=1>x+8x+8(c+)</td><td rowspan=1 colspan=1>x+δ>0x>0x+δ>0</td><td rowspan=1 colspan=1>α(exp(x+δ)-1)α(exp(𝑥)-1)+δa(exp(+)-1)</td><td rowspan=1 colspan=1>x+δ≤0x≤0x+δ≤0</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Note that the introduced shifts $\delta$ in Table 2 are individual for all neurons. As an example, consider the first layers in the Lenet network (LeCun et al., 1998) shown in Figure 3. The input is an image $3 2 \times 3 2 \times 3$ . In the first convolutional layer, there are 192 filters with size $5 \times 5 \times 3$ . The output from the convolutional layer consists of 192 feature maps with size $3 2 \times 3 2$ . The output includes a bias level for each feature map (each large square in the convolutional output), i.e. a total of 192 bias levels. The activation function is applied to the individual neurons resulting in an output with size $3 2 \times 3 2 \times 1 9 2$ . When we say that we introduce individual shifts for all neurons, it means that there is one tuneable shift for each of the $3 2 \times 3 2 \times 1 9 2$ neurons (all small squares in the activation output) where the activation function is applied.
|
| 124 |
+
|
| 125 |
+
In Goodfellow et al. (2016), chapter 9.5, it is stated that for CNNs it is natural to have shared biases with the same tiling pattern as the convolutional kernels, but that individual biases for each neuron ”would allow the model to correct for differences in the image statistics at different locations”. By introducing the activation function ShELU, with individual shifts for each neuron, we have indirectly created individual biases for the convolutional layer feature map output. Note that a convolutional layer with a shared bias level for each feature map output followed by a ShELU activation is equivalent with a convolutional layer with individual bias levels for each feature map output followed by an ELU activation. This equivalence was verified with experiments presented in section 4.2.1. However, frameworks as Caffe (Jia et al., 2014) and MatConvNet do not allow for individual biases in a convolutional layer but is restricted to shared biases.
|
| 126 |
+
|
| 127 |
+
# 4 EXPERIMENTS
|
| 128 |
+
|
| 129 |
+
# 4.1 EXPERIMENTS WITH PIECEWISE LINEAR ACTIVATION FUNCTIONS
|
| 130 |
+
|
| 131 |
+
To investigate the behavior of the piecewise linear activation function we made some experiments with the Lenet network and the Cifar-100 dataset (Krizhevsky & Hinton, 2009). We used the implementation of Lenet as provided when downloading the MatConvNet framework. We ran the Lenet network with the ReLU activation function, and also replaced all activation layers with LReLU and
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 3: Bias levels for convolutional layers and shifts for activation function. Biases/shifts can either be shared (large squares) or individual for each neuron (small squares).
|
| 135 |
+
|
| 136 |
+
Table 3: Top1error on Cifar-100 with Lenet network.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Activation</td><td>Toplerror (%)</td><td>Activation</td><td>Toplerror (%)</td><td>Activation</td><td>Toplerror (%)</td></tr><tr><td>ReLU</td><td>46.58</td><td>LReLU</td><td>45.41</td><td>ELU</td><td>44.96</td></tr><tr><td>Tuned ReLU</td><td>45.92</td><td>Tuned LReLU</td><td>45.18</td><td>Tuned ELU</td><td>44.51</td></tr></table>
|
| 139 |
+
|
| 140 |
+
ELU. We then exchanged the activation layers with the piecewise linear activation layer. We initialized the layers as a linear version of ReLU, LReLU and ELU respectively. We consistently noticed a slight improvement (a few tenths of a percent) in classification performance when using the tuneable piecewise linear activation function compared to its corresponding fixed activation function, see Table 3. Besides the slight classification improvement, it is also interesting to analyse the shape of the activation functions after tuning, see Figure 4. All three activation functions remain linear and with almost unity slope on the positive side. All three tuned activation functions exhibit a smooth exponential decay for small negative inputs and then remain fairly constant for larger negative inputs. The resulting shape after tuning for all three initializations is close to the ELU shape. However, notice that all tuned activation functions tend to return a variable but negative output for zero input and that they do not pass through the origin. These results suggest that we introduce the Shifted Exponential Linear Unit (ShELU) as an activation function. From the results it is not obvious whether the introduced shift around the origin should be vertical or horizontal. For a horizontal shift, the saturation level remains constant for large negative inputs which may seem more intuitive. For a vertical shift, the saturation level will vary depending on the shift which better matches the achieved results on the Lenet network.
|
| 141 |
+
|
| 142 |
+
# 4.2 EXPERIMENTS WITH SHIFTED ACTIVATION FUNCTIONS
|
| 143 |
+
|
| 144 |
+
# 4.2.1 EXPERIMENTS ON CIFAR-100 WITH LENET NETWORK
|
| 145 |
+
|
| 146 |
+
We now want to evaluate if the classification performance improves with the new activation functions ShELU and SvELU compared to ELU. We start with the Lenet network and replace all ELU activations with either the ShELU or the SvELU activation. The learning rate was set to 0.005 for the first 40 epochs, then lowered by a factor of 10 every 20 epochs, running a total of 80 epochs. The learning rate momentum was set to 0.9 and the weight decay to 0.0005. Image data was preprocessed with global contrast normalization and whitening (Coates et al., 2011). Note that the complete dataset was divided by a factor of 10 (compared to the preprocessing provided with the MatConvNet download) to better match the variance with Xavier initialization. During training the dataset was augmented with random horizontal flipping and by randomly cropping images from the original images zero padded with a frame of width four.
|
| 147 |
+
|
| 148 |
+
The classification errors for the training and test sets shown in Figure 5 are the average over 8 runs for each activation function. The top1errors in Table 4 are the average over the last 15 epochs for the lowest learning rate. The learning rate for the ShELU and SvELU activation layer weights was set to $2 \%$ of the base learning rate. The results show that there is a small improvement on the top1error using the ShELU and SvELU activation functions compared with the original ELU. Futhermore, the shifted activation function PShELU achieves a slightly better test results than both ELU and PELU.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 4: Initialization (red) and 20, 50 and 80 percentiles for tuned activation functions in last layer; ReLU (left), LReLU (middle) and ELU (right).
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 5: Training (dashed) and test (solid) errors on Cifar-100 with network Lenet (left). Test errors (final part) for ELU, SvELU and ShELU (middle), and ELU, PELU and PShELU (right).
|
| 155 |
+
|
| 156 |
+
Table 4: Top1 test errors on Cifar-100 with Lenet and Clevert-11 networks.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Activation</td><td>Lenetnetwork</td><td>Clevert-11 network</td></tr><tr><td>ELU</td><td>44.96</td><td>28.76</td></tr><tr><td>SvELU</td><td>44.70</td><td>28.85</td></tr><tr><td>ShELU</td><td>44.77</td><td>28.57</td></tr><tr><td>PELU</td><td>45.03</td><td>28.78</td></tr><tr><td>PShELU</td><td>44.76</td><td>28.74</td></tr><tr><td>ConvIndBias+ELU</td><td>44.78</td><td>1</td></tr></table>
|
| 159 |
+
|
| 160 |
+
The training behavior is very similar for all activation functions but the shifted activation functions exhibit a slightly better generalization behavior. However, the significance of these results is limited as Lenet is a rather shallow network.
|
| 161 |
+
|
| 162 |
+
We also created a network layer named ”ConvIndBias”, which is an identity mapping but it also adds an individually learned bias shift for each neuron. The results in Table 4 confirm that a ShELU activation is equivalent to the combination of a ConvIndBias layer and an ELU activation as was stated in section 3.
|
| 163 |
+
|
| 164 |
+
# 4.2.2 EXPERIMENTS ON CIFAR-100 WITH CLEVERT-11
|
| 165 |
+
|
| 166 |
+
To further evaluate the shifted activation functions in comparison with ELU, we built the 11-layer network used by Clevert et al. (2015) to replicate the experiments when ELU was introduced. We denote the network Clevert-11. Parameter settings and weight initializations were as in Clevert et al. (2015). Our results are the average over 9 runs for each activation function. Our classification results with the network Clevert-11 on the Cifar-100 dataset for the activation functions ELU, SvELU, ShELU, PELU and PShELU are presented in Figure 6 and summarized in Table 4. The results in the table are the average top1error over the last 20 epochs for each activation function. The results show that the test error for the ShELU activation function is significantly better than for ELU, whereas the error for SvELU is slightly inferior. The results suggest that a horizontal shift for the activation function is preferable to a vertical shift. The training behavior is almost identical for ELU and
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 6: Training (dashed) and test (solid) errors on Cifar-100 with network Clevert-11 (left). Test errors (final part) for ELU, SvELU and ShELU (middle), and ELU, PELU and PShELU (right).
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 7: Learned shifts for ShELU activation function, relative frequency (left), kurtosis (middle) and spatial variation (right).
|
| 173 |
+
|
| 174 |
+
ShELU. We believe that the improved test result can be attributed to that ShELU adaptively learns where to set the reference level between the linear and exponential parts of the activation function.
|
| 175 |
+
|
| 176 |
+
ELU, PELU and PShELU all show very similar test errors. Note, however, that the training error is by far lower for PELU indicating pronounced overfitting compared to ELU. The training error is lower for PShELU than for ShELU but the test error is inferior. This suggests that PShELU suffers from overfitting when allowed to tune the hyperparameters $\alpha$ and $\beta$ . Note that we were able to almost exactly reproduce the results for ELU achieved in Clevert et al. (2015) who report a top1error of $2 8 . 7 5 \%$ .
|
| 177 |
+
|
| 178 |
+
# 4.3 LEARNED SHIFTS FOR SHELU
|
| 179 |
+
|
| 180 |
+
In all experments, we initialized the individual shifts for the ShELU activation from a Gaussian distribution with standard deviation 0.001. The learned shifts after training in the 10 activation layers of the Clevert-11 network are shown as normalized frequency histograms in Figure 7, together with the kurtosis and the spatial variation for the shifts.
|
| 181 |
+
|
| 182 |
+
The shape of the learned shifts is almost a perfect Gaussian distribution for all layers. This is supported by the computed kurtosis which is close to 3.0. The kurtosis increases slightly for the last three layers where the distribution tends to be somewhat skewed towards the negative side. The standard deviation for the shift is relatively constant for the first nine layers but grows considerably for the last layer.
|
| 183 |
+
|
| 184 |
+
Figure 7 shows the learned shifts for the first ShELU activation layer where the shifts for the 192 feature maps have been placed as $1 2 \times 1 6$ tiles side by side. Interestingly, the spatial variation for the learned shift seems to be completely random. Any statistical difference spatially over the image cannot be perceived.
|
| 185 |
+
|
| 186 |
+
# 5 CONCLUSIONS
|
| 187 |
+
|
| 188 |
+
We use a new formulation to tune a continuous piecewise linear activation function during training and learn the shape of the locally optimal activation function. With this tuned activation function, the classification performance for convolutional neural networks is improved and the resulting, learned activation function shows to be ELU-shaped irrespective whether it is initialized as a RELU, LReLU or ELU activation function. The learned activation function exhibits a variable shift around the origin for each neuron, indicating that a shifted ELU-shaped activation function is preferable. This observation leads us to introduce the Shifted Exponential Linear Unit (ShELU) as a new activation function.
|
| 189 |
+
|
| 190 |
+
Experiments on Cifar-100 show that the classification performance is further improved when using the ShELU activation function in comparison with ELU. Normally in a convolutional network layer, one shared bias shift is learned for each feature map output. The improvement for the ShELU activation is achieved when learning an individual bias shift for each neuron. The equivalent to the ShELU activation function would be to learn an individual bias shift for each neuron in the convolutional layer output and then apply an ELU activation, which however is not supported by commonly used deep learning frameworks. The implementation of individual biases in the activation function is therefore preferable and leads to the ShELU activation function.
|
| 191 |
+
|
| 192 |
+
# REFERENCES
|
| 193 |
+
|
| 194 |
+
Forest Agostinelli, Matthew Hoffman, Peter Sadowski, and Pierre Baldi. Learning activation functions to improve deep neural networks. arXiv preprint arXiv:1412.6830, 2014.
|
| 195 |
+
|
| 196 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
|
| 197 |
+
|
| 198 |
+
Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 215–223, 2011.
|
| 199 |
+
|
| 200 |
+
J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009.
|
| 201 |
+
|
| 202 |
+
Michael Felsberg and Gosta Granlund. P-channels: Robust multivariate m-estimation of large ¨ datasets. In Pattern Recognition, 2006. ICPR 2006. 18th International Conference on, volume 3, pp. 262–267. IEEE, 2006.
|
| 203 |
+
|
| 204 |
+
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, pp. 249–256, 2010.
|
| 205 |
+
|
| 206 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 315–323, 2011.
|
| 207 |
+
|
| 208 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.
|
| 209 |
+
|
| 210 |
+
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, pp. 770–778, 2016.
|
| 211 |
+
|
| 212 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. 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. 448–456, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings. mlr.press/v37/ioffe15.html.
|
| 213 |
+
|
| 214 |
+
Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014.
|
| 215 |
+
|
| 216 |
+
Gunter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing ¨ neural networks. arXiv preprint arXiv:1706.02515, 2017.
|
| 217 |
+
|
| 218 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 219 |
+
|
| 220 |
+
Yann Le Cun, Ido Kanter, and Sara A Solla. Eigenvalues of covariance matrices: Application to neural-network learning. Physical Review Letters, 66(18):2396, 1991.
|
| 221 |
+
|
| 222 |
+
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.
|
| 223 |
+
|
| 224 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
|
| 225 |
+
|
| 226 |
+
Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In Proc. ICML, volume 30, 2013.
|
| 227 |
+
|
| 228 |
+
MatConvNet. http://www.vlfeat.org/matconvnet/,v.beta-20.
|
| 229 |
+
|
| 230 |
+
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(1):1929–1958, 2014.
|
| 231 |
+
|
| 232 |
+
Ludovic Trottier, Philippe Giguere, and Brahim Chaib-draa. Parametric exponential linear unit for \` deep convolutional neural networks. arXiv preprint arXiv:1605.09332, 2016.
|
| 233 |
+
|
| 234 |
+
# APPENDIX
|
| 235 |
+
|
| 236 |
+
# DERIVATIVES OF SHELU AND SVELU
|
| 237 |
+
|
| 238 |
+
For backpropagation, the derivates of ShELU and SvELU with respect to the input $x$ and the shift $\delta$ are computed as
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
\begin{array} { r l } & { \frac { d \mathrm { S h E L U } } { d x } = \left\{ 1 , \mathrm { ~ i f ~ } x + \delta > 0 \right. } \\ & { \frac { d \mathrm { S h E L U } } { d \delta } = \left\{ 1 , \mathrm { ~ i f ~ } x + \delta > 0 \right. } \\ & { \frac { d \mathrm { S h E L U } } { d \delta } = \left\{ 1 , \mathrm { ~ i f ~ } x + \delta > 0 \right. } \\ & { \frac { d \mathrm { S v E L U } } { d x } = \left\{ 1 , \mathrm { ~ i f ~ } x > 0 \right. } \\ & { \frac { d \mathrm { S v E L U } } { d \delta } = \left\{ \alpha ( \exp ( x ) ) , \mathrm { i f ~ } x \leq 0 \right. } \\ & { \frac { d \mathrm { S v E L U } } { d \delta } = 1 } \end{array}
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
# DERIVATIVES OF PSHELU
|
| 245 |
+
|
| 246 |
+
For backpropagation, the derivates of PShELU with respect to the input $x$ , the hyperparameters $\alpha$ and $\beta$ , and the shift $\delta$ are computed as
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
\begin{array} { r l } & { \frac { d \mathrm { P S h e L U } } { d x } = \left\{ \frac { \alpha } { \beta } , \ \mathrm { i f } \ x + \delta > 0 \right. } \\ & { \frac { d \mathrm { P S h e L U } } { d \alpha } = \left\{ \frac { \alpha + \delta } { \beta } , \ \mathrm { i f } \ x + \delta > 0 \right. } \\ & { \frac { d \mathrm { P S h e L U } } { d \alpha } = \left\{ \frac { \alpha + \delta } { \beta } , \ \mathrm { i f } \ x + \delta > 0 \right. } \\ & { \frac { d \mathrm { P S h e L U } } { d \beta } = \left\{ - \frac { \alpha } { \beta ^ { 2 } } ( x + \delta ) , \ \mathrm { i f } \ x + \delta > 0 \right. } \\ & { \frac { d \mathrm { P S h e L U } } { d \beta } = \left\{ - \frac { \alpha } { \beta ^ { 2 } } ( \exp ( \frac { \alpha + \delta } { \beta } ) ) , \ \mathrm { i f } \ x + \delta \leq 0 \right. } \\ & { \frac { d \mathrm { P S h e L U } } { d \delta } = \left\{ \frac { \alpha } { \beta } , \ \mathrm { i f } \ x + \delta > 0 \right. } \end{array}
|
| 250 |
+
$$
|
md/train/HkeuD34KPH/HkeuD34KPH.md
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SSE-PT: SEQUENTIAL RECOMMENDATION VIA PERSONALIZED TRANSFORMER
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Temporal information is crucial for recommendation problems because user preferences are naturally dynamic in the real world. Recent advances in deep learning, especially the discovery of various attention mechanisms and newer architectures in addition to widely used RNN and CNN in natural language processing, have allowed for better use of the temporal ordering of items that each user has engaged with. In particular, the SASRec model, inspired by the popular Transformer model in natural languages processing, has achieved state-of-the-art results. However, SASRec, just like the original Transformer model, is inherently an un-personalized model and does not include personalized user embeddings. To overcome this limitation, we propose a Personalized Transformer (SSE-PT) model, outperforming SASRec by almost $5 \%$ in terms of NDCG $@ 1 0$ on 5 real-world datasets. Furthermore, after examining some random users’ engagement history, we find our model not only more interpretable but also able to focus on recent engagement patterns for each user. Moreover, our SSE-PT model with a slight modification, which we call $\mathrm { S S E – P T + + }$ , can handle extremely long sequences and outperform SASRec in ranking results with comparable training speed, striking a balance between performance and speed requirements. Our novel application of the Stochastic Shared Embeddings (SSE) regularization is essential to the success of personalization. Code and data are open-sourced at https://github.com/SSE-PT/SSE-PT.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The sequential recommendation problem has been an important open research question, yet using temporal information to improve recommendation performance has proven to be challenging. SASRec, proposed by (Kang and McAuley, 2018) for sequential recommendation problems, has achieved stateof-the-art results and enjoyed more than 10x speed-up when compared to earlier CNN/RNN-based methods. However, the model used in SASRec is the standard Transformer which is inherently an un-personalized model. In practice, it is important to include a personalized Transformer in SASRec especially for recommender systems, but (Kang and McAuley, 2018) found that adding additional personalized embeddings did not improve the performance of their Transformer model, and postulate that the failure of adding personalization is due to the fact that they already use the user history and the user embeddings only contribute to overfitting. In this work, we propose a novel method, Personalized Transformer (SSE-PT), that successfully introduces personalization into self-attentive neural network architectures.
|
| 12 |
+
|
| 13 |
+
Introducing user embeddings into the standard transformer model is intrinsically difficult with existing regularization techniques, as unavoidably a large number of user parameters are introduced, which is often at the same scale of the number of training data. But we show that personalization can greatly improve ranking performance with a recent regularization technique called Stochastic Shared Embeddings (SSE) (Wu et al., 2019). The personalized Transformer (SSE-PT) model with SSE regularization works well for all 5 real-world datasets we consider without overfitting, outperforming previous state-of-the-art algorithm SASRec by almost $5 \%$ in terms of ${ \mathrm { N D C G } } @ 1 0 .$ . Furthermore, after examining some random users’ engagement history, we find our model is not only more interpretable but also able to focus on recent engagement patterns for each user. Moreover, our SSE-PT model with a slight modification, which we call SSE- $\mathrm { \cdot P T } { + } { + }$ , can handle extremely long sequences and outperform SASRec in ranking results with comparable training speed, striking a balance between performance and speed requirements.
|
| 14 |
+
|
| 15 |
+
# 2 RELATED WORK
|
| 16 |
+
|
| 17 |
+
# 2.1 SESSION-BASED AND SEQUENTIAL RECOMMENDATION
|
| 18 |
+
|
| 19 |
+
Both session-based and sequential (i.e., next-basket) recommendation algorithms take advantage of additional temporal information to make better personalized recommendations. The main difference between session-based recommendations (Hidasi et al., 2015) and sequential recommendations (Kang and McAuley, 2018) is that the former assumes that the user ids are not recorded and therefore the length of engagement sequences are relatively short. Therefore, session-based recommendations normally do not consider user factors. On the other hand, sequential recommendation treats each sequence as a user’s engagement history (Kang and McAuley, 2018). Both settings, do not explicitly require time-stamps: only the relative temporal orderings are assumed known (in contrast to, for example, timeS $\mathrm { V D } { + } { + }$ (Koren, 2009) using time-stamps). Initially, sequence data in temporal order are usually modelled with Markov models, in which a future observation is conditioned on the last few observed items (Rendle et al., 2010). In (Rendle et al., 2010), a personalized Markov model with user latent factors is proposed for more personalized results.
|
| 20 |
+
|
| 21 |
+
In recent years, deep learning techniques, borrowed from natural language processing (NLP) literature, are getting widely used in tackling sequential data. Like word sentences in NLP, item sequences in recommendations can be similarly modelled by recurrent neural networks (RNN) (Hidasi et al., 2015; Hidasi and Karatzoglou, 2018) and convolutional neural network (CNN) (Tang and Wang, 2018) models. Recently, attention models are increasingly used in both NLP (Vaswani et al., 2017; Devlin et al., 2018) and recommender systems (Liu et al., 2018; Kang and McAuley, 2018). SASRec (Kang and McAuley, 2018) is a recent method with state-of-the-art performance among the many deep learning models. Motivated by the Transformer model in neural machine translation (Vaswani et al., 2017), SASRec utilizes a similar architecture to the encoder part of the Transformer model. Our proposed model, SSE-PT, is a personalized extension of the transformer model.
|
| 22 |
+
|
| 23 |
+
# 2.2 REGULARIZATION TECHNIQUES
|
| 24 |
+
|
| 25 |
+
In deep learning, models with many more parameters than data points can easily overfit to the training data. This may prevent us from adding user embeddings as additional parameters into complicated models like the Transformer model (Kang and McAuley, 2018), which can easily have 20 layers with millions of parameters for a medium-sized dataset like Movielens10M (Harper and Konstan, 2016). $\ell _ { 2 }$ regularization (Hoerl and Kennard, 1970) is the most widely used approach and has been used in many matrix factorization models in recommender systems; $\ell _ { 1 }$ regularization (Tibshirani, 1996) is used when a sparse model is preferred. For deep neural networks, it has been shown that $\ell _ { p }$ regularizations are often too weak, while dropout (Hinton et al., 2012; Srivastava et al., 2014) is more effective in practice. There are many other regularization techniques, including parameter sharing (Goodfellow et al., 2016), max-norm regularization (Srebro et al., 2005), gradient clipping (Pascanu et al., 2013), etc. Very recently, a new regularization technique called Stochastic Shared Embeddings (SSE) (Wu et al., 2019) is proposed as a new means of regularizing embedding layers. We find that the base version SSE-SE is essential to the success of our Personalized Transformer (SSE-PT) model.
|
| 26 |
+
|
| 27 |
+
# 3 METHODOLOGY
|
| 28 |
+
|
| 29 |
+
# 3.1 SEQUENTIAL RECOMMENDATION
|
| 30 |
+
|
| 31 |
+
Given $n$ users and each user engaging with a subset of $m$ items in a temporal order, the goal of sequential recommendation is to learn a good personalized ranking of top $K$ items out of total $m$ items for any given user at any given time point. We assume data in the format of $n$ item sequences:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
s _ { i } = ( j _ { i 1 } , j _ { i 2 } , \ldots , j _ { i T } ) \mathrm { f o r } 1 \le i \le n .
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
Sequences $s _ { i }$ of length $T$ contain indices of the last $T$ items that user $i$ has interacted with in the temporal order (from old to new). For different users, the sequence lengths can vary, but we can pad the shorter sequences so all of them have length $T$ . We cannot simply randomly split data points into train/validation/test sets because they come in temporal orders. Instead, we need to make sure our training data is before validation data which is before test data temporally. We use last items in sequences as test sets, second-to-last items as validation sets and the rest as training sets. We use ranking metrics such as NDCG $@ K$ and Recal $@ K$ for evaluations, which are defined in the Appendix.
|
| 38 |
+
|
| 39 |
+
# 3.2 PERSONALIZED TRANSFORMER ARCHITECTURE
|
| 40 |
+
|
| 41 |
+
Our model, which we call SSE-PT, is motivated by the Transformer model in (Vaswani et al., 2017) and (Kang and McAuley, 2018). It also utilizes a new regularization technique called stochastic shared embeddings (Wu et al., 2019). In the following sections, we are going to examine each important component of our Personalized Transformer (SSE-PT) model, especially the embedding layer, and the novel application of stochastic shared embeddings (SSE) regularization technique.
|
| 42 |
+
|
| 43 |
+
Embedding Layer We define a learnable user embedding look-up table $U \in R ^ { n \times d _ { u } }$ and item embedding look-up table $V \in R ^ { m \times d _ { i } }$ , where $d _ { u }$ , $d _ { i }$ are the number of hidden units for user and item respectively. We also specify learnable positional encoding table $P \in R ^ { T \times d }$ , where $d = d _ { u } + d _ { i }$ . So each input sequence $s _ { i } \in \dot { R ^ { T } }$ will be represented by the following embedding:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
E = \left[ \begin{array} { c } { \left[ v _ { j _ { i 1 } } ; u _ { i } \right] + p _ { 1 } } \\ { \left[ v _ { j _ { i 2 } } ; u _ { i } \right] + p _ { 2 } } \\ { \vdots } \\ { \left[ v _ { j _ { i T } } ; u _ { i } \right] + p _ { T } } \end{array} \right] \in R ^ { T \times d } ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $[ v _ { j _ { i t } } ; u _ { i } ]$ represents concatenating item embedding $v _ { j _ { i t } } \in R ^ { d _ { i } }$ and user embedding $u _ { i } \in R ^ { d _ { u } }$ into embedding $E _ { t } \in R ^ { d }$ for time $t$ . Note that the main difference between our model and (Kang and McAuley, 2018) is that we introduce the user embeddings $u _ { i }$ , making our model personalized.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 1: Illustration of our proposed SSE-PT model
|
| 53 |
+
|
| 54 |
+
Transformer Encoder On top of the embedding layer, we have $B$ blocks of self-attention layers and fully connected layers, where each layer extracts features for each time step based on the previous layer’s outputs. Since this part is identical to the Transformer encoder used in the original papers (Vaswani et al., 2017; Kang and McAuley, 2018), we will skip the details.
|
| 55 |
+
|
| 56 |
+
Prediction Layer At time $t$ , the predicted probability of user $i$ engaged item $l$ is:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
p _ { i t l } = \sigma ( r _ { i t l } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\sigma$ is the sigmoid function and $r _ { i t l }$ is the predicted score of item $l$ by user $l$ at time point $t$ defined as:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
r _ { i t l } = F _ { t - 1 } ^ { B } \cdot [ v _ { l } ; u _ { i } ] ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $F _ { t - 1 } ^ { B }$ is the output hidden units associated with the transformer encoder at the last timestamp. Although we can use another set of user and item embedding look-up tables for the $u _ { i }$ and $v _ { l }$ , we
|
| 69 |
+
|
| 70 |
+
find it better to use the same set of embedding look-up tables $U , V$ as in the embedding layer. But regularization for those embeddings can be different. To distinguish the $u _ { i }$ and $v _ { l }$ in (4) from $u _ { i } , v _ { j }$ in (2), we call embeddings in (4) output embeddings and those in (2) input embeddings.
|
| 71 |
+
|
| 72 |
+
The binary cross entropy loss between predicted probability for the positive item $l = j _ { i ( t + 1 ) }$ and one uniformly sampled negative item $k \in \Omega$ is given as $- [ \log ( p _ { i t l } ) + \log ( 1 - p _ { i t k } ) ]$ . Summing over $s _ { i }$ and $t$ , we obtain the objective function that we want to minimize is:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\sum _ { i } \sum _ { t = 1 } ^ { T - 1 } \sum _ { k \in \Omega } - \big [ \log ( p _ { i t l } ) + \log ( 1 - p _ { i t k } ) \big ] .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
At the inference time, top- $K$ recommendations for user $i$ at time $t$ can be made by sorting scores $r _ { i t l }$ for all items $\ell$ and recommending the first $K$ items in the sorted list.
|
| 79 |
+
|
| 80 |
+
Novel Application of Stochastic Shared Embeddings The most important regularization technique to SSE-PT model is the Stochastic Shared Embeddings (SSE) (Wu et al., 2019). The main idea of SSE is to stochastically replace embeddings with another embedding with some pre-defined probability during SGD, which has the effect of regularizing the embedding layers. Without SSE, all the existing well-known regularization techniques like layer normalization, dropout and weight decay fail and cannot prevent the model from over-fitting badly after introducing user embeddings. (Wu et al., 2019) develops two versions of SSE, SSE-Graph and SSE-SE. In the simplest uniform case, SSE-SE replaces one embedding with another embedding uniformly with probability $p$ , which is called SSE probability in (Wu et al., 2019). Since we don’t have knowledge graphs for user or items, we simply apply the SSE-SE to our SSE-PT model. We find SSE-SE makes possible training this personalized model with $O ( n d _ { u } )$ additional parameters.
|
| 81 |
+
|
| 82 |
+
There are 3 different places in our model that SSE-SE can be applied. We can apply SSE-SE to input/output user embeddings, input item embeddings, and output item embeddings with probabilities $p _ { u }$ , $p _ { i }$ and $p _ { y }$ respectively. Note that input user embedding and output user embedding are always replaced at the same time with SSE probability $p _ { u }$ . Empirically, we find that SSE-SE to user embeddings and output item embeddings always helps, but SSE-SE to input item embeddings is only useful when the average sequence length is large, e.g., more than 100 in Movielens1M and Movielens10M datasets.
|
| 83 |
+
|
| 84 |
+
Other Regularization Techniques Besides the SSE (Wu et al., 2019), we also utilized other widely used regularization techniques, including layer normalization (Ba et al., 2016), batch normalization (Ioffe and Szegedy, 2015), residual connections (He et al., 2016), weight decay (Krogh and Hertz, 1992), and dropout (Srivastava et al., 2014). Since they are used in the same way in the previous paper (Kang and McAuley, 2018), we omit the details to the Appendix.
|
| 85 |
+
|
| 86 |
+
# 3.3 HANDLING LONG SEQUENCES: SSE-PT $^ { + + }$
|
| 87 |
+
|
| 88 |
+
To handle extremely long sequences, a slight modification can be made on the base SSE-PT model in terms of how input sequences $s _ { i }$ ’s are fed into the SSE-PT neural network. We call the enhanced model SSE- $\mathrm { P T } { + } { + }$ to distinguish it from the previously discussed SSE-PT model, which cannot handle sequences longer than $T$ .
|
| 89 |
+
|
| 90 |
+
The motivation of SSE- $\mathbf { \nabla } \cdot \mathbf { P } \mathbf { T } + +$ over SSE-PT comes from: sometimes we want to make use of extremely long sequences, $s _ { i } = ( j _ { i 1 } , j _ { i 2 } , . ~ . ~ . ~ , j _ { i t } )$ for $1 \leq i \leq n$ , where $t > T$ , but our SSE-PT model can only handle sequences of maximum length of $T$ . The simplest way is to sample starting index $1 \leq v \leq t$ uniformly and use $s _ { i } = ( j _ { i v } , j _ { i ( v + 1 ) } , . ~ . ~ . , j _ { i z } )$ , where $z = \operatorname* { m i n } ( t , v + T - 1 )$ . Although sampling the starting index uniformly from $[ 1 , t ]$ can accommodate long sequences of length $t > T$ , this does not work well in practice. Uniform sampling does not take into account the importance of recent items in a long sequence. To solve this dilemma, we introduce an additional hyper-parameter $p _ { s }$ which we call sampling probability. It implies that with probability $p _ { s }$ , we sample the starting index $v$ uniformly from $[ 1 , t - T ]$ and use sequence $s _ { i } = \left( j _ { i v } , j _ { i ( v + 1 ) } , \ldots , j _ { i ( v + T - 1 ) } \right)$ as input. With probability $1 - p _ { s }$ we simply use the recent $T$ items $( j _ { i ( t - T + 1 ) } , \ldots , j _ { i t } )$ as input. If the sequence $s _ { i }$ is already shorter than $T$ , then we always use the recent input sequence for user $i$ .
|
| 91 |
+
|
| 92 |
+
Our proposed SSE- $\mathrm { P T } { + } { + }$ model can work almost as well as SSE-PT with a much smaller $T$ . One can see in Table 2 with $T = 1 0 0$ , SSE-PT++ can perform almost as well as SSE-PT. The time complexity of the SSE-PT model is of order $O ( T ^ { 2 } d + T d ^ { 2 } )$ . Therefore, reducing $T$ by one half would lead to a theoretically $4 \mathbf { x }$ speed-up in terms of the training and inference speeds. As to the model’s space complexity, both SSE-PT and SSE- $\mathrm { P T } { + } { + }$ are of order $O ( n d _ { u } + m \dot { d _ { i } } + T d + d ^ { 2 } )$ .
|
| 93 |
+
|
| 94 |
+
# 4 EXPERIMENTS
|
| 95 |
+
|
| 96 |
+
In this section, we compare our proposed algorithms, Personalized Transformer (SSE-PT) and SSE$\mathrm { P T } { + } { + }$ , with other state-of-the-art algorithms on real-world datasets. We implement our codes in Tensorflow and conduct all our experiments on a server with 40-core Intel Xeon E5-2630 v4 $@$ 2.20GHz CPU, 256G RAM and Nvidia GTX 1080 GPUs.
|
| 97 |
+
|
| 98 |
+
Datasets We use 5 datasets. The first 4 have exactly the same train/dev/test splits as in (Kang and McAuley, 2018). The datasets are: Beauty and Games categories from Amazon product review datasets1; Steam dataset introduced in (Kang and McAuley, 2018), which contains reviews crawled from a large video game distribution platform; Movielens1M dataset (Harper and Konstan, 2016), a widely used benchmark datasets containing one million user movie ratings; Movielens10M dataset with ten million user ratings cleaned by us. Detailed dataset statistics are given in Table 4. One can easily see that the first 3 datasets have short sequences (average length $< 1 2$ ) while the last 2 datasets have very long sequences $\mathrm { \Phi } > 1 0 \mathrm { \mathbf { x } }$ longer).
|
| 99 |
+
|
| 100 |
+
Evaluation Metrics The evaluation metrics we use are standard ranking metrics, namely NDCG and Recall for top recommendations (See Appendix). We follow the same evaluation setting as the previous paper (Kang and McAuley, 2018): predicting ratings at time point $t + 1$ given the previous $t$ ratings. For a large dataset with numerous users and items, the evaluation procedure would be slow because (6) would require computing the ranking of all items based on their predicted scores for every single user. As a means of speed-up evaluations, we sample a fixed number $C$ (e.g., 100) of negative candidates while always keeping the positive item that we know the user will engage next. This way, both $R _ { i j }$ and $\Pi _ { i }$ will be narrowed down to a small set of item candidates, and prediction scores will only be computed for those items through a single forward pass of the neural network.
|
| 101 |
+
|
| 102 |
+
Ideally, we want both NDCG and Recall to be as close to 1 as possible, because $\operatorname { N D C G @ } K = 1$ means the positive item is always put on the top-1 position of the top- $K$ ranking list, and Recall $\Theta K = 1$ means the positive item is always contained by the top- $K$ recommendations the model makes.
|
| 103 |
+
|
| 104 |
+
Table 1: Comparing various state-of-the-art temporal collaborative ranking algorithms on various datasets. The (A) to (E) are non-deep-learning methods, the $( \mathrm { F } )$ to (K) are deep-learning methods and the (L) to (O) are our variants. We did not report SSE- $\mathbf { \nabla } \cdot \mathbf { P } \mathbf { T } + +$ results for beauty, games and steam, as the input sequence lengths are very short (see Table 4), so there is no need for SSE- $\mathrm { P T } { + } { + }$ .
|
| 105 |
+
|
| 106 |
+
<table><tr><td rowspan="2">DATASET METRIC</td><td colspan="2">BEAUTY</td><td colspan="2">GAMES</td><td colspan="2">STEAM</td><td colspan="2"></td><td colspan="2">ML-1M</td></tr><tr><td>RECALL@10 NDCG@10</td><td></td><td></td><td>RECALL@10 NDCG@10</td><td></td><td></td><td>RECALL@10 NDCG@10</td><td></td><td>RECALL@10 NDCG@10</td><td></td></tr><tr><td>(A)POPREC</td><td>0.4003</td><td>0.2277</td><td>1</td><td>0.4724</td><td>0.2779</td><td>0.7172</td><td>0.4535</td><td>1</td><td>0.4329</td><td>0.2377</td></tr><tr><td>(B)BPR</td><td>0.3775</td><td>0.2183</td><td>一 1</td><td>0.4853</td><td>0.2875</td><td>0.7061</td><td>0.4436</td><td>1 1</td><td>0.5781</td><td>0.3287</td></tr><tr><td>(C)FMC</td><td>0.3771</td><td>0.2477</td><td>一</td><td>0.6358</td><td>0.4456</td><td>0.7731</td><td>0.5193</td><td>1</td><td>0.6983</td><td>0.4676</td></tr><tr><td>(D)FPMC</td><td>0.4310</td><td>0.2891</td><td>一</td><td>0.6802</td><td>0.4680</td><td>0.7710</td><td>0.5011</td><td>1</td><td>0.7599</td><td>0.5176</td></tr><tr><td>(E)TRANSREC</td><td>0.4607</td><td>0.3020</td><td>一</td><td>0.6838</td><td>0.4557</td><td>0.7624</td><td>0.4852</td><td>1 1</td><td>0.6413</td><td>0.3969</td></tr><tr><td>(F) GRU4REC</td><td>0.2125</td><td>0.1203</td><td>1</td><td>0.2938</td><td>0.1837</td><td>0.4190</td><td>0.2691</td><td>1</td><td>0.5581</td><td>0.3381</td></tr><tr><td>(G) STAMP</td><td>0.4607</td><td>0.3020</td><td>一</td><td>0.6838</td><td>0.4557</td><td>0.7624</td><td>0.4852</td><td>1</td><td>0.6413</td><td>0.3969</td></tr><tr><td>(H) GRU4REC+</td><td>0.3949</td><td>0.2556</td><td>一 一</td><td>0.6599</td><td>0.4759</td><td>0.8018</td><td>0.5595</td><td>1 1</td><td>0.7501</td><td>0.5513</td></tr><tr><td>(I) CASER</td><td>0.4264</td><td>0.2547</td><td>1</td><td>0.5282</td><td>0.3214</td><td>0.7874</td><td>0.5381</td><td>1</td><td>0.7886</td><td>0.5538</td></tr><tr><td>(J) SASREC</td><td>0.4837</td><td>0.3220</td><td>1</td><td>0.7434</td><td>0.5401</td><td>0.8732</td><td>0.6293</td><td>1</td><td>0.8233</td><td>0.5936</td></tr><tr><td>(K)HGN</td><td>0.4469</td><td>0.2994</td><td>1 1</td><td>0.7164</td><td>0.5209</td><td>0.7426</td><td>0.4871</td><td>1 1</td><td>0.7584</td><td>0.5241</td></tr><tr><td>(L) SSE-SASREC</td><td>0.4878</td><td>0.3342</td><td>1</td><td>0.7517</td><td>0.5535</td><td>0.8697</td><td>0.6333</td><td>1</td><td>0.8230</td><td>0.5995</td></tr><tr><td>(M)PT</td><td>0.3954</td><td>0.2449</td><td>1 1</td><td>0.6427</td><td>0.4434</td><td>0.7535</td><td>0.4853</td><td>1 1</td><td>0.7658</td><td>0.5241</td></tr><tr><td>(N) SSE-PT</td><td>0.5028</td><td>0.3370</td><td>一</td><td>0.7757</td><td>0.5660</td><td>0.8772</td><td>0.6378</td><td>一</td><td>0.8341</td><td>0.6281</td></tr><tr><td>(O) SSE-PT++</td><td>二</td><td>=</td><td>一</td><td>二</td><td>二</td><td></td><td></td><td>1</td><td>0.8389</td><td>0.6292</td></tr></table>
|
| 107 |
+
|
| 108 |
+
Baselines We include 5 non-deep-learning and 6 deep-learning algorithms in our comparisons.
|
| 109 |
+
|
| 110 |
+
Table 2: Comparing SASRec, SSE-PT and SSE- $\mathbf { \nabla \cdot P T + + }$ on Movielens1M Dataset while varying the maximum length allowed and dimension of embeddings.
|
| 111 |
+
|
| 112 |
+
<table><tr><td>METHODS</td><td>NDCG@10</td><td>RECALL @10</td><td>MAX LEN</td><td>USER DIM</td><td>ITEMDIM</td></tr><tr><td>SASREC</td><td>0.5769</td><td>0.8045</td><td>100</td><td>N/A</td><td>100</td></tr><tr><td>SASREC</td><td>0.5936</td><td>0.8233</td><td>200</td><td>N/A</td><td>50</td></tr><tr><td>SASREC</td><td>0.5919</td><td>0.8202</td><td>200</td><td>N/A</td><td>100</td></tr><tr><td>SSE-PT</td><td>0.6142</td><td>0.8212</td><td>100</td><td>50</td><td>100</td></tr><tr><td>SSE-PT</td><td>0.6191</td><td>0.8358</td><td>200</td><td>50</td><td>50</td></tr><tr><td>SSE-PT</td><td>0.6281</td><td>0.8341</td><td>200</td><td>50</td><td>100</td></tr><tr><td>SSE-PT++</td><td>0.6186</td><td>0.8318</td><td>100</td><td>50</td><td>100</td></tr><tr><td>SSE-PT++</td><td>0.6208</td><td>0.8358</td><td>200</td><td>50</td><td>50</td></tr><tr><td>SSE-PT++</td><td>0.6292</td><td>0.8389</td><td>200</td><td>50</td><td>100</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Non-deep-learning Baselines The simplest baseline is PopRec, basically ranking items according to their popularity. More advanced methods such as matrix factorization based baselines include Bayesian personalized ranking for implicit feedback (Rendle et al., 2009), namely $B P R$ ; Factorized Markov Chains and Personalized Factorized Markov Chains models (Rendle et al., 2010) also known as FMC and PFMC; and translation based method (He et al., 2017) called TransRec.
|
| 115 |
+
|
| 116 |
+
Deep-learning Baselines Recent years have seen many advances in deep learning for sequential recommendations. GRU4Rec is the first RNN-based method proposed for this problem (Hidasi et al., 2015); $G R U 4 R e c ^ { + }$ (Hidasi and Karatzoglou, 2018) later is proposed to address some shortcomings of the initial version. Caser is the corresponding CNN-based method (Tang and Wang, 2018). STAMP (Liu et al., 2018) utilizes the attention mechanism without using RNN or CNN as building blocks. Very recently, SASRec utilizes state-of-art Transformer encoder (Vaswani et al., 2017) with selfattention mechanisms. Hierarchical gating networks, also known as HGN (Ma et al., 2019) are also proposed to solve this problem.
|
| 117 |
+
|
| 118 |
+
Table 3: Comparing Different Regularizations for SSE-PT on Movielen1M Dataset. NO REG stands for no regularization. PS stands for parameter sharing across all users while PS(AGE) means PS is used within each age group. SASRec is added to last row after all SSE-PT results as a baseline.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>REGULARIZATION</td><td>NDCG@5</td><td>% GAIN</td><td>RECALL@5</td><td>%GAIN</td></tr><tr><td>NO REG (BASELINE)</td><td>0.4855</td><td>1</td><td>0.6500</td><td>-</td></tr><tr><td>PS</td><td>0.5065</td><td>4.3</td><td>0.6656</td><td>2.4</td></tr><tr><td>PS (JOB)</td><td>0.4938</td><td>1.7</td><td>0.6570</td><td>1.1</td></tr><tr><td>PS (GENDER)</td><td>0.5110</td><td>5.3</td><td>0.6672</td><td>2.6</td></tr><tr><td>PS (AGE)</td><td>0.5133</td><td>5.7</td><td>0.6743</td><td>3.7</td></tr><tr><td>l2</td><td>0.5149</td><td>6.0</td><td>0.6786</td><td>4.4</td></tr><tr><td>DROPOUT</td><td>0.5165</td><td>6.4</td><td>0.6823</td><td>5.0</td></tr><tr><td>l2+DROPOUT</td><td>0.5293</td><td>9.0</td><td>0.6921</td><td>6.5</td></tr><tr><td>SSE-SE</td><td>0.5393</td><td>11.1</td><td>0.6977</td><td>7.3</td></tr><tr><td>l2 + SSE-SE + DROPOUT</td><td>0.5870</td><td>20.9</td><td>0.7442</td><td>14.5</td></tr><tr><td>SASREC (l2+DROPOUT)</td><td>0.5601</td><td></td><td>0.7164</td><td></td></tr></table>
|
| 121 |
+
|
| 122 |
+
Experiment Setup We use the same datasets as in (Kang and McAuley, 2018) and follow the same procedure in the paper: use last items for each user as test data, second-to-last as validation data and the rest as training data. We implemented our method in Tensorflow and solve it with Adam Optimizer (Kingma and Ba, 2014) with a learning rate of 0.001, momentum exponential decay rates $\beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 8$ and a batch size of 128. In Table 1, since we use the same data, the performance of previous methods except STAMP have been reported in (Kang and McAuley, 2018). We tune the dropout rate, and SSE probabilities $p _ { u } , p _ { i } , p _ { y }$ for input user/item embeddings and output embeddings on validation sets and report the best NDCG and Recall for top- $K$ recommendations on test sets. For a fair comparison, we restrict all algorithms to use up to 50 hidden units for item embeddings. For the SSE-PT and SASRec models, we use the same number of transformer encoder blocks (i.e. $B = 2$ ) and set the maximum length $T = 2 0 0$ for Movielens 1M and 10M dataset and $T = 5 0$ for other datasets. We use top- $K$ with $K = 1 0$ and the number of negatives $C = 1 0 0$ in the evaluation procedure. In practice, using a different $K$ and $C$ does not affect our conclusions.
|
| 123 |
+
|
| 124 |
+
Comparisons One can easily see from Table 1 that our proposed SSE-PT has the best performance over all previous methods on all four datasets. On most datasets, our SSE-PT improves NDCG by more than $4 \%$ when compared with SASRec (Kang and McAuley, 2018) and more than $20 \%$ when compared to non-deep-learning methods. SSE-SE, together with dropout and weight decay, is the best choice for regularization, which is evident from Table 3. SSE-SE is a more effective way to regularize our neural networks than any existent techniques including parameter sharing, dropout, weight decay. In practice, these SSE probabilities, just like dropout rate, can be treated as tuning parameters and easily tuned. Movielens10M results are left to Table 6 in the Appendix.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
|
| 128 |
+
Figure 2: Illustration of how SASRec (Left) and SSE-PT (Right) differs on utilizing the Engagement History of A Random User in Movielens1M Dataset.
|
| 129 |
+
|
| 130 |
+
# 4.1 ATTENTION MECHANISM VISUALIZATION
|
| 131 |
+
|
| 132 |
+
Apart from evaluating our SSE-PT against SASRec using well-defined ranking metrics on realworld datasets, we also visualize the differences between both methods in terms of their attention mechanisms. In Figure 2, a random user’s engagement history in Movielens1M dataset is given in temporal order (column-wise). We hide the last item whose index is 26 in test set and hope that a temporal collaborative ranking model can figure out item-26 is the one this user will watch next using only previous engagement history. One can see for a typical user; they tend to look at a different style of movies at different times. Earlier on, they watched a variety of movies, including Sci-Fi, animation, thriller, romance, horror, action, comedy and adventure. But later on, in the last two columns of Figure 2, drama and thriller are the two types they like to watch most, especially the drama type. In fact, they watched 9 drama movies out of recent 10 movies. For humans, it is natural to reason that the hidden movie should probably also be drama type. So what about the machine’s reasoning?
|
| 133 |
+
|
| 134 |
+
For our SSE-PT, the hidden item indexed 26 is put in the first place among its top-5 recommendations. Intelligently, the SSE-PT recommends 3 drama movies, 2 thriller movies and mixing them up in positions. Interestingly, the top recommendation is ‘Othello’, which like the recently watched ‘Richard III’, is an adaptation of a Shakespeare play, and this dependence is reflected in the attention weight. On the contrast, SASRec cannot provide top-5 recommendations that are personalized enough. It recommends a variety of action, Sci-Fi, comedy, horror, and drama movies but none of them match item-26. Although this user has watched all these types of movies in the past, they do not watch these anymore as one can easily tell from his recent history. Unfortunately, SASRec cannot capture this and does not provide personalized recommendations for this user by focusing more on drama and thriller movies. It is easy to see that in contrast, our SSE-PT model shares with human reasoning that more emphasis should be placed on recent movies.
|
| 135 |
+
|
| 136 |
+
# 4.2 TRAINING SPEED
|
| 137 |
+
|
| 138 |
+
In (Kang and McAuley, 2018), it has been shown that SASRec is about 11 times faster than Caser and 17 times faster than $\mathrm { G R U 4 R e c ^ { + } }$ and achieves much better NDCG $@ 1 0$ results so we did not include Caser and GRU4Rec+ in our comparisons. In Figure 3, we only compare the training speeds and ranking performances among SASRec, SSEPT and SSE- $\mathrm { P T } { + } { + }$ for Movielens1M dataset. Given that we added additional user embeddings into our SSE-PT model, it is expected that it will take slightly longer to train our model than un-personalized SASRec. We find empirically that training speed of the SSE-PT and SSE$\mathrm { P T } { + } { + }$ model are comparable to that of SASRec, with SSE$\mathrm { P T } { + } { + }$ being the fastest and the best performing model. It is clear that our SSE-PT and $\mathrm { S S E – P T + + }$ achieve much better ranking performances than our baseline SASRec using the same training time.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 3: Illustration of the speed of SSE-PT
|
| 142 |
+
|
| 143 |
+
# 4.3 ABLATION STUDY
|
| 144 |
+
|
| 145 |
+
SSE probability Given the importance of SSE regularization for our SSE-PT model, we carefully examined the SSE probability for input user embedding in Table 7 in Appendix. We find that the appropriate hyper-parameter SSE probability is not very sensitive: anywhere between 0.4 and 1.0 gives good results, better than parameter sharing and not using SSE-SE. This is also evident based on comparison results in Table 3.
|
| 146 |
+
|
| 147 |
+
Sampling Probability Recall that the sampling probability is unique to our SSE- $\mathrm { P T } { + } { + }$ model. We show in Table 8 in Appendix using an appropriate sampling probability like $0 . 2 0 . 3$ would allow it to outperform SSE-PT when the same maximum length is used.
|
| 148 |
+
|
| 149 |
+
Number of Attention Blocks We find for our SSE-PT model, a larger number of attention blocks is preferred. One can easily see in Table 9 in Appendix, the optimal ranking performances are achieved at $B = 4$ or 5 for Movielens1M dataset and at $B = 6$ for Movielens10M dataset.
|
| 150 |
+
|
| 151 |
+
Personalization and Number of Negatives Sampled Based on the results in Table 10 in Appendix, we are positive that the personalized model always outperforms the un-personalized one when we use the same regularization techniques. This holds true regardless of how many negatives sampled or what ranking metrics are used during evaluation.
|
| 152 |
+
|
| 153 |
+
# 5 CONCLUSION
|
| 154 |
+
|
| 155 |
+
In this paper, we propose a novel neural network architecture called Personalized Transformer for the temporal collaborative ranking problem. It enjoys the benefits of being a personalized model, therefore achieving better ranking results for individual users than the current state-of-the-art. By examining the attention mechanisms during inference, the model is also more interpretable and tends to pay more attention to recent items in long sequences than un-personalized deep learning models.
|
| 156 |
+
|
| 157 |
+
# REFERENCES
|
| 158 |
+
|
| 159 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 160 |
+
|
| 161 |
+
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
|
| 162 |
+
|
| 163 |
+
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.
|
| 164 |
+
|
| 165 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT press Cambridge, 2016.
|
| 166 |
+
|
| 167 |
+
F Maxwell Harper and Joseph A Konstan. The movielens datasets: History and context. Acm transactions on interactive intelligent systems (tiis), 5(4):19, 2016.
|
| 168 |
+
|
| 169 |
+
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.
|
| 170 |
+
|
| 171 |
+
Ruining He, Wang-Cheng Kang, and Julian McAuley. Translation-based recommendation. In Proceedings of the Eleventh ACM Conference on Recommender Systems, pages 161–169. ACM, 2017.
|
| 172 |
+
|
| 173 |
+
Balázs Hidasi and Alexandros Karatzoglou. Recurrent neural networks with top- $\mathbf { \nabla } _ { k }$ gains for sessionbased recommendations. In Proceedings of the 27th ACM International Conference on Information and Knowledge Management, pages 843–852. ACM, 2018.
|
| 174 |
+
|
| 175 |
+
Balázs Hidasi, Alexandros Karatzoglou, Linas Baltrunas, and Domonkos Tikk. Session-based recommendations with recurrent neural networks. arXiv preprint arXiv:1511.06939, 2015.
|
| 176 |
+
|
| 177 |
+
Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012.
|
| 178 |
+
|
| 179 |
+
Arthur E Hoerl and Robert W Kennard. Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1):55–67, 1970.
|
| 180 |
+
|
| 181 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 182 |
+
|
| 183 |
+
Wang-Cheng Kang and Julian McAuley. Self-attentive sequential recommendation. arXiv preprint arXiv:1808.09781, 2018.
|
| 184 |
+
|
| 185 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 186 |
+
|
| 187 |
+
Yehuda Koren. Collaborative filtering with temporal dynamics. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 447–456. ACM, 2009.
|
| 188 |
+
|
| 189 |
+
Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pages 950–957, 1992.
|
| 190 |
+
|
| 191 |
+
Qiao Liu, Yifu Zeng, Refuoe Mokhosi, and Haibin Zhang. Stamp: short-term attention/memory priority model for session-based recommendation. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 1831–1839. ACM, 2018.
|
| 192 |
+
|
| 193 |
+
Chen Ma, Peng Kang, and Xue Liu. Hierarchical gating networks for sequential recommendation. arXiv preprint arXiv:1906.09217, 2019.
|
| 194 |
+
|
| 195 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning, pages 1310–1318, 2013.
|
| 196 |
+
|
| 197 |
+
Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. Bpr: Bayesian personalized ranking from implicit feedback. In Proceedings of the twenty-fifth conference on uncertainty in artificial intelligence, pages 452–461. AUAI Press, 2009.
|
| 198 |
+
|
| 199 |
+
Steffen Rendle, Christoph Freudenthaler, and Lars Schmidt-Thieme. Factorizing personalized markov chains for next-basket recommendation. In Proceedings of the 19th international conference on World wide web, pages 811–820. ACM, 2010.
|
| 200 |
+
|
| 201 |
+
Badrul Munir Sarwar, George Karypis, Joseph A Konstan, John Riedl, et al. Item-based collaborative filtering recommendation algorithms. Www, 1:285–295, 2001.
|
| 202 |
+
|
| 203 |
+
Nathan Srebro, Jason Rennie, and Tommi S Jaakkola. Maximum-margin matrix factorization. In Advances in neural information processing systems, pages 1329–1336, 2005.
|
| 204 |
+
|
| 205 |
+
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.
|
| 206 |
+
|
| 207 |
+
Jiaxi Tang and Ke Wang. Personalized top-n sequential recommendation via convolutional sequence embedding. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pages 565–573. ACM, 2018.
|
| 208 |
+
|
| 209 |
+
Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pages 267–288, 1996.
|
| 210 |
+
|
| 211 |
+
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, pages 5998–6008, 2017.
|
| 212 |
+
|
| 213 |
+
Liwei Wu, Cho-Jui Hsieh, and James Sharpnack. Sql-rank: A listwise approach to collaborative ranking. In Proceedings of Machine Learning Research (35th International Conference on Machine Learning), volume 80, 2018.
|
| 214 |
+
|
| 215 |
+
Liwei Wu, Shuqing Li, Cho-Jui Hsieh, and James Sharpnack. Stochastic shared embeddings: Datadriven regularization of embedding layers. arXiv preprint arXiv:1905.10630, 2019.
|
| 216 |
+
|
| 217 |
+
# 6 APPENDIX
|
| 218 |
+
|
| 219 |
+
• $\operatorname { N D C G @ } K$ : defined as:
|
| 220 |
+
|
| 221 |
+
$$
|
| 222 |
+
\mathrm { N D C G @ } K = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \frac { \mathrm { D C G @ } K ( i , \Pi _ { i } ) } { \mathrm { D C G @ } K ( i , \Pi _ { i } ^ { * } ) } ,
|
| 223 |
+
$$
|
| 224 |
+
|
| 225 |
+
where $i$ represents $i$ -th user and
|
| 226 |
+
|
| 227 |
+
$$
|
| 228 |
+
\mathrm { D C G @ } K ( i , \Pi _ { i } ) = \sum _ { l = 1 } ^ { K } \frac { 2 ^ { R _ { i \Pi _ { i l } } } - 1 } { \log _ { 2 } ( l + 1 ) } .
|
| 229 |
+
$$
|
| 230 |
+
|
| 231 |
+
In the DCG definition, $\Pi _ { i l }$ represents the index of the $l$ -th ranked item for user $i$ in test data based on the learned score matrix $X$ . $R$ is the rating matrix and $R _ { i j }$ is the rating given to item $j$ by user $i$ . $\Pi _ { i } ^ { * }$ is the ordering provided by the ground truth rating.
|
| 232 |
+
|
| 233 |
+
• Recall $@ K$ : defined as a fraction of positive items retrieved by the top $K$ recommendations the model makes:
|
| 234 |
+
|
| 235 |
+
$$
|
| 236 |
+
{ \mathrm { R e c a l l @ } } K = { \frac { \sum _ { i = 1 } ^ { n } \mathbb { 1 } \left\{ \exists 1 \leq l \leq K : R _ { i \Pi _ { i l } } = 1 \right\} } { n } } ,
|
| 237 |
+
$$
|
| 238 |
+
|
| 239 |
+
here we already assume there is only a single positive item that user will engage next and the indicator function $\mathbb { 1 } \{ \exists 1 \leq l \leq k : { R _ { i \Pi _ { i l } } } = \hat { 1 } \}$ is defined to indicate whether the positive item falls into the top $K$ position in our obtained ranked list using scores predicted in (4).
|
| 240 |
+
|
| 241 |
+
Layer Normalization Layer normalization (Ba et al., 2016) normalizes neurons within a layer. Previous studies (Ba et al., 2016) show it is more effective than batch normalization for training recurrent neural networks (RNNs). One alternative is the batch normalization (Ioffe and Szegedy, 2015) but we find it does not work as well as the layer normalization in practice even for a reasonable large batch size of 128. Therefore, our SSE-PT model adopts layer normalization.
|
| 242 |
+
|
| 243 |
+
Residual Connections Residual connections are firstly proposed in ResNet for image classification problems (He et al., 2016). Recent research finds that residual connections can help training very deep neural networks even if they are not convolutional neural networks (Vaswani et al., 2017). Using residual connections allows us to train very deep neural networks here. For example, the best performing model for Movielens10M dataset in Table 9 is the SSE-PT with 6 attention blocks, in which $1 + 6 * 3 + 1 = 2 0$ layers are trained end-to-end.
|
| 244 |
+
|
| 245 |
+
Weight Decay Weight decay (Krogh and Hertz, 1992), also known as $l _ { 2 }$ regularization (Hoerl and Kennard, 1970), is applied to all embeddings, including both user and item embeddings.
|
| 246 |
+
|
| 247 |
+
Dropout Dropout (Srivastava et al., 2014) is applied to the embedding layer $E$ , self-attention layer and pointwise feed-forward layer by stochastically dropping some percentage of hidden units to prevent co-adaption of neurons. Dropout has been shown to be an effective way of regularizing deep learning models.
|
| 248 |
+
|
| 249 |
+
In summary, layer normalization and dropout are used in all layers except prediction layer. Residual connections are used in both self-attention layer and pointwise feed-forward layer. SSE-SE is used in embedding layer and prediction layer.
|
| 250 |
+
|
| 251 |
+
Table 4: Description of Datasets Used in Evaluations.
|
| 252 |
+
|
| 253 |
+
<table><tr><td>DATASET</td><td>#USERS</td><td>#ITEMS</td><td>AVG SEQUENCELEN</td><td>MAX SEQUENCE LEN</td></tr><tr><td>BEAUTY</td><td>52,024</td><td>57,289</td><td>7.6</td><td>291</td></tr><tr><td>GAMES</td><td>31,013</td><td>23,715</td><td>7.3</td><td>858</td></tr><tr><td>STEAM</td><td>334,730</td><td>13,047</td><td>11.0</td><td>1,229</td></tr><tr><td>ML-1M</td><td>6,040</td><td>3,416</td><td>163.5</td><td>2,275</td></tr><tr><td>ML-10M</td><td>69,878</td><td>65,133</td><td>141.1</td><td>7,357</td></tr></table>
|
| 254 |
+
|
| 255 |
+
Table 5: Comparing our SSE-PT, SSE- $\mathrm { P T } { + } { + }$ with SASRec on Movielen1M dataset. We use number of negatives $C = 1 0 0$ , dropout probability of 0.2 and learning rate of $1 e ^ { - 3 }$ for all experiments while varying others. $p _ { u } , p _ { i } , p _ { u }$ are SSE probabilities for user embedding, input item embedding and output item embedding respectively.
|
| 256 |
+
|
| 257 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Movielens1m</td><td colspan="2">Dimensions</td><td colspan="2">Number of Blocks</td><td colspan="3">Sampling Probability SSE-SE Parameters</td></tr><tr><td>NDCG@10</td><td>Recall@10</td><td>du</td><td>di</td><td>b</td><td>ps</td><td>Pu</td><td>Pi</td><td>Py</td></tr><tr><td>SASRec</td><td>0.5961</td><td>0.8195</td><td>-</td><td>50</td><td>2</td><td></td><td>-</td><td>=</td><td>-</td></tr><tr><td>SASRec</td><td>0.5941</td><td>0.8182</td><td>-</td><td>100</td><td>2</td><td></td><td></td><td>=</td><td>-</td></tr><tr><td>SASRec</td><td>0.5996</td><td>0.8272</td><td>-</td><td>100</td><td>6</td><td></td><td>-</td><td>-</td><td>-</td></tr><tr><td>SSE-PT</td><td>0.6101</td><td>0.8343</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0</td></tr><tr><td>SSE-PT</td><td>0.6164</td><td>0.8336</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.5832</td><td>0.8091</td><td>50</td><td>50</td><td>2</td><td></td><td>0</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6174</td><td>0.8351</td><td>50</td><td>50</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.5949</td><td>0.8205</td><td>75</td><td>25</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6214</td><td>0.8359</td><td>25</td><td>75</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT</td><td>0.6281</td><td>0.8341</td><td>50</td><td>100</td><td>2</td><td></td><td>0.92</td><td>0.1</td><td>0.1</td></tr><tr><td>SSE-PT++</td><td>0.6292</td><td>0.8389</td><td>50</td><td>100</td><td>2</td><td>0.3</td><td>0.92</td><td>0.1</td><td>0.1</td></tr></table>
|
| 258 |
+
|
| 259 |
+
Table 6: Comparing our SSE-PT with SASRec on Movielens10M dataset. Unlike Table 5, we use the number of negatives $C = 5 0 0$ instead of 100 as $C = 1 0 0$ is too easy for this dataset and it gets too difficult to tell the differences between different methods: Hit Ratio $@ 1 0$ approaches 1.
|
| 260 |
+
|
| 261 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Movielens1m</td><td colspan="2">Dimensions</td><td colspan="2">Number of Blocks</td><td colspan="3">SSE-SE Parameters</td></tr><tr><td>Model NDCG@10</td><td>Hit Ratio@10</td><td>d</td><td>di</td><td></td><td>b</td><td>Pu</td><td>Pi</td><td>Py</td></tr><tr><td>SASRec</td><td>0.7268</td><td>0.9429</td><td>-</td><td>50</td><td>2</td><td></td><td>1</td><td>-</td><td>1</td></tr><tr><td>SASRec</td><td>0.7413</td><td>0.9474</td><td>1</td><td>100</td><td>2</td><td></td><td>1</td><td>1</td><td>1</td></tr><tr><td>SSE-PT</td><td>0.7199</td><td>0.9331</td><td>50</td><td>100</td><td>2</td><td></td><td>PS</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7169</td><td>0.9296</td><td>50</td><td>100</td><td>2</td><td></td><td>0.0</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7398</td><td>0.9418</td><td>50</td><td>100</td><td>2</td><td></td><td>0.2</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7500</td><td>0.9500</td><td>50</td><td>100</td><td>2</td><td></td><td>0.4</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7484</td><td>0.9480</td><td>50</td><td>100</td><td></td><td>2</td><td>0.6</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7529</td><td>0.9485</td><td>50</td><td>100</td><td></td><td>2</td><td>0.8</td><td>0.01</td><td>0.01</td></tr><tr><td>SSE-PT</td><td>0.7503</td><td>0.9505</td><td>50</td><td>100</td><td></td><td>2</td><td>1.0</td><td>0.01</td><td>0.01</td></tr></table>
|
| 262 |
+
|
| 263 |
+
• PopRec: ranking items according to their popularity.
|
| 264 |
+
|
| 265 |
+
• BPR: Bayesian personalized ranking for implicit feedback setting (Rendle et al., 2009). It is a low-rank matrix factorization model with a pairwise loss function. But it does not utilize the temporal information. Therefore, it serves as a strong baseline for non-temporal methods.
|
| 266 |
+
|
| 267 |
+
• FMC: Factorized Markov Chains: a first-order Markov Chain method, in which predictions are made only based on previously engaged item.
|
| 268 |
+
|
| 269 |
+
• PFMC: a personalized Markov chain model (Rendle et al., 2010) that combines matrix factorization and first-order Markov Chain to take advantage of both users’ latent long-term preferences as well as short-term item transitions.
|
| 270 |
+
|
| 271 |
+
• TransRec: a first-order sequential recommendation method (He et al., 2017) in which items are embedded into a transition space and users are modelled as translation vectors operating on item sequences.
|
| 272 |
+
|
| 273 |
+
SQL-Rank (Wu et al., 2018) and item-based recommendations (Sarwar et al., 2001) are omitted because the former is similar to BPR (Rendle et al., 2009) except using the listwise loss function instead of the pairwise loss function and the latter has been shown inferior to TransRec (He et al., 2017).
|
| 274 |
+
|
| 275 |
+
# 6.0.1 DEEP-LEARNING BASELINES
|
| 276 |
+
|
| 277 |
+
• GRU4Rec: the first RNN-based method proposed for the session-based recommendation problem (Hidasi et al., 2015). It utilizes the GRU structures (Chung et al., 2014) initially proposed for speech modelling.
|
| 278 |
+
|
| 279 |
+
• GRU4Rec+: follow-up work of GRU4Rec by the same authors: the model has a very similar architecture to GRU4Rec but has a more complicated loss function (Hidasi and Karatzoglou, 2018).
|
| 280 |
+
|
| 281 |
+
• Caser: a CNN-based method (Tang and Wang, 2018) which embeds a sequence of recent items in both time and latent spaces forming an ‘image’ before learning local features through horizontal and vertical convolutional filters. In (Tang and Wang, 2018), user embeddings are included in the prediction layer only. On the contrast, in our Personalized Transformer, user embeddings are also introduced in the lowest embedding layer so they can play an important role in self-attention mechanisms as well as in prediction stages.
|
| 282 |
+
|
| 283 |
+
• STAMP: a session-based recommendation algorithm (Liu et al., 2018) using attention mechanism. (Liu et al., 2018) only uses fully connected layers with one attention block that is not self-attentive.
|
| 284 |
+
|
| 285 |
+
• SASRec: a self-attentive sequential recommendation method (Kang and McAuley, 2018) motivated by Transformer in NLP (Vaswani et al., 2017). Unlike our method SSE-PT, SASRec does not incorporate user embedding and therefore is not a personalized method. SASRec paper (Kang and McAuley, 2018) also does not utilize SSE (Wu et al., 2019) for further regularization: only dropout and weight decay are used.
|
| 286 |
+
|
| 287 |
+
• HGN: hierarchical gating networks method to solve the sequential recommendation problem (Ma et al., 2019), which incorporates the user embeddings and gating networks for better personalization than the SASRec model.
|
| 288 |
+
|
| 289 |
+
Table 7: Comparing Different SSE probability for user embeddings for SSE-PT on Movielens1M Dataset. Embedding hidden units of 50 for users and 100 for items, attention blocks of 2, SSE probability of 0.01 for item embeddings, dropout probability of 0.2 and max length of 200 are used.
|
| 290 |
+
|
| 291 |
+
<table><tr><td>USER-SIDE SSE-SE PROBABILITY</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td>PARAMETER SHARING</td><td>0.6188</td><td>0.8294</td></tr><tr><td>1.0</td><td>0.6258</td><td>0.8346</td></tr><tr><td>0.9</td><td>0.6275</td><td>0.8321</td></tr><tr><td>0.8</td><td>0.6244</td><td>0.8359</td></tr><tr><td>0.6</td><td>0.6256</td><td>0.8341</td></tr><tr><td>0.4</td><td>0.6237</td><td>0.8369</td></tr><tr><td>0.2</td><td>0.6163</td><td>0.8281</td></tr><tr><td>0.0</td><td>0.5908</td><td>0.8048</td></tr></table>
|
| 292 |
+
|
| 293 |
+
Table 8: Comparing Different Sampling Probability, $p _ { s }$ , of SSE- $\mathrm { P T } { + } { + }$ on Movielens1M Dataset. Hyper-parameters the same as Table 7, except that the max length $T$ allowed is set 100 instead of 200 to show effects of sampling sequences.
|
| 294 |
+
|
| 295 |
+
<table><tr><td>SAMPLING PROBABILITY</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td>SASREC (T: =100)</td><td>0.5769</td><td>0.8045</td></tr><tr><td>SSE-PT(T: = 100)</td><td>0.6142</td><td>0.8212</td></tr><tr><td>1.0</td><td>0.5697</td><td>0.7977</td></tr><tr><td>0.8</td><td>0.5735</td><td>0.7801</td></tr><tr><td>0.6</td><td>0.6062</td><td>0.8242</td></tr><tr><td>0.4</td><td>0.6113</td><td>0.8273</td></tr><tr><td>0.3</td><td>0.6186</td><td>0.8318</td></tr><tr><td>0.2</td><td>0.6193</td><td>0.8233</td></tr><tr><td>0.0</td><td>0.6142</td><td>0.8212</td></tr></table>
|
| 296 |
+
|
| 297 |
+
Table 9: Comparing Different Number of Blocks for SSE-PT while Keeping The Rest Fixed on Movielens1M and Movielens10M Datasets.
|
| 298 |
+
|
| 299 |
+
<table><tr><td>DATASETS</td><td># OF BLOCKS</td><td>NDCG@10</td><td>RECALL@10</td></tr><tr><td rowspan="7">MOVIELENS1M</td><td>SASREC (6 BLOCKS)</td><td>0.5984</td><td>0.8207</td></tr><tr><td>1</td><td>0.6162</td><td>0.8301</td></tr><tr><td>2</td><td>0.6280</td><td>0.8365</td></tr><tr><td>3</td><td>0.6293</td><td>0.8376</td></tr><tr><td>4</td><td>0.6270</td><td>0.8401</td></tr><tr><td>5</td><td>0.6308</td><td>0.8361</td></tr><tr><td>6</td><td>0.6270</td><td>0.8397</td></tr><tr><td rowspan="6">MOVIELENS10M</td><td>SASREC(6 BLOCKS)</td><td>0.7531</td><td>0.9490</td></tr><tr><td>1</td><td>0.7454</td><td>0.9478</td></tr><tr><td>2</td><td>0.7512</td><td>0.9522</td></tr><tr><td>3</td><td>0.7543</td><td>0.9491</td></tr><tr><td>4</td><td>0.7608</td><td>0.9485</td></tr><tr><td>5</td><td>0.7619</td><td>0.9524</td></tr><tr><td></td><td>6</td><td>0.7683</td><td>0.9537</td></tr></table>
|
| 300 |
+
|
| 301 |
+
Table 10: Varying number of negatives $C$ in evaluation on Movielens1M dataset. Other hyperparameters are fixed for a fair comparison.
|
| 302 |
+
|
| 303 |
+
<table><tr><td>METRIC</td><td>NDCG@10</td><td>RECALL @10</td><td>C</td></tr><tr><td>UN-PERSONALIZED</td><td>0.3787</td><td>0.6119</td><td>500</td></tr><tr><td>PERSONALIZED</td><td>0.3846</td><td>0.6171</td><td>500</td></tr><tr><td>UN-PERSONALIZED</td><td>0.2791</td><td>0.4781</td><td>1000</td></tr><tr><td>PERSONALIZED</td><td>0.2860</td><td>0.4929</td><td>1000</td></tr><tr><td>UN-PERSONALIZED</td><td>0.1939</td><td>0.3515</td><td>2000</td></tr><tr><td>PERSONALIZED</td><td>0.1993</td><td>0.3667</td><td>2000</td></tr></table>
|
md/train/HkxjYoCqKX/HkxjYoCqKX.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RELAXED QUANTIZATION FOR DISCRETIZED NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Christos Louizos∗ University of Amsterdam TNO Intelligent Imaging c.louizos@uva.nl
|
| 4 |
+
|
| 5 |
+
Matthias Reisser QUVA Lab University of Amsterdam m.reisser@uva.nl
|
| 6 |
+
|
| 7 |
+
Tijmen Blankevoort Qualcomm AI Research tijmen@qti.qualcomm.com
|
| 8 |
+
|
| 9 |
+
Efstratios Gavves QUVA Lab University of Amsterdam egavves@uva.nl
|
| 10 |
+
|
| 11 |
+
Max Welling
|
| 12 |
+
University of Amsterdam Qualcomm
|
| 13 |
+
m.welling@uva.nl
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Neural network quantization has become an important research area due to its great impact on deployment of large models on resource constrained devices. In order to train networks that can be effectively discretized without loss of performance, we introduce a differentiable quantization procedure. Differentiability can be achieved by transforming continuous distributions over the weights and activations of the network to categorical distributions over the quantization grid. These are subsequently relaxed to continuous surrogates that can allow for efficient gradient-based optimization. We further show that stochastic rounding can be seen as a special case of the proposed approach and that under this formulation the quantization grid itself can also be optimized with gradient descent. We experimentally validate the performance of our method on MNIST, CIFAR 10 and Imagenet classification.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Neural networks excel in a variety of large scale problems due to their highly flexible parametric nature. However, deploying big models on resource constrained devices, such as mobile phones, drones or IoT devices is still challenging because they require a large amount of power, memory and computation. Neural network compression is a means to tackle this issue and has therefore become an important research topic.
|
| 22 |
+
|
| 23 |
+
Neural network compression can be, roughly, divided into two not mutually exclusive categories: pruning and quantization. While pruning (LeCun et al., 1990; Han et al., 2015) aims to make the model “smaller” by altering the architecture, quantization aims to reduce the precision of the arithmetic operations in the network. In this paper we focus on the latter. Most network quantization methods either simulate or enforce discretization of the network during training, e.g. via rounding of the weights and activations. Although seemingly straighforward, the discontinuity of the discretization makes the gradient-based optimization infeasible. The reason is that there is no gradient of the loss with respect to the parameters. A workaround to the discontinuity are the “pseudo-gradients” according to the straight-through estimator (Bengio et al., 2013), which have been successfully used for training low-bit width architectures at e.g. Hubara et al. (2016); Zhu et al. (2016).
|
| 24 |
+
|
| 25 |
+
The purpose of this work is to introduce a novel quantization procedure, Relaxed Quantization (RQ). RQ can bypass the non-differentiability of the quantization operation during training by smoothing it appropriately. The contributions of this paper are four-fold: First, we show how to make the set of quantization targets part of the training process such that we can optimize them with gradient descent. Second, we introduce a way to discretize the network by converting distributions over the weights and activations to categorical distributions over the quantization grid. Third, we show that we can obtain a “smooth” quantization procedure by replacing the categorical distributions with concrete (Maddison et al., 2016; Jang et al., 2016) equivalents. Finally we show that stochastic rounding (Gupta et al., 2015), one of the most popular quantization techniques, can be seen as a special case of the proposed framework. We present the details of our approach in Section 2, discuss related work in Section 3 and experimentally validate it in Section 4. Finally we conclude and provide fruitful directions for future research in Section 5.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: The proposed discretization process. (a) Given a distribution $p ( \tilde { x } )$ over the real line we partition it into $K$ intervals of width $\alpha$ where the center of each of the intervals is a grid point $g _ { i }$ . The shaded area corresponds to the probability of $\tilde { x }$ falling inside the interval containing that specific $g _ { i }$ . (b) Categorical distribution over the grid obtained after discretization. The probability of each of the grid points $g _ { i }$ is equal to the probability of $\tilde { x }$ falling inside their respective intervals.
|
| 29 |
+
|
| 30 |
+
# 2 RELAXED QUANTIZATION FOR DISCRETIZING NEURAL NETWORKS
|
| 31 |
+
|
| 32 |
+
The central element for the discretization of weights and activations of a neural network is a quantizer $q ( \cdot )$ . The quantizer receives a (usually) continous signal as input and discretizes it to a countable set of values. This process is inherently lossy and non-invertible: given the output of the quantizer, it is impossible to determine the exact value of the input. One of the simplest quantizers is the rounding function:
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
q ( x ) = \alpha \left\lfloor { \frac { x } { \alpha } } + { \frac { 1 } { 2 } } \right\rfloor ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $\alpha$ corresponds to the step size of the quantizer. With $\alpha = 1$ , the quantizer rounds $x$ to its nearest integer number.
|
| 39 |
+
|
| 40 |
+
Unfortunately, we cannot simply apply the rounding quantizer to discretize the weights and activations of a neural network. Because of the quantizers’ lossy and non-invertible nature, important information might be destroyed and lead to a decrease in accuracy. To this end, it is preferable to train the neural network while simulating the effects of quantization during the training procedure. This encourages the weights and activations to be robust to quantization and therefore decreases the performance gap between a full-precision neural network and its discretized version.
|
| 41 |
+
|
| 42 |
+
However, the aforementioned rounding process is non-differentiable. As a result, we cannot directly optimize the discretized network with stochastic gradient descent, the workhorse of neural network optimization. In this work, we posit a “smooth” quantizer as a possible way for enabling gradient based optimization.
|
| 43 |
+
|
| 44 |
+
# 2.1 LEARNING (FIXED POINT) QUANTIZERS VIA GRADIENT DESCENT
|
| 45 |
+
|
| 46 |
+
The proposed quantizer comprises four elements: a vocabulary, its noise model and the resulting discretization procedure, as well as a final relaxation step to enable gradient based optimization.
|
| 47 |
+
|
| 48 |
+
The first element of the quantizer is the vocabulary: it is the set of (countable) output values that the quantizer can produce. In our case, this vocabulary has an inherent structure, as it is a grid of ordered
|
| 49 |
+
|
| 50 |
+
scalars. For fixed point quantization the grid $\mathcal { G }$ is defined as
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathcal { G } = \left[ - 2 ^ { b - 1 } , \ldots , 0 , \ldots , 2 ^ { b - 1 } - 1 \right] ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $b$ is the number of available bits that allow for $K = 2 ^ { b }$ possible integer values. By construction this grid of values is agnostic to the input signal $x$ and hence suboptimal; to allow for the grid to adapt to $x$ we introduce two free parameters, a scale $\alpha$ and an offset $\beta$ . This leads to a learnable grid via $\hat { \mathcal { G } } = \alpha \mathcal { G } + \beta$ that can adapt to the range and location of the input signal.
|
| 57 |
+
|
| 58 |
+
The second element of the quantizer is the assumption about the input noise $\epsilon$ ; it determines how probable it is for a specific value of the input signal to move to each grid point. Adding noise to $x$ will result in a quantizer that is, on average, a smooth function of its input. In essense, this is an application of variational optimization (Staines & Barber, 2012) to the non-differentiable rounding function, which enables us to do gradient based optimization.
|
| 59 |
+
|
| 60 |
+
We model this form of noise as acting additively to the input signal $x$ and being governed by a distribution $p ( \epsilon )$ . This process induces a distribution $p ( \tilde { x } )$ where $\tilde { x } = x + \epsilon$ . In the next step of the quantization procedure, we discretize $p ( \tilde { x } )$ according to the quantization grid $\hat { \mathcal G }$ ; this neccesitates the evaluation of the cumulative distribution function (CDF). For this reason, we will assume that the noise is distributed according to a zero mean logistic distribution with a standard deviation $\sigma$ , i.e. $L ( 0 , \sigma )$ , hence leading to $p ( \bar { \tilde { x } } ) = L ( x , \sigma )$ . The CDF of the logistic distribution is the sigmoid function which is easy to evaluate and backpropagate through. Using Gaussian distributions proved to be less effective in preliminary experiments. Other distributions are conceivable and we will briefly discuss the choice of a uniform distribution in Section 2.3.
|
| 61 |
+
|
| 62 |
+
The third element is, given the aforementioned assumptions, how the quantizer determines an appropriate assignment for each realization of the input signal $x$ . Due to the stochastic nature of $\tilde { x }$ , a deterministic round-to-nearest operation will result in a stochastic quantizer for $x$ . Quantizing $x$ in this manner corresponds to discretizing $p ( \tilde { x } )$ onto $\hat { \mathcal G }$ and then sampling grid points $g _ { i }$ from it. More specifically, we construct a categorical distribution over the grid by adopting intervals of width equal to $\alpha$ centered at each of the grid points. The probability of selecting that particular grid point will now be equal to the probability of $\tilde { x }$ falling inside those intervals:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r l } & { p ( \hat { x } = g _ { i } | x , \sigma ) = P ( \tilde { x } \leq ( g _ { i } + \alpha / 2 ) ) - P ( \tilde { x } < ( g _ { i } - \alpha / 2 ) ) ) } \\ & { \qquad = \mathrm { S i g m o i d } ( ( g _ { i } + \alpha / 2 - x ) / \sigma ) - \mathrm { S i g m o i d } ( ( g _ { i } - \alpha / 2 - x ) / \sigma ) , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $\hat { x }$ corresponds to the quantized variable, $P ( \cdot )$ corresponds to the CDF and the step from Equation 2 to Equation 3 is due to the logistic noise assumption. A visualization of the aforementioned process can be seen in Figure 1. For the first and last grid point we will assume that they reside within $( g _ { 0 } - \alpha / 2 , g _ { 0 } + \alpha / 2 ]$ and $\left( g _ { K } - \alpha / 2 , g _ { K } + \alpha / 2 \right]$ respectively. Under this assumption we will have to truncate $p ( \tilde { x } )$ such that it only has support within $\left( g _ { 0 } - \alpha / 2 , g _ { K } + \alpha / 2 \right]$ . Fortunately this is easy to do, as it corresponds to just a simple modification of the CDF:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
P ( \tilde { x } \le c | \tilde { x } \in ( g _ { 0 } - \alpha / 2 , g _ { K } + \alpha / 2 ] ) = \frac { P ( \tilde { x } \le c ) - P ( \tilde { x } < ( g _ { 0 } - \alpha / 2 ) ) } { P ( \tilde { x } \le ( g _ { K } + \alpha / 2 ) ) - P ( \tilde { x } < ( g _ { 0 } - \alpha / 2 ) ) } .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Armed with this categorical distribution over the grid, the quantizer proceeds to assign a specific grid value to $\hat { x }$ by drawing a random sample. This procedure emulates quantization noise, which prevents the model from fitting the data. This noise can be reduced in two ways: by clustering the weights and activations around the points of the grid and by reducing the logistic noise $\sigma$ . As $\sigma 0$ , the CDF converges towards the step function, prohibiting gradient flow. On the other hand, if $\epsilon$ is too high, the optimization procedure is very noisy, prohibiting convergence. For this reason, during optimization we initialize $\sigma$ in a sensible range, such that $L ( x , \sigma )$ covers a significant portion of the grid. Please confer Appendix A for details. We then let $\sigma$ be freely optimized via gradient descent such that the loss is minimized. Both effects reduce the gap between the function that the neural network computes during training time vs. test time. We illustrate this in Figure 2.
|
| 75 |
+
|
| 76 |
+
The fourth element of the procedure is the relaxation of the non-differentiable categorical distribution sampling. While we can use an unbiased gradient estimator via REINFORCE (Williams, 1992), we opt for a continuous relaxation due to high variances with REINFORCE. This is achieved by replacing the categorical distribution with a concrete distribution (Maddison et al., 2016; Jang et al., 2016). This relaxation procedure corresponds to adopting a “smooth” categorical distribution that can be seen as a “noisy” softmax. Let $\pi _ { i }$ be the categorical probability of sampling grid point $i$ , i.e. $\pi _ { i } = p ( { \hat { x } } = g _ { i } )$ ; the “smoothed” quantized value $\hat { x }$ can be obtained via:
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 2: Best viewed in color. Illustration of the inductive bias obtained via training with the proposed quantizer; means of the logistic distribution over the weights for each layer of the LeNet-5 when trained with 2 bits per weight and activation. Each color corresponds to an assignment to a particular grid point and the vertical dashed lines correspond to the grid points $\beta = 0$ ). We can clearly see that the real valued weights are naturally encouraged through training to cluster into multiple modes, one for each grid point. It should also be mentioned, that for the right and leftmost grid points the probability of selecting them is maximized by moving the corresponding weight furthest right or left respectively. Interestingly, we observe that the network converged to ternary weights for the input and (almost) binary weights for the output layer.
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
u _ { i } \sim \mathrm { G u m b e l } ( 0 , 1 ) , \qquad z _ { i } = \frac { \exp ( ( \log \pi _ { i } + u _ { i } ) / \lambda ) } { \sum _ { j } \exp ( ( \log \pi _ { j } + u _ { j } ) / \lambda ) } , \qquad \hat { x } = \sum _ { i = 1 } ^ { K } z _ { i } g _ { i } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $z _ { i }$ is the random sample from the concrete distribution and $\lambda$ is a temperature parameter that controls the degree of approximation, since as $\lambda 0$ the concrete distribution becomes a categorical.
|
| 86 |
+
|
| 87 |
+
We have thus defined a fully differentiable “soft” quantization procedure that allows for stochastic gradients for both the quantizer parameters $\alpha , \beta , \sigma$ as well as the input signal $x$ (e.g. the weights or the activations of a neural network). We refer to this algorithm as Relaxed Quantization (RQ). We summarize its forward pass as performed during training in Algorithm 1. It is also worthwhile to notice that if there were no noise at the input $x$ then the categorical distribution would have non-zero mass only at a single value, thus prohibiting gradient based optimization for $x$ and $\sigma$ .
|
| 88 |
+
|
| 89 |
+
One drawback of this approach is that the smoothed quantized values defined in Equation 5 do not have to coincide with grid points, as $z$ is not a one-hot vector. Instead, these values can lie anywhere between the smallest and largest grid point, something which is impossible with e.g. stochastic rounding (Gupta et al., 2015). In order to make sure that only grid-points are sampled, we propose an alternative algorithm RQ ST in which we use the variant of the straight-through (ST) estimator proposed in Jang et al. (2016). Here we sample the actual categorical distribution during the forward pass but assume a sample from the concrete distribution for the backward pass. While this gradient estimator is obviously biased, in practice it works as the “gradients” seem to point towards a valid direction. This effect was also recently studied at Yin et al. (2019). We perform experiments with both variants.
|
| 90 |
+
|
| 91 |
+
After convergence, we can obtain a “hard” quantization procedure, i.e. select points from the grid, at test time by either reverting to a categorical distribution (instead of the continuous surrogate) or by rounding to the nearest grid point. In this paper we chose the latter as it is more aligned with the low-resource environments in which quantized models will be deployed. Furthermore, with this goal in mind, we employ two quantization grids with their own learnable scalar $\alpha , \sigma$ (and potentially $\beta$ ) parameters for each layer; one for the weights and one for the activations.
|
| 92 |
+
|
| 93 |
+
# 2.2 SCALABLE QUANTIZATION VIA A LOCAL GRID
|
| 94 |
+
|
| 95 |
+
Sampling $\hat { x }$ based on drawing $K$ random numbers for the concrete distribution as described in Equation 5 can be very expensive for larger values of $K$ . Firstly, drawing $K$ random numbers for every individual weight and activation in a neural network drastically increases the number of operations required in the forward pass. Secondly, it also requires keeping many more numbers in memory for gradient computations during the backward pass. Compared to a standard neural network or stochastic rounding approaches, the proposed procedure can thus be infeasible for larger models and datasets.
|
| 96 |
+
|
| 97 |
+
<table><tr><td>Algorithm 1 Quantization during training.</td><td>Algorithm 2 Quantization during testing.</td></tr><tr><td>Require: Input x, grid G, scale of the grid α, scale of noise o, temperature 入, fuzz param. e r =[- α/2,gk +α/2] #interval points c = Sigmoid((r - x)/σ)# evaluate CDF Ti= cK+1]-c[1]+Ke c[i+1]-c[i]+∈ # categorical distr. z ~ Concrete(π,λ) return ∑i zigi</td><td>Require: Input x, scale and offset of the grid α, β, minimum and maximum values go, gK y = α·round((x - β)/α) + β return min(gk,max(go,y)</td></tr></table>
|
| 98 |
+
|
| 99 |
+
Fortunately, we can make sampling $\hat { x }$ independent of the grid size by assuming zero probability for grid-points that lie far away from the signal $x$ . Specifically, by only considering grid points that are within $\delta$ standard deviations away from $x$ , we truncate $p ( \tilde { x } )$ such that it lies within a “localized” grid around $x$ .
|
| 100 |
+
|
| 101 |
+
To simplify the computation required for determining the local grid elements, we choose the grid point closest to $x$ , $\lfloor x \rceil$ , as the center of the local grid (Figure 3). Since $\sigma$ is shared between all elements of the weight matrix or activation, the local grid has the same width for every element.
|
| 102 |
+
|
| 103 |
+
The computation of the probabilities over the localized grid is similar to the truncation happening in Equation 4 and the smoothed quantized value is obtained via a manner similar to Equation 5:
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 3: Local grid construction
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { c } { P ( \tilde { x } \leq c | \tilde { x } \in ( \lfloor x \rceil - \delta \sigma , \lfloor x \rceil + \delta \sigma ] ) = \displaystyle \frac { P ( \tilde { x } \leq c ) - P ( \tilde { x } < \lfloor x \rceil - \delta \sigma ) } { P ( \tilde { x } \leq \lfloor x \rceil + \delta \sigma ) - P ( \tilde { x } < \lfloor x \rceil - \delta \sigma ) } } \\ { \displaystyle \hat { x } = \displaystyle \sum _ { g _ { i } \in ( \lfloor x \rceil - \delta \sigma , \lfloor x \rceil + \delta \sigma ] } z _ { i } g _ { i } } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
# 2.3 RELATION TO STOCHASTIC ROUNDING
|
| 113 |
+
|
| 114 |
+
One of the pioneering works in neural network quantization has been the work of Gupta et al. (2015); it introduced stochastic rounding, a technique that is one of the most popular approaches for training neural networks with reduced numerical precision. Instead of rounding to the nearest representable value, the stochastic rounding procedure selects one of the two closest grid points with probability depending on the distance of the high precision input from these grid points. In fact, we can view stochastic rounding as a special case of RQ where $\begin{array} { r } { p ( \tilde { x } ) = U ( x - \frac { \alpha } { 2 } , \tilde { x } + \frac { \bar { \alpha } } { 2 } ) } \end{array}$ . This uniform distribution centered at $x$ of width equal to the grid width $\alpha$ generally has support only for the closest grid point. Discretizing this distribution to a categorical over the quantization grid however assigns probabilities to the two closest grid points as in stochastic rounding, following Equation 2:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
p ( \hat { x } = \left\lfloor \frac { x } { \alpha } \right\rfloor \alpha \left. x \right. = P ( \tilde { x } \leq ( \left\lfloor \frac { x } { \alpha } \right\rfloor \alpha + \alpha / 2 ) ) - P ( \tilde { x } < ( \left\lfloor \frac { x } { \alpha } \right\rfloor \alpha - \alpha / 2 ) ) = \left\lceil \frac { x } { \alpha } \right\rceil - \frac { x } { \alpha } .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Stochastic rounding has proven to be a very powerful quantization scheme, even though it relies on biased gradient estimates for the rounding procedure. On the one hand, RQ provides a way to circumvent this estimator at the cost of optimizing a surrogate objective. On the other hand, RQ ST makes use of the unreasonably effective straight-through estimator as used in Jang et al. (2016)
|
| 121 |
+
|
| 122 |
+
to avoid optimizing a surrogate objective, at the cost of biased gradients. Compared to stochastic rounding, RQ ST further allows sampling of not only the two closest grid points, but also has support for more distant ones depending on the estimated input noise $\sigma$ . Intuitively, this allows for larger steps in the input space without first having to decrease variance at the traversion between grid sections.
|
| 123 |
+
|
| 124 |
+
# 3 RELATED WORK
|
| 125 |
+
|
| 126 |
+
In this work we focus on hardware oriented quantization approaches. As opposed to methods that focus only on weight quantization and network compression for a reduced memory footprint, quantizing all operations within the network aims to additionally provide reduced execution times. Within the body of work that considers quantizing weights and activations fall papers using stochastic rounding (Gupta et al., 2015; Hubara et al., 2016; Gysel et al., 2018; Wu et al., 2018). (Wu et al., 2018) also consider quantized backpropagation, which is out-of-scope for this work.
|
| 127 |
+
|
| 128 |
+
Furthermore, another line of work considers binarizing (Courbariaux et al., 2015; Zhou et al., 2018) or ternarizing (Li et al., 2016; Zhou et al., 2018) weights and activations (Hubara et al., 2016; Rastegari et al., 2016; Zhou et al., 2016) via the straight-through gradient estimator (Bengio et al., 2013); these allow for fast implementations of convolutions using only bit-shift operations. In a similar vein, the straight through estimator has also been used in Cai et al. (2017); Faraone et al. (2018); Jacob et al. (2017); Zhou et al. (2017); Mishra & Marr (2017) for quantizing neural networks to arbitrary bit-precision. In these approaches, the full precision weights that are updated during training correspond to the means of the logistic distributions that are used in RQ. Furthermore, Jacob et al. (2017) maintains moving averages for the minimum and maximum observed values for activations while parameterises the network’s weights’ grids via their minimum and maximum values directly. This fixed-point grid is therefore learned during training, however without gradient descent; unlike the proposed RQ. Alternatively, instead of discretizing real valued weights, Shayer et al. (2018) directly optimize discrete distributions over them. While providing promising results, this approach does not generalize straightforwardly to activation quantization. A bayesian approach to binarized models was taken in Soudry et al. (2014), which provided encouraging results on small scale experiments with an ensemble of quantized models sampled from the approximate posterior distribution. For small vocabulary sizes (e.g. ternary weights / activations) Yin et al. (2016) proposed explicit formulas to compute the closest (according to the Euclidean distance) quantized value.
|
| 129 |
+
|
| 130 |
+
Another line of work quantizes networks through regularization. (Louizos et al., 2017a) formulate a variational approach that allows for heuristically determining the required bit-width precision for each weight of the model. Improving upon this work, (Achterhold et al., 2018) proposed a quantizing prior that encourages ternary weights during training. Similarly to RQ, this method also allows for optimizing the scale of the ternary grid. In contrast to RQ, this is only done implicitly via the regularization term. One drawback of these approaches is that the strength of the regularization decays with the amount of training data, thus potentially reducing their effectiveness on large datasets. Alternatively, one could directly regularize towards a set of specific values via the approach described at Yin et al. (2018).
|
| 131 |
+
|
| 132 |
+
Weights in a neural network are usually not distributed uniformly within a layer. As a result, performing non-uniform quantization is usually more effective. (Baskin et al., 2018) employ a stochastic quantizer by first uniformizing the weight or activation distribution through a non-linear transformation and then injecting uniform noise into this transformed space. (Polino et al., 2018) propose a version of their method in which the quantizer’s code book is learned by gradient descent, resulting in a non-uniformly spaced grid. Another line of works quantizes by clustering and therefore falls into this category; (Han et al., 2015; Ullrich et al., 2017) represent each of the weights by the centroid of its closest cluster. While such non-uniform techniques can be indeed effective, they do not allow for efficient implementations on todays hardware. Nevertheless, there is encouraging recent work (Zhang et al., 2018) on non-uniform grids that can be implemented with bit operations.
|
| 133 |
+
|
| 134 |
+
Within the liteterature on quantizing neural networks there are many approaches that are orthogonal to our work and could potentially be combined for additional improvements. (Mishra & Marr, 2017; Polino et al., 2018) use knowledge distrillation techniques to good effect, whereas works such as (Mishra et al., 2017) modify the architecture to compensate for lower precision computations. (Zhou et al., 2017; 2018; Baskin et al., 2018) perform quantization in an step-by-step manner going from input layer to output, thus allowing the later layers to more easily adapt to the rounding errors introduced. Polino et al. (2018); Faraone et al. (2018) further employ “bucketing”, where small groups of weights share a grid, instead of one grid per layer. As an example from Polino et al. (2018), a bucket size of 256 weights per grid on Resnet-18 translates to $\sim 9 1 . 4 k$ separate scaling factors / offsets as opposed to 22 in RQ.
|
| 135 |
+
|
| 136 |
+
# 4 EXPERIMENTS
|
| 137 |
+
|
| 138 |
+
For the subsequent experiments RQ will correspond to the proposed procedure that has concrete sampling and RQ ST will correspond to the proposed procedure that uses the Gumbel-softmax straight-through estimator (Jang et al., 2016) for the gradient. We did not optimize an offset for the grids in order to be able to represent the number zero exactly, which allows for sparsity and is required for zero-padding. Furthermore we assumed a grid that starts from zero when quantizing the outputs of ReLU. We provide further details on the experimental settings at Appendix A. We will also provide results of our own implementation of stochastic rounding (Gupta et al., 2015) with the dynamic fixed point format (Gysel et al., 2018) $\mathrm { S R + D R } )$ . Here we used the same hyperparameters as for RQ. All experiments were implemented with TensorFlow (Abadi et al., 2015), using the Keras library (Chollet et al., 2015).
|
| 139 |
+
|
| 140 |
+
# 4.1 LENET-5 ON MNIST AND VGG7 ON CIFAR 10
|
| 141 |
+
|
| 142 |
+
For the first task we considered the toy LeNet-5 network trained on MNIST with the 32C5 - MP2 - 64C5 - MP2 - 512FC - Softmax architecture and the VGG $2 \mathrm { x } ( 1 2 8 \mathrm { C } 3 ) - \mathrm { M P } 2 - 2 \mathrm { x } ( 2 5 6 \mathrm { C } 3 ) - \mathrm { M P } 2$ - 2x(512C3) - MP2 - 1024FC - Softmax architecture on the CIFAR 10 dataset. Details about the hyperparameter settings can be found in Appendix A.
|
| 143 |
+
|
| 144 |
+
By observing the results in Table 1, we see that our method can achieve competitive results that improve upon several recent works on neural network quantization. Considering that we achieve lower test error for 8 bit quantization than the high-precision models, we can see how RQ has a regularizing effect. Generally speaking we found that the gradient variance for low bit-widths (i.e. 2-4 bits) in RQ needs to be kept in check through appropriate learning rates.
|
| 145 |
+
|
| 146 |
+
# 4.2 RESNET-18 AND MOBILENET ON IMAGENET
|
| 147 |
+
|
| 148 |
+
In order to demonstrate the effectiveness of our proposed approach on large scale tasks we considered the task of quantizing a Resnet-18 (He et al., 2016) as well as a Mobilenet (Howard et al., 2017) trained on the Imagenet (ILSVRC2012) dataset. For the Resnet-18 experiment, we started from a pre-trained full precision model that was trained for 90 epochs. We provide further details about the training procedure in Appendix C. The Mobilenet was initialized with the pretrained model available on the tensorflow github repository1. We quantized the weights of all layers, post ReLU activations and average pooling layer for various bit-widths via fine-tuning for ten epochs. Further details can be found in Appendix C.
|
| 149 |
+
|
| 150 |
+
Some of the existing quantization works do not quantize the first (and sometimes) last layer. Doing so simplifies the problem but it can, depending on the model and input dimensions, significantly increase the amount of computation required. We therefore make use of the bit operations (BOPs) metric (Baskin et al., 2018), which can be seen as a proxy for the execution speed on appropriate hardware. In BOPs, the impact of not quantizing the first layer in, for example, the Resnet-18 model on Imagenet, becomes apparent: keeping the first layer in full precision requires roughly 1.3 times as many BOPs for one forward pass through the whole network compared to quantizing all weights and activations to 5 bits.
|
| 151 |
+
|
| 152 |
+
Figure 4 compares a wide range of methods in terms of accuracy and BOPs. We choose to compare only against methods that employ fixed-point quantization on Resnet-18 and Mobilenet, hence do not compare with non-uniform quantization techniques, such as the one described at Baskin et al. (2018). In addition to our own implementation of (Gupta et al., 2015) with the dynamic fixed point format (Gysel et al., 2018), we also report results of “rounding”. This corresponds to simply rounding the pre-trained high-precision model followed by re-estimation of the batchnorm statistics. The grid in this case is defined as the initial grid used for fine-tuning with RQ. For batchnorm re-estimation and grid initialization, please confer Appendix A.
|
| 153 |
+
|
| 154 |
+
Table 1: Test error $( \% )$ on MNIST and CIFAR 10 using LeNet5-Caffe and VGG-7 respectively. Two and four bit for VGG with $\mathrm { S R + D R }$ resulted in a big gap between training and validation accuracy, so we omit those results.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Method</td><td># Bits weights/act.</td><td>MNIST</td><td>CIFAR 10</td></tr><tr><td>Original</td><td>32/32</td><td>0.64</td><td>6.95</td></tr><tr><td rowspan="3">SR+DR (Gupta et al.,2015; Gysel et al., 2018)</td><td>8/8</td><td>0.58</td><td>7.06</td></tr><tr><td>4/4</td><td>0.66</td><td>1</td></tr><tr><td>2/2</td><td>1.03</td><td>1</td></tr><tr><td>Deep Comp. (Han et al., 2015)</td><td>(5-8)/32</td><td>0.74</td><td>-</td></tr><tr><td>TWN (Li et al., 2016)</td><td>2/32</td><td>0.65a</td><td>7.44</td></tr><tr><td>BWN (Rastegari et al., 2016)</td><td>1/32</td><td>-</td><td>9.88</td></tr><tr><td>XNOR-net (Rastegari et al., 2016) SWS (Ullrich et al., 2017)</td><td>1/1</td><td>1</td><td>10.17</td></tr><tr><td>Bayesian Comp. (Louizos et al., 2017a)</td><td>3/32</td><td>0.97</td><td>-</td></tr><tr><td>VNQ(Achterhold et al.,2018)</td><td>(7-18)/32</td><td>1.00</td><td>-</td></tr><tr><td>WAGE (Wu et al., 2018)</td><td>2/32</td><td>0.73</td><td>1</td></tr><tr><td>LR Net (Shayer et al., 2018)b</td><td>2/8</td><td>0.40</td><td>6.78</td></tr><tr><td rowspan="2"></td><td>1/32 2/32</td><td>0.53a 0.50a</td><td>6.82 6.74</td></tr><tr><td></td><td></td><td></td></tr><tr><td rowspan="3">RQ (ours)</td><td>8/8</td><td>0.55</td><td>6.70</td></tr><tr><td>4/4 2/2</td><td>0.58</td><td>8.43</td></tr><tr><td></td><td>0.76</td><td>11.75</td></tr><tr><td rowspan="3">RQ ST (ours)</td><td>8/8</td><td>0.56</td><td>6.72</td></tr><tr><td>4/4</td><td>0.61</td><td>7.96</td></tr><tr><td>2/2</td><td>0.63</td><td>9.08</td></tr></table>
|
| 157 |
+
|
| 158 |
+
aWith batch normalization after convolution bLast layer in full precision
|
| 159 |
+
|
| 160 |
+
In Figure 4a we observe that on ResNet-18 the RQ variants form the “Pareto frontier” in the trade-off between accuracy and efficiency, along with SYQ, Apprentice and Jacob et al. (2017). SYQ, however, employs “bucketing” and Apprentice uses distillation, both of which can be combined with RQ and improve performance. Jacob et al. (2017) does better than RQ with 8 bits, however RQ improved w.r.t. to its pretrained model, whereas Jacob et al. (2017) decreased slightly. For experimental details with Jacob et al. (2017), please confer Appendix C.1. $\mathrm { S R + D R }$ underperforms in this setting and is worse than simple rounding for 5 to 8 bits.
|
| 161 |
+
|
| 162 |
+
For Mobilenet, 4b shows that RQ is competitive to existing approaches. Simple rounding resulted in almost random chance for all of the bit configurations. $\mathrm { S R + D R }$ shows its strength for the 8 bit scenario, while in the lower bit regime, RQ outperforms competitive approaches.
|
| 163 |
+
|
| 164 |
+
# 5 DISCUSSION
|
| 165 |
+
|
| 166 |
+
We have introduced Relaxed Quantization (RQ), a powerful and versatile algorithm for learning low-bit neural networks using a uniform quantization scheme. As such, the models trained by this method can be easily transferred and executed on low-bit fixed point chipsets. We have extensively evaluated RQ on various image classification benchmarks and have shown that it allows for the better trade-offs between accuracy and bit operations per second.
|
| 167 |
+
|
| 168 |
+
Future hardware might enable us to cheaply do non-uniform quantization, for which this method can be easily extended. (Lai et al., 2017; Ortiz et al., 2018) for example, show the benefits of low-bit floating point weights that can be efficiently implemented in hardware. The floating point quantization grid can be easily learned with RQ by redefining $\hat { \mathcal G }$ . General non-uniform quantization, as described for example in (Baskin et al., 2018), is a natural extension to RQ, whose exploration we leave to future work. For example, we could experiment with a base grid that is defined as in Zhang et al. (2018). Currently, the bit-width of every quantizer is determined beforehand, but in future work we will explore learning the required bit precision within this framework. In our experiments, batch normalization was implemented as a sequence of convolution, batch normalization and quantization. On a low-precision chip, however, batch normalization would be ”folded” (Jacob et al., 2017) into the kernel and bias of the convolution, the result of which is then rounded to low precision. In order to accurately reflect this folding at test time, future work on the proposed algorithm will emulate folded batchnorm at training time and learn the corresponding quantization grid of the modified kernel and bias. For fast model evaluation on low-precision hardware, quantization goes hand-in-hand with network pruning. The proposed method is orthogonal to pruning methods such as, for example, $L _ { 0 }$ regularization (Louizos et al., 2017b), which allows for group sparsity and pruning of hidden units.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 4: Best viewed in color. Comparison of various methods on Resnet-18 and Mobilenet according to top-1 error (on the y-axis) and bit operations (on the $\mathbf { X }$ -axis) computed according to the formula described in Baskin et al. (2018). Each dashed line corresponds to employing a specific bit configuration for every layer’s weights and activations. Values for top-1 and top-5 errors are given in Table 2 in the Appendix. We compare against multiple works that employ fixed-point quantization: $\mathrm { S R + D R }$ (Gupta et al., 2015; Gysel et al., 2018), LR Net (Shayer et al., 2018), Jacob et al. (2017), TWN (Li et al., 2016), INQ (Zhou et al., 2017), BWN (Rastegari et al., 2016), XNORnet (Rastegari et al., 2016), DoReFa (Zhou et al., 2016), HWGQ (Cai et al., 2017), ELQ Zhou et al. (2018), SYQ (Faraone et al., 2018), Apprentice (Mishra & Marr, 2017), QSM (Sheng et al., 2018) and rounding.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´ Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Wattenberg, ´ Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org.
|
| 176 |
+
|
| 177 |
+
Jan Achterhold, Jan Mathias Koehler, Anke Schmeink, and Tim Genewein. Variational network quantization. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ ry-TW-WAb.
|
| 178 |
+
|
| 179 |
+
Chaim Baskin, Eli Schwartz, Evgenii Zheltonozhskii, Natan Liss, Raja Giryes, Alex M Bronstein, and Avi Mendelson. Uniq: Uniform noise injection for the quantization of neural networks. arXiv
|
| 180 |
+
|
| 181 |
+
preprint arXiv:1804.10969, 2018.
|
| 182 |
+
|
| 183 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients through ´ stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 184 |
+
|
| 185 |
+
Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. arXiv preprint arXiv:1702.00953, 2017.
|
| 186 |
+
|
| 187 |
+
Franc¸ois Chollet et al. Keras. https://keras.io, 2015.
|
| 188 |
+
|
| 189 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in neural information processing systems, pp. 3123–3131, 2015.
|
| 190 |
+
|
| 191 |
+
Julian Faraone, Nicholas Fraser, Michaela Blott, and Philip HW Leong. Syq: Learning symmetric quantization for efficient deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4300–4309, 2018.
|
| 192 |
+
|
| 193 |
+
Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In International Conference on Machine Learning, pp. 1737–1746, 2015.
|
| 194 |
+
|
| 195 |
+
Philipp Gysel, Jon Pimentel, Mohammad Motamedi, and Soheil Ghiasi. Ristretto: A framework for empirical study of resource-efficient inference in convolutional neural networks. IEEE Transactions on Neural Networks and Learning Systems, 2018. doi: 10.1109/TNNLS.2018.2808319.
|
| 196 |
+
|
| 197 |
+
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.
|
| 198 |
+
|
| 199 |
+
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, pp. 770–778, 2016.
|
| 200 |
+
|
| 201 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 202 |
+
|
| 203 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. arXiv preprint arXiv:1609.07061, 2016.
|
| 204 |
+
|
| 205 |
+
Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. arXiv preprint arXiv:1712.05877, 2017.
|
| 206 |
+
|
| 207 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 208 |
+
|
| 209 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 210 |
+
|
| 211 |
+
Liangzhen Lai, Naveen Suda, and Vikas Chandra. Deep convolutional neural network inference with floating-point weights and fixed-point activations. arXiv preprint arXiv:1703.03073, 2017.
|
| 212 |
+
|
| 213 |
+
Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems 2, NIPS 1989, volume 2, pp. 598–605. Morgan-Kaufmann Publishers, 1990.
|
| 214 |
+
|
| 215 |
+
Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016.
|
| 216 |
+
|
| 217 |
+
Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. arXiv preprint arXiv:1705.08665, 2017a.
|
| 218 |
+
|
| 219 |
+
Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through $l _ { 0 }$ regularization. arXiv preprint arXiv:1712.01312, 2017b.
|
| 220 |
+
|
| 221 |
+
Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016.
|
| 222 |
+
|
| 223 |
+
Asit Mishra and Debbie Marr. Apprentice: Using knowledge distillation techniques to improve low-precision network accuracy. arXiv preprint arXiv:1711.05852, 2017.
|
| 224 |
+
|
| 225 |
+
Asit Mishra, Eriko Nurvitadhi, Jeffrey J Cook, and Debbie Marr. Wrpn: wide reduced-precision networks. arXiv preprint arXiv:1709.01134, 2017.
|
| 226 |
+
|
| 227 |
+
Marc Ortiz, Adrian Cristal, Eduard Ayguad ´ e, and Marc Casas. Low-precision floating-point schemes ´ for neural network training. arXiv preprint arXiv:1804.05267, 2018.
|
| 228 |
+
|
| 229 |
+
Jorn WT Peters and Max Welling. Probabilistic binary neural networks. arXiv preprint arXiv:1809.03368, 2018.
|
| 230 |
+
|
| 231 |
+
Antonio Polino, Razvan Pascanu, and Dan Alistarh. Model compression via distillation and quantization. arXiv preprint arXiv:1802.05668, 2018.
|
| 232 |
+
|
| 233 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pp. 525–542. Springer, 2016.
|
| 234 |
+
|
| 235 |
+
Oran Shayer, Dan Levi, and Ethan Fetaya. Learning discrete weights using the local reparameterization trick. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ BySRH6CpW.
|
| 236 |
+
|
| 237 |
+
Tao Sheng, Chen Feng, Shaojie Zhuo, Xiaopeng Zhang, Liang Shen, and Mickey Aleksic. A quantization-friendly separable convolution for mobilenets. 2018.
|
| 238 |
+
|
| 239 |
+
Daniel Soudry, Itay Hubara, and Ron Meir. Expectation backpropagation: Parameter-free training of multilayer neural networks with continuous or discrete weights. In Advances in Neural Information Processing Systems, pp. 963–971, 2014.
|
| 240 |
+
|
| 241 |
+
Joe Staines and David Barber. Variational optimization. arXiv preprint arXiv:1212.4507, 2012.
|
| 242 |
+
|
| 243 |
+
Karen Ullrich, Edward Meeds, and Max Welling. Soft weight-sharing for neural network compression. ICLR, 2017.
|
| 244 |
+
|
| 245 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 246 |
+
|
| 247 |
+
Shuang Wu, Guoqi Li, Feng Chen, and Luping Shi. Training and inference with integers in deep neural networks. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ HJGXzmspb.
|
| 248 |
+
|
| 249 |
+
Penghang Yin, Shuai Zhang, Yingyong Qi, and Jack Xin. Quantization and training of low bit-width convolutional neural networks for object detection. arXiv preprint arXiv:1612.06052, 2016.
|
| 250 |
+
|
| 251 |
+
Penghang Yin, Shuai Zhang, Jiancheng Lyu, Stanley Osher, Yingyong Qi, and Jack Xin. Binaryrelax: A relaxation approach for training deep neural networks with quantized weights. SIAM Journal on Imaging Sciences, 11(4):2205–2223, 2018.
|
| 252 |
+
|
| 253 |
+
Penghang Yin, Shuai Zhang, Jiancheng Lyu, Stanley Osher, Yingyong Qi, and Jack Xin. Blended coarse gradient descent for full quantization of deep neural networks. Research in the Mathematical Sciences, 6(1):14, 2019.
|
| 254 |
+
|
| 255 |
+
Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In European Conference on Computer Vision (ECCV), 2018.
|
| 256 |
+
|
| 257 |
+
Aojun Zhou, Anbang Yao, Yiwen Guo, Lin Xu, and Yurong Chen. Incremental network quantization: Towards lossless cnns with low-precision weights. arXiv preprint arXiv:1702.03044, 2017.
|
| 258 |
+
|
| 259 |
+
Aojun Zhou, Anbang Yao, Kuan Wang, and Yurong Chen. Explicit loss-error-aware quantization for low-bit deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9426–9435, 2018.
|
| 260 |
+
|
| 261 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
| 262 |
+
|
| 263 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016.
|
| 264 |
+
|
| 265 |
+
# A EXPERIMENTAL DETAILS
|
| 266 |
+
|
| 267 |
+
The grid width $\alpha$ of each grid was initialized according to the bit-width $b$ and the maximum and minimum values of the input $x$ to the quantizer2. Since the inputs $\tilde { x }$ in both cases for our approach are stochastic it makes sense to assume a width for the grid that is slightly larger than the standard width $t = ( \operatorname* { m a x } ( x ) - \operatorname* { m i n } ( x ) ) / 2 ^ { b }$ ; for the activations, whenever $b > 4$ , we initialize $\alpha = t + 3 t / 2 ^ { b }$ , for $4 \geq b > 2$ we used $\alpha = { { t + 3 t } \ o { / { 2 ^ { b + 1 } } } }$ and finally for $b = 2$ we used $\alpha = t$ . Since with ReLU activations the magnitude can become quite large (thus leading to increased quantization noise for smaller bit widths), this scheme keeps the noise injected to the network in check. For the weights we always used an initial $\alpha = t + 3 t / \dot { 2 } ^ { b }$ . The standard deviation of the logistic noise $\sigma$ was initialized to be three times smaller than the width $\alpha$ , i.e. $\sigma = \alpha / 3$ . Under this specification, most of the probability mass of the logistic distribution is initially (roughly) in the bins containing the closest grid point and its’ two neighbors.
|
| 268 |
+
|
| 269 |
+
The moving averages of layer statistics that are aggregated during the training phase for the batch normalization do not necessarily reflect the statistics of the quantized model accurately. Even though RQ aims to minimize the gap between training and testing phase, we found that the aggregated statistics in combination with the learned scale and shift parameters of batch normalization lead to decreased test performance. In order to avoid this drop in accuracy, we apply the insights from (Peters & Welling, 2018) and recompute the statistics of the quantized model before reporting the final test error rate. The final models were determined through early stopping using the validation loss computed with minibatch statistics, in case the model uses batch normalization.
|
| 270 |
+
|
| 271 |
+
For the MNIST experiment we rescaled the input to the [-1, 1] range, employed no regularization and the network was trained with Adam (Kingma & Ba, 2014) and a batch size of 128. We used a local grid whenever the bit width was larger than 2 for both, weights and biases (shared grid parameters), as well as for the ouputs of the ReLU, with $\delta = 3$ . For the 8 and 4 bit networks we used a temperature $\lambda$ of 2 whereas for the 2 bit models we used a temperature of 1 for RQ. We trained the 8 and 4 bit networks for 100 epochs using a learning rate of 1e-3 and the 2 bit networks for 200 epochs with a learning rate of 5e-4. In all of the cases the learning rate was annealed to zero during the last 50 epochs.
|
| 272 |
+
|
| 273 |
+
For the CIFAR 10 experiment, the hyperparameters were chosen identically to the LeNet-5 experiments except a few differences. We chose a learning rate ot 1e-4 instead of 1e-3 for 8 and 4 bit networks and trained for 300 epochs with a batch size of 100. We also included a weight decay term of 1e-4 for the 8 bit networks. For the 2 bit model we started with a learning rate of 1e-3. The VGG model contains a batch normalization layer after every convolutional layer, but preceeded by max pooling, if present.
|
| 274 |
+
|
| 275 |
+
# B CONVERGENCE SPEED OF VGG ON CIFAR 10
|
| 276 |
+
|
| 277 |
+
Training a neural network with RQ imposes an additional sampling burden for every weight and activation in the network. Here, we investigate whether the extra “noise” that is introduced hampers the convergence speed of the network when we train from a random initialization. We recorded the learning curves for a $2 / 2$ bit RQ-VGG network on CIFAR 10 (as this quantization level exhibits the largest amount of noise) and compare it to the full precision baseline. The results can be seen in
|
| 278 |
+
|
| 279 |
+
Figure 5. As we can observe, the 2/2 bit network has qualitatively similar trends to the full precision baseline. Therefore we can conclude that the noise is not detrimental for the task at hand, at least for this particular model. In terms of wall-clock time, training the RQ model with a full (4 elements) grid took approximately 15 times as long as the high-precision baseline with an implementation in Tensorflow v1.11.0 and running on a single Titan-X Nvidia GPU.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 5: Learning curves for the VGG on CIFAR 10.
|
| 283 |
+
|
| 284 |
+
# C IMAGENET DETAILS
|
| 285 |
+
|
| 286 |
+
Each channel of the input images was preprocessed by subtracting the mean and dividing by the standard deviation of that channel across the training set. We then resized the images such that the shorter side is set to 256 and then applied random $2 2 4 \mathrm { x } 2 2 4$ crops and random horizontal flips for data augmentation. For evaluation we consider the center $2 2 4 \mathbf { x } 2 2 4$ crop of the images.
|
| 287 |
+
|
| 288 |
+
We trained the base Resnet-18 model with stochastic gradient descent, a batch size of 128, nesterov momentum of 0.9 and a learning rate of 0.1 which was multiplied by 0.1 at the 30th and 60th epoch. We also applied weight decay with a strength of 1e-4. For the quantized model fine-tuning phase, we used Adam with a learning rate of $5 e ^ { - \tilde { 6 } }$ , a batch size of 24 and a momentum of 0.99. We used a temperature of 2 for both RQ variants. Following the strategy in (Jacob et al., 2017), we did not quantize the biases.
|
| 289 |
+
|
| 290 |
+
Table 2 contains the error rates for Resnet-18 and Mobilenet on which Figure 1 is based on. Algorithm and architecture specific changes are mentioned explicitly through footnotes.
|
| 291 |
+
|
| 292 |
+
# C.1 JACOB ET AL. (2017) FOR RESNET18
|
| 293 |
+
|
| 294 |
+
We used the code provided at https://github.com/tensorflow/models/tree/ master/official/resnet and modified the construction of the training and evaluation graph by inserting quantization operations provided by the tensorflow.contrib.quantize package. In a first step, the unmodified code was used to train a high-precision Resnet18 model using the hyper-parameter settings for the learning rate scheduling that are provided in the github repository. More specifically, the model was trained for 90 epochs with a batch size of 128. The learning rate scheduling involved a ”warm up” period in which the learning rate was annealed from zero to 0.64 over the first $5 0 k$ steps, after which it was divided by 10 after epochs 30, 60 and 80 respectively. Gradients were modified using a momentum of 0.9. Final test performance under this procedure is $2 9 . 5 3 \%$ top-1 error and $1 0 . 4 4 \%$ top-5 error. From the high-precision model checkpoint, the final quantized model was then fine-tuned for 10 epochs using a constant learning rate of $1 e ^ { - 4 }$ and momentum of 0.9. We did not freeze the moving averages of the batch normalization layers. Finally, we found that re-estimating the batchnorm statistics was harmful for this algorithm. We hypothesise that this is due to the usage of folded batch normalization, which incorporates the statistics into the construction of the grid at training time.
|
| 295 |
+
|
| 296 |
+
Table 2: Top-1 and top-5 error $( \% )$ with Resnet18 and Mobilenet (full resolution and multiplier of one) on Imagenet
|
| 297 |
+
|
| 298 |
+
<table><tr><td colspan="2"></td><td colspan="2">Resnet18</td><td colspan="2">Mobilenet</td></tr><tr><td>Method</td><td># Bits weights/act.</td><td>Top-1</td><td>Top-5</td><td>Top-1</td><td>Top-5</td></tr><tr><td>Original</td><td>32/32</td><td>30.46</td><td>10.81</td><td>29.39</td><td>10.53</td></tr><tr><td rowspan="2">SR+DR (Gupta et al., 2015; Gysel et al., 2018)</td><td>8/8</td><td>31.83</td><td>11.48</td><td>28.70</td><td>10.04</td></tr><tr><td>6/6</td><td>40.75 45.48</td><td>16.90 20.16</td><td>33.34 40.61</td><td>12.83</td></tr><tr><td rowspan="2">Rounding</td><td>5/5</td><td></td><td></td><td></td><td>17.65</td></tr><tr><td>8/8</td><td>30.22</td><td>10.60</td><td>1</td><td>1</td></tr><tr><td rowspan="3">(Jacob et al., 2017)a</td><td>6/6</td><td>31.61 36.97</td><td>11.32 14.95</td><td></td><td></td></tr><tr><td>5/5</td><td>78.79</td><td>57.10</td><td>= 1</td><td></td></tr><tr><td>4/4</td><td>29.62</td><td>10.45</td><td></td><td>1</td></tr><tr><td rowspan="3"></td><td>8/8</td><td>32.69</td><td>12.46</td><td>30.30</td><td>10.50</td></tr><tr><td>6/6 5/5</td><td>35.36</td><td>13.33</td><td>1 =</td><td>1</td></tr><tr><td>1/32b</td><td>40.10</td><td>17.70</td><td></td><td></td></tr><tr><td rowspan="2">LR Net (Shayer et al., 2018)</td><td>2/32℃</td><td>36.50</td><td>15.20</td><td></td><td></td></tr><tr><td>8/8</td><td>1</td><td>1</td><td>31.97</td><td></td></tr><tr><td>QSM (Sheng et al., 2018)a d</td><td></td><td>38.20</td><td>15.80</td><td></td><td></td></tr><tr><td>TWN (Li et al., 2016) INQ (Zhou et al., 2017)</td><td>2/32 5/32</td><td>31.02</td><td>10.90</td><td></td><td></td></tr><tr><td>BWN (Rastegari et al., 2016)</td><td>1/32</td><td>39.20</td><td>17.00</td><td></td><td></td></tr><tr><td>XNOR-net (Rastegari et al., 2016)</td><td>1/1</td><td>48.80</td><td>26.80</td><td></td><td></td></tr><tr><td>HWGQ (Cai et al., 2017)b</td><td>1/2</td><td>40.4</td><td>17.8</td><td></td><td></td></tr><tr><td>DoReFa (Zhou et al., 2016)be</td><td>1/4</td><td>40.8</td><td>18.5</td><td></td><td></td></tr><tr><td>ELQ (Zhou et al., 2018)</td><td>1/32</td><td>35.28</td><td>13.96</td><td></td><td></td></tr><tr><td></td><td>2/32</td><td>32.48</td><td>11.95</td><td></td><td></td></tr><tr><td rowspan="2">SYQ (Faraone et al., 2018)f</td><td>1/8</td><td>37.1</td><td>15.4</td><td></td><td></td></tr><tr><td>2/8</td><td>32.3</td><td>12.2</td><td></td><td></td></tr><tr><td rowspan="2">Apprentice (Mishra & Marr,2017)b</td><td></td><td>32</td><td></td><td></td><td></td></tr><tr><td>2/8 4/8</td><td>29.6</td><td>一</td><td></td><td></td></tr><tr><td rowspan="3">RQ (ours)</td><td>8/8</td><td></td><td></td><td></td><td></td></tr><tr><td>6/6</td><td>30.03 31.35</td><td>10.56 11.22</td><td>29.57 31.98</td><td>10.58 12.00</td></tr><tr><td>5/5</td><td>34.90</td><td>13.43</td><td>38.62</td><td>16.27</td></tr><tr><td rowspan="4">RQ ST (ours)</td><td>4/4</td><td>38.48</td><td>16.01</td><td>1</td><td>1</td></tr><tr><td>8/8</td><td>30.37</td><td>10.67</td><td>29.94</td><td>10.48</td></tr><tr><td>6/6</td><td>31.85</td><td>11.62</td><td>32.38</td><td>12.22</td></tr><tr><td>5/5</td><td>36.65</td><td>14.54</td><td>43.15</td><td>19.65</td></tr><tr><td></td><td>4/4</td><td>37.54</td><td>15.22</td><td>1</td><td>1</td></tr></table>
|
| 299 |
+
|
| 300 |
+
aIncludes folded batch normalization bFirst and last layer not quantized cFirst layer not quantized dModified architecture eResults taken from https://github.com/tensorpack/tensorpack/blob/master/ examples/DoReFa-Net/resnet-dorefa.py fWeights of first and last layer not quantized
|
| 301 |
+
|
| 302 |
+
# C.2 JACOB ET AL. (2017) FOR MOBILENET
|
| 303 |
+
|
| 304 |
+
The $8 / 8$ bit results for quantizing Mobilenet provided in table 2 are read off from Figure 4.1 in Jacob et al. (2017). The pre-trained models published at https://github.com/tensorflow/ models/blob/master/research/slim/nets/mobilenet_v1.md originally reflected that number up until commit 4415c2613b0c74032a7c631769ef9fa7f5477d88, but have since been updated to improved error rates of 29.9 and 11.1 respectively. Unfortunately, there are several conflicting sources for quantized Mobilenet results and pretrainedmodels within the tensorflow github repository. https://github.com/tensorflow/ tensorflow/blob/master/tensorflow/contrib/lite/g3doc/models.md# image-classification-quantized-models, for example, reports error rates of 30.0 and 11.0, whereas at https://github.com/tensorflow/tensorflow/tree/master/ tensorflow/contrib/quantize the reported top-1 error rate is 30.3.
|
| 305 |
+
|
| 306 |
+
We attempted to use the provided training scripts in the https://github.com/tensorflow/ models/blob/master/research/slim repository to train lower-bit mobilenet variants, but did not succeed in doing so. We experimented with learning rates in the range of $[ 5 e ^ { - 6 } , 5 e ^ { - 5 } , 1 e ^ { - 4 } ]$ for $5 / 5 , \ 6 / 6$ and $8 / 8$ bit-width variants, but could not achieve significant accuracy improvements within the first 10 epochs of fine-tuning of the high-precision model published at https://github.com/tensorflow/models/blob/master/research/ slim/nets/mobilenet_v1.md. After 10 epochs, the $8 / 8$ version achieved 31.39 top-1 error with a learning rate of $1 e ^ { - 4 }$ and as such is worse than the published results. We therefore chose to only include the published numbers for the $8 / 8$ bit model and leave addition hyperparameter tuning to future work.
|
md/train/HyAddcLge/HyAddcLge.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REVISITING DISTRIBUTED SYNCHRONOUS SGD
|
| 2 |
+
|
| 3 |
+
Jianmin Chen∗, Xinghao Pan∗†, Rajat Monga, Samy Bengio
|
| 4 |
+
Google Brain
|
| 5 |
+
Mountain View, CA, USA
|
| 6 |
+
{jmchen,xinghao,rajatmonga,bengio}@google.com
|
| 7 |
+
|
| 8 |
+
Rafal Jozefowicz OpenAI San Francisco, CA, USA rafal@openai.com
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Distributed training of deep learning models on large-scale training data is typically conducted with asynchronous stochastic optimization to maximize the rate of updates, at the cost of additional noise introduced from asynchrony. In contrast, the synchronous approach is often thought to be impractical due to idle time wasted on waiting for straggling workers. We revisit these conventional beliefs in this paper, and examine the weaknesses of both approaches. We demonstrate that a third approach, synchronous optimization with backup workers, can avoid asynchronous noise while mitigating for the worst stragglers. Our approach is empirically validated and shown to converge faster and to better test accuracies.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
The recent success of deep learning approaches for domains like speech recognition (Hinton et al., 2012) and computer vision (Ioffe & Szegedy, 2015) stems from many algorithmic improvements but also from the fact that the size of available training data has grown significantly over the years, together with the computing power, in terms of both CPUs and GPUs. While a single GPU often provides algorithmic simplicity and speed up to a given scale of data and model, there exist an operating point where a distributed implementation of training algorithms for deep architectures becomes necessary.
|
| 17 |
+
|
| 18 |
+
Currently, popular distributed training algorithms include mini-batch versions of stochastic gradient descent (SGD) and other stochastic optimization algorithms such as AdaGrad (Duchi et al., 2011), RMSProp (Tieleman & Hinton, 2012), and ADAM (Kingma & Ba, 2014). Unfortunately, bulksynchronous implementations of stochastic optimization are often slow in practice due to the need to wait for the slowest machine in each synchronous batch. To circumvent this problem, practitioners have resorted to asynchronous approaches which emphasize speed by using potentially stale information for computation. While asynchronous training have proven to be faster than their synchronous counterparts, they often result in convergence to poorer results.
|
| 19 |
+
|
| 20 |
+
In this paper1, we revisit synchronous learning, and propose a method for mitigating stragglers in synchronous stochastic optimization. Specifically, we synchronously compute a mini-batch gradient with only a subset of worker machines, thus alleviating the straggler effect while avoiding any staleness in our gradients. The primary contributions of our paper are:
|
| 21 |
+
|
| 22 |
+
• Illustration of how gradient staleness in asynchronous training negatively impacts test accuracy and is exacerbated by deep models.
|
| 23 |
+
Measurement of machine response times for synchronous stochastic optimization in a large deployment of 100 GPUs, showing how stragglers in the tail end affect convergence speed. Proposal of synchronous stochastic optimization with backup workers to mitigate straggler effects without gradient staleness.
|
| 24 |
+
• Establishing the need to measure both speed of convergence and test accuracy of optimum for empirical validation.
|
| 25 |
+
|
| 26 |
+
• Empirical demonstration that our proposed synchronous training method outperforms asynchronous training by converging faster and to better test accuracies.
|
| 27 |
+
|
| 28 |
+
The remainder of this paper is organized as follows. We briefly present preliminaries and notation in Section 1.1. Section 2 describes asynchronous stochastic optimization and presents experimental evidence of gradient staleness in deep neural network models. We present our approach in Section 3, and exhibit straggler effects that motivate the approach. We then empirically evaluate our approach in Sections 4. Related work is discussed in Section 5, and we conclude in Section 6.
|
| 29 |
+
|
| 30 |
+
# 1.1 PRELIMINARIES AND NOTATION
|
| 31 |
+
|
| 32 |
+
Given a dataset $\mathcal { X } = \{ x _ { i } : i = 1 , \ldots , | \mathcal { X } | \}$ , our goal is to learn the parameters $\theta$ of a model with respect to an empirical loss function $f$ , defined as $\begin{array} { r } { f ( \theta ) \stackrel { \Delta } { = } \frac { 1 } { | \mathcal { X } | } \sum _ { i = 1 } ^ { | \mathcal { X } | } F ( x _ { i } ; \theta ) } \end{array}$ , where $F ( x _ { i } ; \theta )$ is the loss with respect to a datapoint $x _ { i }$ and the model $\theta$ .
|
| 33 |
+
|
| 34 |
+
A first-order stochastic optimization algorithm achieves this by iteratively updating $\theta$ using a stochastic gradient $G \overset { \Delta } { = } \nabla F ( x _ { i } ; \theta )$ computed at a randomly sampled $x _ { i }$ , producing a sequence of models $\theta ^ { ( 0 ) } , \theta ^ { ( 1 ) } , \ldots$ . Stochastic optimization algorithms differ in their update equations. For example, the update of SGD is $\bar { \theta ^ { ( t + 1 ) } } \bar { \bf \Phi } = \theta ^ { ( t ) } - \gamma _ { t } \bar { G } ^ { ( t ) } = \theta ^ { ( t ) } - \gamma _ { t } \nabla F ( x _ { i } ; \bar { \theta } ^ { ( t ) } )$ , where $\gamma _ { t }$ is the learning rate or step size at iteration $t$ . A mini-batch version of the stochastic optimization algorithm computes the stochastic gradient over mini-batch of size $B$ instead of a single datapoint, i.e., $\begin{array} { r } { G \stackrel { \Delta } { = } \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \nabla F ( \widetilde { x } _ { i } ; \theta ^ { ( t ) } ) } \end{array}$ , where $\widetilde { x } _ { i }$ ’s are randomly sampled from $\mathcal { X }$ . We will often evaluate performance on an exponential moving average $\bar { \theta } ^ { ( t ) } = \alpha \bar { \theta } ^ { ( t - 1 ) } + ( 1 - \alpha ) \theta ^ { ( t ) }$ with decay rate $\alpha$ .
|
| 35 |
+
|
| 36 |
+
Our interest is in distributed stochastic optimization using $N$ worker machines in charge of computing stochastic gradients that are sent to $M$ parameter servers. Each parameter server $j$ is responsible for storing a subset $\theta [ j ]$ of the model, and performing updates on $\theta [ j ]$ . In the synchronous setting, we will also introduce additional $b$ backup workers for straggler mitigation.
|
| 37 |
+
|
| 38 |
+
# 2 ASYNCHRONOUS STOCHASTIC OPTIMIZATION
|
| 39 |
+
|
| 40 |
+
An approach for a distributed stochastic gradient descent algorithm was presented in Dean et al. (2012), consisting of two main ingredients. First, the parameters of the model are distributed on multiple servers, depending on the architecture. This set of servers are called the parameter servers. Second, there can be multiple workers processing data in parallel and communicating with the parameter servers. Each worker processes a mini-batch of data independently of the others, as follows:
|
| 41 |
+
|
| 42 |
+
• The worker fetches from the parameter servers the most up-to-date parameters of the model needed to process the current mini-batch;
|
| 43 |
+
• It then computes gradients of the loss with respect to these parameters;
|
| 44 |
+
• Finally, these gradients are sent back to the parameter servers, which then updates the model accordingly.
|
| 45 |
+
|
| 46 |
+
Since each worker communicates with the parameter servers independently of the others, this is called Asynchronous Stochastic Gradient Descent (Async-SGD), or more generally, Asynchronous Stochastic Optimization (Async-Opt). A similar approach was later proposed by Chilimbi et al. (2014). Async-Opt is presented in Algorithms 1 and 2.
|
| 47 |
+
|
| 48 |
+
In practice, the updates of Async-Opt are different than those of serially running the stochastic optimization algorithm for two reasons. Firstly, the read operation (Algo 1 Line 2) on a worker may be interleaved with updates by other workers to different parameter servers, so the resultant $\widehat { \theta } _ { k }$ may not be consistent with any parameter incarnation $\boldsymbol { \theta } ^ { ( t ) }$ . Secondly, model updates may have occurred while a worker is computing its stochastic gradient; hence, the resultant gradients are typically computed with respect to outdated parameters. We refer to these as stale gradients, and its staleness as the number of updates that have occurred between its corresponding read and update operations.
|
| 49 |
+
|
| 50 |
+
Understanding the theoretical impact of staleness is difficult work and the topic of many recent papers, e.g. Recht et al. (2011); Duchi et al. (2013); Leblond et al. (2016); Reddi et al. (2015);
|
| 51 |
+
|
| 52 |
+
# Algorithm 1: Async-SGD worker $k$
|
| 53 |
+
|
| 54 |
+
Input: Dataset $\mathcal { X }$
|
| 55 |
+
Input: $B$ mini-batch size
|
| 56 |
+
1 while True do
|
| 57 |
+
2 Read $\widehat { \theta } _ { k } = ( \theta [ 0 ] , \ldots , \theta [ M ] )$ from PSs.
|
| 58 |
+
3 $G _ { k } ^ { ( t ) } : = 0$ .
|
| 59 |
+
4 for $i = 1 , \ldots , B$ do
|
| 60 |
+
5 Sample datapoint $\widetilde { x } _ { i }$ from $\mathcal { X }$ .
|
| 61 |
+
6 $\begin{array} { r } { G _ { k } ^ { ( t ) } G _ { k } ^ { ( t ) } + \frac { 1 } { B } \nabla F ( \widetilde { x } _ { i } ; \widehat { \theta } _ { k } ) . } \end{array}$
|
| 62 |
+
7 end
|
| 63 |
+
8 Send $G _ { k } ^ { ( t ) }$ to parameter servers.
|
| 64 |
+
9 end
|
| 65 |
+
|
| 66 |
+
# Algorithm 2: Async-SGD Parameter Server j
|
| 67 |
+
|
| 68 |
+
Input: $\gamma _ { 0 } , \gamma _ { 1 } , \ldots$ learning rates. Input: $\alpha$ decay rate. Input: $\theta ^ { ( 0 ) }$ model initialization. 1 for $t = 0 , 1 , \ldots$ do 2 Wait for gradient $G$ from any worker. 3 $\theta ^ { ( t + 1 ) } [ j ] \theta ^ { ( t ) } [ j ] - \gamma _ { t } G [ j ]$ . 4 $\bar { \theta } ^ { ( t ) } [ j ] = \alpha \bar { \theta } ^ { ( t - 1 ) } [ j ] + ( 1 - \alpha ) \theta ^ { ( t ) } [ j ] ,$ . 5 end
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 1: Gradient staleness dependence on model layer. Gradients are computed in a bottom-up forward propagation step followed by a top-down back propagation step. Parameters are read from servers in the forward prop, but gradients are sent to servers during the back prop. Thus, gradients of lower layers are more stale than top layers.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 2: Degradation of test classification error with increasing average gradient staleness in MNIST CNN model.
|
| 75 |
+
|
| 76 |
+
De Sa et al. (2015); Mania et al. (2015), most of which focus on individual algorithms, under strong assumptions that may not hold up in practice. This is further complicated by deep models with multiple layers, since the times at which model parameters are read and which gradients are computed and sent are dependent on the depth of the layers (Figure 1). To better understand this dependence in real models, we collected staleness statistics on a Async-Opt run with 40 workers on a 18-layer Inception model (Szegedy et al., 2016) trained on the ImageNet Challenge dataset (Russakovsky et al., 2015), as shown in Table 1.
|
| 77 |
+
|
| 78 |
+
Despite the abovementioned problems, Async-Opt has been shown to be scale well up to a few dozens of workers for some models. However, at larger scales, increasing the number of machines (and thus staleness of gradients) can result in poorer trained models.
|
| 79 |
+
|
| 80 |
+
<table><tr><td>Layer</td><td>Min</td><td>Mean</td><td>Median</td><td>Max</td><td>Std Dev</td><td>Count</td></tr><tr><td>18</td><td>4</td><td>14.54</td><td>13.94</td><td>29</td><td>3.83</td><td>10908</td></tr><tr><td>12</td><td>5</td><td>11.35</td><td>11.3</td><td>23</td><td>3.09</td><td>44478</td></tr><tr><td>11</td><td>8</td><td>19.8</td><td>19.59</td><td>34</td><td>3.65</td><td>187</td></tr><tr><td>0</td><td>24</td><td>38.97</td><td>38.43</td><td>61</td><td>5.43</td><td>178</td></tr></table>
|
| 81 |
+
|
| 82 |
+
Table 1: Staleness of gradients in a 18-layer Inception model. Gradients were collected in a run of asynchronous training using 40 machines. Staleness of a gradient is measured as the number of updates that have occurred between its corresponding read and update operations. The staleness of gradients increases from a mean of ${ \sim } 1 4 . 5$ in the top layer (Layer 18) to ${ \sim } 3 9 . 0 $ in the bottom layer (Layer 0).
|
| 83 |
+
|
| 84 |
+
# 2.1 IMPACT OF STALENESS ON TEST ACCURACY
|
| 85 |
+
|
| 86 |
+
We explore how increased staleness contributes to training of poorer models. In order to mimic the setting on a smaller scale, we trained a state-of-the-art MNIST CNN model but simulated staleness by using old gradients for the parameter updates. Details of the model and training are provided in Appendix A.1.
|
| 87 |
+
|
| 88 |
+
The best final classification error on a test set was $0 . 3 6 \%$ , which increases to $0 . 4 7 \%$ with average gradient staleness of 20 steps, and up to $0 . 7 9 \%$ with 50 steps (see Figure 2).
|
| 89 |
+
|
| 90 |
+
Once the average simulated staleness was chosen to be more than 15 steps, the results started to significantly deteriorate and the training itself became much less stable. We had to employ following tricks to prevent the results from blowing up:
|
| 91 |
+
|
| 92 |
+
• Slowly increase the staleness over the first 3 epochs of training. This mimics increasing the number of asynchronous workers and is also very important in practice for some of the models we experimented with (e.g. large word-level language models). The trick was not relevant with a simulated staleness less than 15 but became crucial for larger values. Use lower initial learning rates when staleness is at least 20, which reduces a frequency of explosions (train error goes to $90 \%$ ). This observation is similar to what we found in other experiments - we were able to use much larger learning rates with synchronous training and the results were also more stable.
|
| 93 |
+
Even with above tricks the divergence occurs occasionally and we found that restarting training from random weights can lead to more successful runs. The best results were then chosen based on validation set performance.
|
| 94 |
+
|
| 95 |
+
# 3 REVISTING SYNCHRONOUS STOCHASTIC OPTIMIZATION
|
| 96 |
+
|
| 97 |
+
Both Dean et al. (2012) and Chilimbi et al. (2014) use versions of Async-SGD where the main potential problem is that each worker computes gradients over a potentially old version of the model. In order to remove this discrepancy, we propose here to reconsider a synchronous version of distributed stochastic gradient descent (Sync-SGD), or more generally, Synchronous Stochastic Optimization (Sync-Opt), where the parameter servers wait for all workers to send their gradients, aggregate them, and send the updated parameters to all workers afterward. This ensures that the actual algorithm is a true mini-batch stochastic gradient descent, with an effective batch size equal to the sum of all the mini-batch sizes of the workers.
|
| 98 |
+
|
| 99 |
+
While this approach solves the staleness problem, it also introduces the potential problem that the actual update time now depends on the slowest worker. Although workers have equivalent computation and network communication workload, slow stragglers may result from failing hardware, or contention on shared underlying hardware resources in data centers, or even due to preemption by other jobs.
|
| 100 |
+
|
| 101 |
+
To alleviate the straggler problem, we introduce backup workers (Dean & Barroso, 2013) as follows: instead of having only $N$ workers, we add $b$ extra workers, but as soon as the parameter servers receive gradients from any $N$ workers, they stop waiting and update their parameters using the $N$ gradients. The slowest $b$ workers’ gradients will be dropped when they arrive. Our method is presented in Algorithms 3, 4.
|
| 102 |
+
|
| 103 |
+
# Algorithm 3: Sync-SGD worker $k$ , where $k =$ $1 , \ldots , N + b$
|
| 104 |
+
|
| 105 |
+
Input: Dataset $\mathcal { X }$ Input: $B$ mini-batch size 1 for $t = 0 , 1 , \ldots$ do 2 Wait to read ${ \boldsymbol { \theta } } ^ { ( t ) } = ( { \boldsymbol { \theta } } ^ { ( t ) } [ 0 ] , \dots , { \boldsymbol { \theta } } ^ { ( t ) } [ M ] )$ from parameter servers. 3 $G _ { k } ^ { ( t ) } : = 0$ 4 for $i = 1 , \ldots , B$ do 5 Sample datapoint $\widetilde { x } _ { k , i }$ from $\mathcal { X }$ . 6 $\begin{array} { r } { G _ { k } ^ { ( t ) } G _ { k } ^ { ( t ) } + \frac { 1 } { B } \nabla F ( \widetilde { x } _ { k , i } ; \theta ^ { ( t ) } ) } \end{array}$ . 7 end 8 Send $( G _ { k } ^ { ( t ) } , t )$ to parameter servers. 9 end
|
| 106 |
+
|
| 107 |
+
# Algorithm 4: Sync-SGD Parameter Server $j$
|
| 108 |
+
|
| 109 |
+
Input: $\gamma _ { 0 } , \gamma _ { 1 } , \ldots$ learning rates. Input: $\alpha$ decay rate. Input: $N$ number of mini-batches to aggregate. Input: $\theta ^ { ( 0 ) }$ model initialization. for $t = 0 , 1 , \ldots$ do 2 $\mathcal { G } = \{ \}$ 3 while $| \mathcal { G } | < N$ do 4 Wait for $( G , t ^ { \prime } )$ from any worker. 5 if $t ^ { \prime } = = t$ then ${ \mathcal { G } } { \mathcal { G } } \cup \{ G \}$ . 6 else Drop gradient $G$ . 7 end 8 $\begin{array} { r } { \theta ^ { ( t + 1 ) } [ j ] \theta ^ { ( t ) } [ j ] - \frac { \gamma _ { t } } { N } \sum _ { G \in \mathcal { G } } G [ j ] . } \\ { \bar { \theta } ^ { ( t ) } [ j ] = \alpha \bar { \theta } ^ { ( t - 1 ) } [ j ] + ( 1 - \alpha ) \theta ^ { ( t ) } [ j ] . } \end{array}$ 9 10 end
|
| 110 |
+
|
| 111 |
+
# 3.1 STRAGGLER EFFECTS
|
| 112 |
+
|
| 113 |
+
The use of backup workers is motivated by the need to mitigate slow stragglers while maximizing computation. We investigate the effect of stragglers on Sync-Opt model training here.
|
| 114 |
+
|
| 115 |
+
We ran Sync-Opt with $N = 1 0 0$ workers, $b = 0$ backups, and 19 parameter servers on the Inception model. Using one variable as a proxy, we collected for each iteration both the start time of the iteration and the time when the $k$ th gradient of that variable arrived at the parameter server. These times are presented in Figure 3 for $k = 1$ , 50, 90, 97, 98, 99, 100. Note that $80 \%$ of the 98th gradient arrives in under 2s, whereas only $30 \%$ of the final gradient do. Furthermore, the time to collect the final few gradients grows exponentially, resulting in wasted idle resources and time expended to wait for the slowest gradients. This exponential increase is also seen in Figure 4.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: CDF of time taken to aggregate gradients from $N$ machines. For clarity, we only show times of $\leq 6 \mathrm { s }$ ; the maximum observed time is 310s.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 4: Mean and median times, across all iterations, to collect $k$ gradients on $N = 1 0 0$ workers and $b = 0$ backups. Most mean times fall between 1.4s and 1.8s, except of final few gradients.
|
| 122 |
+
|
| 123 |
+
Thus, one might choose to drop slow stragglers to decrease the iteration time. However, using fewer machines implies a smaller effective mini-batch size and thus greater gradient variance, which in turn could require more iterations for convergence. We examine this relationship by running Sync-Opt2 with $N = 5 0$ , 70, 80, 90, 100 and $b = 6$ , and note the number of iterations required for convergence in Figure 5. Additional details of this training are provided in Appendix A.2. As $N$ is doubled from 50 to 100, the number of iterations to converge nearly halves from $1 3 7 . 5 e 3$ to $7 6 . 2 e 3$ .
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 5: Number of iterations to converge when aggregating gradient from $N$ machines.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 6: Estimated time to converge when aggregating gradients from $N$ machines on a $N + b = \bar { 1 } 0 0$ machine configuration. Convergence is fastest when choosing $N = 9 6$ , $b = 4$ .
|
| 130 |
+
|
| 131 |
+
Hence, there is a trade-off between dropping more stragglers to reduce iteration time, and waiting for more gradients to improve the gradient quality. Consider a hypothetical setting where we have $N + b = 1 0 0$ machines, and we wish to choose the best configuration of $N$ and $b$ to minimize running time to convergence3. For each configuration, we can estimate the iterations required from Figure 5 (linearly interpolating for values of $N$ for which we did not collect data). We can multiply this with the mean iteration times (Figure 4) to obtain the running time required to converge for each setting of $N$ and $b$ . These results are shown in Figure 6, indicating that $N = 9 6$ , $b = 4$ converges fastest. Therefore, this motivates our choice to use a few backup workers for mitigating stragglers.
|
| 132 |
+
|
| 133 |
+
# 4 EXPERIMENTS
|
| 134 |
+
|
| 135 |
+
In this section, we present our empirical comparisons of synchronous and asynchronous distributed stochastic optimization algorithms as applied to models such as Inception and PixelCNN. All experiments in this paper are using the TensorFlow system (Abadi et al., 2015).
|
| 136 |
+
|
| 137 |
+
# 4.1 METRICS OF COMPARISON: FASTER CONVERGENCE, BETTER OPTIMUM
|
| 138 |
+
|
| 139 |
+
We are interested in two metrics of comparison for our empirical validation: (1) test error or accuracy, and (2) speed of convergence3. We point out that for non-convex deep learning models, it is possible to converge faster to a poorer local optimum. Here we show a simple example with Inception using different learning rates.
|
| 140 |
+
|
| 141 |
+
Table 2: Test accuracies at convergence and number of epochs to converge for different initial learning rates $\gamma _ { 0 }$ . Low initial learning rates result in faster convergence to poorer local optimum.
|
| 142 |
+
|
| 143 |
+
<table><tr><td>Initial rate 20</td><td>Test precision at convergence</td><td>Epochs to converge</td></tr><tr><td>1.125 2.25</td><td>77.29% 77.75%</td><td>52628 65811</td></tr><tr><td>4.5</td><td></td><td></td></tr><tr><td>9.0</td><td>78.15%</td><td>76209</td></tr><tr><td></td><td>78.17%</td><td>77235</td></tr></table>
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 7: Convergence of Sync-Opt on Inception model using $N =$ 100 workers and $b = 6$ backups, with varying initial learning rates $\gamma _ { 0 }$ . To reach a lower $\epsilon$ test precision, small $\gamma _ { 0 }$ ’s require fewer epochs than large $\gamma _ { 0 }$ ’s. However, small $\gamma _ { 0 }$ ’s either fail to attain high $\epsilon$ precision, or take more epochs than higher $\gamma _ { 0 }$ ’s.
|
| 147 |
+
|
| 148 |
+
We ran Sync-Opt on Inception with $N = 1 0 0$ and $b = 6$ , but varied the initial learning rate $\gamma _ { 0 }$ between 1.125 and 9.0. (Learning rates are exponentially decreased with iterations.) Table 2 shows that smaller $\gamma _ { 0 }$ converge faster, but to poorer test precisions. Focusing on speed on an early phase of training could lead to misleading conclusions if we fail to account for eventual convergence. For example, Figure 3b shows that using $\gamma _ { 0 } = 1 . 1 2 5$ reaches $\epsilon = 7 5 \%$ precision $1 . 5 \times$ faster than $\gamma _ { 0 } = 4 . 5$ , but is slower for $\epsilon = 7 7 . 7 5 \%$ , and fails to reach higher precisions.
|
| 149 |
+
|
| 150 |
+
# 4.2 INCEPTION
|
| 151 |
+
|
| 152 |
+
We conducted experiments on the Inception model (Szegedy et al., 2016) trained on ImageNet Challenge dataset (Russakovsky et al., 2015), where the task is to classify images out of 1000 categories. We used several configurations, varying $N + b$ from 53 to 212 workers. Additional details of the training are provided in Appendix A.3. An epoch is a synchronous iteration for Sync-Opt, or a full pass of $N$ updates for Async-Opt, which represent similar amounts of computation. Results of this experiment are presented in Figure 8.
|
| 153 |
+
|
| 154 |
+
Figure 8b shows that Sync-Opt outperforms Async-Opt in test precision: Sync-Opt attains ${ \sim } 0 . 5 \%$ better test precision than Async-Opt for comparable $N + b$ workers. Furthermore, Sync-Opt converges 6h and 18h faster than Async-Opt for 106 and 212 workers respectively, and is 3h slower when 53 workers are used, as seen in Figure 8d. This difference in speed is largely due to the fewer epochs (Figure 8c) needed by Sync-Opt, but comparable or better epoch time (Figure 8e).
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 8: Convergence of Sync-Opt and Async-Opt on Inception model using varying number of machines. Sync-Opt with backup workers converge faster, with fewer epochs, to higher test accuracies.
|
| 158 |
+
|
| 159 |
+
# 4.3 PIXELCNN EXPERIMENTS
|
| 160 |
+
|
| 161 |
+
The second model we experimented on is PixelCNN (Oord et al., 2016), a conditional image generation deep neural network, which we train on the CIFAR-10 (Krizhevsky & Hinton, 2009) dataset. Configurations of $N + b = 1 , 8 , 1 6$ workers were used; for Sync-Opt, we always used $b = 1$ backup worker. Additional details are provided in Appendix A.4.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 9: Convergence of synchronous and asynchronous training on PixelCNN model. Sync-Opt achieves lower negative log likelihood in less time than Async-Opt.
|
| 165 |
+
|
| 166 |
+
Convergence of the test negative log likelihood (NLL) on PixelCNN is shown in Figure 9a, where lower is better. Observe that Sync-Opt obtains lower NLL than Async-Opt; in fact, Async-Opt is even outperformed by serial RMSProp with $N = 1$ worker, with degrading performance as $N$ increases from 8 to 16. Figure 9b further shows the time taken to reach $\epsilon$ test NLL. Sync-Opt reduces the time to reach $\epsilon = 2 . 1 4 5$ from 247h to $5 8 . 3 \mathrm { h }$ ; this NLL is not even achieved by Async-Opt.
|
| 167 |
+
|
| 168 |
+
# 5 RELATED WORK
|
| 169 |
+
|
| 170 |
+
Multicore and distributed optimization algorithms have received much attention in recent years. Asynchronous algorithms include Recht et al. (2011); Duchi et al. (2013); Zhang et al. (2015a); Reddi et al. (2015); Leblond et al. (2016). Implementations of asynchronous optimization include Xing et al. (2015); Li et al. (2014); Chilimbi et al. (2014). Attempts have also been made in Zinkevich et al. (2010) and Zhang & Jordan (2015) to algorithmically improve synchronous SGD.
|
| 171 |
+
|
| 172 |
+
An alternative solution, “softsync”, was presented in Zhang et al. (2015b), which proposed batching gradients from multiple machines before performing an asynchronous SGD update, thereby reducing the effective staleness of gradients. Similar to our proposal, softsync avoids stragglers by not forcing updates to wait for the slowest worker. However, softsync allows the use of stale gradients but we do not. The two solutions provide different explorations of the trade-off between high accuracy (by minimizing staleness) and fast throughput (by avoiding stragglers).
|
| 173 |
+
|
| 174 |
+
Watcharapichat et al. (2016) introduces a distributed deep learning system without parameter servers, by having workers interleave gradient computation and communication in a round-robin pattern. Like Async-Opt, this approach suffers from staleness. We also note that in principle, workers in Sync-Opt can double as parameter servers and execute the update operations and avoid the need to partition hardware resources between workers and servers.
|
| 175 |
+
|
| 176 |
+
Das et al. (2016) analyzes distributed stochastic optimization and optimizes the system by solving detailed system balance equations. We believe this approach is complimentary to our work, and could potentially be applied to guide the choice of systems configurations for Sync-Opt.
|
| 177 |
+
|
| 178 |
+
Keskar et al. (2016) suggests that large batch sizes for synchronous stochastic optimization leads to poorer generalization. Our effective batch size increases linearly with the number of workers $N$ . However, we did not observe this effect in our experiments; we believe we are not yet in the large batch size regime examined by Keskar et al. (2016).
|
| 179 |
+
|
| 180 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 181 |
+
|
| 182 |
+
Distributed training strategies for deep learning architectures will become ever more important as the size of datasets increases. In this work, we have shown how both synchronous and asynchronous distributed stochastic optimization suffer from their respective weaknesses of stragglers and staleness. This has motivated our development of synchronous stochastic optimization with backup workers, which we show to be a viable and scalable strategy.
|
| 183 |
+
|
| 184 |
+
We are currently experimenting with different kinds of datasets, including word-level language models where parts of the model (the embedding layers) are often very sparse, which involves very different communication constraints. We are also working on further improving the performance of synchronous training like combining gradients from multiple workers sharing the same machine before sending them to the parameter servers to reduce the communication overhead. An alternative of using time-outs instead of backup workers is also being explored.
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit ´ Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, ´ Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/.
|
| 189 |
+
|
| 190 |
+
Jianmin Chen, Rajat Monga, Samy Bengio, and Rafal Jozefowicz. Revisiting distributed synchronous sgd. arXiv preprint arXiv:1604.00981, 2016.
|
| 191 |
+
|
| 192 |
+
T. Chilimbi, Y. Suzue, J. Apacible, and K. Kalyanaraman. Project adam: Building an efficient and scalable deep learning training system. In Proceedings of the 11th USENIX Symposium on Operating Systems Design and Implementation, 2014.
|
| 193 |
+
|
| 194 |
+
Dipankar Das, Sasikanth Avancha, Dheevatsa Mudigere, Karthikeyan Vaidynathan, Srinivas Sridharan, Dhiraj Kalamkar, Bharat Kaul, and Pradeep Dubey. Distributed deep learning using synchronous stochastic gradient descent. arXiv preprint arXiv:1602.06709, 2016.
|
| 195 |
+
|
| 196 |
+
Christopher M De Sa, Ce Zhang, Kunle Olukotun, and Christopher Re. Taming the wild: A unified analysis of ´ hogwild-style algorithms. In Advances in Neural Information Processing Systems, pp. 2674–2682, 2015.
|
| 197 |
+
|
| 198 |
+
J. Dean, G. S. Corrado, R. Monga, K. Chen, M. Devin, Q. V. Le, M. Z. Mao, M. A. Ranzato, A. Senior, P. Tucker, K. Yang, and A. Y. Ng. Large scale distributed deep networks. In Advances in Neural Information Processing Systems, NIPS, 2012.
|
| 199 |
+
|
| 200 |
+
Jeffrey Dean and Luiz Andr Barroso. The tail at scale. Communications of the ACM, 56:74–80, 2013. URL http://cacm.acm.org/magazines/2013/2/160173-the-tail-at-scale/fulltext.
|
| 201 |
+
|
| 202 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 203 |
+
|
| 204 |
+
John Duchi, Michael I Jordan, and Brendan McMahan. Estimation, optimization, and parallelism when data is sparse. In Advances in Neural Information Processing Systems, pp. 2832–2840, 2013.
|
| 205 |
+
|
| 206 |
+
G. Hinton, L. Deng, D. Yu, G. Dahl, A. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. N. Sainath, and B. Kingsbury. Deep neural networks for acoustic modeling in speech recognition. IEEE Signal Processing Magazine, 29:82–97, 2012.
|
| 207 |
+
|
| 208 |
+
S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML, 2015.
|
| 209 |
+
|
| 210 |
+
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.
|
| 211 |
+
|
| 212 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 213 |
+
|
| 214 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 215 |
+
|
| 216 |
+
Remi Leblond, Fabian Pedregosa, and Simon Lacoste-Julien. Asaga: Asynchronous parallel saga. ´ arXiv preprint arXiv:1606.04809, 2016.
|
| 217 |
+
|
| 218 |
+
Mu Li, David G Andersen, Jun Woo Park, Alexander J Smola, Amr Ahmed, Vanja Josifovski, James Long, Eugene J Shekita, and Bor-Yiing Su. Scaling distributed machine learning with the parameter server. In 11th USENIX Symposium on Operating Systems Design and Implementation (OSDI 14), pp. 583–598, 2014.
|
| 219 |
+
|
| 220 |
+
Horia Mania, Xinghao Pan, Dimitris Papailiopoulos, Benjamin Recht, Kannan Ramchandran, and Michael I Jordan. Perturbed iterate analysis for asynchronous stochastic optimization. arXiv preprint arXiv:1507.06970, 2015.
|
| 221 |
+
|
| 222 |
+
Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray Kavukcuoglu. Conditional image generation with pixelcnn decoders. arXiv preprint arXiv:1606.05328, 2016.
|
| 223 |
+
|
| 224 |
+
Benjamin Recht, Christopher Re, Stephen Wright, and Feng Niu. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in Neural Information Processing Systems, pp. 693–701, 2011.
|
| 225 |
+
|
| 226 |
+
Sashank J Reddi, Ahmed Hefny, Suvrit Sra, Barnabas Poczos, and Alex J Smola. On variance reduction in stochastic gradient descent and its asynchronous variants. In Advances in Neural Information Processing Systems, pp. 2647–2655, 2015.
|
| 227 |
+
|
| 228 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. Imagenet large scale visual recognition challenge. In International Journal of Computer Vision, 2015.
|
| 229 |
+
|
| 230 |
+
C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In ArXiv 1512.00567, 2016.
|
| 231 |
+
Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 4(2), 2012.
|
| 232 |
+
Pijika Watcharapichat, Victoria Lopez Morales, Raul Castro Fernandez, and Peter Pietzuch. Ako: Decentralised deep learning with partial gradient exchange. In Proceedings of the Seventh ACM Symposium on Cloud Computing, pp. 84–97. ACM, 2016.
|
| 233 |
+
Eric P Xing, Qirong Ho, Wei Dai, Jin Kyu Kim, Jinliang Wei, Seunghak Lee, Xun Zheng, Pengtao Xie, Abhimanu Kumar, and Yaoliang Yu. Petuum: A new platform for distributed machine learning on big data. IEEE Transactions on Big Data, 1(2):49–67, 2015.
|
| 234 |
+
Sixin Zhang, Anna E Choromanska, and Yann LeCun. Deep learning with elastic averaging sgd. In Advances in Neural Information Processing Systems, pp. 685–693, 2015a.
|
| 235 |
+
Wei Zhang, Suyog Gupta, Xiangru Lian, and Ji Liu. Staleness-aware async-sgd for distributed deep learning. arXiv preprint arXiv:1511.05950, 2015b.
|
| 236 |
+
Yuchen Zhang and Michael I Jordan. Splash: User-friendly programming interface for parallelizing stochastic algorithms. arXiv preprint arXiv:1506.07552, 2015.
|
| 237 |
+
Martin Zinkevich, Markus Weimer, Lihong Li, and Alex J Smola. Parallelized stochastic gradient descent. In Advances in neural information processing systems, pp. 2595–2603, 2010.
|
| 238 |
+
|
| 239 |
+
# A DETAILS OF MODELS AND TRAINING
|
| 240 |
+
|
| 241 |
+
# A.1 MNIST CNN, SECTION 2.1
|
| 242 |
+
|
| 243 |
+
The model used in our experiments is a 4-layer CNN that have $3 { \tt X } 3$ filters with max-pooling and weight normalization in every layer. We trained the model with SGD for 25 epochs and evaluated performance on the exponential moving average $\bar { \theta }$ using a decay rate of $\alpha = 0 . 9 9 9 9$ . Initial learning rate was set to be 0.1 and linearly annealed to 0 in the last 10 epochs. We also used small image rotations and zooms as a data augmentation scheme.
|
| 244 |
+
|
| 245 |
+
# A.2 INCEPTION, SECTION 3.1
|
| 246 |
+
|
| 247 |
+
For our straggler experiments, we trained the Inception (Szegedy et al., 2016) model on the ImageNet Challenge dataset (Russakovsky et al., 2015). 10 parameter servers were used, and each worker was equipped with a k40 GPU.
|
| 248 |
+
|
| 249 |
+
The underlying optimizer was RMSProp with momentum, with decay of 0.9 and momentum of 0.9. Mini-batch size $B = 3 2$ was used. Initial learning rates $\gamma _ { 0 }$ were set at $0 . 0 4 5 N$ , which we found to provide good test precisions for Inception. Learning rates were also exponentially decreased with decay rate $\beta = 0 . 9 4$ as $\gamma _ { 0 } \beta ^ { t N / ( 2 T ) }$ , where $T = | { \mathcal { X } } | / B$ is the number of mini-batches in the dataset.
|
| 250 |
+
|
| 251 |
+
Test precisions were evaluated on the exponential moving average $\bar { \theta }$ using $\alpha = 0 . 9 9 9 9$ .
|
| 252 |
+
|
| 253 |
+
# A.3 INCEPTION, SECTION 4.2
|
| 254 |
+
|
| 255 |
+
For experiments comparing Async-Opt and Sync-Opt on the Inception model in Section 4.2, each worker is equipped with a k40 GPU. For $N + b = 5 3$ workers, 17 parameter servers were used; for $N + b = 1 0 6$ workers, we used 27 parameter servers; and 37 parameter servers were used for $N + b = 2 1 2$ .
|
| 256 |
+
|
| 257 |
+
In the asynchronous training mode, gradient clipping is also needed for stabilization, which requires each worker to collect the gradient across all layers of the deep model, compute the global norm $| | G | |$ and then clip all gradient accordingly. However, synchronization turns out to be very stable so gradient clipping is no longer needed, which means that we can pipeline the update of parameters in different layers: the gradient of top layers’ parameters can be sent to parameter servers while concurrently computing gradients for the lower layers.
|
| 258 |
+
|
| 259 |
+
The underlying optimizer is RMSProp with momentum, with decay of 0.9 and momentum of 0.9. Mini-batch size $B = 3 2$ was used. Initial learning rates $\gamma _ { 0 }$ for Async-Opt were set to 0.045; for Sync-Opt, we found as a rule-of-thumb that a learning rate of $0 . 0 4 5 N$ worked well for this model. Learning rates were then exponentially decayed with decay rate $\beta = 0 . 9 4$ as $\gamma _ { 0 } \beta ^ { t / ( 2 T ) }$ for AsyncOpt, where $T = | { \mathcal { X } } | / B$ is the number of mini-batches in the dataset. For Sync-Opt, we learning rates were also exponentially decreased at rate of $\gamma _ { 0 } \beta ^ { t N / ( 2 T ) }$ , so that the learning rates after computing the same number of datapoints are comparable for Async-Opt and Sync-Opt.
|
| 260 |
+
|
| 261 |
+
Test precisions were evaluated on the exponential moving average $\bar { \theta }$ using $\alpha = 0 . 9 9 9 9$
|
| 262 |
+
|
| 263 |
+
# A.4 PIXELCNN, SECTION 4.3
|
| 264 |
+
|
| 265 |
+
The PixelCNN (Oord et al., 2016) model was trained on the CIFAR-10 (Krizhevsky & Hinton, 2009) dataset. Configurations of $N + b = 1 , 8 , 1 6$ workers each with a $\mathbf { k } 8 0$ GPU, and 10 parameter servers were used. For Sync-Opt, we always used $b = 1$ backup worker. The underlying optimizer is RMSProp with momentum, using decay of 0.95 and momentum of 0.9. Initial learning rates $\gamma _ { 0 }$ were set to $1 e - 4$ and slowly decreased to $3 e - 6$ after 200,000 iterations. Mini-batch size $B = 4$ was used.
|
md/train/HylsTT4FvB/HylsTT4FvB.md
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE “STEERABILITY” OF GENERATIVE ADVERSARIAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Ali Jahanian\*, Lucy Chai\*, & Phillip Isola
|
| 4 |
+
|
| 5 |
+
Massachusetts Institute of Technology Cambridge, MA 02139, USA {jahanian,lrchai,phillipi}@mit.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
An open secret in contemporary machine learning is that many models work beautifully on standard benchmarks but fail to generalize outside the lab. This has been attributed to biased training data, which provide poor coverage over real world events. Generative models are no exception, but recent advances in generative adversarial networks (GANs) suggest otherwise – these models can now synthesize strikingly realistic and diverse images. Is generative modeling of photos a solved problem? We show that although current GANs can fit standard datasets very well, they still fall short of being comprehensive models of the visual manifold. In particular, we study their ability to fit simple transformations such as camera movements and color changes. We find that the models reflect the biases of the datasets on which they are trained (e.g., centered objects), but that they also exhibit some capacity for generalization: by “steering” in latent space, we can shift the distribution while still creating realistic images. We hypothesize that the degree of distributional shift is related to the breadth of the training data distribution. Thus, we conduct experiments to quantify the limits of GAN transformations and introduce techniques to mitigate the problem. Code is released on our project page: https://ali-design.github.io/gan_steerability/.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
The quality of deep generative models has increased dramatically over the past few years. When introduced in 2014, Generative Adversarial Networks (GANs) could only synthesize MNIST digits and low-resolution grayscale faces (Goodfellow et al., 2014). The most recent models, however, produce diverse high-resolution images that are often indistinguishable from natural photos (Brock et al., 2018; Karras et al., 2018).
|
| 14 |
+
|
| 15 |
+
Science fiction has long dreamed of virtual realities filled of synthetic content as rich as, or richer, than the real world (e.g., The Matrix, Ready Player One). How close are we to this dream? Traditional computer graphics can render photorealistic 3D scenes, but cannot automatically generate detailed content. Generative models like GANs, in contrast, can create content from scratch, but we do not currently have tools for navigating the generated scenes in the same kind of way as you can walk through and interact with a 3D game engine.
|
| 16 |
+
|
| 17 |
+
In this paper, we explore the degree to which you can navigate the visual world of a GAN. Figure 1 illustrates the kinds of transformations we explore. Consider the dog at the top-left. By moving in some direction of GAN latent space, can we hallucinate walking toward this dog? As the figure indicates, and as we will show in this paper, the answer is yes. However, as we continue to zoom in, we quickly reach limits. Once the dog face fills the full frame, continuing to walk in this direction fails to increase the zoom. A similar effect occurs in the daisy example (row 2 of Fig. 1), where a direction in latent space moves the daisy up and down, but cannot move it out of frame.
|
| 18 |
+
|
| 19 |
+
We hypothesize that these limits are due to biases in the distribution of images on which the GAN is trained. For example, if the training dataset consists of centered dogs and daises, the same may be the case in GAN-generated images. Nonetheless, we find that some degree of transformation is possible. When and why can we achieve certain transformations but not others?
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Learned latent space trajectories in generative adversarial networks correspond to visual transformations like camera shift and zoom. Take the “steering wheel”, drive in the latent space, and explore the natural image manifold via generative transformations!
|
| 23 |
+
|
| 24 |
+
This paper seeks to quantify the degree to which we can achieve basic visual transformations by navigating in GAN latent space. In other words, are GANs “steerable” in latent space?1 We analyze the relationship between the data distribution on which the model is trained and the success in achieving these transformations. From our experiments, it is possible to shift the distribution of generated images to some degree, but we cannot extrapolate entirely out of the dataset’s support. In particular, attributes can be shifted in proportion to the variability of that attribute in the training data. We further demonstrate an approach to increase model steerability by jointly optimizing the generator and latent direction, together with data augmentation on training images. One of the current criticisms of generative models is that they simply interpolate between datapoints, and fail to generate anything truly new, but our results add nuance to this story. It is possible to achieve distributional shift, but the ability to create realistic images from a modified distributions relies on sufficient diversity in the dataset along the dimension that we vary.
|
| 25 |
+
|
| 26 |
+
Our main findings are:
|
| 27 |
+
|
| 28 |
+
A simple walk in the latent space of GANs achieves camera motion and color transformations in the output image space. These walks are learned in self-supervised manner without labeled attributes or distinct source and target images. The linear walk is as effective as more complex non-linear walks, suggesting that the models learn to roughly linearize these operations without being explicitly trained to do so. The extent of each transformation is limited, and we quantify a relationship between dataset variability and how much we can shift the model distribution. The transformations are a general-purpose framework that work with different model architectures, e.g. BigGAN, StyleGAN, and DCGAN, and illustrate different disentanglement properties in their respective latent spaces.
|
| 29 |
+
• Data augmentation improves steerability, as does jointly training the walk trajectory and the generator weights, which allows us to achieve larger transformation effects.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Latent space manipulations can be seen from several perspectives – how we achieve it, what limits it, and what it enables us to do. Our work addresses these three aspects together, and we briefly refer to each one in related work.
|
| 34 |
+
|
| 35 |
+
Interpolations in latent space Traditional approaches to image editing with GAN latent spaces find linear directions that correspond to changes in labeled attributes, such as smile-vectors and gender-vectors for faces (Radford et al., 2015; Karras et al., 2018). However these manipulations are not exclusive to GANs; in flow-based generative models, linearly interpolating between two encoded images allow one to edit a source image toward attributes of the target (Kingma & Dhariwal, 2018). Mollenhoff & Cremers (2019) proposes a modified GAN formulation by treating data ¨ as directional $k$ -currents, where moving along tangent planes naturally corresponds to interpretable manipulations. Upchurch et al. (2017) removes the generative model entirely and instead interpolates in the intermediate feature space of a pretrained classifier, again using feature mappings of source and target sets to determine an edit direction. Unlike these approaches, we learn our latentspace trajectories in a self-supervised manner without labeled attributes or distinct source and target images. Instead, we learn to approximate editing operations on individual source images. We find that linear trajectories in latent space can capture simple image manipulations, e.g., zoom-vectors and shift-vectors, although we also obtain similar results using nonlinear trajectories.
|
| 36 |
+
|
| 37 |
+
Dataset bias Biases from training data and network architecture both impact the generalization capacity of learned models (Torralba & Efros, 2011; Geirhos et al., 2018; Amini et al.). Dataset biases partly comes from human preferences in taking photos: we tend to take pictures in specific “canonical” views that are not fully representative of the entire visual world (Mezuman & Weiss, 2012; Jahanian et al., 2015). Consequently, models trained with these datasets inherit their biases. This may result in models that misrepresent the given task – such as tendencies towards texture bias rather than shape bias on ImageNet classifiers (Geirhos et al., 2018) – and in turn limits their generalization performance on similar objectives (Azulay & Weiss, 2018). Our latent space trajectories transform the output corresponding to various image editing operations, but ultimately we are constrained by biases in the data and cannot extrapolate arbitrarily far beyond the data’s support.
|
| 38 |
+
|
| 39 |
+
Generative models for content creation The recent progress in generative models has opened interesting avenues for content creation (Brock et al., 2018; Karras et al., 2018), including applications that enable users to fine-tune the generated output (Simon; Zhu et al., 2016; Bau et al., 2018). A by-product the current work is enable users to modify image properties by turning a single knob – the magnitude of the learned transformation in latent space. We further demonstrate that these image manipulations are not just a simple creativity tool; they also provide us with a window into biases and generalization capacity of these models.
|
| 40 |
+
|
| 41 |
+
Applications of latent space editing Image manipulations using generative models suggest several interesting downstream applications. For example, Denton et al. (2019) learns linear walks corresponding to various facial characteristics – they use these to measure biases in facial attribute detectors, whereas we study biases in the generative model that originate from training data. Shen et al. (2019) also assumes linear latent space trajectories and learns paths for face attribute editing according to semantic concepts such as age and expression, thus demonstrating disentanglement of the latent space. White (2016) suggests approaches to improve the learned manipulations, such as using spherical linear interpolations, resampling images to remove biases in attribute vectors, and using data augmentation as a synthetic attribute for variational autoencoders. Goetschalckx et al. (2019) applies a linear walk to achieve transformations corresponding to cognitive properties of an image such as memorability, aesthetics, and emotional valence. Unlike these works, we do not require an attribute detector or assessor function to learn the latent space trajectory, and therefore our loss function is based on image similarity between source and target images. In addition to linear walks, we explore using non-linear walks parametrized by neural networks for editing operations.
|
| 42 |
+
|
| 43 |
+
# 3 METHOD
|
| 44 |
+
|
| 45 |
+
Generative models such as GANs (Goodfellow et al., 2014) learn a mapping function $G$ such that $G : z x$ . Here, $z$ is the latent code drawn from a Gaussian density and $x$ is an output, e.g., an image. Our goal is to achieve transformations in the output space by moving in latent space, as shown in Fig. 2. In general, this goal also captures the idea in equivariance, in which transformations in the input space result in equivalent transformations in the output space (c.f. Hinton et al. (2011); Cohen et al. (2019); Lenc & Vedaldi (2015)).
|
| 46 |
+
|
| 47 |
+
Objective We want to learn an $N$ -dimensional vector representing the optimal path in latent space for a given transformation. The vector is multiplied with continuous parameter $\alpha$ which signifies the step size: large $\alpha$ values correspond to a greater degree of transformation, while small $\alpha$ values correspond to a lesser degree. Formally, we learn the walk $w$ by minimizing the objective function:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\boldsymbol { w } ^ { * } = \underset { \boldsymbol { w } } { \arg \operatorname* { m i n } } \mathbb { E } _ { z , \boldsymbol { \alpha } } [ \mathcal { L } ( \boldsymbol { G } ( \boldsymbol { z } + \boldsymbol { \alpha } \boldsymbol { w } ) , \mathrm { e d i t } ( \boldsymbol { G } ( \boldsymbol { z } ) , \boldsymbol { \alpha } ) ) ] .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 2: We aim to find a path in $z$ space to transform the generated image $G ( z )$ to its edited version edit $\left( G ( z , \alpha ) \right)$ , e.g., an $\alpha \times$ zoom. This walk results in the generated image $G ( z + \alpha w )$ when we choose a linear walk, or $G ( f ( f ( . . . ( z ) ) )$ when we choose a non-linear walk.
|
| 55 |
+
|
| 56 |
+
Here, $\mathcal { L }$ measures the distance between the generated image after taking an $\alpha$ -step in the latent direction $G ( z + \alpha w )$ and the target edit $( G ( z ) , \alpha )$ derived from the source image $\overset { \cdot } { G } ( z )$ . We use $L 2$ loss as our objective $\mathcal { L }$ , however we also obtain similar results when using the LPIPS perceptual image similarity metric (Zhang et al., 2018) (see Appendix B.4.1). Note that we can learn this walk in a fully self-supervised manner – we perform the edit(·) operation on an arbitrary generated image and subsequently the vector to minimize the objective. Let model $( \alpha )$ denote the optimized transformation vector $w ^ { * }$ with the step size $\alpha$ , defined as model $( \alpha ) = G \big ( z + \alpha w ^ { * } \big )$ .
|
| 57 |
+
|
| 58 |
+
The previous setup assumes linear latent space walks, but we can also learn non-linear trajectories in which the walk direction depends on the current latent space position. For the non-linear walk, we learn a function, $f ^ { \ast } ( z )$ , which corresponds to a small $\epsilon$ -step transformation $\mathtt { e d i t } ( G ( z ) , \epsilon )$ . To achieve bigger transformations, we apply $f$ recursively, mimicking discrete Euler ODE approximations. Formally, for a fixed $\epsilon$ , we minimize
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\mathcal { L } = \mathbb { E } _ { z , n } [ | | G ( f ^ { n } ( z ) ) - \mathrm { e d i t } ( G ( z ) , n \epsilon ) ) | | ] ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $f ^ { n } ( \cdot )$ is an $n$ th-order function composition $f ( f ( f ( \dots ) ) )$ , and $f ( z )$ is parametrized with a neural network. We discuss further implementation details in Appendix A.4. We use this function composition approach rather than the simpler setup of $G ( z + \alpha \mathbf { N } \mathbf { N } ( z ) )$ because the latter learns to ignore the input $z$ when $\alpha$ takes on continuous values, and is thus equivalent to the previous linear trajectory (see Appendix A.3 for further details).
|
| 65 |
+
|
| 66 |
+
Quantifying Steerability We further seek to quantify how well we can achieve desired image manipulations under each transformation. To this end, we compare the distribution of a given attribute, e.g., “luminance”, in the dataset versus in images generated after walking in latent space.
|
| 67 |
+
|
| 68 |
+
For color transformations, we consider the effect of increasing or decreasing the $\alpha$ coefficient corresponding to each color channel. To estimate the color distribution of model-generated images, we randomly sample $N = 1 0 0$ pixels per image both before and after taking a step in latent space. Then, we compute the pixel value for each channel, or the mean RGB value for luminance, and normalize the range between 0 and 1.
|
| 69 |
+
|
| 70 |
+
For zoom and shift transformations, we rely on an object detector which captures the central object in the image class. We use a MobileNet-SSD v1 (Liu et al., 2016) detector to estimate object bounding boxes, and average over image classes recognizable by the detector. For each successful detection, we take the highest probability bounding box corresponding to the desired class and use that to quantify the amount of transformation. For the zoom operation, we use the area of the bounding box normalized by the area of the total image. For shift in the X and Y directions, we take the center X and Y coordinates of the bounding box, and normalize by image width or height.
|
| 71 |
+
|
| 72 |
+
Truncation parameters in GANs (as used in Brock et al. (2018); Karras et al. (2018)) trade off between the diversity of the generated images and sample quality. When comparing generated images to the dataset distribution, we use the largest possible truncation for the model and perform similar cropping and resizing of the dataset as done during model training (see Brock et al. (2018)). When comparing the attributes of generated distributions under different $\alpha$ magnitudes to each other but not to the dataset, we reduce truncation to 0.5 to ensure better performance of the object detector.
|
| 73 |
+
|
| 74 |
+
Reducing Transformation Limits Equations 1 and 2 learn a latent space walk assuming a pretrained generative model, thus keeping the model weights fixed. The previous approach allows us to understand the latent space organization and limitations in the model’s transformation capacity. To overcome these limits, we explore adding data augmentation by editing the training images with each corresponding transformation, and train the generative model with this augmented dataset. We also introduce a modified objective function that jointly optimizes the generator weights and a linear walk vector:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
G ^ { * } , w ^ { * } = \arg \operatorname* { m i n } _ { G , w } \left( \mathcal { L } _ { e d i t } + \mathcal { L } _ { G A N } \right) ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where the edit loss encourages low $L 2$ error between learned transformation and target image:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\mathcal { L } _ { e d i t } = L 2 \left( G ( z + \alpha w ) - \mathsf { e d i t } ( G ( z ) , \alpha ) \right) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
The GAN loss optimizes for discriminator error:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal { L } _ { G A N } = \operatorname* { m a x } _ { D } \left( \mathbb { E } _ { z , \alpha } [ D ( G ( z + \alpha w ) ) ] - \mathbb { E } _ { x , \alpha } [ D ( \mathsf { e d i t } ( x , \alpha ) ) ] \right) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where we draw images $x$ from the training dataset and perform data augmentation by applying the edit operation on them. This optimization approach encourages the generator to organize its latent space so that the transformations lie along linear paths, and when combined with data augmentation, results in larger transformation ranges which we demonstrate in Sec. 4.4
|
| 93 |
+
|
| 94 |
+
# 4 EXPERIMENTS
|
| 95 |
+
|
| 96 |
+
We demonstrate our approach using BigGAN (Brock et al., 2018), a class-conditional GAN trained on 1000 ImageNet categories. We learn a shared latent space walk by averaging across the image categories, and further quantify how this walk affects each class differently. We focus on linear walks in latent space for the main text, and show additional results on nonlinear walks in Sec. 4.3 and Appendix B.4.2. We also conduct experiments on StyleGAN (Karras et al., 2018), which uses an unconditional style-based generator architecture in Sec. 4.3 and Appendix B.5.
|
| 97 |
+
|
| 98 |
+
# 4.1 WHAT IMAGE TRANSFORMATIONS CAN WE ACHIEVE IN LATENT SPACE?
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 3: Transformation limits. As we increase the magnitude of $w ^ { * }$ , the operation either does not transform the image any further, or the image becomes unrealisitic. Below each figure we also indicate the average LPIPS perceptual distance between 200 sampled image pairs of that category. Perceptual distance decreases as we move farther from the source (center image), which indicates that the images are converging.
|
| 102 |
+
|
| 103 |
+
We show qualitative results of the learned transformations in Fig. 1. By steering in the generator latent space, we learn a variety of transformations on a given source image (shown in the center panel of each transformation). Interestingly, several priors come into play when learning these image transformations. When we shift a daisy downwards in the Y direction, the model hallucinates that the sky exists on the top of the image. However, when we shift the daisy up, the model inpaints the remainder of the image with grass. When we alter the brightness of a image, the model transitions between nighttime and daytime. This suggests that the model can extrapolate from the original source image, and still remain consistent with the image context.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 4: Each row shows how a single latent direction $w ^ { * }$ affects two different ImageNet classes. We observe that changes are consistent with semantic priors (e.g., “Volcanoes” explode, “Alps” do not). Boxplots show the LPIPS perceptual distance before and after transformation for 200 samples per class.
|
| 107 |
+
|
| 108 |
+
However, when we increase the step size of $\alpha$ , we observe that the degree to which we can achieve each transformation is limited. In Fig. 3 we observe two potential failure cases: one in which the the image becomes unrealistic, and the other in which the image fails to transform any further. When we try to zoom in on a Persian cat, we observe that the cat no longer increases in size beyond some point, and in fact consistently undershoots the target zoom. On the other hand, when we try to zoom out on the cat, we observe that it begins to fall off the image manifold, and does not become any smaller after some point. Indeed, the perceptual distance (using LPIPS) between images decreases as we push $\alpha$ towards the transformation limits. Similar trends hold with other transformations: we are able to shift a lorikeet up and down to some degree until the transformation yields unrealistic output, and despite adjusting $\alpha$ on the rotation vector, we are unable to rotate a pizza. Are the limitations to these transformations governed by the training dataset? In other words, are our latent space walks limited because in ImageNet photos the cats are mostly centered and taken within a certain size? We seek to investigate and quantify these biases in the next sections.
|
| 109 |
+
|
| 110 |
+
An intriguing characteristic of the learned trajectory is that the amount it affects the output depends on the image class. In Fig. 4, we investigate the impact of the walk for different image categories under color transformations. By moving in the direction of a redness vector, we are able to successfully recolor a jellyfish, but we are unable to change the color of a goldfinch, which remains yellow which slight changes in background textures. Likewise, increasing brightness changes an erupting volcano to a dormant one, but does not have much effect on Alps, which only transitions between night and day. In the third example, we use our latent walk to turn red sports cars to blue, but it cannot recolor firetrucks. Again, perceptual distance over image samples confirms these qualitative observations: a 2-sample $t$ -test yields $t = 2 0 . 7 7$ , $p < 0 . 0 0 1$ for jellyfish/goldfinch, $t = 8 . 1 4$ , $p < 0 . 0 0 1$ for volcano/alp, and $t = 6 . 8 4$ , $p < 0 . 0 0 1$ for sports car/fire engine. We hypothesize that the different impact of the shared transformation on separate image classes relates to the variability in the underlying dataset. The overwhelming majority of firetrucks are red2, but sports cars appear in a variety of colors. Therefore, our color transformation is constrained by the dataset biases of individual classes.
|
| 111 |
+
|
| 112 |
+
With shift, we can move the distribution of the center object by varying $\alpha$ . In the underlying model, the center coordinate of the object is most concentrated at half of the image width and height, but after applying the shift in X and shift in Y transformation, the mode of the transformed distribution varies between 0.3 and 0.7 of the image width/height. To quantify the distribution changes, we compute the area of intersection between the original model distribution and the distribution after applying each transformation and observe that the intersection decreases as we increase or decrease the magnitude of $\alpha$ . However, our transformations are limited to a certain extent – if we increase $\alpha$ beyond 150 pixels for vertical shifts, we start to generate unrealistic images, as evidenced by a sharp rise in FID and converging modes in the transformed distributions (Fig. 5 columns 2 & 3).
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 5: Quantifying the extent of transformations. We compare the attributes of generated images under the raw model output $G ( z )$ , compared to the distribution under a learned transformation model $( \alpha )$ . We measure the intersection between $G ( z )$ and $\scriptstyle { \mathrm { m o d e l } } ( \alpha )$ , and also compute the FID on the transformed image to limit our transformations to the natural image manifold.
|
| 116 |
+
|
| 117 |
+
We perform a similar procedure for zoom, by measuring the area of the bounding box for the detected object under different magnitudes of $\alpha$ . Like shift, we observe that subsequent increases in $\alpha$ magnitude start to have smaller and smaller effects on the mode of the resulting distribution (Fig. 5 last column). Past an ${ 8 } \mathbf { x }$ zoom in or out, we observe an increase in the FID signifying decreasing image quality. Interestingly for zoom, the FID under zooming in and zooming out is anti-symmetric, indicating that how well we can zoom-in and retain realisitic images differs from that of zooming out. These trends are consistent with the plateau in transformation behavior that we qualitatively observe in Fig. 3. Although we can arbitrarily increase the $\alpha$ step size, after some point we are unable to achieve further transformation and risk deviating from the natural image manifold.
|
| 118 |
+
|
| 119 |
+
# 4.2 HOW DOES THE DATA AFFECT THE TRANSFORMATIONS?
|
| 120 |
+
|
| 121 |
+
Is the extent to which we can transform each class, as we observed in Fig. 4, due to limited variability in the underlying dataset for each class? One way of quantifying this is to measure the difference in transformed model means, model $( + \alpha )$ and model $( - \alpha )$ , and compare it to the spread of the dataset distribution. For each class, we compute standard deviation of the dataset with respect to our statistic of interest (pixel RGB value for color, and bounding box area and center value for zoom and shift transformations respectively). We hypothesize that if the amount of transformation is biased depending on the image class, we will observe a correlation between the distance of the mean shifts and the standard deviation of the data distribution.
|
| 122 |
+
|
| 123 |
+
More concretely, we define the change in model means under a given transformation as:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\Delta \mu _ { k } = \mu _ { k , \mathrm { m o d e l } ( + \alpha ^ { * } ) } - \mu _ { k , \mathrm { m o d e l } ( - \alpha ^ { * } ) }
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
for a given class $k$ and we set $\alpha ^ { * }$ to be largest and smallest $\alpha$ values used in training. The degree to which we achieve each transformation is a function of $\alpha$ , so we use the same $\alpha$ value for all classes – one that is large enough to separate the means of $\mu _ { k , \mathrm { m o d e 1 } ( \alpha ^ { * } ) }$ and $\mu _ { k , \mathrm { m o d e 1 } ( - \alpha ^ { * } ) }$ under transformation, but also for which the FID of the generated distribution remains below a threshold $T$ of generating reasonably realistic images (for our experiments we use $T = 2 2$ ).
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 6: Understanding per-class biases. We observe a correlation between the variability in the training data for ImageNet classes, and our ability to shift the distribution under latent space transformations. Classes with low variability (e.g., robin) limit our ability to achieve desired transformations, in comparison to classes with a broad dataset distribution (e.g., laptop). To the right, we show the distribution of the zoom attribute in the dataset (black) and under $+ \alpha$ (red) and $- \alpha$ (green) transformations for these two examples.
|
| 133 |
+
|
| 134 |
+
In Fig. 6 we plot the standard deviation $\sigma$ of the dataset on the $\mathbf { X }$ -axis, and the model $\Delta \mu$ under a $+ \alpha ^ { * }$ and $- \alpha ^ { * }$ transformation on the y-axis, as defined in Eq. 6. We sample randomly from 100 classes for the color, zoom and shift transformations, and generate 200 samples of each class under the positive and negative transformations. We use the same setup of drawing samples from the model and dataset and computing the statistics for each transformation as described in Sec. 4.1.
|
| 135 |
+
|
| 136 |
+
Indeed, we find that the width of the dataset distribution, captured by the standard deviation of random samples drawn from the dataset for each class, relates to how much we can transform. There is a positive correlation between the spread of the dataset and the magnitude of $\Delta \mu$ observed in the transformed model distributions, and the slope of all observed trends differs significantly from zero $\mathit { p } < 0 . 0 0 1$ for all transformations). For the zoom transformation, we show examples of two extremes along the trend. For the “robin” class the spread $\sigma$ in the dataset is low, and subsequently, the separation $\Delta \mu$ that we are able to achieve by applying $+ \alpha ^ { * }$ and $- \alpha ^ { * }$ transformations is limited. On the other hand, for “laptops”, the dataset spread is broad; ImageNet contains images of laptops of various sizes, and we are able to attain wider shifts in the model distribution.
|
| 137 |
+
|
| 138 |
+
From these results, we conclude that the amount of transformation we can achieve relates to the dataset variability. Consistent with our qualitative observations in Fig. 4, we find that if the images for a particular class have adequate coverage over the entire range of a given transformation, then we are better able to move the model distribution to both extremes. On the other hand, if the images for a given class are less diverse, the transformation is limited by this dataset bias.
|
| 139 |
+
|
| 140 |
+
# 4.3 ALTERNATIVE ARCHITECTURES AND WALKS
|
| 141 |
+
|
| 142 |
+
We ran an identical set of experiments using the nonlinear walk in the BigGAN latent space (Eq 2) and obtained similar quantitative results. To summarize, the Pearson’s correlation coefficient between dataset $\sigma$ and model $\Delta \mu$ for linear walks and nonlinear walks is shown in Table 1, and full results in Appendix B.4.2. Qualitatively, we observe that while the linear trajectory undershoots the targeted level of transformation, it is able to preserve more realistic-looking results (Fig. 7). The transformations involve a trade-off between minimizing the loss and maintaining realistic output, and we hypothesize that the linear walk functions as an implicit regularizer that corresponds well with the inherent organization of the latent space.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 7: Comparison of linear and nonlinear walks for the zoom operation. The linear walk undershoots the targeted level of transformation, but maintains more realistic output.
|
| 146 |
+
|
| 147 |
+
<table><tr><td></td><td>Luminance</td><td>Shift X</td><td>Shift Y</td><td>Zoom</td></tr><tr><td>Linear</td><td>0.59</td><td>0.28</td><td>0.39</td><td>0.37</td></tr><tr><td>Non-linear</td><td>0.49</td><td>0.49</td><td>0.55</td><td>0.60</td></tr></table>
|
| 148 |
+
|
| 149 |
+
Table 1: Pearson’s correlation coefficient between dataset $\sigma$ and model $\Delta \mu$ for measured attributes.
|
| 150 |
+
p-value for slope $< 0 . 0 0 1$ for all transformations.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 8: Distribution for luminance transformation learned from the StyleGAN cars generator, and qualitative examples of color transformations on various datasets using StyleGAN.
|
| 154 |
+
|
| 155 |
+
To test the generality of our findings across model architecture, we ran similar experiments on StyleGAN, in which the latent space is divided into two spaces, $z$ and $W$ . As Karras et al. (2018) notes that the $W$ space is less entangled than $z$ , we apply the linear walk to $W$ and show results in Fig. 8 and Appendix B.5. One interesting aspect of StyleGAN is that we can change color while leaving other structure in the image unchanged. In other words, while green faces do not naturally exist in the dataset, the StyleGAN model is still able to generate them. This differs from the behavior of BigGAN, where changing color results in different semantics in the image, e.g., turning a dormant volcano to an active one. StyleGAN, however, does not preserve the exact geometry of objects under other transformations, e.g., zoom and shift (see Appendix B.5).
|
| 156 |
+
|
| 157 |
+
# 4.4 TOWARDS STEERABLE GANS
|
| 158 |
+
|
| 159 |
+
So far, we have frozen the parameters of the generative model when learning a latent space walk for image editing, and observe that the transformations are limited by dataset bias. Here we investigate approaches to overcome these limitations and increase model steerability. For these experiments, we use a class-conditional DCGAN model (Radford et al., 2015) trained on MNIST digits (LeCun, 1998).
|
| 160 |
+
|
| 161 |
+
To study the effect of dataset biases, we train (1) a vanilla DCGAN and (2) a DCGAN with data augmentation, and then learn the optimal walk in Eq. 1 after the model has been trained – we refer to these two approaches in Fig. 9 as argmin $W$ and argmin $W + a u g$ , respectively. We observe that adding data augmentation yields transformations that better approximate the target image and attain lower $L 2$ error than the vanilla DCGAN (blue and orange curves in Fig. 9). Qualitatively, we observe that transformations using the vanilla GAN (argmin W) become patchy and unrealistic as we increase the magnitude of $\alpha$ , but when the model is trained with data augmentation (argmin $W +$ aug), the digits retain their structural integrity.
|
| 162 |
+
|
| 163 |
+
Rather than learning the walk vector $w$ assuming a frozen generator, we may also jointly optimize the model and linear walk parameter together, as we formalized in Eq. 3. This allows the model to learn an equivariance between linear directions in the latent space and the corresponding image transformations. We refer to this model as argmin $G , W$ in Fig. 9. Compared to the frozen generator (in argmin $W$ and argmin $W + a u g$ ), the joint objective further decreases $L 2$ error (green curve in Fig. 9). We show additional qualitative examples in Appendix B.8. The steerable range of the generator increases with joint optimization and data augmentation, which provides additional evidence that training data bias impacts the models’ steerability and generalization capacity. We tried DCGAN on CIFAR10 as a more complicated dataset, however were unable to get steering to be effective – all three methods failed to produce realistic transformations and joint training in fact performed the worst. Finding the right steering implementation per GAN and dataset, especially for joint training, may be a difficult problem and an interesting direction for future work.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 9: Reducing the effect of transformation limits. Using a DCGAN model on MNIST digits, we compare the $L 2$ reconstruction errors on latent space walks for models trained with vanilla GANs without (argmin W) and with data augmentation (argmin $W + a u g$ ). We also compare to jointly optimizing the generator and the walk parameters with data augmentation (argmin $G , W )$ , which achieves the lowest $L 2$ error.
|
| 167 |
+
|
| 168 |
+
# 5 CONCLUSION
|
| 169 |
+
|
| 170 |
+
GANs are powerful generative models, but are they simply replicating the existing training datapoints, or can they to generalize beyond the training distribution? We investigate this question by exploring walks in the latent space of GANs. We optimize trajectories in latent space to reflect simple image transformations in the generated output, learned in a self-supervised manner. We find that the model is able to exhibit characteristics of extrapolation – we are able to “steer” the generated output to simulate camera zoom, horizontal and vertical movement, camera rotations, and recolorization. However, our ability to naively move the distribution is finite: we can transform images to some degree but cannot extrapolate entirely outside the support of the training data. To increase model steerability, we add data augmentation during training and jointly optimize the model and walk trajectory. Our experiments illustrate the connection between training data bias and the resulting distribution of generated images, and suggest methods for extending the range of images that the models are able to create.
|
| 171 |
+
|
| 172 |
+
# ACKNOWLEDGEMENTS
|
| 173 |
+
|
| 174 |
+
We would like to thank Quang H Le, Lore Goetschalckx, Alex Andonian, David Bau, and Jonas Wulff for helpful discussions. This work was supported by a Google Faculty Research Award to P.I., and a U.S. National Science Foundation Graduate Research Fellowship to L.C.
|
| 175 |
+
|
| 176 |
+
# REFERENCES
|
| 177 |
+
|
| 178 |
+
Alexander Amini, Ava Soleimany, Wilko Schwarting, Sangeeta Bhatia, and Daniela Rus. Uncovering and mitigating algorithmic bias through learned latent structure.
|
| 179 |
+
|
| 180 |
+
Aharon Azulay and Yair Weiss. Why do deep convolutional networks generalize so poorly to small image transformations? arXiv preprint arXiv:1805.12177, 2018.
|
| 181 |
+
|
| 182 |
+
David Bau, Jun-Yan Zhu, Hendrik Strobelt, Bolei Zhou, Joshua B Tenenbaum, William T Freeman, and Antonio Torralba. Gan dissection: Visualizing and understanding generative adversarial networks. arXiv preprint arXiv:1811.10597, 2018.
|
| 183 |
+
|
| 184 |
+
Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
|
| 185 |
+
|
| 186 |
+
Taco S Cohen, Maurice Weiler, Berkay Kicanaoglu, and Max Welling. Gauge equivariant convolutional networks and the icosahedral cnn. arXiv preprint arXiv:1902.04615, 2019.
|
| 187 |
+
|
| 188 |
+
Emily Denton, Ben Hutchinson, Margaret Mitchell, and Timnit Gebru. Detecting bias with generative counterfactual face attribute augmentation. arXiv preprint arXiv:1906.06439, 2019.
|
| 189 |
+
|
| 190 |
+
Bella DiGrazia. Swampscott fd debuts new blue fire truck, 2019. https://www.itemlive. com/2019/05/29/swampscott-fd-debuts-new-blue-fire-truck/, accessed 2019-09-18.
|
| 191 |
+
|
| 192 |
+
William T. Freeman and Edward H Adelson. The design and use of steerable filters. IEEE Transactions on Pattern Analysis & Machine Intelligence, (9):891–906, 1991.
|
| 193 |
+
|
| 194 |
+
Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. arXiv preprint arXiv:1811.12231, 2018.
|
| 195 |
+
|
| 196 |
+
Lore Goetschalckx, Alex Andonian, Aude Oliva, and Phillip Isola. Ganalyze: Toward visual definitions of cognitive image properties. arXiv preprint arXiv:1906.10112, 2019.
|
| 197 |
+
|
| 198 |
+
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.
|
| 199 |
+
|
| 200 |
+
Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
|
| 201 |
+
|
| 202 |
+
Ali Jahanian, SVN Vishwanathan, and Jan P Allebach. Learning visual balance from large-scale datasets of aesthetically highly rated images. In Human Vision and Electronic Imaging XX, volume 9394, pp. 93940Y. International Society for Optics and Photonics, 2015.
|
| 203 |
+
|
| 204 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017.
|
| 205 |
+
|
| 206 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. arXiv preprint arXiv:1812.04948, 2018.
|
| 207 |
+
|
| 208 |
+
Davis E. King. Dlib-ml: A machine learning toolkit. Journal of Machine Learning Research, 10: 1755–1758, 2009.
|
| 209 |
+
|
| 210 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 211 |
+
|
| 212 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10236–10245, 2018.
|
| 213 |
+
|
| 214 |
+
Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
|
| 215 |
+
|
| 216 |
+
Karel Lenc and Andrea Vedaldi. Understanding image representations by measuring their equivariance and equivalence. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 991–999, 2015.
|
| 217 |
+
|
| 218 |
+
Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed, Cheng-Yang Fu, and Alexander C Berg. Ssd: Single shot multibox detector. In European conference on computer vision, pp. 21–37. Springer, 2016.
|
| 219 |
+
|
| 220 |
+
Elad Mezuman and Yair Weiss. Learning about canonical views from internet image collections. In Advances in neural information processing systems, pp. 719–727, 2012.
|
| 221 |
+
|
| 222 |
+
Thomas Mollenhoff and Daniel Cremers. Flat metric minimization with applications in generative ¨ modeling. arXiv preprint arXiv:1905.04730, 2019.
|
| 223 |
+
|
| 224 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 225 |
+
|
| 226 |
+
Yujun Shen, Jinjin Gu, Xiaoou Tang, and Bolei Zhou. Interpreting the latent space of gans for semantic face editing. arXiv preprint arXiv:1907.10786, 2019.
|
| 227 |
+
|
| 228 |
+
Joel Simon. Ganbreeder. http:/https://ganbreeder.app/, accessed 2019-03-22.
|
| 229 |
+
|
| 230 |
+
Antonio Torralba and Alexei A Efros. Unbiased look at dataset bias. 2011.
|
| 231 |
+
|
| 232 |
+
Paul Upchurch, Jacob Gardner, Geoff Pleiss, Robert Pless, Noah Snavely, Kavita Bala, and Kilian Weinberger. Deep feature interpolation for image content changes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7064–7073, 2017.
|
| 233 |
+
|
| 234 |
+
Tom White. Sampling generative networks. arXiv preprint arXiv:1609.04468, 2016.
|
| 235 |
+
|
| 236 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
|
| 237 |
+
|
| 238 |
+
Jun-Yan Zhu, Philipp Krahenb ¨ uhl, Eli Shechtman, and Alexei A Efros. Generative visual manipu- ¨ lation on the natural image manifold. In European Conference on Computer Vision, pp. 597–613. Springer, 2016.
|
| 239 |
+
|
| 240 |
+
# A METHOD DETAILS
|
| 241 |
+
|
| 242 |
+
# A.1 OPTIMIZATION FOR THE LINEAR WALK
|
| 243 |
+
|
| 244 |
+
We learn the walk vector using mini-batch stochastic gradient descent with the Adam optimizer (Kingma & Ba, 2014) in tensorflow, trained on 20000 unique samples from the latent space $z$ . We share the vector $w$ across all ImageNet categories for the BigGAN model.
|
| 245 |
+
|
| 246 |
+
# A.2 IMPLEMENTATION DETAILS FOR LINEAR WALK
|
| 247 |
+
|
| 248 |
+
We experiment with a number of different transformations learned in the latent space, each corresponding to a different walk vector. Each of these transformations can be learned without any direct supervision, simply by applying our desired edit to the source image. Furthermore, the parameter $\alpha$ allows us to vary the extent of the transformation. We found that a slight modification to each transformation improved the degree to which we were able to steer the output space: we scale $\alpha$ differently for the learned transformation $G ( z + \alpha _ { g } w )$ , and the target edit edit $\left( G ( z ) , \alpha _ { t } \right)$ . We detail each transformation below:
|
| 249 |
+
|
| 250 |
+
Shift. We learn transformations corresponding to shifting an image in the horizontal X direction and the vertical Y direction. We train on source images that are shifted $- \alpha _ { t }$ pixels to the left and $\alpha _ { t }$ pixels to the right, where we set $\alpha _ { t }$ to be between zero and one-half of the source image width or height $D$ . When training the walk, we enforce that the $\alpha _ { g }$ parameter ranges between -1 and 1; thus for a random shift by $t$ pixels, we use the value $\alpha _ { g } = \alpha _ { t } / D$ . We apply a mask to the shifted image, so that we only apply the loss function on the visible portion of the source image. This forces the generator to extrapolate on the obscured region of the target image.
|
| 251 |
+
|
| 252 |
+
Zoom. We learn a walk which is optimized to zoom in and out up to four times the original image. For zooming in, we crop the central portion of the source image by some $\alpha _ { t }$ amount, where $0 . 2 5 <$ $\alpha _ { t } < 1$ and resize it back to its original size. To zoom out, we downsample the image by $\alpha _ { t }$ where $1 < \alpha _ { t } < 4$ . To allow for both a positive and negative walk direction, we set $\alpha _ { g } = \log ( \alpha _ { t } )$ . Similar to shift, a mask applied during training allows the generator to inpaint the background scene.
|
| 253 |
+
|
| 254 |
+
Color. We implement color as a continuous RGB slider, e.g., a 3-tuple $\alpha _ { t } = ( \alpha _ { R } , \alpha _ { G } , \alpha _ { B } )$ , where each $\alpha _ { R }$ , $\alpha _ { G }$ , $\alpha _ { B }$ can take values between $[ - 0 . 5 , 0 . 5 ]$ in training. To edit the source image, we simply add the corresponding $\alpha _ { t }$ values to each of the image channels. Our latent space walk is parameterized as $z + \alpha _ { g } w = z + \alpha _ { R } w _ { R } + \alpha _ { G } w _ { G } + \alpha _ { B } w _ { B }$ where we jointly learn the three walk directions $w _ { R } , w _ { G }$ , and $w _ { B }$ .
|
| 255 |
+
|
| 256 |
+
Rotate in 2D. Rotation in 2D is trained in a similar manner as the shift operations, where we train with $- 4 5 \leq \alpha _ { t } \leq 4 5$ degree rotation. Using $R = 4 5$ , scale $\alpha _ { g } = \alpha _ { t } / R$ . We use a mask to enforce the loss only on visible regions of the target.
|
| 257 |
+
|
| 258 |
+
Rotate in 3D. We simulate a 3D rotation using a perspective transformation along the $\mathrm { _ { Z } }$ -axis, essentially treating the image as a rotating billboard. Similar to the 2D rotation, we train with $- 4 5 \leq \alpha _ { t } \leq 4 5$ degree rotation, we scale $\alpha _ { g } = \alpha _ { t } / R$ where $R = 4 5$ , and apply a mask during training.
|
| 259 |
+
|
| 260 |
+
# A.3 LINEAR $\operatorname { N N } ( z )$ WALK
|
| 261 |
+
|
| 262 |
+
Rather than defining $w$ as a vector in $z$ space (Eq. 1), one could define it as a function that takes a $z$ as input and maps it to the desired $z ^ { \prime }$ after taking a variable-sized step $\alpha$ in latent space. In this case, we may parametrize the walk with a neural network $w = \Nu \Nu ( z )$ , and transform the image using $G ( z + \mathrm { \bar { \alpha } N N } ( z ) )$ . However, as we show in the following proof, this idea will not learn to let $w$ be a function of $z$ .
|
| 263 |
+
|
| 264 |
+
Proof. For simplicity, let $\begin{array} { r l r } { w } & { { } \ = \ } & { F ( z ) } \end{array}$ . We optimize for $\begin{array} { r l } { J ( w , \alpha ) \quad } & { { } = } \end{array}$ $\mathbb { E } _ { z } \left[ \dot { \mathcal { L } } ( G ( z + \alpha w ) , \mathrm { e d i t } ( G ( z ) , \alpha ) ) \right]$ where $\alpha$ is an arbitrary scalar value. Note that for the target image, two equal edit operations is equivalent to performing a single edit of twice the size (e.g., shifting by $1 0 \mathrm { p x }$ the same as shifting by 5px twice; zooming by $4 \mathbf { x }$ is the same as zooming by $2 \mathbf { x }$ twice). That is,
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
\mathsf { e d i t } ( G ( z ) , 2 \alpha ) = \mathsf { e d i t } ( \mathsf { e d i t } ( G ( z ) , \alpha ) , \alpha ) .
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
To achieve this target, starting from an initial $z$ , we can take two steps of size $\alpha$ in latent space as follows:
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\begin{array} { l } { { z _ { 1 } = z + \alpha F ( z ) } } \\ { { z _ { 2 } = z _ { 1 } + \alpha F ( z _ { 1 } ) } } \end{array}
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
However, because we let $\alpha$ take on any scalar value during optimization, our objective function enforces that starting from $z$ and taking a step of size $2 \alpha$ equals taking two steps of size $\alpha$ :
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
z + 2 \alpha F ( z ) = z _ { 1 } + \alpha F ( z _ { 1 } )
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
Therefore:
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
\begin{array} { c } { { z + 2 \alpha F ( z ) = z + \alpha F ( z ) + \alpha F ( z _ { 1 } ) \Rightarrow } } \\ { { \alpha F ( z ) = \alpha F ( z _ { 1 } ) \Rightarrow } } \\ { { F ( z ) = F ( z _ { 1 } ) . } } \end{array}
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
Thus $F ( \cdot )$ simply becomes a linear trajectory that is independent of the input $z$
|
| 289 |
+
|
| 290 |
+
# A.4 OPTIMIZATION FOR THE NON-LINEAR WALK
|
| 291 |
+
|
| 292 |
+
Given the limitations of the previous walk, we define our nonlinear walk $F ( z )$ using discrete step sizes $\epsilon$ . We define $F ( z )$ as $z + \mathrm { N N } ( z )$ , where the neural network NN learns a fixed $\epsilon$ step transformation, rather than a variable $\alpha$ step. We then renormalize the magnitude $z$ . This approach mimics the Euler method for solving ODEs with a discrete step size, where we assume that the gradient of the transformation in latent space is of the form $\begin{array} { r } { \epsilon \frac { d z } { d t } = \mathbf { \hat { N } } \mathbf { N } ( z ) } \end{array}$ and we approximate $\begin{array} { r } { z _ { i + 1 } = z _ { i } + \epsilon \frac { d z } { d t } | _ { z _ { i } } } \end{array}$ . The key difference from A.3 is the fixed step size, which avoids optimizing for the equality in (7).
|
| 293 |
+
|
| 294 |
+
We use a two-layer neural network to parametrize the walk, and optimize over 20000 samples using the Adam optimizer as before. Positive and negative transformation directions are handled with two neural networks having identical architecture but independent weights. We set $\epsilon$ to achieve the same transformation ranges as the linear trajectory within 4-5 steps.
|
| 295 |
+
|
| 296 |
+
# B ADDITIONAL EXPERIMENTS
|
| 297 |
+
|
| 298 |
+
# B.1 MODEL AND DATA DISTRIBUTIONS
|
| 299 |
+
|
| 300 |
+
How well does the model distribution of each property match the dataset distribution? If the generated images do not form a good approximation of the dataset variability, we expect that this would also impact our ability to transform generated images. In Fig. 10 we show the attribute distributions of the BigGAN model $G ( z )$ compared to samples from the ImageNet dataset. We show corresponding results for StyleGAN and its respective datasets in Appendix B.5. While there is some bias in how well model-generated images approximate the dataset distribution, we hypothesize that additional biases in our transformations come from variability in the training data.
|
| 301 |
+
|
| 302 |
+
# B.2 QUANTIFYING TRANSFORMATION LIMITS
|
| 303 |
+
|
| 304 |
+
We observe that when we increase the transformation magnitude $\alpha$ in latent space, the generated images become unrealistic and the transformation ceases to have further effect. We show this qualitatively in Fig. 3. To quantitatively verify this trends, we can compute the LPIPS perceptual distance of images generated using consecutive pairs of $\alpha _ { i }$ and $\alpha _ { i + 1 }$ . For shift and zoom transformations, perceptual distance is larger when $\alpha$ (or $\log ( \alpha )$ for zoom) is near zero, and decreases as the the magnitude of $\alpha$ increases, which indicates that large $\alpha$ magnitudes have a smaller transformation effect, and the transformed images appear more similar. On the other hand, color and rotate in 2D/3D exhibit a steady transformation rate as the magnitude of $\alpha$ increases.
|
| 305 |
+
|
| 306 |
+
Note that this analysis does not tell us how well we achieve the specific transformation, nor whether the latent trajectory deviates from natural-looking images. Rather, it tells us how much we manage to change the image, regardless of the transformation target. To quantify how well each transformation is achieved, we rely on attribute detectors such as object bounding boxes (see B.3).
|
| 307 |
+
|
| 308 |
+
# B.3 DETECTED BOUNDING BOXES
|
| 309 |
+
|
| 310 |
+
To quantify the degree to which we are able to achieve the zoom and shift transformations, we rely on a pre-trained MobileNet- $S S D \nu I ^ { 3 }$ object detection model. In Fig. 12 and 13 we show the results of applying the object detection model to images from the dataset, and images generated by the model under the zoom, horizontal shift, and vertical shift transformations for randomly selected values of $\alpha$ , to qualitatively verify that the object detection boundaries are reasonable. Not all ImageNet images contain recognizable objects, so we only use ImageNet classes containing objects recognizable by the detector for this analysis.
|
| 311 |
+
|
| 312 |
+
# B.4 ALTERNATIVE WALKS IN BIGGAN
|
| 313 |
+
|
| 314 |
+
# B.4.1 LPIPS OBJECTIVE
|
| 315 |
+
|
| 316 |
+
In the main text, we learn the latent space walk $w$ by minimizing the objective function:
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
J ( w , \alpha ) = \mathbb { E } _ { z } \left[ \mathcal { L } ( G ( z + \alpha w ) , \mathsf { e d i t } ( G ( z ) , \alpha ) ) \right] .
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
using a Euclidean loss for $\mathcal { L }$ . In Fig. 14 we show qualitative results using the LPIPS perceptual similarity metric (Zhang et al., 2018) instead of Euclidean loss. Walks were trained using the same parameters as those in the linear-L2 walk shown in the main text: we use $2 0 \mathrm { k }$ samples for training, with Adam optimizer and learning rate 0.001 for zoom and color, 0.0001 for the remaining edit operations (due to scaling of $\alpha$ ).
|
| 323 |
+
|
| 324 |
+
# B.4.2 NON-LINEAR WALKS
|
| 325 |
+
|
| 326 |
+
Following B.4.2, we modify our objective to use discrete step sizes $\epsilon$ rather than continuous steps. We learn a function $F ( z )$ to perform this $\epsilon$ -step transformation on given latent code $z$ , where $F ( z )$ is parametrized with a neural network. We show qualitative results in Fig. 15. We perform the same set of experiments shown in the main text using this nonlinear walk in Fig. 16. These experiments exhibit similar trends as we observed in the main text – we are able to modify the generated distribution of images using latent space walks, and the amount to which we can transform is related to the variability in the dataset. However, there are greater increases in FID when we apply the non-linear transformation, suggesting that these generated images deviate more from natural images and look less realistic.
|
| 327 |
+
|
| 328 |
+
# B.4.3 ADDITIONAL QUALITATIVE EXAMPLES
|
| 329 |
+
|
| 330 |
+
We show qualitative examples for randomly generated categories for BigGAN linear-L2, linear LPIPS, and nonlinear trajectories in Figs. 17, 18, 19 respectively.
|
| 331 |
+
|
| 332 |
+
# B.5 WALKS IN STYLEGAN
|
| 333 |
+
|
| 334 |
+
We perform similar experiments for linear latent space walks using StyleGAN models trained on the LSUN cat, LSUN car, and FFHQ face datasets. As suggested by Karras et al. (2018), we learn the walk vector in the intermediate $W$ latent space due to improved attribute disentanglement in $W$ . We show qualitative results for color, shift, and zoom transformations in Figs. 20, 22, 24 and corresponding quantitative analyses in Figs. 21, 23, 25. We show qualitative examples for the comparison of optimizing in the $W$ and $z$ latent spaces in Stylegan in 28.
|
| 335 |
+
|
| 336 |
+
# B.6 WALKS IN PROGRESSIVE GAN
|
| 337 |
+
|
| 338 |
+
We also experiment with the linear walk objective in the latent space of Progressive GAN Karras et al. (2017). One interesting property of the Progressive GAN interpolations is that they take much longer to train to have a visual effect – for example for color, we could obtain drastic color changes in Stylegan W latent space using as few as 2k samples, but with progressive gan, we used $6 0 \mathrm { k }$ samples and still did not obtain as strong of an effect. This points to the Stylegan w latent space being more “flexible” and generalizable for transformation, compared to the latent space of progressive GAN. Moreover, we qualitatively observe some entanglement in the progressive gan transformations – for example, changing the level of zoom also changes the lighting. We did not observe big effects in the horizontal and vertical shift transformations. Qualitative examples and quantitative results are shown in Figs. 26, 27.
|
| 339 |
+
|
| 340 |
+
# B.7 QUALITATIVE EXAMPLES FOR ADDITIONAL TRANSFORMATIONS
|
| 341 |
+
|
| 342 |
+
Since the color transformation operates on individual pixels, we can optimize the walk using a segmented target – for example when learning a walk for cars, we only modify pixels in segmented car region when generating edit $( G ( z ) , \alpha )$ . StyleGAN is able to roughly localize the color transformation to this region, suggesting disentanglement of different objects within the $W$ latent space (Fig. 29 left) as also noted in Karras et al. (2018); Shen et al. (2019). We also show qualitative results for adjust image contrast (Fig. 29 right), and for combining zoom, shift X, and shift Y transformations (Fig. 30).
|
| 343 |
+
|
| 344 |
+
# B.8 ADDITIONAL RESULTS FOR IMPROVING MODEL STEERABILITY
|
| 345 |
+
|
| 346 |
+
We further test the hypothesis that dataset variability impacts the amount we are able to transform by comparing DCGAN models trained with and without data augmentation. Namely, with data augmentation, the discriminator is able to see edited versions of the real images. We also jointly train the model and the walk trajectory which encourages the model to learn linear walks. For zoom, horizontal shift, and 2D rotate transformations, additional samples for three training approaches – without data augmentation, with data augmentation, and joint optimization – appear in Fig. 31-33. Qualitatively, transformations using the model trained without data augmentation degrade the digit structure as $\alpha$ magnitude increases, and may even change one digit to another. Training with data augmentation and joint optimization better preserves digit structure and identity.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 10: Comparing model versus dataset distribution. We plot statistics of the generated under the color (luminance), zoom (object bounding box size), and shift operations (bounding box center), and compare them to the statistics of images in the training dataset.
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 11: LPIPS Perceptual distances between images generated from pairs of consecutive $\alpha _ { i }$ and $\alpha _ { i + 1 }$ . We sample 1000 images from randomly selected categories using BigGAN, transform them according to the learned linear trajectory for each transformation. We plot the mean perceptual distance and one standard deviation across the 1000 samples (shaded area), as well as 20 individual samples (scatterplot). Because the Rotate 3D operation undershoots the targeted transformation, we observe more visible effects when we increase the $\alpha$ magnitude.
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
Figure 12: Bounding boxes for random selected classes using ImageNet training images.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 13: Bounding boxes for random selected classes using model-generated images for zoom and horizontal and vertical shift transformations under random values of $\alpha$ .
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 14: Linear walks in BigGAN, trained to minimize LPIPS loss. For comparison, we show the same samples as in Fig. 1 (which used a linear walk with L2 loss).
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 15: Nonlinear walks in BigGAN, trained to minimize L2 loss for color and LPIPS loss for the remaining transformations. For comparison, we show the same samples in Fig. 1 (which used a linear walk with L2 loss), replacing the linear walk vector $w$ with a nonlinear walk.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 16: Quantitative experiments for nonlinear walks in BigGAN. We show the attributes of generated images under the raw model output $G ( z )$ , compared to the distribution under a learned transformation $\scriptstyle { \mathrm { m o d e l } } ( \alpha )$ , the intersection area between $G ( z )$ and $\scriptstyle { \mathrm { m o d e l } } ( \alpha )$ , FID score on transformed images, and scatterplots relating dataset variability to the extent of model transformation.
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 17: Qualitative examples for randomly selected categories in BigGAN, using the linear trajectory and L2 objective.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 18: Qualitative examples for randomly selected categories in BigGAN, using the linear trajectory and LPIPS objective.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 19: Qualitative examples for randomly selected categories in BigGAN, using a nonlinear trajectory.
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Figure 20: Qualitative examples for learned transformations using the StyleGAN car generator.
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
Figure 21: Quantitative experiments for learned transformations using the StyleGAN car generator.
|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
Figure 22: Qualitative examples for learned transformations using the StyleGAN cat generator.
|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
Figure 23: Quantitative experiments for learned transformations using the StyleGAN cat generator.
|
| 389 |
+
|
| 390 |
+

|
| 391 |
+
Figure 24: Qualitative examples for learned transformations using the StyleGAN FFHQ face generator.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 25: Quantitative experiments for learned transformations using the StyleGAN FFHQ face generator. For the zoom operation not all faces are detectable; we plot the distribution as zeros for $\alpha$ values in which no face is detected. We use the dlib face detector (King, 2009) for bounding box coordinates.
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
Figure 26: Qualitative examples for learned transformations using the Progressive GAN CelebaAHQ face generator.
|
| 398 |
+
|
| 399 |
+

|
| 400 |
+
Figure 27: Quantitative experiments for learned transformations using the Progressive GAN CelebA-HQ face generator.
|
| 401 |
+
|
| 402 |
+

|
| 403 |
+
Figure 28: Comparison of optimizing for color transformations in the Stylegan w and $\mathbf { Z }$ latent spaces.
|
| 404 |
+
|
| 405 |
+

|
| 406 |
+
Figure 29: Qualitative examples of optimizing for a color walk with a segmented target using StyleGAN in left column and a contrast walk for both BigGAN and StyleGAN in the right column.
|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
Figure 30: Qualitative examples of a linear walk combining the zoom, shift X, and shift Y transformations. First row shows the target image, second row shows the result of learning a walk for the three transformations jointly, and the third row shows results for combining the separately trained walks. Green vertical line denotes image center.
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Figure 31: Quantitative experiments on steerability with an MNIST DCGAN for the Zoom transformation. Odd rows are the target images and even rows are the learned transformations.
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 32: Quantitative experiments on steerability with an MNIST DCGAN for the Shift X transformation. Odd rows are the target images and even rows are the learned transformations.
|
| 416 |
+
|
| 417 |
+

|
| 418 |
+
Figure 33: Quantitative experiments on steerability with an MNIST DCGAN for the Rotate 2D transformation. Odd rows are the target images and even rows are the learned transformations.
|
md/train/HyxfGCVYDr/HyxfGCVYDr.md
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ONE GENERATION KNOWLEDGE DISTILLATION BYUTILIZING PEER SAMPLES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Knowledge Distillation is a widely used technique in recent deep learning research to obtain small and simple models whose performance is on a par with their large and complex counterparts. Standard Knowledge Distillation tends to be time-consuming because of the training time spent to obtain a teacher model that would then provide guidance for the student model. It might be possible to cut short the time by training a teacher model on the fly, but it is not trivial to have such a high-capacity teacher that gives quality guidance to student models this way. To improve this, we present a novel framework of Knowledge Distillation exploiting dark knowledge from the whole training set. In this framework, we propose a simple and effective implementation named Distillation by Utilizing Peer Samples (DUPS) in one generation. We verify our algorithm on numerous experiments. Compared with standard training on modern architectures, DUPS achieves an average improvement of $1 \% - 2 \%$ on various tasks with nearly zero extra cost. Considering some typical Knowledge Distillation methods which are much more time-consuming, we also get comparable or even better performance using DUPS.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent years have witnessed continuous development of deep neural network models. A general trend is that improvements in model performance are usually coupled with more complex architecture designs and higher cost of computation. In order to obtain more compact models with higher quality, the idea of Knowledge Distillation (KD) first emerged in the form of knowledge transfer between models (Bucilua et al., 2006). KD takes advantage of the “dark knowledge” by transfer- ˇ ring it from teacher models to student models so as to facilitate the latter’s training process (Hinton et al., 2015). Student models, with the availability of softened output vectors from teacher models in KD, have access to richer information in comparison to directly learning from hard labels provided by training set. KD significantly improves smaller models’ performance, and thus it further allows model compression.
|
| 12 |
+
|
| 13 |
+
Although great progress has been made in this area, much more training cost is incurred due to involved time-consuming mid-output (e.g. feature maps) alignment when training student models, on top of extra training of a huge teacher model. It is ad meaningful objective of finding more efficient KD methods. Recent works by (Furlanello et al., 2018) and (Lan et al., 2018b) show that a stronger teacher model is not the necessary condition for improving the student model. Their research shows that it is possible that the student model’s performance can be significantly improved by an identically structured teacher model. Although the techniques remain inefficient due to the cost of multi-generation (at least one extra) training of teacher models, these works give important hints that cheaper teachers with considerable effectiveness may exist. Recently (Yang et al., 2018) extend these works, trying to obtain continuously improved teachers by introducing the cyclic learning rate technique in one-generation training. They propose Snapshot Distillation (SD), which uses models obtained from earlier checkpoints as teachers and skips the process of separately training a teacher model.
|
| 14 |
+
|
| 15 |
+
Inspired by recent interesting ideas of dataset distillation (Wang et al., 2019) for objectives on other research areas, we propose a novel approach for KD in this paper. Instead of relying on the assitance of a separate teacher model or checkpoint, we exploit hidden knowledge in the dataset to generate a surrogate teacher. Specifically, we first define a more general framework of knowledge distillation utilizing the whole dataset to generate extra supervision signals, rather than using a single sample alone. Then we propose a very simple yet effective implementation of one-generation KD, called Distillation by Utilizing Peer Samples (DUPS). In DUPS, each sample borrows continuously boosted secondary information from a random subset of peer samples belonging to the same category on the fly.
|
| 16 |
+
|
| 17 |
+
We perform extensive experiments on CIFAR100 dataset, with various modern architectures such as PreActResNet, WideResNet, and ResNeXt, demonstrating that our proposed DUPS gains significant improvement compared to standard SGD training with nearly zero extra computation cost. DUPS also outperforms recent one-generation KD method SnapShot Distillation (Yang et al., 2018) on most architectures. Moreover, we validate our algorithm on more practical tasks, include ImageNet classification, transfer learning, and language model. Experiments show that DUPS is generally effective across different tasks.
|
| 18 |
+
|
| 19 |
+
In summary, our main contributions include: 1) To the best of our knowledge, we are the first to propose an extension framework of Knowledge Distillation utilizing the whole training set other than a single sample. 2) Under this framework we implement a general on-the-fly algorithm DUPS which achieves significant improvement at almost no extra cost.
|
| 20 |
+
|
| 21 |
+
The rest of the paper is organized as follows. Section 2 presents prior works related to this paper. Section 3 introduces our methodology of the general knowledge distillation framework. Section 4 demonstrates our experimental results and provides some discussions. Section 5 concludes the paper.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
# 2.1 KNOWLEDGE DISTILLATION
|
| 26 |
+
|
| 27 |
+
Methodologies and Applications In a traditional KD approach, a separate and typically timeconsuming phase is unavoidable to first obtain a complex teacher model. The softened outputs of the teacher model are then utilized to train a student model that has a much simpler network structure (Hinton et al., 2015). Other works further develop this idea, such as aligning feature maps, grammian matrix or activation boundaries (Romero et al., 2014; Zagoruyko & Komodakis, 2016; Yim et al., 2017; Heo et al., 2018). KD is typically used to get compact models with high performance or for purely purpose of model quality improvement (Furlanello et al., 2018; Lan et al., 2018b; Yang et al., 2018). In addition to these general works, KD is widely demonstrated to be effective on various modern practical tasks, including transfer learning (Li et al., 2019), object detection (Chen et al., 2017), visual relationship detection (Yu et al., 2017) and so on. Despite its effectiveness, one common limitation is the improved performance of student networks in traditional KD is achieved at the cost of extra training time to obtain the teacher model in the first place.
|
| 28 |
+
|
| 29 |
+
Efficiency of Knowledge Distillation Recently researchers have begun paying more attention to the inefficiency problem of KD. In the scenario of large scale training, (Anil et al., 2018) proposed online distillation which trains multiple copies of a model in a distributed system, at the expense of involving more activated devices simultaneously. It becomes challenging to distill knowledge in one generation because the model currently being trained lacks the capacity to be a good teacher model for itself. SnapShot Distillation ameliorates this problem by utilizing cyclic learning rate (Yang et al., 2018). They divide the whole training process into a few mini-generations, using cosine annealing learning rate policy (Loshchilov & Hutter, 2016) in each mini-generation so as to ensure the teacher models’ quality. Other works tackle the problem by implementing architecture-specific knowledge transfer techniques, e.g. adding new branches or connections to the original model structure (Lan et al., 2018a; Zhang et al., 2019; Hahn & Choi, 2019).
|
| 30 |
+
|
| 31 |
+
In this paper, we mainly focus on architecture-agnostic KD that aims to use inter-class information to improve general supervision.
|
| 32 |
+
|
| 33 |
+
# 2.2 LABEL PROPAGATION
|
| 34 |
+
|
| 35 |
+
Although rarely mentioned, KD is closely related to the area of label propagation. Some early works exploit language knowledge related to image classification objects to help improve the performance of the latter. For example, (Deng et al., 2010; Verma et al., 2012; Akata et al., 2015) draw on external knowledge such as well-constructed language database WordNet, annotated attributes of each instance, or other dataset with hierarchical semantic labels. Recently (Bagherinezhad et al., 2018) utilize the idea of KD to obtain a refined label of a specific crop by a pre-trained teacher model, offering more accurate targets for cropped input images. Another popular idea is to construct propagated labels for effective regularization. (Szegedy et al., 2016) introduce Label Smoothing (LS) which softens the labels in the dataset: instead of being a one-hot encoding vector, the label after LS becomes smoother in distribution over all entries in the vector. It’s a very useful technique in practice till today. Some recent works further analyze the effectiveness of LS or other label-disturb methods (Pereyra et al., 2017; Muller et al., 2019). In this paper We will show that, albeit being similar in appearance, the continuously boosted softened target generated by the whole dataset is more than a data-agnostic regularizer like Label Smoothing.
|
| 36 |
+
|
| 37 |
+
# 3 METHODOLOGY
|
| 38 |
+
|
| 39 |
+
# 3.1 TYPICAL FORM OF KD
|
| 40 |
+
|
| 41 |
+
Without loss of generality, we first define a typical formulation of KD based on past works (Hinton et al., 2015; Furlanello et al., 2018; Yang et al., 2018) in the classical classification setting. Let $\mathcal { D } \in \mathcal { X } { \times } \mathcal { Y }$ be the training set which contains $n$ labelled training samples and $C$ classes. Each sample is denoted by $( \mathbf { x _ { i } } , y _ { i } ) \in \mathbf { \bar { \mathcal { D } } }$ , where $y _ { i } \in \{ 1 , 2 , \ldots , C \}$ . We define our objective network $f _ { S } ( { \bf x } , \overbar { \theta } ) :$ $\mathcal { X } \mapsto \mathcal { V }$ parameterized with $\pmb \theta$ as the mapping function. Commonly in practice, we use the cross entropy function to metric the distance between ground-truth one-hot labels and outputs generated by $f _ { S }$ . For traditional KD, we need to introduce another optimized solution $\pmb { \theta } ^ { \prime }$ of a particular function $f _ { T }$ into the final loss function. We omit normal regularization terms such as $L ^ { \dot { 2 } }$ normalization of parameters for the sake of simplicity. Upon some input sample $\mathcal { D } _ { i } = ( \mathbf { x _ { i } } , y _ { i } )$ , we get
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\mathcal { L } ( \mathcal { D } _ { i } ; \pmb { \theta } ) = \lambda _ { C E } \cdot \mathcal { L } _ { C E } [ y _ { i } , \pmb { f } _ { S } ( \mathbf { x _ { i } } ; \pmb { \theta } ) ] + \lambda _ { K D } \cdot \mathcal { L } _ { K D } [ \pmb { f } _ { S } ( \mathbf { x _ { i } } ; \pmb { \theta } ) , \pmb { f } _ { T } ( \mathbf { x _ { i } } ; \pmb { \theta } ^ { \prime } ) ]
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
, where $\lambda _ { C E }$ and $\lambda _ { K D }$ are hyperparameters to balance the relative contribution of the cross entropy term and knowledge distillation term. $\mathcal { L } _ { K D }$ is typically computed by cross entropy (Furlanello et al., 2018; Hahn & Choi, 2019) or Kullback Leibler divergence (Lan et al., 2018a; Yang et al., 2018) between the logits produced by the teacher model and the student model. Note that $f _ { T }$ can be identical in structure as $f _ { S }$ , as demonstrated by the successful implementations of Born-Again Network (Furlanello et al., 2018), Self-Referenced Network (Lan et al., 2018a) and Snapshot Distillation (Yang et al., 2018). For one generation distillation, since there isn’t an external training process of a teacher model, the teacher signal ${ \pmb f } _ { T } ( { \bf x } _ { \bf i } ; { \pmb \theta } ^ { \prime } )$ for sample $\mathcal { D } _ { i }$ is generated from the internal of training procedure or dataset. For example, Snapshot Distillation uses a sequence of checkpoints at the end of each training cycle ${ \pmb \theta } ^ { \prime } \in \{ { \pmb \theta } ^ { c _ { 1 } } , { \pmb \theta } ^ { c _ { 2 } } , \dots \}$ as teacher solutions.
|
| 48 |
+
|
| 49 |
+
# 3.2 EXTENDED FORM OF KD
|
| 50 |
+
|
| 51 |
+
We will extend the formulation of KD, making it more compatible with commonly used neural network architectures and algorithms. In the above typical framework, KD loss term is with respect to some sample $\mathcal { D } _ { i } = ( \mathbf { x _ { i } } , y _ { i } )$ . In contrast, our proposed KD framework has its KD term as a function of the whole dataset $\mathcal { D }$ . Thus with the help of dataset $\mathcal { D }$ and some internal or external obtained supplementary teacher solution(s) $\pmb { \theta } ^ { \prime }$ , we have
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathcal { L } ( \mathcal { D } _ { i } ; \pmb { \theta } ) = \lambda _ { C E } \cdot \mathcal { L } _ { C E } [ y _ { i } , \pmb { f } _ { S } ( \mathbf { x _ { i } } ; \pmb { \theta } ) ] + \lambda _ { K D } \cdot \mathcal { L } _ { K D } [ \pmb { f } _ { S } ( \mathbf { x _ { i } } ; \pmb { \theta } ) , \pmb { f } _ { T } ( \mathcal { D } _ { i } ; \pmb { \theta } ^ { \prime } , \mathcal { D } ) ]
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
. The notation for teacher signal changes from ${ \pmb f } _ { T } ( { \bf x } _ { \bf i } ; { \pmb \theta } ^ { \prime } )$ to ${ \pmb f } _ { T } ( \mathcal { D } _ { i } ; { \pmb \theta } ^ { \prime } , \mathcal { D } )$ because the teacher model requires the label $y _ { i }$ and at least part of the dataset to effectively utilize dataset information in our KD. We note that implementations of traditional KD by (Hinton et al., 2015), Born-Again Network (Furlanello et al., 2018) and Snapshot Distillation (Yang et al., 2018) can be seen as special cases of the above general formulation whose distilled information only depends on the input sample while ignoring others.
|
| 58 |
+
|
| 59 |
+
# 3.3 TEACHER SIGNAL UTILIZING PEER SAMPLES
|
| 60 |
+
|
| 61 |
+
The most straightforward idea of leveraging other samples to help is to utilize similar samples. Given a training sample $\mathcal { D } _ { i } = ( \mathbf { x _ { i } } , y _ { i } )$ , we random select $n$ peer samples in the same category of training set, noted by
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
Y _ { y _ { i } } = \{ ( \mathbf { x _ { k _ { 1 } } } , y _ { i } ) , ( \mathbf { x _ { k _ { 2 } } } , y _ { i } ) , . . . , ( \mathbf { x _ { k _ { n } } } , y _ { i } ) \} \subset \mathcal { D }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
. With the help of these peer samples, we get teaching signal with respect to $D _ { i }$ as below
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\pmb { f } _ { T } ( { \mathscr { D } _ { i } ; \pmb { \theta } ^ { \prime } } , { \mathscr { D } } ) = \pmb { f } _ { T } ( \mathscr { D } _ { i } ; \pmb { \theta } ^ { \prime } , Y _ { y _ { i } } )
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
. As shown above, we do not focus on how one single instance could provide the student model with secondary information that is not directly available from the dataset labels (Hinton et al., 2015; Yang et al., 2019); rather, we aim to find a general trend that reveals the extent of some statistical characteristics, e.g. inter-class similarity, by utilizing peer samples. There are two benefits. First, since such information is relatively static or stable for a period of training procedure and can be shared among samples of the same category, it is cheap to obtain and store in memory. Second, teaching signals voted by a cluster of samples may offer more reliable secondary information comparing with that produced by a sub-optimized checkpoint found before training completes.
|
| 74 |
+
|
| 75 |
+
# 3.4 DUPS IMPLEMENTATION
|
| 76 |
+
|
| 77 |
+
Similar to SnapShot Distillation proposed by (Yang et al., 2018), our method achieves on-the-fly distillation within one generation of training by dividing the training process into $m$ stages, with each stage consisting of $t$ epochs. However, an important difference is that our method do not strongly depend on cyclic learning rate for obtaining reliable teaching signal. Let $M$ be the set of such stages and $T$ be the set of epochs. Then $M = \{ M _ { 1 } , M _ { 2 } , . . . , M _ { m } \}$ , and for each $i$ such that $1 \leq i \leq m$ , $M _ { i } = \{ T _ { ( i - 1 ) \times t + 1 } , T _ { ( i - 1 ) \times t + 2 } , \ldots , T _ { ( i - 1 ) \times t + ( t - 1 ) } , T _ { i \times t } \} .$ . We follow the algorithm in Alg. 1 to implement DUPS. For a sample $\mathcal { D } _ { i } = ( \mathbf { x _ { i } } , y _ { i } )$ , its peer samples, denoted by $Y _ { y _ { i } }$ , are a random subset of the all samples found in the same category. Hence,
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
Y _ { y _ { i } } \subset \{ ( \mathbf { x } , y ) \in \mathcal { D } \mid y = y _ { i } \}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
. For specific implementation, we share teacher signal among samples of the same category. Thus, Eq. 3 is further simplified to
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\forall D _ { j } \in \{ ( \mathbf { x } , y ) \in \mathcal { D } \mid y = y _ { i } \} , f _ { T } ( \mathcal { D } _ { j } ; \pmb { \theta } ^ { \prime } , \mathcal { D } ) = f _ { T } ( Y _ { y _ { i } } ; \pmb { \theta } ^ { \prime } )
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
, which means the teacher signal ${ \pmb f } _ { T }$ for sample $D _ { j } = ( \mathbf { x _ { j } } , y _ { j } )$ only depends on the sample’s label $y _ { j }$ but not its data input $\mathbf { x _ { j } }$ . $\mathcal { D }$ is omitted in $\pmb { f } _ { T } ( Y _ { y _ { i } } ; \pmb { \theta } ^ { \prime } )$ as the last parameter because only $Y _ { y _ { j } } \subset \mathcal { D }$ is utilized.
|
| 90 |
+
|
| 91 |
+
Formally, let the teacher signal for each category with label $y _ { i }$ at stage $M _ { n }$ be $f _ { T } ^ { n } ( Y _ { y _ { i } } ; \pmb { \theta } ^ { \prime } )$ , where $n$ is the index of the current training stage. We denote the checkpoint of student model $f _ { S }$ at the end of $n ^ { t h }$ stage be $\pmb { \theta } ^ { n }$ . We define $\pmb { f } _ { T } ^ { 1 } ( Y _ { y _ { i } } ; \mathbf { \bar { \theta } } ^ { \prime } )$ to be zero. The rest of teacher signals are computed based on
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\pmb { f } _ { T } ^ { n } ( Y _ { y _ { i } } ; \pmb { \theta } ^ { \prime } ) = \frac { 1 } { \| Y _ { y _ { i } } \| } \sum _ { ( \mathbf { x } , y ) \in Y _ { y _ { i } } } \pmb { f } _ { S } ( \mathbf { x } ; \pmb { \theta } ^ { n - 1 } )
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
. The average softened logit of each category obtained at the last epoch of each stage is used as the “teacher model” for training of student model at next stage. In total, there are $m - 1$ iterations of knowledge distillation between “teacher models” and “student models” in the whole training process.
|
| 98 |
+
|
| 99 |
+
Input: Current epoch $T _ { c } \in M _ { n }$ , the set of training samples $\mathcal { D }$ Output: Improved neural network model parameters $\pmb \theta$
|
| 100 |
+
|
| 101 |
+
1 for each batch $\boldsymbol { B }$ in $\mathcal { D }$ do
|
| 102 |
+
|
| 103 |
+
2 for each sample $( \mathbf { x _ { j } } , y _ { j } )$ in $\boldsymbol { B }$ do
|
| 104 |
+
3 Compute the logits $l$ and prediction ${ \bf \nabla } f _ { S } ( { \bf x _ { j } } )$ produced by the current model;
|
| 105 |
+
4 Compute cross entropy loss $\mathcal { L } _ { C E }$ using $f _ { S } ( \bf { x } _ { j } )$ and ${ \tt y } _ { j }$
|
| 106 |
+
5 if $M _ { n }$ is the first stage $M _ { 1 }$ then
|
| 107 |
+
6 Set knowledge distillation loss $\mathcal { L } _ { K D }$ to be ${ f _ { T } ^ { 1 } } ( Y _ { y _ { j } } ; \pmb { \theta } ^ { \prime } ) = 0$ ;
|
| 108 |
+
7 else
|
| 109 |
+
8 Compute knowledge distillation loss $\mathcal { L } _ { K D }$ using $l$ and $f _ { T } ^ { n } ( Y _ { y _ { j } } ; \pmb { \theta } ^ { \prime } )$ where
|
| 110 |
+
$Y _ { y _ { j } } = \{ ( \mathbf { x } , y ) \in \mathcal { D } \mid y = y _ { j } \}$ ;
|
| 111 |
+
9 Obtain the total loss (Eq 2);
|
| 112 |
+
10 Calculate the average loss of this batch;
|
| 113 |
+
11 Update model parameters;
|
| 114 |
+
|
| 115 |
+
12 if $T _ { c }$ is the last epoch in the current stage $M _ { n }$ then
|
| 116 |
+
|
| 117 |
+
13 Update $\pmb { f } _ { T } ^ { n - 1 } ( Y _ { y _ { p } } ; \pmb { \theta } ^ { \prime } )$ to $f _ { T } ^ { n } ( Y _ { y _ { p } } ; \pmb { \theta } ^ { \prime } )$ using the corresponding set of peer samples $Y _ { y _ { p } }$ for all $y _ { p } \in \{ 1 , 2 , \ldots , C \}$ (Eq 5);
|
| 118 |
+
|
| 119 |
+
# 4 EXPERIMENTS
|
| 120 |
+
|
| 121 |
+
# 4.1 TASKS AND DATASETS
|
| 122 |
+
|
| 123 |
+
Image Classification We use CIFAR100 (Krizhevsky, 2009) and ImageNet (Deng et al., 2009) to test the performance of DUPS on image classification task. CIFAR 100 contains RGB images categorized into 100 classes, with each class composing 600 images. There are 500 training images and 100 testing images in each class. ImageNet is a tree-structured image database created according to the WordNet hierarchy. It consists of more than 20K categories and a total of 14 million images. We use the popular subset ILSVRC2012 which containing 1.3M images covering 1K categories. We do not conduct experiments on CIFAR10 because it has been empirically observed that, due to the lack of fine-level categorization in CIFAR10, neural networks do not significantly benefit from distillations between teacher and student models (Yang et al., 2018; Furlanello et al., 2018).
|
| 124 |
+
|
| 125 |
+
Transfer Learning We use ImageNet as the source dataset and have 4 different datasets as the target dataset in the transfer learning task, covering typical types of plants, animals, objects and texture . The 4 target datasets are (1) Flower102 (Nilsback & Zisserman, 2008) which contains 102 categories of 8189 flower images, (2) Caltech-UCSD Birds-200-2011 (Wah et al., 2011), which has 11,788 images classified into 200 categories, (3) FGVC-Aircraft (Maji et al., 2013) which composes 10,000 images of aircraft across 100 aircraft models, and (4) Describable Textures Dataset (DTD) (Cimpoi et al., 2015) which is a texture database, consisting of 5640 images, organized according to a list of 47 terms (categories).
|
| 126 |
+
|
| 127 |
+
Natural Language Processing We use Penn Tree Bank (PTB) dataset (Marcus et al., 1993) to evaluate the performance of DUPS on language modeling.
|
| 128 |
+
|
| 129 |
+
# 4.2 EXPERIMENT SETTINGS
|
| 130 |
+
|
| 131 |
+
Image Classification We train all models except DenseNet for image classification in 160 epochs. For DenseNet we train 240 epochs because it converges slower. The initial learning rate is 0.1 for all architectures. Training batch size is 64. We use standard SGD optimizer with momentum 0.9 and weight decay 0.0001. We apply standard data augmentation the same way as the Pytorch official examples on both CIFAR100 and ImageNet classification task. For CIFAR100, we pad the input
|
| 132 |
+
|
| 133 |
+
Table 1: Test accuracy on CIFAR100. SGD refers to models trained with standard Stochastic Gradient Descent optimizer. LS are models improved by using Label Smoothing technique. SD are the models trained with SnapShot Distillation method. Finally, DUPS and ${ \mathrm { D U P S } } +$ are our methods proposed in this paper. The difference between DUPS and ${ \mathrm { D U P S } } +$ is that ${ \mathrm { D U P S } } +$ uses cyclic learning rate while DUPS does not.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Model</td><td>SGD</td><td>LS</td><td>DUPS</td><td>SD</td><td>DUPS+</td></tr><tr><td>PreActResNet18</td><td>0.7646</td><td>0.7795</td><td>0.7785</td><td>0.7729</td><td>0.7794</td></tr><tr><td>PreActResNet34</td><td>0.7701</td><td>0.7729</td><td>0.7823</td><td>0.7665</td><td>0.7785</td></tr><tr><td>PreActResNet50</td><td>0.7687</td><td>0.7798</td><td>0.7847</td><td>0.7809</td><td>0.7877</td></tr><tr><td>PreActResNet101</td><td>0.7756</td><td>0.7829</td><td>0.7882</td><td>0.7788</td><td>0.7899</td></tr><tr><td>DenseNet40(240)</td><td>0.7003</td><td>0.7034</td><td>0.7101</td><td>0.7115</td><td>0.7174</td></tr><tr><td>DenseNet100(240)</td><td>0.7515</td><td>0.7559</td><td>0.7557</td><td>0.7657</td><td>0.7617</td></tr><tr><td>WideResNet28x10</td><td>0.7968</td><td>0.7996</td><td>0.8028</td><td>0.8013</td><td>0.8062</td></tr><tr><td>ResNeXt29_8x64d</td><td>0.8017</td><td>0.8103</td><td>0.8184</td><td>=</td><td>=</td></tr></table>
|
| 136 |
+
|
| 137 |
+
images by 4 pixels, and then randomly crop a sub-region of $3 2 \times 3 2$ and randomly do a horizontal flip. For ImageNet, we first randomly crop a sub-region of $2 2 4 \times 2 2 4$ and randomly do a horizontal flip. We normalize the input data as done in common practice.
|
| 138 |
+
|
| 139 |
+
Transfer Learning We use ResNet-101 as the base model to apply DUPS. We train the model with 40 epochs and the batch size for training is 64. SGD optimizer is used with a momentum of 0.9. The initial learning rate is set to 0.01 and the weight decay is set to 0.0001. We use exactly the same data augmentation methods as in ImageNet classification task.
|
| 140 |
+
|
| 141 |
+
Natural Language Processing We validate the performance of DUPS on three regularized LSTM models with varying depth. For the large model, we use 1500 hidden units and train 55 epochs. The learning rate decays by $1 / 1 . 5$ after 15 epochs. Its dropout rate is set to be 0.65 and dropout is applied to all non-recurrent connections. The medium model consists of 650 hidden units. We train it with 40 epochs. The learning rate decays by 0.8 after 5 epochs. Its dropout rate is 0.5. The small model has 200 hidden units. It is trained in 15 epochs. The learning rate remains as the initial value for 4 epochs and then starts to decay at the rate of 0.5. No dropout is used in the small model. For all three models, the initial learning rate is 20.
|
| 142 |
+
|
| 143 |
+
While training DUPS to compare with models trained with SGD optimizer or label smoothing technique in the three tasks, we use cosine annealing policy to update learning rates for all these models. In order to make fair comparisons with Snapshot Distillation, we upgrade our DUPS with cyclic learning rate policy, which is named ${ \mathrm { D U P S } } +$ . Within each cycle , ${ \mathrm { D U P S } } +$ uses cosine annealing learning rate.
|
| 144 |
+
|
| 145 |
+
For hyper-parameters specific to DUPS, we also use a common setting for all tasks following instructions from some empirical studies. We set $\lambda _ { C E }$ to 0.8 and $\lambda _ { K D }$ to 0.2. The Kullback Leibler divergence is used to calculate knowledge distillation term. We use temperature of 6 to soften the logits. We divide the training process into 10 stages for image classification tasks and 5 stages for transfer learning and language model tasks.
|
| 146 |
+
|
| 147 |
+
# 4.3 EXPERIMENT RESULTS
|
| 148 |
+
|
| 149 |
+
We present our experiment results and give insights into the advantages as well as disadvantages using DUPS. We achieve this by comparing DUPS with models trained with SGD, and sometimes with closely related algorithms, namely Label Smoothing and Snapshot Distillation. Although SnapShot Ensembles (Huang et al., 2017) also offers ideas on which we further develop, we do not carry out duplicate experiments to compare with it because (Yang et al., 2018) have already made comparisons between Snapshot Distillation and SnapShot Ensembles. Therefore, we directly compare our proposed DUPS with SnapShot Distillation.
|
| 150 |
+
|
| 151 |
+
Image Classification Table. 1 shows that our DUPS implementation consistently and significantly improve baseline models in accuracy for the vast majority of neural network architectures we tested.
|
| 152 |
+
|
| 153 |
+
Table 2: Training Time of Different Algorithms on PreActResNet50 and WideResNet28x10. All abbreviations follow the same rule as in Table. 1. We run experiments on Tesla V100 GPUs and normalize the training time of SGD to 1 for simplified comparison.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Model</td><td>SGD</td><td>LS</td><td>SD</td><td>DUPS</td></tr><tr><td>PreActResNet50</td><td>1</td><td>~1</td><td>1.32</td><td>1.04</td></tr><tr><td>WideResNet28x10</td><td>1</td><td>~1</td><td>1.27</td><td>1.01</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 3: Top-1 Test accuracy on ImageNet. All abbreviations follow the same rule as in Table. 1.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Model</td><td>SGD</td><td>LS</td><td>DUPS</td></tr><tr><td>ResNet50</td><td>76.58</td><td>76.69</td><td>77.58</td></tr><tr><td>ResNet101</td><td>77.86</td><td>78.41</td><td>78.74</td></tr><tr><td>ResNet152</td><td>78.17</td><td>78.63</td><td>79.06</td></tr></table>
|
| 160 |
+
|
| 161 |
+
The improvement is generally within $1 \% - 2 \%$ in comparison to models trained with the standard SGD optimizer. We notice that more complex architectures do not always perform better than simpler ones, while DUPS achieves stable improvement. We can observe a similar trend in Table. 3 when we apply DUPS to different models on ImageNet.
|
| 162 |
+
|
| 163 |
+
For the majority of the models we tested, DUPS also outperforms Label Smoothing (LS) in image classification. Although DUPS does not beat LS on PreActResNet18 and DenseNet100, the difference is relatively marginal. When compared with a recently proposed KD method SnapShot Distillation, DUPS shows comparable performance even though the SD uses a more complicated learning rate policy. We also demonstrate that ${ \mathrm { D U P S } } +$ which combines cyclic learning rate outperforms SD in most cases. However we noticed that leveraging cyclic learning rate doesn’t always bring benefit. In addition, DUPS obtains the improved results with significantly less training time than that SD needs as showed in Table. 2.
|
| 164 |
+
|
| 165 |
+
Transfer Learning We fixed our test model to be ResNet101 and perform experiments on the chosen datasets. Results in Table. 4 indicate that, compared with models trained using SGD, DUPS improves the transfer learning outcomes on all four datasets, and the improvements range from $0 . 4 6 \%$ to $1 . 7 8 \%$ . These results testify that DUPS can enhance model performance on varying datasets.
|
| 166 |
+
|
| 167 |
+
In contrast, LS does not always yield positively improved results. Furthermore, the extent of improvement LS brings is considerably less than that of DUPS, as shown by the statistics.
|
| 168 |
+
|
| 169 |
+
Natural Language Processing Last but not least, we investigate the effectiveness of DUPS on language modeling. As shown in Table 5, the use of DUPS reduces the perplexity value by a proportion of $1 . 5 \% { \sim } 4 . 1 \%$ on all three models. Note that the model displays better performance when the perplexity value is low in language modeling. Since DUPS significantly lowers the perplexity values to both small and large size of the LSTM models, its effectiveness is not hindered by scaling the size of the model in this task. This flexibility is another advantage of DUPS.
|
| 170 |
+
|
| 171 |
+
# 4.4 DISCUSSIONS
|
| 172 |
+
|
| 173 |
+
Here we give a short discussion about how and why DUPS brings benefits. We first demonstrate some empirical characteristics of DUPS observed in our experiments. We plot the learning curve of the whole training procedure of PreActResNet18 as Fig. 1. For better demonstration purpose, we divide the training process into only 4 stages for DUPS training, with each stage consisting of 40 epochs. We observe that SGD and DUPS display almost the same standard of performance in the first stage as expected. While at the 41th epoch, both training and test accuracy of DUPS get a sharp rise due to involving teacher signal generated in the 40th epoch. Then both training and test accuracy drop slightly for a few epochs, and then return to the trend of slowly rising for the remaining epochs until next stage. A similar phenomenon also appears at the beginning of next stage, although the magnitude of accuracy improvement becomes much more smaller. As the model reaches the beginning of final stage, we no longer see increases in accuracy since training is nearly saturated. We notice that since the first sharp rising, DUPS continuously outperforms SGD by a stable gap for the following training epochs until convergence.
|
| 174 |
+
|
| 175 |
+
Table 4: Test accuracy using ResNet101 on various datasets. All abbreviations follow the same rule as in Table. 1 or explained in Section 4.1.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Dataset</td><td>SGD</td><td>LS</td><td>DUPS</td></tr><tr><td>Flower102</td><td>0.9179</td><td>0.9279</td><td>0.9294</td></tr><tr><td>FGVC_Aircraft</td><td>0.7741</td><td>0.7675</td><td>0.7787</td></tr><tr><td>DTD</td><td>0.6646</td><td>0.6705</td><td>0.6824</td></tr><tr><td>CUB_200_2011</td><td>0.8172</td><td>0.8152</td><td>0.8246</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Table 5: Perplexity value of the model using LSTM on Penn Treebank. Lower is better. All abbreviations follow the same rule as in Table. 1 or explained in Section 4.1.
|
| 180 |
+
|
| 181 |
+
<table><tr><td>Model Size</td><td>SGD</td><td>LS</td><td>DUPS</td></tr><tr><td>Small</td><td>129.7</td><td>129.1</td><td>125.4</td></tr><tr><td>Medium</td><td>95.3</td><td>96.7</td><td>93.9</td></tr><tr><td>Large</td><td>89.2</td><td>88.7</td><td>85.7</td></tr></table>
|
| 182 |
+
|
| 183 |
+
We also investigate the influence of different choices of hyper-parameters specific to DUPS. The most important two are the number of stages and number of random peer samples. We run a grid search method to validate different combinations of these two variables. We use update intervals, or equivalently number of epochs per stage, instead of number of stages for clarity in this experiments. In Fig. 2 we see that performance of DUPS does not seem to be very sensitive to most combinations of the hyperparameters. When the number of peer samples increases to 5 or more, model accuracy tends to be over $7 7 . 3 \%$ . Even when the number of peer samples is low, a good choice of the value of update interval can boost the model performance significantly. For example, when number of peer samples is 1 and update interval is set to be between 20 to 40, DUPS still delivers satisfying results which is comparable to its best performance. Low accuracy of the model only happens consistently when the value of update interval is large. If update interval is set to 80, the model, teacher-student knowledge transfer only takes place once during the whole training process. Consequently, the opportunity to distill the knowledge obtained from the dataset is too rare for the model to benefit from DUPS.
|
| 184 |
+
|
| 185 |
+
# 5 CONCLUSION
|
| 186 |
+
|
| 187 |
+
In this paper, we have introduced a general framework for one-generation KD: We incorporate the information contained within the dataset into teacher-student optimization. We have also proposed an effective implementation of this general framework named DUPS. With extensive experiments, this simple yet effective algorithm is verified to be effective in improving model performance in tasks like image classification, transfer learning and language modeling with almost no additional cost in training resources. The demonstrated success of DUPS imply that utilizing dataset information during training potentially allow us to gain even more benefits.
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Zeynep Akata, Florent Perronnin, Zaid Harchaoui, and Cordelia Schmid. Label-embedding for image classification. IEEE transactions on pattern analysis and machine intelligence, 38(7): 1425–1438, 2015.
|
| 192 |
+
|
| 193 |
+
Rohan Anil, Gabriel Pereyra, Alexandre Passos, Robert Orm ´ andi, George E. Dahl, and Geof- ´ frey E. Hinton. Large scale distributed neural network training through online distillation. ArXiv, abs/1804.03235, 2018.
|
| 194 |
+
|
| 195 |
+
Hessam Bagherinezhad, Maxwell Horton, Mohammad Rastegari, and Ali Farhadi. Label refinery: Improving imagenet classification through label progression. ArXiv, abs/1805.02641, 2018.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 1: SGD and DUPS Learning Curves on PreActResNet18
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 2: DUPS hyperparameter experiment on PreActResNet18
|
| 202 |
+
|
| 203 |
+
Cristian Bucilua, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In ˇ Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’06, pp. 535–541, New York, NY, USA, 2006. ACM.
|
| 204 |
+
|
| 205 |
+
Guobin Chen, Wongun Choi, Xiang Yu, Tony X. Han, and Manmohan Krishna Chandraker. Learning efficient object detection models with knowledge distillation. In NIPS, 2017.
|
| 206 |
+
|
| 207 |
+
Mircea Cimpoi, Subhransu Maji, and Andrea Vedaldi. Deep filter banks for texture recognition and segmentation. 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3828–3836, 2015.
|
| 208 |
+
|
| 209 |
+
Jia Deng, Alexander C Berg, Kai Li, and Li Fei-Fei. What does classifying more than 10,000 image categories tell us? In European conference on computer vision, pp. 71–84. Springer, 2010.
|
| 210 |
+
|
| 211 |
+
Jun Deng, Wei Dong, Richard Socher, Li-Jia Li, Kuntai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255, 2009.
|
| 212 |
+
|
| 213 |
+
Tommaso Furlanello, Zachary C. Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born again neural networks. In ICML, 2018.
|
| 214 |
+
|
| 215 |
+
Sangchul Hahn and Heeyoul Choi. Self-knowledge distillation in natural language processing. arXiv preprint arXiv:1908.01851, 2019.
|
| 216 |
+
|
| 217 |
+
Byeongho Heo, Minsik Lee, Sangdoo Yun, and Jin Young Choi. Knowledge transfer via distillation of activation boundaries formed by hidden neurons. ArXiv, abs/1811.03233, 2018.
|
| 218 |
+
|
| 219 |
+
Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. ArXiv, abs/1503.02531, 2015.
|
| 220 |
+
|
| 221 |
+
Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E. Hopcroft, and Kilian Q. Weinberger. Snapshot ensembles: Train 1, get m for free. ArXiv, abs/1704.00109, 2017.
|
| 222 |
+
|
| 223 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 224 |
+
|
| 225 |
+
Xu Lan, Xiatian Zhu, and Shaogang Gong. Knowledge distillation by on-the-fly native ensemble. In NeurIPS, 2018a.
|
| 226 |
+
|
| 227 |
+
Xu Lan, Xiatian Zhu, and Shaogang Gong. Self-referenced deep learning. ArXiv, abs/1811.07598, 2018b.
|
| 228 |
+
|
| 229 |
+
Xingjian Li, Haoyi Xiong, Hanchao Wang, Yuxuan Rao, Liping Liu, and Jun Huan. Delta: Deep learning transfer using feature map with attention for convolutional networks. ArXiv, abs/1901.09229, 2019.
|
| 230 |
+
|
| 231 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. In ICLR, 2016.
|
| 232 |
+
|
| 233 |
+
Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew B. Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. ArXiv, abs/1306.5151, 2013.
|
| 234 |
+
|
| 235 |
+
Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. Building a large annotated corpus of english: The penn treebank. Computational Linguistics, 19:313–330, 1993.
|
| 236 |
+
|
| 237 |
+
Rafael J. Muller, Simon Kornblith, and Geoffrey E. Hinton. When does label smoothing help? ArXiv, abs/1906.02629, 2019.
|
| 238 |
+
|
| 239 |
+
Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, pp. 722–729, 2008.
|
| 240 |
+
|
| 241 |
+
Gabriel Pereyra, George Tucker, Jan Chorowski, Łukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv:1701.06548, 2017.
|
| 242 |
+
|
| 243 |
+
Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. CoRR, abs/1412.6550, 2014.
|
| 244 |
+
|
| 245 |
+
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, pp. 2818–2826, 2016.
|
| 246 |
+
|
| 247 |
+
Nakul Verma, Dhruv Mahajan, Sundararajan Sellamanickam, and Vinod Nair. Learning hierarchical similarity metrics. In 2012 IEEE conference on computer vision and pattern recognition, pp. 2280–2287. IEEE, 2012.
|
| 248 |
+
|
| 249 |
+
C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011.
|
| 250 |
+
|
| 251 |
+
Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A. Efros. Dataset distillation. ArXiv, abs/1811.10959, 2019.
|
| 252 |
+
|
| 253 |
+
Chenglin Yang, Lingxi Xie, Chi Su, and Alan L. Yuille. Snapshot distillation: Teacher-student optimization in one generation. ArXiv, abs/1812.00123, 2018.
|
| 254 |
+
|
| 255 |
+
Chenglin Yang, Lingxi Xie, Siyuan Qiao, and Alan L. Yuille. Training deep neural networks in generations: A more tolerant teacher educates better students. In AAAI, 2019.
|
| 256 |
+
|
| 257 |
+
Junho Yim, Donggyu Joo, Jihoon Bae, and Junmo Kim. A gift from knowledge distillation: Fast optimization, network minimization and transfer learning. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, 2017.
|
| 258 |
+
|
| 259 |
+
Ruichi Yu, Ang Li, Vlad I. Morariu, and Larry S. Davis. Visual relationship detection with internal and external linguistic knowledge distillation. 2017 IEEE International Conference on Computer Vision (ICCV), pp. 1068–1076, 2017.
|
| 260 |
+
|
| 261 |
+
Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. arXiv preprint arXiv:1612.03928, 2016.
|
| 262 |
+
|
| 263 |
+
Linfeng Zhang, Jiebo Song, Anni Gao, Jingwei Chen, Chenglong Bao, and Kaisheng Ma. Be your own teacher: Improve the performance of convolutional neural networks via self distillation. ArXiv, abs/1905.08094, 2019.
|
md/train/Hyxu6oAqYX/Hyxu6oAqYX.md
ADDED
|
@@ -0,0 +1,478 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AN ENERGY-BASED FRAMEWORK FOR ARBITRARY LABEL NOISE CORRECTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose an energy-based framework for correcting mislabelled training examples in the context of binary classification. While existing work addresses random and class-dependent label noise, we focus on feature dependent label noise, which is ubiquitous in real-world data and difficult to model. Two elements distinguish our approach from others: 1) instead of relying on the original feature space, we employ an autoencoder to learn a discriminative representation and 2) we introduce an energy-based formalism for the label correction problem. We prove that a discriminative representation can be learned by training a generative model using a loss function comprised of the difference of energies corresponding to each class. The learned energy value for each training instance is compared to the original training labels and contradictions between energy assignment and training label are used to correct labels. We validate our method across eight datasets, spanning synthetic and realistic settings, and demonstrate the technique’s state-of-the-art label correction performance. Furthermore, we derive analytical expressions to show the effect of label noise on the gradients of empirical risk.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Machine learning algorithms depend on reliable training labels or, when applicable, sufficiently robust learning models in order to produce generalizable predictions (Zhu & Wu, 2004; Frenay & ´ Verleysen, 2014). Many empirical datasets suffer from training label corruption, which can result from annotation error, human bias, or a noisy process for generating labels (Smyth, 1996; Brodley & Friedl, 1999). In practice, it can be costly to obtain noise-free labels; hence, research on reducing the effects of label noise on learning has received considerable attention.
|
| 12 |
+
|
| 13 |
+
Most work, however, focuses on label noise that is independent of the input features (e.g., random label noise or class conditional random noise). The introduction of feature dependency significantly complicates mathematical analysis (Natarajan et al., 2013; Liu & Tao, 2014; Northcutt et al., 2017). Although work in this domain has yielded impressive results and improved generalization (Rebbapragada & Brodley, $2 0 0 7 \mathrm { a }$ ; Natarajan et al., 2013; Patrini et al., 2017; Rolnick et al., 2017; Ren et al., 2018), the simplicity of these noise assumptions fails to capture crucial mislabelling processes that arise in practice. In this work, we propose a semi-supervised framework for correcting the effects of feature dependent label noise on supervised learning algorithms.
|
| 14 |
+
|
| 15 |
+
Label noise processes are categorized into three types, as illustrated in Figure 1. Type I refers to a noise model where any label in the training data is incorrect with probability $\gamma$ . In the case of type II noise, the probability of label corruption is conditioned on the class, such that we have different noise rate $\gamma _ { 0 }$ and $\gamma _ { 1 }$ for each class. Finally, type III noise models describe how label noise depends explicitly on input features. Feature dependent label noise or equivalently type III noise is a more realistic type of label noise that is ubiquitous in empirical datasets (Lachenbruch, 1974; Schafer & Graham, 2002; Frenay & Verleysen, 2014). As an example of type III noise, consider the ´ diagnostic labels of Alzheimer’s disease. In this setting, the probability of label noise depends on both age and sex (i.e., younger male patients are harder to diagnose) (Khachaturian, 1985; Murray et al., 2016). Type III noise also includes the prevalence of unreliable labels for training instances in low density regions of feature space (Denoeux, 1995; 1997; 2000) or near classification boundaries (Lachenbruch, 1966; 1974; Chhikara & McKeon, 1984; Cohen, 1997; Beigman & Klebanov, 2009; Beigman Klebanov & Beigman, 2009; Kolcz & Cormack, 2009).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Different categories of label noise and their statistical dependencies, as depicted by the red arrow. In type I noise, all instances are equally likely to be mislabelled base on some probability $\gamma \in \ [ 0 , \frac { 1 } { 2 } ]$ . In the case of type II, this probability is different for each class: $\gamma _ { 0 } \ \in [ 0 , \frac { 1 } { 2 } ]$ and $\gamma _ { 1 } \in [ 0 , \frac { 1 } { 2 } ]$ . Type III label noise is the most realistic model and yet the least studied. In this case the probability of an error is a function of the input features: i.e. $p _ { \mathrm { e r r o r } } \sim f ( \pmb { x } )$ .
|
| 19 |
+
|
| 20 |
+
In this paper, we present a practical framework for correcting label noise that extends beyond type I and type II noise. We train an energy-based generative model on a small subset of the training data with reliable labels, either manually annotated or automatically learned. This model is used to identify and correct mislabelled examples based on the whether the assigned energy of a given point is compatible with its original label. We empirically demonstrate our framework’s ability to handle input dependent label noise on both simulated and real datasets.
|
| 21 |
+
|
| 22 |
+
# 2 RELATED WORK
|
| 23 |
+
|
| 24 |
+
The full body of work on the problem of label noise is too extensive to review here; however, we direct interested readers to the detailed review by Frenay & Verleysen (2014). In this section, we ´ highlight key contributions in the label noise literature. We then briefly discuss existing theoretical work.
|
| 25 |
+
|
| 26 |
+
# 2.1 LABEL NOISE CORRECTION
|
| 27 |
+
|
| 28 |
+
Existing work in label noise correction is designed for Type I and Type II noise and falls into three categories: relabeling, learning procedures and loss functions. We expand on each area below.
|
| 29 |
+
|
| 30 |
+
Relabeling: Earlier approaches to label noise focus on relabeling the noisy training set. Brodley & Friedl (1999) use the output of an ensemble of classifiers to identify mislabeled training examples. Sun et al. (2007) identify mislabeled instances based on the entropy of class probabilities outputted by a Bayesian classifier. These approaches, while robust to simpler label noise models, do not account for Type III noise.
|
| 31 |
+
|
| 32 |
+
Learning Procedures: Methods modifying the learning procedure include the perceptron algorithm with margin (PAM) Frenay & Verleysen (2014). Crammer & Lee (2010) use a velocity-based learn- ´ ing procedure to learn the weight vector distribution, termed gaussian herding (NHERD). Sukhbaatar et al. (2014) introduce a noise layer to a neural network architecture to learn the noise function, while Rebbapragada & Brodley (2007b) weight each example by class confidence in the training procedure. These methods commonly suffer from overfitting to the noise and again, primarily focus on Type I and Type II noise.
|
| 33 |
+
|
| 34 |
+
Loss Functions: Long & Servedio (2010) have shown classification algorithms that optimize a convex potential over a linear class are not robust to random label noise. This has led to work which aims to modify convex loss functions in order to make them noise-tolerant in the presence of type I and type II noise. Ghosh et al. (2015) derived sufficient conditions for classification losses that render them robust to random noise; namely, the components of a loss (where each component is defined over a given class) must sum to a constant value. Rooyen et al. (2015) proposed a convex loss that avoids the negative result of Long & Servedio (2010) for type I noise by virtue of being negatively unbounded. Natarajan et al. (2013) have shown that risk minimization over the corrupted data is consistent with risk minimization over clean data provided that the standard convex loss (e.g., binary cross entropy) is modified appropriately to produce an unbiased loss estimator (ULE). Each of these loss functions is presented for and validated on Type I and Type II noise.
|
| 35 |
+
|
| 36 |
+
# 2.2 EXISTING THEORETICAL GUARANTEES
|
| 37 |
+
|
| 38 |
+
(Bylander, 1994; Blum et al., 1998; Blum & Mitchell, 1998) offer guarantees for hypothesis generalization in the face of Type I and Type II noise. Angluin & Laird (1988); Bylander (1997; 1998); Servedio (1999) present guarantees for type III noise, where the probability of error depends on the distance to the margin. We introduce a gradient-based interpretation of label noise to these existing results.
|
| 39 |
+
|
| 40 |
+
# 3 BINARY CLASSIFICATION IN THE PRESENCE OF LABEL NOISE
|
| 41 |
+
|
| 42 |
+
# 3.1 PROBLEM SETUP AND NOTATION
|
| 43 |
+
|
| 44 |
+
Let $P$ denote the true distribution from which $n$ i.i.d. training examples $( \pmb { x } _ { 1 } , y _ { 1 } ) , ( \pmb { x } _ { 2 } , y _ { 2 } ) , \dots , ( \pmb { x } _ { n } , y _ { n } )$ have been drawn, where $( \pmb { x } _ { i } , y _ { i } ) ~ \in ~ \mathbb { R } ^ { d } \times \{ 0 , 1 \}$ . The clean and corrupted training datasets are denoted as
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r } { T = \{ ( \boldsymbol { x } _ { i } , y _ { i } ) \mathrm { ~ f o r ~ } i = 1 , 2 , \ldots , n \} \quad \& \quad \tilde { T } = \{ ( \boldsymbol { x } _ { i } , \tilde { y } _ { i } ) \mathrm { ~ f o r ~ } i = 1 , 2 , \ldots , n \} , } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
respectively, where due to some label noise process $y _ { i } \to \tilde { y } _ { i }$ . Hence, we have access to the noisy data $\tilde { \tau }$ during training instead of the clean data $\tau$ . It can be assumed that the corrupted samples $( { \pmb x } _ { i } , \tilde { y } _ { i } )$ are drawn from a noisy distribution $\tilde { P }$ .
|
| 51 |
+
|
| 52 |
+
In supervised binary classification, we aim to learn a discriminator $f : \mathbb { R } ^ { d } \mathbb { R }$ that minimizes the risk with respect to a given loss function1. Formally, we want to minimize the empirical risk is $\begin{array} { r } { \hat { R } \left[ \ell , f , \mathcal { T } \right] = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \ell \left( f ( x _ { i } , \pmb { \theta } ) , y _ { i } \right) } \end{array}$ , where the $m , \ell , \theta$ denote the size of the mini-batch size, loss function, and the learnable model parameters respectively. Gradient based learning algorithms compute $\nabla _ { \pmb { \theta } } ( \hat { R } [ \ell , f , \mathcal { T } ] )$ and update model parameters. For example, as in mini-batch gradient descent,
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\pmb { \theta } _ { t + 1 } = \pmb { \theta } _ { t } - \eta \nabla _ { \pmb { \theta } } \left( \hat { R } \left[ \ell , f , \mathcal { T } \right] \right) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\eta$ is the learning rate. In practice, we may not have access to the clean data $\tau$ . Instead we must learn the discriminator using the noisy data $\tilde { \tau }$ . Thus, the second term in Eq. 2 becomes $\nabla _ { \pmb { \theta } } ( \hat { R } [ \ell , f , \tilde { \mathcal { T } } ] )$ , which denotes the risk with respect to the noisy training data.
|
| 59 |
+
|
| 60 |
+
# 3.2 LABEL NOISE EFFECT ON RISK MINIMIZATION
|
| 61 |
+
|
| 62 |
+
We can describe the effect of label noise on learning by expressing the noisy gradient $\nabla _ { \pmb { \theta } } ( \hat { R } [ \ell , f , \tilde { \mathcal { T } } ] )$ in terms of the true gradient $\nabla _ { \pmb { \theta } } ( \hat { R } [ \ell , f , \mathcal { T } ] )$ and a noise term. In the case of type I noise where any label $y _ { i }$ can be flipped to $1 - y _ { i }$ with probability $\gamma \in [ 0 , 1 / 2 ]$ , we have
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathbb { E } _ { ( \pmb { x } , \tilde { y } ) \sim \tilde { P } } \left[ \nabla _ { \pmb { \theta } } \hat { R } [ \ell , \tilde { \mathcal { T } } ] \right] = ( 1 - 2 \gamma ) \mathbb { E } _ { \mathrm { t r u e } } + 2 \gamma \mathbb { E } _ { \mathrm { r a n d } } ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $\mathbb { E } _ { \mathrm { t r u e } } \equiv \mathbb { E } _ { ( \pmb { x } , \tilde { \pmb { y } } ) \sim \tilde { P } } [ \nabla _ { \pmb { \theta } } \hat { R } [ \ell , \mathcal { T } ] ]$ is the true (i.e. noise-free) gradient, and $\mathbb { E } _ { \mathrm { r a n d } }$ is the completely noisy term obtained by replacing all targets $y _ { i }$ with a random value of either 0 or 1. For type II noise, we have an equation analogous to Eq. 3, where $\gamma$ is replaced by the average $\bar { \gamma } = ( \gamma _ { 0 } + \gamma _ { 1 } ) / 2$ noise rate and we have an additional term reflecting the noise imbalance between each class when $\gamma _ { 0 } \neq \gamma _ { 1 }$ . For more information on this and derivations of these equations, see Appendix A.
|
| 69 |
+
|
| 70 |
+
From Eq. 3 we deduce that for small $\gamma$ the true gradients dominate the dynamics of searching $\pmb \theta$ space for optimal parameters. As $\gamma$ grows, the true gradients are scaled down by the factor $( 1 - 2 \gamma )$ , which means that the contribution of ${ \mathbb E } _ { \mathrm { t r u e } }$ diminishes and the random perturbation term $\mathbb { E } _ { \mathrm { r a n d } }$ starts to dominate as $\gamma$ grows. A similar conclusion can be reached for type II noise (replacing $\gamma$ with $\bar { \gamma }$ ) where we have an additional term modifying the true gradients based on the class imbalance (see A.2).
|
| 71 |
+
|
| 72 |
+
The effect of $\mathbb { E } _ { \mathrm { r a n d } }$ can be negated by increasing the amount of training data proportionately with $\bar { \gamma }$ as discussed by Rolnick et al. (2017): i.e. as the probability of a random error occurring increases, the model needs more data to make progress in the direction of the true gradient. We can neutralize the effects (i.e. suppress $\mathbb { E } _ { \mathrm { r a n d } , }$ ) of random noise (type I) or class conditional random noise (type II) by increasing the number of training examples and by utilizing a robust loss function when possible (Natarajan et al., 2013).
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
Figure 2: Plots showing the path traversed in $\pmb \theta$ space by a supervised model as learnable parameters are updated via a gradient based optimizer. The gold line shows the path followed by a noise-free model and the blue lines show the modified paths due to label noise. In the case of random label noise (left plot), the perturbations $\mathbb { E } _ { \mathrm { r a n d } }$ to the true gradient direction are curbed by an increase in training set size. In contrast, for input dependent noise (right plot), supplying the model with more data perpetuates the label bias.
|
| 76 |
+
|
| 77 |
+
In contrast, Type III noise is substantially more difficult to address because the available training data $\tilde { \tau }$ can have optimal discriminators that are significantly different from the true discriminator corresponding to the clean data $\tau$ . Separating Type III noise into the true term and the perturbation term necessitates restrictive assumptions on the noise model (See Appendix A. In Figure 2, we show this by visualizing SGD over the true training set (gold lines) and the noise training set (blue lines). As shown in Figure 2, increasing the size of the training set is effective in address Type II noise. This strategy is not only ineffective for addressing type III noise, but they can also lead to our model learning the biased discriminator; thus, hindering any possibility of generalization.
|
| 78 |
+
|
| 79 |
+
# 4 AN ENERGY-BASED FRAMEWORK FOR BIAS CORRECTION
|
| 80 |
+
|
| 81 |
+
Type III noise is particularly challenging because noise can depend on the input features in an arbitrarily complex way. Modeling this requires significant information about the noise process, which can be difficult to obtain in practice. In order to deal with this challenge we will avoid training directly on the mislabelled instances. Instead, we start our training procedure by assuming there exists a small subset of $\tilde { \tau }$ that is noise-free (e.g. $1 \%$ of the data is sufficient the MNIST dataset). Such a set can be obtained via a manual labelling process or by using domain knowledge to identify the appropriate data points2.
|
| 82 |
+
|
| 83 |
+
Our objective is to correct mislabelled training instances such that the corrected data leads to the improved generalization of a trained model. We will demonstrate in Section 5 that our framework extends beyond Type I and Type $\mathrm { I I }$ noise to Type III noise, in realistic settings. In particular, we demonstrate the method’s strength in correcting algorithmically assigned labels.
|
| 84 |
+
|
| 85 |
+
The proposed correction framework consists of three steps:
|
| 86 |
+
|
| 87 |
+
1. Obtain known labels: There are two ways of identifying instances that have correct labels. The first approach is to use domain knowledge – frequently, one has access to a subset of clean labels and their instances. We can use this subset as our clean data for step 2. If this set is unknown or too small, then we can inference which examples are likely to be correctly labeled, as is done in Ding et al. (2018). We report results on both approaches in Section 5.
|
| 88 |
+
|
| 89 |
+
2. Train semi-supervised model: The framework uses the filtered data from the previous step to train a semi-supervised algorithm that learns to classify instances based on similarity between features. In contrast with supervised learning, where the goal is to learn $p ( y | \mathbf { \boldsymbol { x } } )$ , we want to learn which features are most compatible with a given label: i.e. $p ( { \pmb x } | { \pmb y } )$ . Thus, we train a generative model (e.g. energy-based autoencoder) to use feature similarity (as quantified by an energy function) to identify which instances belong to the specific class.
|
| 90 |
+
|
| 91 |
+
3. Identify and correct mislabelled instances: The features of the full training data (with mislabeled targets) are injected into the previously trained semi-supervised model resulting in each instance being assigned an energy value based on the output of the model. The energy corresponding to each instance serves as a proxy for class assignment (i.e. low energy corresponds to $y = 0$ whereas high energy corresponds to $y = 1$ ). Contradictions between energy assignment and training labels are used to correct the training data such that all labels are compatible with their assigned energy.
|
| 92 |
+
|
| 93 |
+
We first motivate the design decisions involved in this framework. Namely, we explore our choice of contrastive divergence as a loss function and empirically justify our use of an autoencoder. In the subsequent section, we elaborate on our implementation of the framework.
|
| 94 |
+
|
| 95 |
+
# 4.1 FRAMEWORK MOTIVATION
|
| 96 |
+
|
| 97 |
+
Given a small, clean dataset $\mathcal { T } \subset \tilde { \mathcal { T } }$ , we aim to train a model which can be used to determine labels on the remaining, noisily labelled dataset. One obvious approach is to train a binary classifier directly and use it to correct labels. However, as discussed by Berthelot et al. (2017), binary classification provides a relatively weak training signal which largely ignores the intricacies of the input feature distribution. See Fig. 3 where we compare the class separation achieved by a few standard binary classifiers with our proposed approach. Alternatively, one could train class conditional models. However, such models are trained without knowledge of the primary task, differentiating classes. Further, traditional unsupervised training regimes typically use a maximum likelihood formulation (i.e. forward KL divergence) which is prone to distributing probability mass broadly (the so-called “mean-seeking behaviour” (Murphy, 2012)) and further limit the discriminative ability of the learned model.
|
| 98 |
+
|
| 99 |
+
Instead, we prioritize learning to discriminate the underlying classes based on aspects of the input feature distributions. To do this, we propose to use a contrastive divergence (Carreira-Perpinan $\&$ Hinton, 2005) training loss:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathrm { C D } \left( \pmb { \theta } \right) = \mathrm { K L } \left[ p _ { 0 } \left( \pmb { x } \right) \| \boldsymbol { q } \left( \pmb { x ; \theta } \right) \right] - \mathrm { K L } \left[ p _ { 1 } \left( \pmb { x } \right) \| \boldsymbol { q } \left( \pmb { x ; \theta } \right) \right] .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $p _ { 0 } ( { \pmb x } )$ and $p _ { 1 } ( { \pmb x } )$ denote the target probability distributions conditioned on class 0 and 1 respectively and $\boldsymbol { q } ( \boldsymbol { \pmb x } ; \boldsymbol { \theta } )$ denotes the learned model. Thus, training aims to produce a model ${ \boldsymbol { q } } \left( { \pmb { x } } ; { \pmb { \theta } } \right)$ which assigns high probability to samples from class 0, while giving low probability to samples from class 1. In theorem 1, we show that a finite sample approximation of the optimization objective in Eq. 4 can be computed as
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\mathcal { L } \left( \pmb { \theta } \right) = \frac { 1 } { \vert \mathcal { T } _ { 0 } \vert } \sum _ { \pmb { x } _ { 0 } \in \mathcal { T } _ { 0 } } E \left( \pmb { x } _ { 0 } ; \pmb { \theta } \right) - \frac { 1 } { \vert \mathcal { T } _ { 1 } \vert } \sum _ { \pmb { x } _ { 1 } \in \mathcal { T } _ { 1 } } E \left( \pmb { x } _ { 1 } ; \pmb { \theta } \right) ,
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $\mathcal { T } _ { y }$ , for $y ~ \in ~ \{ 0 , 1 \}$ , contains instances from class $y$ and $\mathcal { T } _ { y } \subseteq \mathcal { T } _ { \mathfrak { s } }$ , $| \mathcal { T } _ { y } |$ denotes the number of elements in $\mathcal { T } _ { y }$ and $E ( \pmb { x } ; \pmb { \theta } )$ is the energy of the model ${ \bf { \nabla } } q \left( { { \bf { x } } ; \theta } \right)$ , i.e., $q \left( { { \pmb x } ; { \pmb \theta } } \right) \ =$ $\exp \left( - E ( \pmb { x } ; \pmb { \theta } ) \right) / Z ( \pmb { \theta } )$ where $Z ( \pmb \theta )$ is the normalizing partition function. Analogously, we can define Eq. 5 over each mini-batch. This contrastive loss have been applied successfully in adversarial training, resulting in faster and improved stability of training, enhanced generator quality, and improved generator diversity (Zhao et al., 2016; Berthelot et al., 2017). As described in section 2.2 of (LeCun et al., 2006), the negative log-likelihood function, $E ( { \pmb x } ; { \pmb \theta } ) = - \log q \left( { \pmb x } ; { \pmb \theta } \right)$ , constitute a valid energy which has been used in numerous energy-based models [e.g. (Bengio et al., 2003; Zhao et al., 2016; Berthelot et al., 2017)].
|
| 112 |
+
|
| 113 |
+
Theorem 1. The contrastive divergence $\mathrm { C D } \left( \theta \right)$ in Equation 4 has the finite approximation $\mathcal { L } \left( \pmb { \theta } \right) u p$ to some constant $k$ which is independent of $\pmb { \theta }$ .
|
| 114 |
+
|
| 115 |
+
Proof. Using the definition of KL divergence, we expand Equation 4:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathrm { C D } \left( \pmb { \theta } \right) = - \int _ { \pmb { x } } p _ { 0 } \left( \pmb { x } \right) \log q \left( \pmb { x ; \theta } \right) d \pmb { x } + \int _ { \pmb { x ^ { \prime } } } p _ { 1 } \left( \pmb { x ^ { \prime } } \right) \log q \left( \pmb { x ^ { \prime } ; \theta } \right) d \pmb { x ^ { \prime } } + \boldsymbol { k }
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 3: In the first row, we visualize the separation achieved by classifiers trained on a training set with noisy labels. From left to right, we show the results of logistic regression, an SVM, a 1 layer feed-forward neural network and the proposed technique. In the second row, we visualize the training data. From left to right, we show the clean data, the noisy data and the autoencodercorrected data. We observe that standard binary classifiers are unable to achieve satisfactory class separation. The 1 hidden layer NN classifier accomplishes significant separation but it incorrectly identifies mislabelled instances. The proposed model is able to identify mislabelled instances based on the energy distribution of the training data.
|
| 123 |
+
|
| 124 |
+
where the two entropy terms $\begin{array} { r } { \int _ { \pmb { x } } p _ { 0 } \left( \pmb { x } \right) \log p _ { 0 } \left( \pmb { x } \right) d \pmb { x } } \end{array}$ and $\begin{array} { r } { \int _ { \pmb { x } } p _ { 1 } \left( \pmb { x } \right) \log p _ { 1 } \left( \pmb { x } \right) d \pmb { x } } \end{array}$ have been grouped in the constant $k$ as they do not depend on the optimization parameters $\pmb \theta$ . Assume the Gibbs form for the model distribution,
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
q \left( { { \bf { x } } ; \pmb { \theta } } \right) = \frac { { { e ^ { - E \left( { { \bf { x } } ; \pmb { \theta } } \right) } } } } { { { Z ( \pmb { \theta } } ) } } ,
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $E ( \pmb { x } ; \pmb { \theta } )$ is the energy and $\begin{array} { r } { Z ( \pmb { \theta } ) = \int _ { \pmb { x } } e ^ { - E ( \pmb { x } ; \pmb { \theta } ) } d \pmb { x } } \end{array}$ is the partition function. Then, Equation 6 becomes
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { l l l } { { \displaystyle \mathrm { { C D } } \left( \theta \right) } } & { { = } } & { { \displaystyle \int _ { x } p _ { 0 } \left( { \pmb x } \right) E ( { \pmb x } ; \theta ) d { \pmb x } - \int _ { { \pmb x } ^ { \prime } } p _ { 1 } \left( { \pmb x } ^ { \prime } \right) E ( { \pmb x } ; \theta ) d { \pmb x } ^ { \prime } } } \\ { { \displaystyle } } & { { - } } & { { \displaystyle \left( \int _ { \pmb x } p _ { 0 } \left( { \pmb x } \right) d { \pmb x } \right) Z ( \pmb \theta ) + \left( \int _ { \pmb x } p _ { 1 } \left( { \pmb x } \right) d { \pmb x } \right) Z ( \pmb \theta ) + k , } } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where the partition function terms conveniently cancel out due to the normalization of $p _ { 0 }$ and $p _ { 1 }$ Therefore,
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r } { \mathrm { C D } \left( \pmb { \theta } \right) = \mathbb { E } _ { p _ { 0 } \left( \pmb { x } \right) } \left[ E \left( \pmb { x } \right) \right] - \mathbb { E } _ { p _ { 1 } \left( \pmb { x } \right) } \left[ E \left( \pmb { x } \right) \right] + k } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
and we conclude that $\mathrm { C D } \left( \theta \right)$ has the finite approximation ${ \mathcal { L } } \left( \theta \right)$ as defined in Equation 5, up to a constant $k$ .
|
| 143 |
+
|
| 144 |
+
# 4.2 FRAMEWORK IMPLEMENTATION: CONTRASTIVE AUTOENCODER
|
| 145 |
+
|
| 146 |
+
Using the clean subset $\mathcal { T }$ , we implement step 2 of our framework by using an energy-based autoencoder (analogous to Zhao et al. (2016)). In order to ensure stable training and to prevent the second term of Equation 5 from diverging, we balance our mini-batch to have an equal number of positive and negative class samples. After training is complete, we process the original training data $\tilde { \tau }$ using the trained autoencoder. Specifically, we compute the energy using the resulting outputs: $E \left( { \pmb x } ; { \pmb \theta } \right) = - \log q \left( { \pmb x } ; { \pmb \theta } \right)$ , which reduces to the reconstruction loss corresponding to the autoencoder (Goodfellow et al., 2016). For example, if the underlying distribution is assumed to be Gaussian then, we have $E \left( { \pmb x } ; { \pmb \theta } \right) = \| { \pmb x } - \hat { \pmb x } ( { \pmb \theta } ) \| ^ { 2 }$ , where $\hat { \mathbf { x } } ( \overset { \cdot } { \boldsymbol { \theta } } )$ is the output of the autoencoder3. Whereas, if the underlying distribution is assumed to be Bernoulli, we obtain $E \left( \pmb { x } ; \pmb { \theta } \right) = - \left[ \pmb { x } \log \hat { \pmb { x } } ( \pmb { \theta } ) + \left( 1 - \pmb { x } \right) \log ( \bar { 1 } - \bar { \pmb { x } } ( \pmb { \theta } ) ) \right]$ .
|
| 147 |
+
|
| 148 |
+
To execute our label correction protocol, we impose the following two conditions. (i) if $E ( \pmb { x } ; \pmb { \theta } ) >$ $\bar { E } _ { 1 } - a$ for $\pmb { x } \in \tilde { \mathcal { T } } _ { 0 }$ , then change label of $_ { \textbf { \em x } }$ . Here we denote $\tilde { \tau } _ { 0 }$ as the originals negative samples, $\bar { E } _ { 1 }$ as the mean energy over the set of clean positive samples $\mathcal { T } _ { 1 }$ , and $a$ is a tuneable hyperparameter that determines how aggressively we want to change $0 1$ . Analogously, we impose condition (ii) if $E ( \pmb { x } ; \pmb { \theta } ) < \bar { E } _ { 0 } - b$ for $\pmb { x } \in \tilde { \mathcal { T } } _ { 1 } ^ { }$ , then change label of $_ { \textbf { \em x } }$ . The rationale is to modify samples where the original label $\tilde { y }$ contradicts the energy assignment. When one is not able to tune the threshold hyperparameters $a$ and $b$ , an empirical heuristic is to set them equal to the standard deviation about the means $\bar { E } _ { 1 }$ and $\bar { E } _ { 0 }$ respectively. See Appendix B details and pseudo-code.
|
| 149 |
+
|
| 150 |
+
# 5 EXPERIMENTS
|
| 151 |
+
|
| 152 |
+
We conduct experiments with simulated data and real-world data where three different type III noise models are studied: (i) Linear noise $( p _ { \mathrm { e r r o r } } \sim \alpha x _ { i } )$ ): the probability of an error occurring depends linearly on a feature (Table 1). (ii) Quadratic noise $( p _ { \mathrm { e r r o r } } \sim \dot { \alpha } \dot { x } _ { i } ^ { 2 } )$ : the probability of an error occurring depends on the square of a feature. We control the amount of noise added with $\alpha$ and we select $x _ { i }$ if it has sufficient variance to make the noise model distinct from random noise, i.e. 0 variance implies random noise (Table 2). (iii) Boundary noise: the probability of label error depends on the distance from the class boundary, which is determined using the noise-free data. We report the average class-weighted F1-score along with the standard error over 10 runs with random train-test (80:20) splits (Table 3).
|
| 153 |
+
|
| 154 |
+
UCI benchmark datasets: We train logistic regression on the corrected dataset resulting from the proposed algorithm. If a small clean dataset is not initially provided, then our results are labelled as AE (learned), otherwise they are labelled at AE (known) – see step 1 in Sec. 4. We compare to noise robust algorithms: NHERD Crammer & Lee (2010), PAM Frenay & Verleysen (2014), and ´ ULE Natarajan et al. (2013). Additionally, we report upper and lower bounds by training logistic regression on the noisy data (LR-N) and on the clean data (LR-C). All algorithms are tested on noisefree data. Even without access to any clean labels (i.e., we learn which labels are likely clean), our framework generally outperforms the other algorithms in the presence of linear noise and quadratic noise. In general, learning which labels are noisy following the method in Ding et al. (2018) is not possible for arbitrary label noise processes: e.g., when the optimal discriminators of $\tilde { \tau }$ are very different than the optimal discriminators of $\tau$ . For boundary noise, we show that using a small clean dataset $\mathcal { T }$ enables our methods to learn in the presence of boundary noise, where the other methods generally breakdown (Table 3). For a fair evaluation, the benchmark algorithms (which don’t have access to clean data) should be compared to AE (learned).
|
| 155 |
+
|
| 156 |
+
MNIST: Next, we compare our method with another state-of-the-art noise robust algorithm that relies on clean data, i.e., the loss weighting scheme of Ren et al. (2018). Both methods are given the same percentage of clean data for each noise setting. The task is to classify the distinguish $\mathbf { \ddot { 3 } } \mathbf { \ " }$ (class 0) vs. other digits (class 1). The noise process is input dependent as it changes $4 , 5 , 6$ to class 0 depending on a specified noise rate $( \alpha )$ . We demonstrate (Table 4) that our method generalizes better in the presence of type III noise, even when starting with only $1 \%$ of the data that is clean.
|
| 157 |
+
|
| 158 |
+
Arrhythmia We use the MIT-BIH Arrhythmia dataset Goldberger et al. (2000) to evaluate the proposed method’s ability to correct algorithmically assigned labels. Algorithmically-assigned labels (AALs) are prevalent in domains with abundant unlabeled data and high labelling costs. Common applications include web page annotation, but the value of this approach extends to automatic annotation of images and natural language. We employ the data preprocessing procedure described by Mondejar-Guerra et al. (2019), where each arrhythmia is described by 59 features. ´
|
| 159 |
+
|
| 160 |
+
We divide the dataset into three parts: $T _ { 1 }$ , $T _ { 2 }$ and $T _ { 3 }$ . $T _ { 1 }$ and $T _ { 2 }$ serve as training sets and $T _ { 3 }$ is the test set. We train a classifier on $T _ { 1 }$ and subsequently use that classifier to generate AALs for $T _ { 2 }$ . Thus, the predictions of the trained classifier become $\tilde { y }$ and the original expert labels remain $y$ . As demonstrated in Table 1, the proposed technique achieves a higher F1 score than competing
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Dataset</td><td>Noise Parameters (col, α)</td><td>LR-N</td><td>NHERD</td><td>PAM</td><td>ULE</td><td>AE (learned)</td><td>AE(known)</td><td>LR-C</td></tr><tr><td>Lin-Sep</td><td>1,1.2</td><td>0.86±0.03</td><td>0.91±0.01</td><td>0.76±0.01</td><td>0.90±0.02</td><td>0.94±0.01</td><td>0.95±0.01</td><td>0.96±0.01</td></tr><tr><td>Diabetes</td><td>5,1.0</td><td>0.60±0.03</td><td>0.50±0.01</td><td>0.48±0.03</td><td>0.60±0.03</td><td>0.64±0.01</td><td>0.70±0.02</td><td>0.72±0.02</td></tr><tr><td>German</td><td>1, 1.2</td><td>0.67±0.03</td><td>0.72 ± 0.01</td><td>0.49 ± 0.03</td><td>0.63 ± 0.01</td><td>0.67± 0.03</td><td>0.73 ±0.01</td><td>0.76 ±0.02</td></tr><tr><td>Image</td><td>1,0.7</td><td>0.61± 0.03</td><td>0.63 ±0.01</td><td>0.54 ± 0.01</td><td>0.61± 0.02</td><td>0.67 ± 0.01</td><td>0.77±0.01</td><td>0.77 ± 0.01</td></tr><tr><td>Twonorm</td><td>1, 1.2</td><td>0.68 ±0.04</td><td>0.50 ±0.02</td><td>0.43 ±0.03</td><td>0.82 ± 0.04</td><td>0.88 ± 0.01</td><td>0.91 ± 0.02</td><td>0.98 ± 0.01</td></tr><tr><td>Breast Cancer</td><td>5,1.0</td><td>0.66 ± 0.02</td><td>0.67±0.02</td><td>0.52 ±0.03</td><td>0.60±0.03</td><td>0.60±0.02</td><td>0.71 ± 0.02</td><td>0.70 ± 0.01</td></tr><tr><td>Arrhythmia</td><td>-</td><td>0.79±0.01</td><td>0.83±0.01</td><td>0.81±0.02</td><td>0.66±0.04</td><td>0.85±0.02</td><td>0.85±.01</td><td>0.85±0.02</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 1: Noise model: probability of an error occurring depends linearly on an input feature. We report the class weighted mean f1 score on the noise-free test set along with the standard error.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Dataset</td><td>Noise Parameters (col,α)</td><td>LR-N</td><td>NHERD</td><td>PAM</td><td>ULE</td><td>AE (learned)</td><td>AE (known)</td><td>LR-C</td></tr><tr><td>Lin-Sep</td><td>1,1.2</td><td>0.40±0.01</td><td>0.53± 0.04</td><td>0.62±0.03</td><td>0.61 ±0.02</td><td>0.93±0.01</td><td>0.96±0.01</td><td>0.96±0.01</td></tr><tr><td>Diabetes</td><td>5,1.2</td><td>0.62±0.01</td><td>0.59±0.01</td><td>0.67±0.01</td><td>0.71±0.01</td><td>0.66±0.03</td><td>0.69±0.01</td><td>0.72±0.02</td></tr><tr><td>German</td><td>1, 1.2</td><td>0.60±0.02</td><td>0.72 ± 0.01</td><td>0.60 ± 0.01</td><td>0.67 ± 0.01</td><td>0.68 ±0.03</td><td>0.73±0.03</td><td>0.76 ± 0.02</td></tr><tr><td>Image</td><td>1,0.7</td><td>0.55 ± 0.02</td><td>0.64 ± 0.01</td><td>0.57 ± 0.01</td><td>0.60 ±0.03</td><td>0.74 ± 0.01</td><td>0.77 ± 0.01</td><td>0.77 ± 0.01</td></tr><tr><td>Twonorm</td><td>1, 1.2</td><td>0.90±0.03</td><td>0.55 ± 0.02</td><td>0.86±0.01</td><td>0.94 ± 0.01</td><td>0.96±0.01</td><td>0.97 ± 0.01</td><td>0.98 ± 0.01</td></tr><tr><td>Breast Cancer</td><td>5,1.0</td><td>0.60±0.02</td><td>0.60 ±0.02</td><td>0.63±0.02</td><td>0.63±0.03</td><td>0.65 ±0.03</td><td>0.66 ±0.01</td><td>0.70± 0.01</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Table 2: Noise model: probability of an error occurring depends quadratically on an input feature.
|
| 169 |
+
We report the class weighted mean f1 score on the noise-free test set along with the standard error.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Dataset</td><td>Noise Parameters (α)</td><td>LR-N</td><td>NHERD</td><td>PAM</td><td>ULE</td><td>AE(known)</td><td>LR-C</td></tr><tr><td>Lin-Sep</td><td>0.7</td><td>0.39±0.01</td><td>0.41 ± 0.01</td><td>0.53±0.02</td><td>0.85±0.01</td><td>0.94±0.01</td><td>0.96±0.01</td></tr><tr><td>Diabetes</td><td>0.7</td><td>0.56±0.01</td><td>0.53±0.03</td><td>0.50±0.02</td><td>0.55±0.02</td><td>0.68±0.02</td><td>0.72 ±0.02</td></tr><tr><td>German</td><td>0.7</td><td>0.57± 0.01</td><td>0.70±0.01</td><td>0.47 ± 0.01</td><td>0.60 ± 0.01</td><td>0.72 ± 0.01</td><td>0.76±0.02</td></tr><tr><td>Image</td><td>0.7</td><td>0.43 ± 0.01</td><td>0.61 ± 0.01</td><td>0.45 ±0.02</td><td>0.43 ± 0.01</td><td>0.74±0.03</td><td>0.77 ± 0.01</td></tr><tr><td>Twonorm</td><td>0.5</td><td>0.52 ±0.03</td><td>0.51±0.03</td><td>0.52 ±0.03</td><td>0.51 ± 0.04</td><td>0.88±0.03</td><td>0.98 ±0.01</td></tr><tr><td>Breast Cancer</td><td>0.7</td><td>0.62 ± 0.02</td><td>0.62 ±0.02</td><td>0.46 ±0.02</td><td>0.63±0.02</td><td>0.66 ±0.04</td><td>0.70± 0.01</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 3: Noise model: probability of an error occurring depends linearly on the distance from class boundary (which is defined by the clean dataset before noise is synthetically introduced). We report the class weighted mean f1 score on the noise-free test set along with the standard error.
|
| 174 |
+
|
| 175 |
+
Table 4: We compare the label re-weighting scheme of Ren et al. (2018) with our proposed model. The models compared for different sizes of clean dataset and different noise rates $\alpha$ . The base model in each case is a standard LeNet as in Ren et al. (2018)
|
| 176 |
+
|
| 177 |
+
<table><tr><td>% Clean data</td><td>Noise Parameter (α)</td><td>AE(known)</td><td>Ren et al. (2018)</td><td>No noise model</td></tr><tr><td>1</td><td>0.1</td><td>98.28±0.01</td><td>93.27±0.01</td><td>90.87±0.05</td></tr><tr><td>1</td><td>0.8</td><td>98.14± 0.00</td><td>91.27 ± 0.01</td><td>87.32 ± 0.03</td></tr><tr><td>5</td><td>0.1</td><td>98.77 ± 0.00</td><td>93.44 ± 0.01</td><td>91.01 ± 0.02</td></tr><tr><td>5</td><td>0.8</td><td>98.65 ± 0.00</td><td>91.29 ± 0.01</td><td>88.85 ± 0.02</td></tr><tr><td>10</td><td>0.1</td><td>98.93 ± 0.00</td><td>94.87 ± 0.03</td><td>90.99 ±0.02</td></tr><tr><td>10</td><td>0.8</td><td>98.54 ± 0.01</td><td>91.77 ± 0.02</td><td>90.16 ± 0.03</td></tr></table>
|
| 178 |
+
|
| 179 |
+
methods. The success of the model in this setting suggests its unique robustness to feature-dependent noise.
|
| 180 |
+
|
| 181 |
+
# 6 CONCLUSION
|
| 182 |
+
|
| 183 |
+
We have proposed an energy-based framework to correct mislabelled training instances. By minimizing a contrastive loss, the proposed method learns a representation that is valuable in relabeling noisy training sets. We evaluate the proposed model across six datasets and three noise models to demonstrate the method’s empirical value in correcting feature-dependent label noise. Furthermore, we demonstrate our method’s improvement upon existing work in making machine learning more robust to label noise processes.
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
Dana Angluin and Philip Laird. Learning from noisy examples. Machine Learning, 2(4):343–370, 1988.
|
| 188 |
+
|
| 189 |
+
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.
|
| 190 |
+
|
| 191 |
+
Eyal Beigman and Beata Beigman Klebanov. Learning with annotation noise. In Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP: Volume 1 - Volume 1, ACL ’09, pp. 280–287, Stroudsburg, PA, USA, 2009. Association for Computational Linguistics. ISBN 978-1- 932432-45-9. URL http://dl.acm.org/citation.cfm?id=1687878.1687919.
|
| 192 |
+
|
| 193 |
+
Beata Beigman Klebanov and Eyal Beigman. From annotator agreement to noise models. Comput. Linguist., 35(4):495–503, December 2009. ISSN 0891-2017. doi: 10.1162/coli.2009.35.4.35402. URL http://dx.doi.org/10.1162/coli.2009.35.4.35402.
|
| 194 |
+
|
| 195 |
+
Yoshua Bengio, Rejean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic´ language model. Journal of machine learning research, 3(Feb):1137–1155, 2003.
|
| 196 |
+
|
| 197 |
+
David Berthelot, Thomas Schumm, and Luke Metz. Began: boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017.
|
| 198 |
+
|
| 199 |
+
A. Blum, A. Frieze, R. Kannan, and S. Vempala. A polynomial-time algorithm for learning noisy linear threshold functions. Algorithmica, 22(1):35–52, Sep 1998. ISSN 1432-0541. doi: 10.1007/ PL00013833. URL https://doi.org/10.1007/PL00013833.
|
| 200 |
+
|
| 201 |
+
Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In Proceedings of the Eleventh Annual Conference on Computational Learning Theory, COLT’ 98, pp. 92–100, New York, NY, USA, 1998. ACM. ISBN 1-58113-057-0. doi: 10.1145/279943.279962. URL http://doi.acm.org/10.1145/279943.279962.
|
| 202 |
+
|
| 203 |
+
Carla E. Brodley and Mark A. Friedl. Identifying mislabeled training data. J. Artif. Int. Res., 11(1): 131–167, July 1999. ISSN 1076-9757. URL http://dl.acm.org/citation.cfm?id= 3013545.3013548.
|
| 204 |
+
|
| 205 |
+
Tom Bylander. Learning linear threshold functions in the presence of classification noise. In In Proceedings of the Seventh Annual Workshop on Computational Learning Theory, pp. 340–347. ACM Press, 1994.
|
| 206 |
+
|
| 207 |
+
Tom Bylander. Learning probabilistically consistent linear threshold functions. In Proceedings of the Tenth Annual Conference on Computational Learning Theory, COLT ’97, pp. 62–71, New York, NY, USA, 1997. ACM. ISBN 0-89791-891-6. doi: 10.1145/267460.267479. URL http: //doi.acm.org/10.1145/267460.267479.
|
| 208 |
+
|
| 209 |
+
Tom Bylander. Learning noisy linear threshold functions. Submitted for journal publication, 1998.
|
| 210 |
+
|
| 211 |
+
Miguel A Carreira-Perpinan and Geoffrey E Hinton. On contrastive divergence learning. In Aistats, volume 10, pp. 33–40. Citeseer, 2005.
|
| 212 |
+
|
| 213 |
+
Raj S. Chhikara and Jim McKeon. Linear discriminant analysis with misallocation in training samples. Journal of the American Statistical Association, 79(388):899–906, 1984. ISSN 01621459. URL http://www.jstor.org/stable/2288722.
|
| 214 |
+
|
| 215 |
+
E. Cohen. Learning noisy perceptrons by a perceptron in polynomial time. In Proceedings 38th Annual Symposium on Foundations of Computer Science, pp. 514–523, Oct 1997. doi: 10.1109/ SFCS.1997.646140.
|
| 216 |
+
|
| 217 |
+
Koby Crammer and Daniel D Lee. Learning via gaussian herding. In Advances in neural information processing systems, pp. 451–459, 2010.
|
| 218 |
+
|
| 219 |
+
Thierry Denoeux. A k-nearest neighbor classification rule based on dempster-shafer theory. IEEE Transactions on Systems, Man, and Cybernetics, 25(5):804–813, May 1995. ISSN 0018-9472. doi: 10.1109/21.376493.
|
| 220 |
+
|
| 221 |
+
Thierry Denoeux. Analysis of evidence-theoretic decision rules for pattern classification. Pattern Recogn., 30(7):1095–1107, July 1997. ISSN 0031-3203. doi: 10.1016/S0031-3203(96)00137-9. URL http://dx.doi.org/10.1016/S0031-3203(96)00137-9.
|
| 222 |
+
|
| 223 |
+
Thierry Denoeux. A neural network classifier based on dempster-shafer theory. IEEE Transactions on Systems, Man, and Cybernetics - Part A: Systems and Humans, 30(2):131–150, Mar 2000. ISSN 1083-4427. doi: 10.1109/3468.833094.
|
| 224 |
+
|
| 225 |
+
Yifan Ding, Liqiang Wang, Deliang Fan, and Boqing Gong. A semi-supervised two-stage approach to learning from noisy labels. arXiv preprint arXiv:1802.02679, 2018.
|
| 226 |
+
|
| 227 |
+
B. Frenay and M. Verleysen. Classification in the presence of label noise: A survey. ´ IEEE Transactions on Neural Networks and Learning Systems, 25(5):845–869, May 2014. ISSN 2162-237X. doi: 10.1109/TNNLS.2013.2292894.
|
| 228 |
+
|
| 229 |
+
Benoˆıt Frenay and Michel Verleysen. Classification in the presence of label noise: a survey. ´ IEEE transactions on neural networks and learning systems, 25(5):845–869, 2014.
|
| 230 |
+
|
| 231 |
+
Aritra Ghosh, Naresh Manwani, and P.S. Sastry. Making risk minimization tolerant to label noise. Neurocomputing, 160:93 – 107, 2015. ISSN 0925-2312. doi: https://doi.org/10.1016/ j.neucom.2014.09.081. URL http://www.sciencedirect.com/science/article/ pii/S0925231215001204.
|
| 232 |
+
|
| 233 |
+
Ary L Goldberger, Luis AN Amaral, Leon Glass, Jeffrey M Hausdorff, Plamen Ch Ivanov, Roger G Mark, Joseph E Mietus, George B Moody, Chung-Kang Peng, and H Eugene Stanley. Physiobank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals. Circulation, 101(23):e215–e220, 2000.
|
| 234 |
+
|
| 235 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT Press, 2016.
|
| 236 |
+
|
| 237 |
+
Zaven S. Khachaturian. Diagnosis of alzheimer’s disease. Archives of Neurology, 42(11):1097– 1105, 1985. doi: 10.1001/archneur.1985.04060100083029. URL $^ +$ http://dx.doi.org/ 10.1001/archneur.1985.04060100083029.
|
| 238 |
+
|
| 239 |
+
Aleksander Kolcz and Gordon V. Cormack. Genre-based decomposition of email class noise. In Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’09, pp. 427–436, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-495- 9. doi: 10.1145/1557019.1557070. URL http://doi.acm.org/10.1145/1557019. 1557070.
|
| 240 |
+
|
| 241 |
+
Peter A. Lachenbruch. Discriminant analysis when the initial samples are misclassified. Technometrics, 8(4):657–662, 1966. ISSN 00401706. URL http://www.jstor.org/stable/ 1266637.
|
| 242 |
+
|
| 243 |
+
Peter A. Lachenbruch. Discriminant analysis when the initial samples are misclassified ii: Nonrandom misclassification models. Technometrics, 16(3):419–424, 1974. ISSN 00401706. URL http://www.jstor.org/stable/1267672.
|
| 244 |
+
|
| 245 |
+
Yann LeCun, Sumit Chopra, Raia Hadsell, M Ranzato, and F Huang. A tutorial on energy-based learning. Predicting structured data, 1(0), 2006.
|
| 246 |
+
|
| 247 |
+
Tongliang Liu and Dacheng Tao. Classification with noisy labels by importance reweighting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38, 11 2014.
|
| 248 |
+
|
| 249 |
+
Philip M. Long and Rocco A. Servedio. Random classification noise defeats all convex potential boosters. Machine Learning, 78(3):287–304, Mar 2010. ISSN 1573-0565. doi: 10.1007/ s10994-009-5165-z. URL https://doi.org/10.1007/s10994-009-5165-z.
|
| 250 |
+
|
| 251 |
+
V Mondejar-Guerra, J Novo, J Rouco, MG Penedo, and M Ortega. Heartbeat classification fusing ´ temporal and morphological information of ecgs via ensemble of classifiers. Biomedical Signal Processing and Control, 47:41–48, 2019.
|
| 252 |
+
|
| 253 |
+
Kevin P Murphy. Machine learning: a probabilistic perspective. The MIT Press, Cambridge, MA, 2012.
|
| 254 |
+
|
| 255 |
+
Melissa E. Murray, Adel Aziz, Owen A. Ross, Ranjan Duara, Dennis W. Dickson, and Neill R. Graff-Radford. Alzheimer’s disease may not be more common in women; men may be more commonly misdiagnosed. Alzheimer’s & Dementia: The Journal of the Alzheimer’s Association, 12(7):1097–1105, 2016. doi: doi:10.1016/j.jalz.2016.06.527. URL http://dx.doi.org/ 10.1016/j.jalz.2016.06.527.
|
| 256 |
+
|
| 257 |
+
Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. In Advances in neural information processing systems, pp. 1196–1204, 2013.
|
| 258 |
+
|
| 259 |
+
C. G. Northcutt, T. Wu, and I. L. Chuang. Learning with Confident Examples: Rank Pruning for Robust Classification with Noisy Labels. In Uncertainty in Artificial Intelligence, August 2017.
|
| 260 |
+
|
| 261 |
+
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 Proc. IEEE Conf. Comput. Vis. Pattern Recognit.(CVPR), pp. 2233–2241, 2017.
|
| 262 |
+
|
| 263 |
+
Umaa Rebbapragada and Carla Brodley. Class noise mitigation through instance weighting. In Machine Learning: ECML 2007: 18th European Conference on Machine Learning, pp. 708–715, 09 2007a.
|
| 264 |
+
|
| 265 |
+
Umaa Rebbapragada and Carla E Brodley. Class noise mitigation through instance weighting. In European Conference on Machine Learning, pp. 708–715. Springer, 2007b.
|
| 266 |
+
|
| 267 |
+
Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. CoRR, abs/1803.09050, 2018. URL http://arxiv.org/abs/1803. 09050.
|
| 268 |
+
|
| 269 |
+
David Rolnick, Andreas Veit, Serge Belongie, and Nir Shavit. Deep learning is robust to massive label noise. arXiv preprint arXiv:1705.10694, 2017.
|
| 270 |
+
|
| 271 |
+
Brendan van Rooyen, Aditya Krishna Menon, and Robert C. Williamson. Learning with symmetric label noise: The importance of being unhinged. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, NIPS’15, pp. 10–18, Cambridge, MA, USA, 2015. MIT Press. URL http://dl.acm.org/citation.cfm?id= 2969239.2969241.
|
| 272 |
+
|
| 273 |
+
Joseph L. Schafer and John W. Graham. Missing data: our view of the state of the art. Psychological Methods, 7 2:147–77, 2002.
|
| 274 |
+
|
| 275 |
+
Rocco A Servedio. On pac learning using winnow, perceptron, and a perceptron-like algorithm. In Proceedings of the twelfth annual conference on Computational learning theory, pp. 296–307. ACM, 1999.
|
| 276 |
+
|
| 277 |
+
Padhraic Smyth. Bounds on the mean classification error rate of multiple experts. Pattern Recognition Letters, 17(12):1253 – 1257, 1996. ISSN 0167-8655. doi: https://doi.org/ 10.1016/0167-8655(96)00105-5. URL http://www.sciencedirect.com/science/ article/pii/0167865596001055.
|
| 278 |
+
|
| 279 |
+
Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. arXiv preprint arXiv:1406.2080, 2014.
|
| 280 |
+
|
| 281 |
+
Jiang-wen Sun, Feng-ying Zhao, Chong-jun Wang, and Shi-fu Chen. Identifying and correcting mislabeled training instances. In Future generation communication and networking (FGCN 2007), volume 1, pp. 244–250. IEEE, 2007.
|
| 282 |
+
|
| 283 |
+
Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
|
| 284 |
+
|
| 285 |
+
Xingquan Zhu and Xindong Wu. Class noise vs. attribute noise: A quantitative study. Artificial Intelligence Review, 22(3):177–210, Nov 2004. ISSN 1573-7462. doi: 10.1007/s10462-004-0751-8. URL https://doi.org/10.1007/s10462-004-0751-8.
|
| 286 |
+
|
| 287 |
+
# APPENDICES
|
| 288 |
+
|
| 289 |
+
# A EFFECT OF LABEL NOISE ON EMPIRICAL RISK
|
| 290 |
+
|
| 291 |
+
Here we show how label noise affects optimization of empirical risk. Recall that our task is to improve the labels of a training set in order to enable effective learning. In the following sections, we explore the Type I, Type II, and Type III noise. We first introduce the key variables.
|
| 292 |
+
|
| 293 |
+
We focus on binary classification, where the probability of class 0 is $p$ and consequently, the probability of class 1 is $( 1 - p )$ :
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\begin{array} { l c l } { { p ( y = 0 ) } } & { { = } } & { { p } } \\ { { p ( y = 1 ) } } & { { = } } & { { 1 - p } } \end{array}
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
$\tau$ represents the training set with correct labels, while $\tilde { \tau }$ represents the training set with label noise. In our setting, we are given $\tilde { \tau }$ and propose a method to transform $\tilde { \tau }$ into $\tau$ . We will call $D$ the true label distribution and $\tilde { P }$ the noisy label distribution.
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\begin{array} { r l r } { \mathcal { T } } & { = } & { \{ ( { \bf X } _ { i } , Y _ { i } ) \mathrm { f o r } i = 1 , 2 , \ldots , n \} } \\ { \tilde { \mathcal { T } } } & { = } & { \{ ( { \bf X } _ { i } , \tilde { Y } _ { i } ) \mathrm { f o r } i = 1 , 2 , \ldots , n \} } \end{array}
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
In the following calculations, we describe the difference in empirical risks over each training set and the subsequent effect on stochastic gradient descent. We refer to the empirical risk over the clean training set as $\hat { R } \left[ \ell , \mathcal { T } \right]$ . Similarly, we refer to the empirical risk over the corrupted training set as ${ \hat { R } } \left[ \ell , { \tilde { \mathcal { T } } } \right]$ .
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
{ \hat { R } } \left[ \ell , { \mathcal { T } } \right] = { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } \ell \left( \Phi ( \mathbf { X } _ { i } , \pmb { \theta } ) , Y _ { i } \right) ,
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
In order to explain the effects of label noise on stochastic gradient descent (SGD), we are primarily interested in the gradient of the empirical risk with respect to $\theta$ . Below, we break the empirical risk term into two class-dependent terms and introduce short-hand to represent each of these terms.
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r c l } { \Xi _ { ( \mathbf x , \nabla ) \times \big [ } \nabla _ { \mathbf e } \hat { R } _ { \xi } , \mathcal { t } \big ] } & { = } & { \Xi _ { ( \mathbf x , \nabla ) \times \big [ } \nabla _ { \mathbf e } \frac { 1 } { \omega _ { \mathbf x } } \frac { \cos \big [ \hat { \pi } _ { \mathbf e } \big ] } { \omega _ { \mathbf x } } \big [ \langle \mathbf i \nabla _ { \mathbf e } \hat { R } _ { \xi } , \theta \rangle , \mathcal { t } \big ] } \\ & { = } & { \displaystyle \nabla _ { \mathbf e } \frac { 1 } { \omega _ { \mathbf x } } \frac { \cos \big [ \hat { \pi } _ { \mathbf e } \hat { \mathbf \nu } _ { \xi } \big ] } { \omega _ { \mathbf x } - 1 } \mathbb E _ { \mathbf x \nabla \cdot \nabla \cdot \nabla \cdot \big [ \hat { \pi } _ { \mathbf e } \hat { R } _ { \xi } \big ] } \big [ \langle \mathbf i \nabla _ { \mathbf e } \hat { R } _ { \xi } , \theta \rangle , \mathcal { t } \big ] } \\ & { = } & { \displaystyle \nabla _ { \mathbf e } \left[ \frac { 1 } { \omega _ { \mathbf x } } \frac { \cos \big [ \hat { \pi } _ { \mathbf e } \hat { \mathbf \nu } _ { \xi } \big ] } { \omega _ { \mathbf x } - 1 } \int \rho ( \mathbf i \nabla _ { \mathbf x } \cdot \nabla ) _ { \mathbf e } \hat { \nu } ( \langle \mathbf i \nabla _ { \mathbf e } \hat { \mathbf a } , \theta \rangle , \mathcal { t } ) \mathbb { A } _ { \mathbf x } \mathcal { A } _ { \mathbf x } \right] } \\ & { = } & { \displaystyle \nabla _ { \mathbf e } \left[ \frac { 1 } { \omega _ { \mathbf x } } \frac { \sin } { \omega _ { \mathbf x } } \int \rho ( \mathbf i \kappa _ { \xi } | \delta ) \mathbf j \cdot \nabla \langle \mathbf i \nabla _ { \mathbf e } \hat { \mathbf a } , \theta \rangle , \mathcal { t } \right] \mathbb { A } _ { \mathbf x } \mathcal { A } _ { \mathbf x } \mathcal { A } _ { \mathbf y } } \\ & { = } & { \displaystyle \rho ( \hat { \nu } _ { \mathbf e } \hat { \mathbf \nu } _ { \xi } ( \mathbf i ) ) \nabla _ { \mathbf e } \left[ \frac { 1 } { \kappa _ { \mathrm { d e f . } } } \int \gamma ( \mathbf s _ { \mathbf x } | \delta ) j _ { \mathbf x } ( \hat { \nu } _ { \mathbf e } \hat { \mathbf a } ) \hat { \nu } _ { \mathbf e } \right] } \\ & + \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
We define shorthand based on Equation (5):
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { r l r } & { } & { \beta _ { 0 } = \nabla _ { \pmb { \theta } } \left[ \frac { 1 } { n } \displaystyle \sum _ { i = 1 } ^ { n } \int p ( \mathbf { x } _ { i } | 0 ) \ell _ { 0 } \left( \Phi ( \mathbf { x } _ { i } , \pmb { \theta } ) \right) d \mathbf { x } _ { i } \right] } \\ & { } & { \beta _ { 1 } = \nabla _ { \pmb { \theta } } \left[ \frac { 1 } { n } \displaystyle \sum _ { i = 1 } ^ { n } \int p ( \mathbf { x } _ { i } | 1 ) \ell _ { 1 } \left( \Phi ( \mathbf { x } _ { i } , \pmb { \theta } ) \right) d \mathbf { x } _ { i } \right] . } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Rewriting the original equation in terms of the above, we arrive at the following form for empirical risk:
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { r } { \mathbb { E } _ { ( \mathbf { X } , Y ) \sim D } \left[ \nabla _ { \theta } \hat { R } [ \ell , \mathcal { T } ] \right] = p ( y _ { i } = 0 ) \beta _ { 0 } + p ( y _ { i } = 1 ) \beta _ { 0 } } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
We revisit Equation 8 in the follow sections to interpret empirical risk under varying noise models. Note that $\beta _ { 0 }$ and $\beta _ { 1 }$ are the same in both the expected empirical risk with respect to the true label distribution $( D )$ and the corrupted label distribution $( \tilde { P } )$ for Type I and Type II noise. Additionally, we introduce shorthand for the true expectation of empirical risk $( \mathbb { E } _ { t r u e } )$ and the expectation of empirical risk when labels are assigned at random $( \mathbb { E } _ { r a n d } )$ .
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\begin{array} { r c l } { { \mathbb { E } _ { t r u e } } } & { { = } } & { { p \beta _ { 0 } + ( 1 - p ) \beta _ { 1 } } } \\ { { \mathbb { E } _ { r a n d } } } & { { = } } & { { . 5 \beta _ { 0 } + . 5 \beta _ { 1 } } } \end{array}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
# A.1 TYPE I: RANDOM NOISE
|
| 336 |
+
|
| 337 |
+
In the random noise scenario, each label has an equal probability of being flipped. We parameterize this noise by $\gamma$ , resulting in :
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\gamma = p ( \tilde { y } _ { i } \ne y _ { i } )
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
We may define both $p ( \tilde { y } _ { i } = 0 )$ in terms of $\gamma$ and $p$ :
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\begin{array} { l c l } { { p ( \tilde { y } _ { i } = 0 ) } } & { { = } } & { { p ( \tilde { y } _ { i } = 0 | y _ { i } = 0 ) + p ( \tilde { y } _ { i } = 0 | y _ { i } = 1 ) } } \\ { { p ( \tilde { y } _ { i } = 0 ) } } & { { = } } & { { ( 1 - \gamma ) p + \gamma ( 1 - p ) } } \end{array}
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
Likewise, we define $p ( \tilde { y } _ { i } = 1 )$ as:
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\begin{array} { l c l } { { p ( \tilde { y } _ { i } = 1 ) } } & { { = } } & { { p ( \tilde { y } _ { i } = 1 | y _ { i } = 0 ) + p ( \tilde { y } _ { i } = 1 | y _ { i } = 1 ) } } \\ { { p ( \tilde { y } _ { i } = 1 ) } } & { { = } } & { { \gamma p + ( 1 - \gamma ) ( 1 - p ) } } \end{array}
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
Below, we substitute these expressions into Equation 8:
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\begin{array} { r l } { \mathbb { E } _ { ( \mathbf { X } , \widetilde { Y } ) \sim \widetilde { P } } \left[ \nabla _ { \theta } \hat { R } [ \ell , \widetilde { \mathcal { T } } ] \right] } & { = \ p ( \tilde { y } _ { i } = 0 ) \beta _ { 0 } + p ( \tilde { y } _ { i } = 1 ) \beta _ { 0 } } \\ & { = \ ( ( 1 - \gamma ) p + \gamma - \gamma p ) \beta _ { 0 } + \left( ( 1 - \gamma ) \left( 1 - p \right) + \gamma p \right) \beta _ { 1 } } \\ & { = \ p \ \beta _ { 0 } - 2 \gamma p \beta _ { 0 } + \gamma \beta _ { 0 } + \beta _ { 1 } - \gamma \beta _ { 1 } - p \beta _ { 1 } + 2 \gamma p \beta _ { 1 } } \\ & { = \ p \beta _ { 0 } + \beta _ { 1 } - p \beta _ { 1 } - 2 \gamma p \beta _ { 0 } - \gamma \beta _ { 1 } + 2 \gamma p \beta _ { 1 } + \gamma \beta _ { 0 } } \\ & { = \ \mathbb { E } _ { t r u e } - 2 \gamma p \beta _ { 0 } - \gamma \beta _ { 1 } + 2 \gamma p \beta _ { 1 } + \gamma \beta _ { 0 } } \\ & { = \ \mathbb { E } _ { t r u e } - 2 \gamma p \beta _ { 0 } - \gamma \beta _ { 1 } + 2 \gamma p \beta _ { 1 } + \gamma \beta _ { 0 } - \gamma \beta _ { 1 } + \gamma \beta _ { 1 } } \\ & { = \ \mathbb { E } _ { t r u e } - 2 \gamma p \beta _ { 0 } - 2 \gamma \beta _ { 1 } + 2 \gamma p \beta _ { 1 } + \gamma \beta _ { 0 } + \gamma \beta _ { 1 } } \\ & { = \ \mathbb { E } _ { t r u e } - 2 \gamma p \beta _ { 0 } - 2 \gamma \beta _ { 1 } + 2 \gamma p \beta _ { 1 } + \gamma \beta _ { 0 } + \gamma \beta _ { 1 } } \\ & { = \ \mathbb { E } _ { t r u e } - 2 \gamma \left( p \beta _ { 0 } + \beta _ { 1 } - p \beta _ { 1 } \right) + \gamma \beta _ { 1 } + \gamma \beta _ { 0 } } \\ & { = \ ( 1 - 2 \gamma ) \mathbb { E } _ { t r u e } + 2 \gamma \mathbb { E } _ { n a d } } \end{array}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
# A.2 TYPE II NOISE
|
| 362 |
+
|
| 363 |
+
Type II noise implies class-dependent label noise. Thus, we define $\gamma _ { 0 }$ and $\gamma _ { 1 }$ , the class-dependent noise rates. In addition, we define $\gamma ^ { * }$ as the average class-dependent noise rate and $\epsilon$ as the absolute distance of $\gamma _ { 0 }$ and $\gamma _ { 1 }$ from $\gamma ^ { * }$ . Without loss of generality, we assume $\gamma _ { 0 } > \gamma _ { 1 }$ .
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\begin{array} { r c l } { { \gamma _ { 0 } } } & { { = } } & { { p ( \tilde { y } _ { i } = 1 | y _ { i } = 0 ) } } \\ { { \gamma _ { 1 } } } & { { = } } & { { p ( \tilde { y } _ { u } = 0 | y _ { i } = 1 ) } } \\ { { \gamma ^ { * } } } & { { = } } & { { \displaystyle \frac { \gamma _ { 0 } + \gamma _ { 1 } } { 2 } } } \\ { { \epsilon } } & { { = } } & { { \displaystyle \frac { \gamma _ { 0 } - \gamma _ { 1 } } { 2 } } } \end{array}
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
We may redefine $p ( \tilde { y } _ { i } = 0 )$ and $p ( \tilde { y } _ { i } = 1 )$ using these terms:
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\begin{array} { r c l } { p ( \tilde { y } _ { i } = 0 ) } & { = } & { \left( \left( 1 - \gamma _ { 0 } \right) p + \gamma _ { 1 } \left( 1 - p \right) \right) } \\ & { = } & { \left( \left( 1 - \gamma ^ { * } - \epsilon \right) p + \left( \gamma ^ { * } - \epsilon \right) \left( 1 - p \right) \right) } \\ & { = } & { \left( p - \gamma ^ { * } p - \epsilon p + \gamma ^ { * } - \gamma ^ { * } p - \epsilon + \epsilon p \right) } \end{array}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
\begin{array} { l c l } { p ( \tilde { y } _ { i } = 1 ) } & { = } & { \left( \left( 1 - \gamma _ { 1 } \right) \left( 1 - p \right) + \gamma _ { 0 } p \right) } \\ & { = } & { \left( \left( 1 - \gamma ^ { * } + \epsilon \right) \left( 1 - p \right) + \left( \gamma ^ { * } + \epsilon \right) p \right) } \\ & { = } & { \left( 1 - \gamma ^ { * } + \epsilon - p + \gamma ^ { * } p - \epsilon p + \gamma ^ { * } p + \epsilon p \right) } \end{array}
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
Plugging this into Equation 8,
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\begin{array} { r c l } { \mathbb { E } _ { ( { \bf X } , \tilde { Y } ) \sim \tilde { P } } \left[ \nabla _ { \theta } \hat { R } [ \ell , \tilde { \mathcal { T } } ] \right] } & { = } & { ( p - \gamma ^ { * } p - \epsilon p + \gamma ^ { * } - \gamma ^ { * } p - \epsilon + \epsilon p ) \beta _ { 0 } } \\ & { + } & { ( 1 - \gamma ^ { * } + \epsilon - p + \gamma ^ { * } p - \epsilon p + \gamma ^ { * } p + \epsilon p ) \beta _ { 1 } } \\ & { = } & { ( p - 2 \gamma ^ { * } p + \gamma ^ { * } - \epsilon ) \beta _ { 0 } } \\ & { + } & { ( 1 - 2 \gamma ^ { * } + \epsilon - p + 2 \gamma ^ { * } p + \gamma ^ { * } ) \beta _ { 1 } } \end{array}
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
Similar to our approach with Type I noise, we aim to rephrase this equation in terms of $\mathbb { E } _ { t r u e }$ and Erand.
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\begin{array} { r l } { = } & { { } \left( 1 - 2 \gamma ^ { * } \right) p \beta _ { 0 } + \left( \gamma ^ { * } - \epsilon \right) \beta _ { 0 } + \left( 1 - 2 \gamma ^ { * } \right) \left( 1 - p \right) \beta _ { 1 } + \left( \epsilon + \gamma ^ { * } \right) \beta _ { 1 } } \\ { = } & { { } \left( 1 - 2 \gamma ^ { * } \right) \mathbb { E } _ { t r u e } + \left( \gamma ^ { * } - \epsilon \right) \beta _ { 0 } + \left( \epsilon + \gamma ^ { * } \right) \beta _ { 1 } } \\ { = } & { { } \left( 1 - 2 \gamma ^ { * } \right) \mathbb { E } _ { t r u e } + 2 \gamma ^ { * } \mathbb { E } _ { r a n d } + \epsilon \left( \beta _ { 1 } - \beta _ { 0 } \right) } \end{array}
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
# A.3 TYPE III NOISE
|
| 392 |
+
|
| 393 |
+
In this section, we analyze a specific case of type III noise where label corruption is restricted to a given region of the feature space. As above, we want to study the effect on learning by determining how the true gradient is modified in the presence of noise. We assume a scalar input space and define the feature dependent noise as follows:
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
p ( \tilde { y } _ { i } | x ) = \left\{ \begin{array} { l l } { \gamma } & { x \in [ a , b ] } \\ { 0 } & { x \notin [ a , b ] } \end{array} \right\}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
The noise model above asserts that label noise depends only on the feature space and is labelagnostic - thus, examples from both class 1 and class 0 with $x \in [ a , b ]$ are equally likely to suffer from a label flip.
|
| 400 |
+
|
| 401 |
+
Revisiting
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\begin{array} { r c l } { \mathbb { E } _ { ( \mathbf { X } , \boldsymbol { \tilde { Y } } ) \sim \tilde { P } } \left[ \nabla _ { \theta } \hat { R } [ \ell , \tilde { T } ] \right] } & { = } & { \nabla _ { \theta } \left[ \displaystyle \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \int p ( \tilde { y } _ { i } | x _ { i } ) p ( x _ { i } ) \ell \left( \Phi ( x _ { i } , \pmb { \theta } ) , \tilde { y } _ { i } \right) d x _ { i } d \tilde { y } _ { i } \right] , } \\ & { = } & { \nabla _ { \theta } \left[ \displaystyle \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \int _ { a } ^ { b } p ( \tilde { y } _ { i } | x _ { i } ) p ( x _ { i } ) \ell \left( \Phi ( x _ { i } , \pmb { \theta } ) , \tilde { y } _ { i } \right) d x _ { i } d \tilde { y } _ { i } \right] } \\ & { + } & { \nabla _ { \theta } \left[ \displaystyle \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \int _ { x \not \in [ a , b ] } p ( y _ { i } | x _ { i } ) p ( x _ { i } ) \ell \left( \Phi ( x _ { i } , \pmb { \theta } ) , \tilde { y } _ { i } \right) d x _ { i } d \tilde { y } _ { i } \right] . } \end{array}
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
Now we add and subtract the following term:
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\nabla _ { \pmb \theta } \left[ \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \int _ { a } ^ { b } p ( y _ { i } | x _ { i } ) p ( x _ { i } ) \ell \left( \Phi ( x _ { i } , \pmb \theta ) , \tilde { y } _ { i } \right) d x _ { i } d \tilde { y } _ { i } \right]
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
In order to obtain:
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\begin{array} { r c l } { \displaystyle \Xi _ { ( \mathbf { X } , \tilde { Y } ) \sim \tilde { P } } \left[ \nabla _ { \theta } \hat { R } [ \ell , \tilde { \mathcal { T } } ] \right] } & { = } & { \displaystyle \mathbb { E } _ { t r u e } + \nabla _ { \theta } \left[ \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \int _ { a } ^ { b } p \big ( \tilde { y } _ { i } | x _ { i } \big ) p \big ( x _ { i } \big ) \ell \big ( \Phi ( x _ { i } , \theta ) , \tilde { y } _ { i } \big ) \ d x _ { i } d \tilde { y } _ { i } \right] } \\ & { - } & { \displaystyle \nabla _ { \theta } \left[ \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \int _ { a } ^ { b } p ( y _ { i } | x _ { i } ) p \big ( x _ { i } \big ) \ell \big ( \Phi ( x _ { i } , \theta ) , \tilde { y } _ { i } \big ) \ d x _ { i } d \tilde { y } _ { i } \right] } \\ & { = } & { \displaystyle \mathbb { E } _ { t r u e } + \nabla _ { \theta } \left[ \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \int _ { a } ^ { b } \big ( p \big ( \tilde { y } _ { i } | x _ { i } \big ) - p \big ( y _ { i } | x _ { i } \big ) \big ) p \big ( x _ { i } \big ) \ell \big ( \Phi ( x _ { i } , \theta ) , \tilde { y } _ { i } \big ) \ d x _ { i } \right] } \end{array}
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
Where we have used the fact that:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\begin{array} { l l l } { \mathbb { E } _ { t r u e } } & { = } & { \nabla _ { \pmb { \theta } } \left[ \frac { 1 } { n } \displaystyle \sum _ { i = 1 } ^ { n } \int _ { a } ^ { b } p ( y _ { i } | x _ { i } ) p ( x _ { i } ) \ell \left( \Phi ( x _ { i } , \pmb { \theta } ) , \tilde { y } _ { i } \right) d x _ { i } d \tilde { y } _ { i } \right] } \\ & { + } & { \nabla _ { \pmb { \theta } } \left[ \frac { 1 } { n } \displaystyle \sum _ { i = 1 } ^ { n } \int _ { x \not \in [ a , b ] } p ( y _ { i } | x _ { i } ) p ( x _ { i } ) \ell \left( \Phi ( x _ { i } , \pmb { \theta } ) , \tilde { y } _ { i } \right) d x _ { i } d \tilde { y } _ { i } \right] } \end{array}
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
# B ALGORITHM PSEUDO-CODE
|
| 426 |
+
|
| 427 |
+
In this section, we include a more detailed form of the algorithms proposed in the paper.
|
| 428 |
+
|
| 429 |
+
# Algorithm 1 Train energy-based autoencoder
|
| 430 |
+
|
| 431 |
+
Require: $\tilde { \tau }$
|
| 432 |
+
Require: $\mathcal { T }$
|
| 433 |
+
Require: $\eta$
|
| 434 |
+
Require: Forward $( x , \theta )$
|
| 435 |
+
Require: $E \left( \hat { \pmb x } \right)$
|
| 436 |
+
Require: $\mathcal { L } \left( \boldsymbol { B } , \boldsymbol { \mathcal { O } } ; \boldsymbol { \theta } \right)$
|
| 437 |
+
Require: GetBalancedBatch $( \mathcal { T } )$
|
| 438 |
+
|
| 439 |
+
1: for $i$ in $\{ 1 , 2 , \ldots , m \}$ do
|
| 440 |
+
2: $B _ { i } = \{ x _ { j } , y _ { j } \} \mathbf { G e t B } { \mathrm { : } }$ alancedBatch $( \mathcal { T } )$
|
| 441 |
+
3: $\mathcal { O } _ { i } = \{ \hat { \pmb { x } } _ { j } \} $ Forward $( B _ { i } , \pmb \theta _ { i } )$
|
| 442 |
+
4: $\ell _ { i } \gets \mathcal { L } \left( \mathbf { \bar { \boldsymbol { B } } } _ { i } , \mathcal { O } _ { i } ; \mathbf { \boldsymbol { \theta } } _ { i } \right)$
|
| 443 |
+
5: $\nabla _ { \pmb { \theta } } \left( \ell _ { i } \right) \gets \mathrm { B a c k w a r d } \left( \ell _ { i } ; \pmb { \theta } _ { i } \right)$
|
| 444 |
+
6: $\pmb { \theta } _ { i + 1 } \mathrm { S t e p } ( \pmb { \theta } _ { i } , \eta , \nabla _ { \pmb { \theta } } ( \ell _ { i } ) )$
|
| 445 |
+
7: end for
|
| 446 |
+
8: Initialize: ${ \mathcal { E } } = \{ \}$
|
| 447 |
+
9: for $\{ x _ { i } , \tilde { y } _ { i } \}$ in $\tilde { \tau }$ do
|
| 448 |
+
10: $\hat { \mathbf { { x } } } _ { i } \gets$ Forward $( { \pmb x } _ { i } ; { \pmb \theta } ^ { \star } )$
|
| 449 |
+
11: $e _ { i } \gets E \left( \hat { \pmb x } _ { i } \right)$
|
| 450 |
+
12: $\mathcal { E } [ i ] e _ { i }$
|
| 451 |
+
13: end for
|
| 452 |
+
|
| 453 |
+
# Algorithm 2 Correct training data
|
| 454 |
+
|
| 455 |
+
Require: $\tilde { \tau }$
|
| 456 |
+
Require: $\mathcal { T }$
|
| 457 |
+
Require: $\mathcal { E }$
|
| 458 |
+
Require: $E \left( { \hat { \pmb x } } \right)$
|
| 459 |
+
Require: GetNegativeSamples $( \mathcal { T } )$
|
| 460 |
+
Require: GetPositiveSamples $( \mathcal { T } )$ )
|
| 461 |
+
|
| 462 |
+
1: $\mathcal { T } _ { 0 } \gets$ GetNegativeSamples $( \mathcal { T } )$
|
| 463 |
+
2: $\mathcal { T } _ { 1 } $ GetPositiveSamples $( \mathcal { T } )$
|
| 464 |
+
3: $\begin{array} { r } { \bar { E } _ { 0 } \frac { 1 } { | \mathcal { T } _ { 0 } | } \sum _ { \pmb { x } \in \mathcal { T } _ { 0 } } E \dot { ( \pmb { x } ) } } \end{array}$
|
| 465 |
+
4: $\begin{array} { r } { \bar { E } _ { 1 } \frac { 1 } { | \mathcal { T } _ { 1 } | } \sum _ { \pmb { x } \in \mathcal { T } _ { 1 } } E ( \pmb { x } ) } \end{array}$
|
| 466 |
+
5: $\begin{array} { r } { \sigma _ { 0 } \gets \left[ \sum _ { \pmb { x } \in \mathcal { T } _ { 0 } } \frac { \left( E ( \pmb { x } ; \pmb { \theta } ) - \bar { E } _ { 0 } \right) ^ { 2 } } { | \mathcal { T } _ { 0 } | - 1 } \right] ^ { \frac { 1 } { 2 } } } \end{array}$ 12
|
| 467 |
+
6: σ1 ← Px∈T1 (E(x;θ)−E¯1)2|T1|−1 12
|
| 468 |
+
7: T c ← T˜ T
|
| 469 |
+
8: for $\{ x _ { i } , y _ { i } \}$ in ${ \mathcal { T } } ^ { \mathrm { c } }$ do
|
| 470 |
+
9: $e _ { i } \gets \mathcal { E } [ i ]$
|
| 471 |
+
10: if $y _ { i } = 1$ and $e _ { i } < \bar { E } _ { 0 } + \sigma _ { 0 }$ then
|
| 472 |
+
11: $y _ { i } \gets 0$
|
| 473 |
+
12: else if $y _ { i } = 0$ and $e _ { i } > \bar { E } _ { 1 } - \sigma _ { 0 }$ then
|
| 474 |
+
13: yi ← 1
|
| 475 |
+
14: end if
|
| 476 |
+
15: end for
|
| 477 |
+
|
| 478 |
+
. full training data . training data with known labels . energies from algorithm 1 . energy function, i.e. reconstruction loss . get all samples from class 0 . get all samples from class 1 $\triangleright$ get mean w.r.t class 0 $\triangleright$ get mean w.r.t class 1 $\triangleright$ get standard deviation w.r.t class 0 $\triangleright$ get standard deviation w.r.t class 1 $\triangleright$ i.e. $\mathcal { T } ^ { \mathrm { c } } = \{ ( \mathbf { x } _ { i } , y _ { i } ) \in \tilde { \mathcal { T } } \| ( \mathbf { x } _ { i } , y _ { i } ) \notin \mathcal { T } \}$ $\triangleright$ get energy corresponding to $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$
|
md/train/LKUfuWxajHc/LKUfuWxajHc.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TransMIL: Transformer based Correlated Multiple Instance Learning for Whole Slide Image Classification
|
| 2 |
+
|
| 3 |
+
Zhuchen Shao∗,1, Hao Bian∗,1, Yang Chen∗,1, Yifeng Wang2, Jian Zhang3, Xiangyang Ji4 Yongbing Zhang†,2
|
| 4 |
+
|
| 5 |
+
1Tsinghua Shenzhen International Graduate School, Tsinghua University 2Harbin Institute of Technology (Shenzhen) 3School of Electronic and Computer Engineering, Peking University 4Department of Automation, Tsinghua University
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Multiple instance learning (MIL) is a powerful tool to solve the weakly supervised classification in whole slide image (WSI) based pathology diagnosis. However, the current MIL methods are usually based on independent and identical distribution hypothesis, thus neglect the correlation among different instances. To address this problem, we proposed a new framework, called correlated MIL, and provided a proof for convergence. Based on this framework, we devised a Transformer based MIL (TransMIL), which explored both morphological and spatial information. The proposed TransMIL can effectively deal with unbalanced/balanced and binary/multiple classification with great visualization and interpretability. We conducted various experiments for three different computational pathology problems and achieved better performance and faster convergence compared with state-of-the-art methods. The test AUC for the binary tumor classification can be up to $9 3 . 0 9 \%$ over CAMELYON16 dataset. And the AUC over the cancer subtypes classification can be up to $9 6 . 0 3 \%$ and $9 8 . 8 2 \%$ over TCGANSCLC dataset and TCGA-RCC dataset, respectively. Implementation is available at: https://github.com/szc19990412/TransMIL.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
The advent of whole slide image (WSI) scanners, which convert the tissue on the biopsy slide into a gigapixel image fully preserving the original tissue structure [1], provides a good opportunity for the application of deep learning in the field of digital pathology [2, 3, 4]. However, the deep learning based biopsy diagnosis in WSI has to face a great challenges due to the huge size and the lack of pixel-level annotations[5]. To address this problem, multiple instance learning (MIL) is usually adopted to take diagnosis analysis as a weakly supervised learning problem.
|
| 14 |
+
|
| 15 |
+
In deep learning based MIL, one straightforward idea is to perform pooling operation [6, 7] on instance feature embeddings extracted by CNN. Ilse et al. [8] proposed an attention based aggregation operator, giving each instance additional contribution information through trainable attention weights. In addition, Li et al. [9] introduced non-local attention into the MIL problem. By calculating the similarity between the highest-score instance and the others, each instance is given different attention weight and the interpretable attention map can be obtained accordingly. There were also other pioneering works [10, 11, 12, 13, 14] in weakly supervised WSI diagnosis.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Decision-making process. MIL Attention Mechanism: follow the i.i.d. assumption. Selfattention Mechanism: under the correlated MIL framework.
|
| 19 |
+
|
| 20 |
+
However, all these methods are based on the assumption that all the instances in each bag are independent and identically distributed (i.i.d.). While achieving some improvements in many tasks, this i.i.d. assumption was not entirely valid [15] in many cases. Actually, pathologists often consider both the contextual information around a single area and the correlation information between different areas when making a diagnostic decision. Therefore, it would be much desirable to consider the correlation between different instances in MIL diagnosis.
|
| 21 |
+
|
| 22 |
+
At present, Transformer is widely used in many vision tasks [16, 17, 18, 19, 20, 21] due to the strong ability of describing correlation between different segments in a sequence (tokens) as well as modelling long distance information. As shown in Figure 1, different from bypass attention network in the existing MIL, the Transformer adopts self-attention mechanism, which can pay attention to the pairwise correlation between each token within a sequence. However, traditional Transformer sequences are limited by their computational complexity and can only tackle shorter sequences (e.g., less than 1000) [22]. Therefore, it is not suitable for large size images such as WSIs.
|
| 23 |
+
|
| 24 |
+
To address these challenges mentioned above, we proposed a correlated MIL framework, including the convergence proof and a generic three-step algorithm. In addition, a Transformer based MIL (TransMIL) was devised to explore both morphological and spatial information between different instances. Great performance over various datasets demonstrate the validity of the proposed method.
|
| 25 |
+
|
| 26 |
+
# 2 Related Work
|
| 27 |
+
|
| 28 |
+
# 2.1 Application of MIL in WSI classification
|
| 29 |
+
|
| 30 |
+
The application of MIL in WSIs can be divided into two categories. The first one is instance-level algorithms [7, 23, 24, 25, 26], where a CNN is first trained by assigning each instance a pseudo-label based on the bag-level label, and then the top-k instances are selected for aggregation. However, this method requires a large number of WSIs, since only a small number of instances within each slide can actually participate in the training. The second category is embedding-level algorithms, where each patch in the entire slide is mapped to a fixed-length embedding, and then all feature embeddings are aggregated by an operator (e.g., max-pooling). To improve the performance, the MIL attention based method [8, 10, 11, 12, 13] assigns the contribution of each instance by introducing trainable parameters. In addition, the feature clustering methods [14, 27, 28] calculated the cluster centroids of all the feature embeddings and then the representative feature embeddings was employed to make the final prediction. Recently, non-local attention [9] was also adopted in MIL to pay more attention to the correlation between the highest-score instance and all the remaining instances.
|
| 31 |
+
|
| 32 |
+
# 2.2 Attention and Self-attention in Deep Learning
|
| 33 |
+
|
| 34 |
+
Attention was initially used to extract important information about sentences in machine translation [29]. Then the attention mechanism was gradually applied to computer vision tasks, including giving different weights to feature channels [30] or spatial distribution [31], or giving different weights to time series in video analysis [32]. Recently, attention was also applied in MIL analysis [10, 11, 12, 13]. However, all these methods did not consider the correlation between different instances.
|
| 35 |
+
|
| 36 |
+
The most typical self-attention application was the Transformer based NLP framework proposed by Google [33]. Recently, Transformer was also applied in many computer vision tasks, including object detection [16, 17], segmentation [18, 19], image enhancement [20, 21] and video processing [34]. In this paper, for the first time, we proposed a Transformer based WSI classification, where the correlations among different instances within the same bag are comprehensively considered.
|
| 37 |
+
|
| 38 |
+
# 3 Method
|
| 39 |
+
|
| 40 |
+
# 3.1 Correlated Multiple Instance Learning
|
| 41 |
+
|
| 42 |
+
Problem formulation Take binary MIL classification as an example, we want to predict a target value $Y _ { i } \in \{ 0 , 1 \}$ , given a bag of instances $\{ \pmb { x } _ { i , 1 } , \pmb { x } _ { i , 2 } , \ldots , \pmb { x } _ { i , n } \}$ with $\mathbf { X } _ { i }$ , for $i = 1 , \ldots , b$ , that exhibit both dependency and ordering among each other. The instance-level labels $\{ y _ { i , 1 } , y _ { i , 2 } , . . . , y _ { i , n } \}$ are unknown, and the bag-level label is $Y _ { i }$ , for $i = 1 , \dots , b$ . A binary MIL classification can be defined as:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
Y _ { i } = \left\{ { 0 , \mathrm { i f f } \sum _ { } y _ { i , j } = 0 y _ { i , j } \in \{ 0 , 1 \} , j = 1 \dots n } _ { } \right.
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\hat { Y } _ { i } = { S } ( { \bf X } _ { i } ) ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $S$ is a scoring function, $\hat { Y _ { i } }$ represents the prediction. $b$ is the total number of bags, $n$ is the number of instances in ith bag, and the number of $n$ can vary for different bags.
|
| 53 |
+
|
| 54 |
+
Compared to the MIL framework proposed by Ilse et al. [8], we further introduce the correlation between different instances. Theorem 1 and Inference give an arbitrary approximation form of the scoring function $S ( \mathbf { X } )$ , and Theorem 2 provides the advantage of correlated MIL.
|
| 55 |
+
|
| 56 |
+
Theorem 1. Suppose $S : \mathcal { X } \mathbb { R }$ is a continuous set function w.r.t Hausdorff distance $d _ { H } ( \cdot , \cdot )$ $\forall \varepsilon > 0$ , for any invertible map $P : \mathcal X \to \mathbb R ^ { n }$ , ∃ function $\sigma$ and $g$ , such that for any $\mathbf { X } \in { \mathcal { X } }$ :
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
| S ( \mathbf { X } ) - g ( \underset { \mathbf { X } \in \mathcal { X } } { P } \{ \sigma ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \} ) | < \varepsilon .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
That is: a Hausdorff continuous function $S ( \mathbf { X } )$ can be arbitrarily approximated by a function in the form $g ( \underset { \mathbf { X } \in \mathcal { X } } { P } \{ \sigma ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \} ,$ ).
|
| 63 |
+
|
| 64 |
+
Proof. By the continuity of $S$ , we take $\forall \varepsilon > 0 , \exists \delta _ { \varepsilon }$ , so that $| S ( \mathbf { X } ) - S ( \mathbf { X } ^ { \prime } ) | < \varepsilon$ for any $\mathbf { X } , \mathbf { X } ^ { \prime } \in \mathcal { X }$ , if ${ d _ { H } } \left( { { \bf { X } } , { \bf { X } } ^ { \prime } } \right) < \delta _ { \varepsilon }$ .
|
| 65 |
+
|
| 66 |
+
Define $\begin{array} { r } { K = \lceil \frac { 1 } { \delta _ { \varepsilon } } \rceil } \end{array}$ and define an auxiliary function: $\begin{array} { r } { \sigma ( { \pmb x } ) = \frac { \lfloor K { \pmb x } \rfloor } { K } } \end{array}$ . Let $\tilde { \mathbf { X } } = \{ \sigma ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \}$ , then:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
| S ( \mathbf { X } ) - S ( \tilde { \mathbf { X } } ) | < \varepsilon ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
because $\begin{array} { r } { d _ { H } ( \mathbf { X } , \tilde { \mathbf { X } } ) < \frac { 1 } { K } \le \delta _ { \varepsilon } } \end{array}$ .
|
| 73 |
+
|
| 74 |
+
Let $P : \mathcal X \to \mathbb R ^ { n }$ be any invertible map, its inverse mapping is expressed as $P ^ { - 1 }$ : $\mathbb { R } ^ { n } \to \mathcal { X }$ . Let $g = S \left( P ^ { - 1 } \right)$ , then:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
S \left( P ^ { - 1 } ( \underset { \mathbf { X } \in \mathcal { X } } { P } ( \{ \sigma ( \mathbf { x } ) : \mathbf { x } \in \mathbf { X } \} ) ) \right) = S \left( P ^ { - 1 } ( \underset { \mathbf { \tilde { X } } \in \mathcal { X } } { P } ( \tilde { \mathbf { X } } ) ) \right) = S ( \tilde { \mathbf { X } } ) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Because $| S ( \mathbf { X } ) - S ( \tilde { \mathbf { X } } ) | < \varepsilon$ and $S ( \tilde { \mathbf { X } } ) = S \left( P ^ { - 1 } ( P ( \tilde { \mathbf { X } } ) ) \right) = g ( P ( \tilde { \mathbf { X } } ) )$ , we have:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
| S ( \mathbf { X } ) - g ( \underset { \mathbf { X } \in \mathcal { X } } { P } \{ \sigma ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \} ) | < \varepsilon .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
This completes the proof.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 2: The difference between different Pooling Matrix P. Suppose there are 5 instances sampled from WSI in (a), $\mathbf { P } \in \mathbb { R } ^ { 5 \times 5 }$ is the corresponding Pooling Matrix, where the values in the diagonal line indicate the attention weight for itself and the rest indicate correlation between different instances. (b,c,d) all neglect the correlation information, hence the $\mathbf { P }$ is diagonal matrix. In (b), the first instance was chosen by Max-pooling operator, so there is only one non-zero value in the first diagonal position. In (c), all the values within diagonal line are the same due to the Mean-pooling operator. In (d), the values within diagonal line can be varied due to the introduction of bypass attention. (e) obeys the correlation assumption, so there are non-zero values in off-diagonal position indicating correlation between different instances.
|
| 90 |
+
|
| 91 |
+
Inference Suppose $S : \mathcal { X } \mathbb { R }$ is a continuous set function w.r.t Hausdorff distance $d _ { H } ( \cdot , \cdot )$ $\forall \varepsilon > 0$ , for any function $f$ and any invertible map $P : \mathcal X \to \mathbb R ^ { n }$ , ∃ function $h$ and $g$ , such that for any $\mathbf { X } \in { \mathcal { X } }$ :
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
| S ( \mathbf { X } ) - g ( \underset { \mathbf { X } \in \mathcal { X } } { P } \{ f ( \pmb { x } ) + h ( \pmb { x } ) : \pmb { x } \in \mathbf { X } \} ) | < \varepsilon .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
That is: a Hausdorff continuous function $S ( \mathbf { X } )$ can be arbitrarily approximated by a function in the form $g { \big ( } { \underset { \mathbf { X } \in { \mathcal { X } } } { P } } { \big \{ } f ( { \pmb { x } } ) + h ( { \pmb { x } } ) : { \pmb { x } } \in \mathbf { X } { \} } .$ ).
|
| 98 |
+
|
| 99 |
+
Proof. The proof is in the Appendix A.
|
| 100 |
+
|
| 101 |
+
Theorem 2. The Instances in the bag are represented by random variables $\Theta _ { 1 } , \Theta _ { 2 } , \ldots , \Theta _ { n }$ , the information entropy of the bag under the correlation assumption can be expressed as $H \left( \Theta _ { 1 } , \Theta _ { 2 } , \ldots , \Theta _ { n } \right)$ , and the information entropy of the bag under the i.i.d. (independent and identical distribution) assumption can be expressed as $\textstyle \sum _ { t = 1 } ^ { n } { \bar { H } } \left( \Theta _ { t } \right)$ , then we have:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
H \left( \Theta _ { 1 } , \Theta _ { 2 } , \ldots , \Theta _ { n } \right) = \sum _ { t = 2 } ^ { n } H \left( \Theta _ { t } \mid \Theta _ { 1 } , \ldots , \Theta _ { t - 1 } \right) + H \left( \Theta _ { 1 } \right) \leq \sum _ { t = 1 } ^ { n } H \left( \Theta _ { t } \right) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Proof. The proof is in the Appendix A.
|
| 108 |
+
|
| 109 |
+
Theorem 2 proved the correlation assumption has smaller information entropy, which may reduce the uncertainty and bring more useful information for the MIL problem. Motivated by the Inference and Theorem 2, a generic three-step method like Algorithm1 was developed. The main difference between the proposed algorithm and existing methods is shown in Figure 2.
|
| 110 |
+
|
| 111 |
+
Algorithm 1: A generic three-step approach under the correlated MIL
|
| 112 |
+
|
| 113 |
+
<table><tr><td>Input: The bag of instances Xi = {xi,1, xi,2 ..., xi,n} Output: Bag-level predicted label Yi</td></tr><tr><td>1) Extracting morphological and spatial information of all the instances by f and h,</td></tr><tr><td>respectively;</td></tr><tr><td>Xf ← f(Xi),Xh ← h(Xi),Xfh ← Xf +Xh,where Xf,Xh,Xfh ∈ Rnxd;</td></tr><tr><td>2) Aggregating the extracted information for all instances by Pooling Matrix P;</td></tr><tr><td>Xp ←PXfh, whereP ∈ Rnxn;</td></tr><tr><td>3) Transforming Xp to obtain the predicted bag-level label by g;</td></tr><tr><td>Y← g(Xp).</td></tr></table>
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 3: Overview of our TransMIL. Each WSI is cropped into patches (background is discarded), and embedded in feature vectors by ResNet50. Then the sequence is processed with the TPT module: 1) Squaring of sequence; 2) Correlation modelling of the sequence; 3) Conditional position encoding and local information fusion; 4) Deep feature aggregation; 5) Mapping of $\mathbb { T } \to \mathcal { y }$ .
|
| 117 |
+
|
| 118 |
+
# 3.2 How to apply Transformer to correlated MIL
|
| 119 |
+
|
| 120 |
+
The Transformer uses a self-attention mechanism to model the interactions between all tokens in a sequence, and the adding of positional information further increases the use of sequential order information. Therefore it’s a good idea to introduce the Transformer into the correlated MIL problem where the function $h$ encodes the spatial information among instances, and the Pooling Matrix $\mathbf { P }$ uses self-attention for information aggregation. To make this clear, we further give a formal denition.
|
| 121 |
+
|
| 122 |
+
Transformer based MIL. Given a set of bags $\{ \mathbf { X } _ { 1 } , \mathbf { X } _ { 2 } , \ldots , \mathbf { X } _ { b } \}$ , and each bag $\mathbf { X } _ { i }$ contains multiple instances $\{ \pmb { x } _ { i , 1 } , \pmb { x } _ { i , 2 } , \ldots , \pmb { x } _ { i , n } \}$ and a corresponding label $Y _ { i }$ . The goal is to learn the mappings: $\mathbb { X } \mathbb { T } \mathcal { Y }$ , where $\mathbb { X }$ is the bag space, $\mathbb { T }$ is the Transformer space and $\mathcal { V }$ is the label space. The specific mapping form of $\mathbb { X } \to \mathbb { T }$ and $\mathbb { T } \to \mathbb { Y }$ are available in the Appendix B.
|
| 123 |
+
|
| 124 |
+
# 3.3 TransMIL for Weakly Supervised WSI Classication
|
| 125 |
+
|
| 126 |
+
To better describe the mapping of $\mathbb { X } \to \mathbb { T }$ , we design a TPT module with two Transformer layers and a position encoding layer, where Transformer layers are designed for aggregating morphological information and Pyramid Position Encoding Generator (PPEG) is designed for encoding spatial information. The overview of proposed Transformer based MIL (TransMIL) is shown in Figure 3.
|
| 127 |
+
|
| 128 |
+
Long Instances Sequence Modelling with TPT. The sequences are from the feature embeddings in each WSI. The processing steps of the TPT module are shown in Algorithm 2, where MSA denotes Multi-head Self-attention, MLP denotes Multilayer Perceptron, and LN denotes Layer Norm.
|
| 129 |
+
|
| 130 |
+
Algorithm 2: TPT module processing flow
|
| 131 |
+
Input: A bag of feature embeddings $\mathbf { H } _ { i } = \{ h _ { i , 1 } , \dots , h _ { i , n } \}$ , where $h _ { i , j } \in \mathbb { R } ^ { 1 \times d }$ is the embedding of the $j$ th instance, $\mathbf { H } _ { i } \in \mathbb { R } ^ { n \times d }$
|
| 132 |
+
Output: Bag-level predicted label $\hat { Y _ { i } }$ 1) Squaring of sequence; $\sqrt { N } \lceil \sqrt { n } \rceil$ , $M \gets N - n$ , $\mathbf { H } _ { S } \gets$ Concat $( h _ { i , c l a s s }$ , $\mathbf { H } _ { i }$ , $( h _ { i , 1 } , \ldots , h _ { i , M } ) )$ , where
|
| 133 |
+
$h _ { i , c l a s s } \in \mathbb { R } ^ { 1 \times d }$ represents class token, $\mathbf { H } _ { S } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ ; 2) Correlation modelling of the sequence; $\mathbf { H } _ { S } ^ { \ell } \gets \mathrm { M S A } \left( \mathbf { H } _ { S } \right)$ , where $\ell$ denotes the layer index of the Transformer, $\mathbf { H } _ { S } ^ { \ell } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ ; 3) Conditional position encoding and local information fusion; $\mathbf { H } _ { S } ^ { P } \mathrm { P P E G } ( \mathbf { H } _ { S } ^ { \ell } )$ , where $\mathbf { H } _ { S } ^ { P } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ ; 4) Deep feature aggregation; $\mathbf { H } _ { S } ^ { \ell + 1 } \mathrm { M S A } ( \mathbf { H } _ { S } ^ { P } )$ , where $\mathbf { H } _ { S } ^ { \ell + 1 } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ ; 5) Mapping of $\mathbb { T } \to \mathcal { y }$ ; $\hat { Y } _ { i } \gets \mathrm { M L P } \left( \mathrm { L N } \left( \left( \mathbf { H } _ { S } ^ { \ell + 1 } \right) ^ { ( 0 ) } \right) \right)$ , where $\big ( \mathbf { H } _ { S } ^ { \ell + 1 } \big ) ^ { ( 0 ) } \in \mathbb { R } ^ { 1 \times d }$ represents class token.
|
| 134 |
+
|
| 135 |
+
For most cases, the softmax used in Transformer for vision tasks such as [17, 18, 35] is a row-byrow softmax normalization function. The standard self-attention mechanism requires the calculation of similarity scores between each pair of tokens, resulting in both memory and time complexity of $O ( n ^ { 2 } )$ . To deal with the long instances sequence problem in WSIs, the softmax in TPT adopts the Nystrom Method proposed in [22]. The approximated self-attention form $\hat { \bf S }$ can be defined as:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\hat { \bf S } = \mathrm { s o f t m a x } \left( \frac { { \bf Q } \tilde { \bf K } ^ { T } } { \sqrt { d _ { q } } } \right) \left( \mathrm { s o f t m a x } \left( \frac { \tilde { \bf Q } \tilde { \bf K } ^ { T } } { \sqrt { d _ { q } } } \right) \right) ^ { + } \mathrm { s o f t m a x } \left( \frac { \tilde { \bf Q } { \bf K } ^ { T } } { \sqrt { d _ { q } } } \right) ,
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
where $\tilde { \mathbf { Q } }$ and $\tilde { \bf K }$ are the $m$ selected landmarks from the original $n$ dimensional sequence of $\mathbf { Q }$ and $\mathbf { K }$ , and $\mathbf { A } ^ { + }$ is a Moore-Penrose pseudoinverse of A. The final computational complexity is reduced from $O ( n ^ { 2 } )$ to $O ( n )$ . By doing this, the TPT module with approximation processing can satisfy the case where a bag contains thousands of tokens as input.
|
| 142 |
+
|
| 143 |
+
Position encoding with PPEG. In WSIs, the number of tokens in the corresponding sequence often varies due to the inherently variable size of the slide and tissue area. In [36] it is shown that the adding of zero padding can provide an absolute position information to convolution. Inspired by this, we designed the PPEG module accordingly. The overview is shown in Figure 4, and the pseudo-code for the processing is shown in Algorithm 3.
|
| 144 |
+
|
| 145 |
+
Figure 4: Pyramid Position Encoding Generator. 1) The sequence is divided into patch tokens and class token; 2) Patch tokens are reshaped into 2-D image space; 3) Different sized convolution kernels are used to encode spatial information; 4) Different spatial information are fused together; 5) Patch tokens are flattened into sequence; 6) Connect class token and patch tokens.
|
| 146 |
+
|
| 147 |
+
Our PPEG module has more advantages over the method proposed in [37]: (1) PPEG module uses different sized convolution kernels in the same layer, which can encode the positional information with different granularity, enabling high adaptability of PPEG. (2) Taking advantage of CNN’s ability to aggregate context information, the tokens in the sequence is able to obtain both global information and context information, which enriches the features carried by each token.
|
| 148 |
+
|
| 149 |
+
# Algorithm 3: PPEG processing flow
|
| 150 |
+
|
| 151 |
+
Input: A bag of feature embeddings $\mathbf { H } _ { S } ^ { \ell }$ after correlation modelling, where $\mathbf { H } _ { S } ^ { \ell } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ .
|
| 152 |
+
Output: The feature embeddings $\mathbf { H } _ { S } ^ { P }$ after conditional position encoding and local information fusion, where $\mathbf { H } _ { S } ^ { P } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ . 1) Split: $\mathbf { H } _ { S } ^ { \ell }$ is divided into patch tokens $\mathbf { H } _ { f }$ and class token $\mathbf { H } _ { c }$ ; $\mathbf { H } _ { f } , \mathbf { H } _ { c } \gets \mathrm { S p l i t } \left( \mathbf { H } _ { S } ^ { \ell } \right)$ , where $\mathbf { H } _ { f } \in \mathbb { R } ^ { N \times d } , \mathbf { H } _ { c } \in \mathbb { R } ^ { 1 \times d }$ ; 2) Spatial Restore: patch tokens $\mathbf { H } _ { f }$ are reshaped to $\mathbf { H } _ { S } ^ { f }$ in the 2-D image space; $\mathbf { H } _ { S } ^ { f } \mathrm { R e s t o r e } ( \mathbf { H } _ { f } )$ , where $\mathbf { H } _ { S } ^ { f } \in \mathbb { R } ^ { \sqrt { N } \times \sqrt { N } \times d }$ ; 3) Group Convolution: using a set of group convolutions with kernel $k$ and $\frac { k - 1 } { 2 }$ zero
|
| 153 |
+
paddings $( k = 3 , 5 , 7 )$ to obtain $\mathbf { H } _ { t } ^ { f } , t = 1 , 2 , 3$ ; $\mathbf { H } _ { t } ^ { f } \gets \mathrm { C o n v } \left( \mathbf { H } _ { S } ^ { f } \right)$ , where $\mathbf { H } _ { t } ^ { f } \in \mathbb { R } ^ { \sqrt { N } \times \sqrt { N } \times d } , t = 1 , 2 , 3 \mathrm { { : } }$ 4) Fusion: $\mathbf { H } _ { S } ^ { f }$ and the $\mathbf { H } _ { t } ^ { f } , t = 1 , 2 , 3$ obtained from the convolution block processing are
|
| 154 |
+
added together to obtain $\mathbf { H } _ { S } ^ { F }$ ; $\mathbf { H } _ { S } ^ { F } \mathbf { H } _ { S } ^ { f } + \mathbf { H } _ { 1 } ^ { f } + \mathbf { H } _ { 2 } ^ { f } + \mathbf { H } _ { 3 } ^ { f }$ , where $\mathbf { H } _ { S } ^ { F } \in \mathbb { R } ^ { \sqrt { N } \times \sqrt { N } \times d }$ ; 5) Flatten: $\mathbf { H } _ { S } ^ { F }$ are flattened into sequence $\mathbf { H } _ { s e }$ ; $\mathbf { H } _ { s e } \gets$ Flatten $\left( \mathbf { H } _ { S } ^ { F } \right)$ , where $\mathbf { H } _ { s e } \in \mathbb { R } ^ { N \times d }$ ; 6) Concat: connect $\mathbf { H } _ { s e }$ and class token $\mathbf { H } _ { c }$ to obtain $\mathbf { H } _ { S } ^ { P }$ ; $\mathbf { H } _ { S } ^ { P } \mathrm { C o n c a t } ( \mathbf { H } _ { s e } , \mathbf { H } _ { c } )$ , where $\mathbf { H } _ { S } ^ { P } \in \mathbb { R } ^ { ( N + 1 ) \times d }$ .
|
| 155 |
+
|
| 156 |
+
# 4 Experiments and Results
|
| 157 |
+
|
| 158 |
+
To demonstrate the superior performance of the proposed TransMIL, various experiments were conducted over three public datasets: CAMELYON16, The Caner Genome Atlas (TCGA) non-small cell lung cancer (NSCLC), as well as the TCGA renal cell carcinoma (RCC).
|
| 159 |
+
|
| 160 |
+
Dataset. CAMELYON16 is a public dataset for metastasis detection in breast cancer, including 270 training sets and 130 test sets. After pre-processing, a total of about 3.5 million patches at $\times 2 0$ magnification, in average about 8,800 patches per bag were obtained.
|
| 161 |
+
|
| 162 |
+
TCGA-NSCLC includes two subtype projects, i.e., Lung Squamous Cell Carcinoma (TGCA-LUSC) and Lung Adenocarcinoma (TCGA-LUAD), for a total of 993 diagnostic WSIs, including 507 LUAD slides from 444 cases and 486 LUSC slides from 452 cases. After pre-processing, the mean number of patches extracted per slide at $\times 2 0$ magnification is 15371.
|
| 163 |
+
|
| 164 |
+
TCGA-RCC includes three subtype projects, i.e., Kidney Chromophobe Renal Cell Carcinoma (TGCA-KICH), Kidney Renal Clear Cell Carcinoma (TCGA-KIRC) and Kidney Renal Papillary Cell Carcinoma (TCGA-KIRP), for a total of 884 diagnostic WSIs, including 111 KICH slides from 99 cases, 489 KIRC slides from 483 cases, and 284 KIRP slides from 264 cases. After preprocessing, the mean number of patches extracted per slide at $\times 2 0$ magnification is 14627.
|
| 165 |
+
|
| 166 |
+
Experiment Setup and Evaluation Metrics. Each WSI is cropped into a series of $2 5 6 \times 2 5 6$ nonoverlapping patches, where the background region (saturation ${ < } 1 5$ ) is discarded. In CAMELYON16 we trained on the official training set after splitting the 270 WSIs into approximately $9 0 \%$ training and $1 0 \%$ validation, and tested on the official test set. For TCGA datasets, we first ensured that different slides from one patient do not exist in both the training and test sets, and then randomly split the data in the ratio of training:validation:test $= 6 0 { : } 1 5 { : } 2 5$ . For the evaluation metrics, we used accuracy and area under the curve (AUC) scores to evaluate the classification performance, where the accuracy was calculated with a threshold of 0.5 in all experiments. For the AUC, the official test set AUC was used on the CAMELYON16 dataset, the average AUC was used on the TCGANSCLC dataset, and the average one-versus-rest AUC (macro-averaged) was used on the TCGARCC dataset. All the results over TCGA datasets are obtained by 4-fold cross-validation.
|
| 167 |
+
|
| 168 |
+
Implementation Details. In the training step, cross-entropy loss was adopted, and the Lookahead optimizer [38] was employed with a learning rate of 2e-4 and weight decay of 1e-5. The size of mini-batch $B$ is 1. As in [13], the feature of each patch is embedded in a 1024-dimensional vector by a ResNet50 [39] model pre-trained on ImageNet. During training, the dimension of each feature embedding is reduced from 1024 to 512 by a fully connected layer. Finally, the feature embedding of each bag can be represented as $\mathbf { H } _ { i } \in \mathbb { R } ^ { n \times 5 1 2 }$ . In the inference step, the softmax is used to normalize the predicted scores for each class. All experiments are done with a RTX 3090.
|
| 169 |
+
|
| 170 |
+
Baseline. The baselines we chose include deep models with traditional pooling operators such as mean-pooling, max-pooling and the current state-of-the-art deep MIL models [8, 9, 13, 23, 40], the attention based pooling operator ABMIL [8] and PT-MTA [40], non-local attention based pooling operator DSMIL [9], single-attention-branch CLAM-SB[13], multi-attention-branch CLAM-MB[13], and recurrent neural network(RNN) based aggregation MIL-RNN [23].
|
| 171 |
+
|
| 172 |
+
# 4.1 Results on WSI classification
|
| 173 |
+
|
| 174 |
+
We will present the results of both binary and multiple classification. The binary classification tasks contain positive/negative classification over CAMELYON16 and LUSC/LUAD subtypes classification over TCGA-NSCLC. The multiple classification refers to TGCA-KICH/TCGA-KIRC/TCGAKIRP subtypes classification over TCGA-RCC. All the results are provided in Table 1.
|
| 175 |
+
|
| 176 |
+
In CAMELYON16, only a small portion of each positive slide contains tumours (averagely total cancer area per slide $< 1 0 \%$ ), resulting in the presence of a large number of negative regions disturbing the prediction of positive slide. The bypass attention-based methods and proposed TransMIL all outperform the traditional pooling operators. However in AUC score, TransMIL was at least $5 \%$ higher than ABMIL, PT-MTA and CLAM which neglect the correlation between instances, and do not consider the spatial information between patches. DSMIL only considers the relationship between the highest scoring instance and others, leading to limited performance.
|
| 177 |
+
|
| 178 |
+
Table 1: Results on CAMELYON16, TCGA-NSCLC and TCGA-RCC.
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan="2"></td><td colspan="2">CAMELYON16</td><td colspan="2">TCGA-NSCLC</td><td colspan="2">TCGA-RCC</td></tr><tr><td>Accuracy</td><td>AUC</td><td>Accuracy</td><td>AUC</td><td>Accuracy</td><td>AUC</td></tr><tr><td>Mean-pooling</td><td>0.6389</td><td>0.4647</td><td>0.7282</td><td>0.8401</td><td>0.9054</td><td>0.9786</td></tr><tr><td>Max-pooling</td><td>0.8062</td><td>0.8569</td><td>0.8593</td><td>0.9463</td><td>0.9378</td><td>0.9879</td></tr><tr><td>ABMIL[8]</td><td>0.8682</td><td>0.8760</td><td>0.7719</td><td>0.8656</td><td>0.8934</td><td>0.9702</td></tr><tr><td>PT-MTA [40]</td><td>0.8217</td><td>0.8454</td><td>0.7379</td><td>0.8299</td><td>0.9059</td><td>0.9700</td></tr><tr><td>MIL-RNN [23]</td><td>0.8450</td><td>0.8880</td><td>0.8619</td><td>0.9107</td><td>一</td><td>一</td></tr><tr><td>DSMIL [9]</td><td>0.7985</td><td>0.8179</td><td>0.8058</td><td>0.8925</td><td>0.9294</td><td>0.9841</td></tr><tr><td>CLAM-SB[13]</td><td>0.8760</td><td>0.8809</td><td>0.8180</td><td>0.8818</td><td>0.8816</td><td>0.9723</td></tr><tr><td>CLAM-MB[13]</td><td>0.8372</td><td>0.8679</td><td>0.8422</td><td>0.9377</td><td>0.8966</td><td>0.9799</td></tr><tr><td>TransMIL</td><td>0.8837</td><td>0.9309</td><td>0.8835</td><td>0.9603</td><td>0.9466</td><td>0.9882</td></tr></table>
|
| 181 |
+
|
| 182 |
+
In TCGA-NSCLC, positive slides contain relatively large areas of tumour region (averagely total cancer area per slide ${ > } 8 0 \%$ ), consequently the pooling operator can achieve better performance than in CAMELYON16. Again, TransMIL performed better than all the other competing methods, achieving $1 . 4 0 \%$ higher in AUC and $2 . 1 6 \%$ in accuracy, compared with the second best method.
|
| 183 |
+
|
| 184 |
+
In TCGA-RCC, as MIL-RNN did not consider the multi-classification problem, it was not included in this comparison result. The TCGA-RCC is unbalanced distributed in cancer subtypes and has large areas of tumour region in the positive slides (averagely total cancer area per slide ${ > } 8 0 \%$ ). However, TransMIL is equally applicable to multi-class problems with unbalanced data. It can be observed that TransMIL achieves best results in both accuracy and AUC score.
|
| 185 |
+
|
| 186 |
+
# 4.2 Ablation Study
|
| 187 |
+
|
| 188 |
+
To further determine the contribution of the PPEG module and the conditional position encoding for the performance, we have conducted a series of ablation studies. Since the high classification accuracy of most methods over TCGA-RCC is not obvious, all ablation study experiments are based on the CAMELYON16 and the TCGA-NSCLC dataset. All experiments were evaluated by AUC.
|
| 189 |
+
|
| 190 |
+
# 4.2.1 Effects of PPEG
|
| 191 |
+
|
| 192 |
+
The position encoding of the Transformer typically explores absolute position encoding (e.g., sinusoidal encoding, learnable absolute encoding) as well as conditional position encoding. However, learnable absolute encoding is commonly used in problems with fixed length sequences, and does not meet the requirement for variable length of input sequences in WSI analysis, so it is not taken into account in this paper. Here, we compared the effect of sinusoidal encoding and PPEG module which represents multi-level conditional position encoding. The same experiments are performed over CAMELYON16 and TCGA-NSCLC dataset, and the results are shown in Table 2. It should be noted that sinusoidal encoding is added to the original sequence with a multiplication of 0.001 as described in [33].
|
| 193 |
+
|
| 194 |
+
Table 2: Effects of PPEG.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Model</td><td>Params</td><td>Camelyon16</td><td>NSCLC</td></tr><tr><td>w/o</td><td>2.625M</td><td>0.8416</td><td>0.9287</td></tr><tr><td>sin-cos</td><td>2.625M</td><td>0.8941</td><td>0.9374</td></tr><tr><td>3×3</td><td>2.630M</td><td>0.8913</td><td>0.9355</td></tr><tr><td>7×7</td><td>2.651M</td><td>0.9015</td><td>0.9336</td></tr><tr><td>both</td><td>2.669M</td><td>0.9059</td><td>0.9402</td></tr><tr><td>PPEG</td><td>2.669M</td><td>0.9309</td><td>0.9603</td></tr></table>
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 5: Effects of Positional Encoding.
|
| 200 |
+
|
| 201 |
+
Compared with the model without position encoding, it can be seen that both sinusoidal encoding and conditional position encoding can improve the classification performance, and conditional position information encoded by PPEG can be more effective in diagnosis analysis. In contrast to the $3 \times 3$ and $7 \times 7$ convolutional block, adding different sized convolution kernels in the same layer allows for multi-level positional encoding and adds more context information to each token.
|
| 202 |
+
|
| 203 |
+
# 4.2.2 Effects of Conditional Position Encoding
|
| 204 |
+
|
| 205 |
+
Here, by disrupting the order of the input sequences, we explore actual improvements for conditional position encoding. The performance of the model under different configurations is shown in Figure 5, where order represents sequential data input and $w / o$ represents random and disordered data input. It can be seen that conditional position information did enhance the model performance, e.g., the improvement can be up to $0 . 9 \%$ over CAMELYON16 and $0 . 6 1 \%$ over TCGA-NSCLC in AUC.
|
| 206 |
+
|
| 207 |
+
Compared with the model without position encoding or with sinusoidal encoding, conditional position information encoded by PPEG can be more effective in diagnosis analysis. Compared with the results trained over the sequential and disordered training sets, conditional position information did enhance the model performance, e.g., the improvement can be up to $0 . 9 \%$ over CAMELYON16 and $0 . 6 1 \%$ over TCGA-NSCLC in AUC.
|
| 208 |
+
|
| 209 |
+
# 4.3 Interpretability and Attention Visualization
|
| 210 |
+
|
| 211 |
+
Here, we will further show the interpretability of TransMIL. As shown in Figure 6(a), the area within the blue curve annotation is the cancer region, which was provided by Gao et al. [41] over the TCGA-RCC dataset. In Figure 6(b), attention scores from TransMIL were visualised as a heatmap to determine the ROI and interpret the important morphology used for diagnosis, and Figure 6(c) is a zoomed-in view of the black square in Figure 6(b). Obviously, there is a high consistency between fine annotation area and heatmap, illustrating great interpretability and attention visualization of the proposed TransMIL.
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 6: Interpretability and visualization.
|
| 215 |
+
|
| 216 |
+
# 4.4 Fast Convergence
|
| 217 |
+
|
| 218 |
+
Traditional MIL methods as well as the latest MIL methods such as ABMIL, DSMIL and CLAM usually require a large number of epochs to converge. Different from these methods, TransMIL makes use of the morphological and spatial information among instances, leading to approximately two to three times fewer training epochs. As shown in Figure 7, TransMIL has better performance in terms of convergence and validation AUC than other MIL methods.
|
| 219 |
+
|
| 220 |
+
# 5 Conclusion
|
| 221 |
+
|
| 222 |
+
In this paper, we have developed a novel correlated MIL framework that is consistent with the behavior of pathologists considering both the contextual information around a single area and the correlation between different areas when making a diagnostic decision. Based on this framework, a
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 7: The convergence comparison of TransMIL and the competing methods.
|
| 226 |
+
|
| 227 |
+
Transformer based MIL (TransMIL) was devised to explore both morphological and spatial information in weakly supervised WSI classification. We also design a PPEG for position encoding as well as a TPT module with two Transformer layers and a position encoding layer. The TransMIL network is easy to train, and can be applied to unbalanced/balanced and binary/multiple classification with great visualization and interpretability. Most importantly, TransMIL outperforms the state-of-the-art MIL algorithms in terms of both AUC and accuracy over three public datasets. Currently, all the experiments were conducted over the dataset with $\times 2 0$ magnification, however the WSIs with higher magnification will result in longer sequence and inevitably pose great challenges in terms of both computational and memory requirements, and we will explore this issue in the follow-up work.
|
| 228 |
+
|
| 229 |
+
Broader Impact Our proposed approach shows greater potential for MIL application to real-world diagnosis analysis, particularly in problems that require more correlated information such as survival analysis and cancer cell spread detection. In the short term, the benefit of this work is to provide a model with better performance, faster convergence and clinical interpretability. In the long term, the proposed TransMIL network is more applicable to real situations, and it is hoped that it will provide more novel and effective ideas about further applications of deep MIL to diagnosis analysis.
|
| 230 |
+
|
| 231 |
+
Acknowledgment This work was supported in part by the National Natural Science Foundation of China (61922048&62031023), in part by the Shenzhen Science and Technology Project (JCYJ20200109142808034), and in part by Guangdong Special Support (2019TX05X187).
|
| 232 |
+
|
| 233 |
+
# References
|
| 234 |
+
|
| 235 |
+
[1] Lei He, L Rodney Long, Sameer Antani, and George R Thoma. Histology image analysis for carcinoma detection and grading. Computer methods and programs in biomedicine, pages 538–556, 2012.
|
| 236 |
+
[2] Anant Madabhushi. Digital pathology image analysis: opportunities and challenges. Imaging in medicine, pages 7–10, 2009.
|
| 237 |
+
[3] Chen Li, Xintong Li, Md Rahaman, Xiaoyan Li, Hongzan Sun, Hong Zhang, Yong Zhang, Xiaoqi Li, Jian Wu, Yudong Yao, et al. A comprehensive review of computer-aided whole-slide image analysis: from datasets to feature extraction, segmentation, classification, and detection approaches. arXiv preprint arXiv:2102.10553, 2021.
|
| 238 |
+
[4] Xiaomin Zhou, Chen Li, Md Mamunur Rahaman, Yudong Yao, Shiliang Ai, Changhao Sun, Qian Wang, Yong Zhang, Mo Li, Xiaoyan Li, et al. A comprehensive review for breast histopathology image analysis using classical and deep neural networks. IEEE Access, pages 90931–90956, 2020.
|
| 239 |
+
[5] Chetan L Srinidhi, Ozan Ciga, and Anne L Martel. Deep neural network models for computational histopathology: A survey. Medical Image Analysis, 2020.
|
| 240 |
+
[6] Xinggang Wang, Yongluan Yan, Peng Tang, Xiang Bai, and Wenyu Liu. Revisiting multiple instance neural networks. Pattern Recognition, pages 15–24, 2018.
|
| 241 |
+
[7] Fahdi Kanavati, Gouji Toyokawa, Seiya Momosaki, Michael Rambeau, Yuka Kozuma, Fumihiro Shoji, Koji Yamazaki, Sadanori Takeo, Osamu Iizuka, and Masayuki Tsuneki. Weaklysupervised learning for lung carcinoma classification using deep learning. Scientific reports, pages 1–11, 2020. [8] Maximilian Ilse, Jakub M. Tomczak, and M. Welling. Attention-based deep multiple instance learning. In International Conference on Machine Learning, pages 2127–2136, 2018.
|
| 242 |
+
[9] Bin Li, Yin Li, and Kevin W Eliceiri. Dual-stream multiple instance learning network for whole slide image classification with self-supervised contrastive learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 243 |
+
[10] Naofumi Tomita, Behnaz Abdollahi, Jason Wei, Bing Ren, A. Suriawinata, and S. Hassanpour. Attention-based deep neural networks for detection of cancerous and precancerous esophagus tissue on histopathological slides. JAMA Network Open, 2019.
|
| 244 |
+
[11] Noriaki Hashimoto, Daisuke Fukushima, Ryoichi Koga, Yusuke Takagi, Kaho Ko, Kei Kohno, Masato Nakaguro, Shigeo Nakamura, Hidekata Hontani, and Ichiro Takeuchi. Multi-scale domain-adversarial multiple-instance cnn for cancer subtype classification with unannotated histopathological images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3852–3861, 2020.
|
| 245 |
+
[12] Nikhil Naik, Ali Madani, Andre Esteva, Nitish Shirish Keskar, Michael F Press, Daniel Ruderman, David B Agus, and Richard Socher. Deep learning-enabled breast cancer hormonal receptor status determination from base-level h&e stains. Nature communications, pages 1–8, 2020.
|
| 246 |
+
[13] Ming Y Lu, Drew FK Williamson, Tiffany Y Chen, Richard J Chen, Matteo Barbieri, and Faisal Mahmood. Data-efficient and weakly supervised computational pathology on wholeslide images. Nature Biomedical Engineering, pages 1–16, 2021.
|
| 247 |
+
[14] Yash Sharma, Aman Shrivastava, Lubaina Ehsan, Christopher A. Moskaluk, Sana Syed, and Donald E. Brown. Cluster-to-conquer: A framework for end-to-end multi-instance learning for whole slide image classification. arXiv preprint arXiv:2103.10626, 2021.
|
| 248 |
+
[15] Ming Tu, Jing Huang, Xiaodong He, and Bowen Zhou. Multiple instance learning with graph neural networks. In International Conference on Machine Learning, 2019.
|
| 249 |
+
[16] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In Proceedings of the European Conference on Computer Vision, pages 213–229, 2020.
|
| 250 |
+
[17] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2021.
|
| 251 |
+
[18] Jieneng Chen, Yongyi Lu, Qihang Yu, Xiangde Luo, Ehsan Adeli, Yan Wang, Le Lu, Alan L Yuille, and Yuyin Zhou. Transunet: Transformers make strong encoders for medical image segmentation. arXiv preprint arXiv:2102.04306, 2021.
|
| 252 |
+
[19] Yundong Zhang, Huiye Liu, and Qiang Hu. Transfuse: Fusing transformers and cnns for medical image segmentation. arXiv preprint arXiv:2102.08005, 2021.
|
| 253 |
+
[20] Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020.
|
| 254 |
+
[21] Fuzhi Yang, Huan Yang, J. Fu, Hongtao Lu, and B. Guo. Learning texture transformer network for image super-resolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5790–5799, 2020.
|
| 255 |
+
[22] Yunyang Xiong, Zhanpeng Zeng, Rudrasis Chakraborty, Mingxing Tan, Glenn Fung, Yin Li, and Vikas Singh. Nyströmformer: A nyström-based algorithm for approximating self-attention. In Proceedings of the AAAI Conference on Artificial Intelligence, 2021.
|
| 256 |
+
[23] Gabriele Campanella, Matthew G Hanna, Luke Geneslaw, Allen Miraflor, Vitor Werneck Krauss Silva, Klaus J Busam, Edi Brogi, Victor E Reuter, David S Klimstra, and Thomas J Fuchs. Clinical-grade computational pathology using weakly supervised deep learning on whole slide images. Nature medicine, pages 1301–1309, 2019.
|
| 257 |
+
[24] G. Xu, Zhigang Song, Zhuo Sun, Calvin Ku, Z. Yang, C. Liu, S. Wang, Jianpeng Ma, and W. Xu. Camel: A weakly supervised learning framework for histopathology image segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10681–10690, 2019.
|
| 258 |
+
[25] Marvin Lerousseau, Maria Vakalopoulou, Marion Classe, Julien Adam, Enzo Battistella, Alexandre Carré, Théo Estienne, Théophraste Henry, Eric Deutsch, and Nikos Paragios. Weakly supervised multiple instance learning histopathological tumor segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 470–479, 2020.
|
| 259 |
+
[26] P. Chikontwe, Meejeong Kim, S. Nam, H. Go, and S. Park. Multiple instance learning with center embeddings for histopathology classification. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 519–528, 2020.
|
| 260 |
+
[27] Xi Wang, Hao Chen, Caixia Gan, Huangjing Lin, Qi Dou, Efstratios Tsougenis, Qitao Huang, Muyan Cai, and Pheng-Ann Heng. Weakly supervised deep learning for whole slide lung cancer image analysis. IEEE Transactions on cybernetics, pages 3950–3962, 2019.
|
| 261 |
+
[28] Chensu Xie, Hassan Muhammad, Chad M Vanderbilt, Raul Caso, Dig Vijay Kumar Yarlagadda, Gabriele Campanella, and Thomas J Fuchs. Beyond classification: Whole slide tissue histopathology analysis by end-to-end part learning. In Medical Imaging with Deep Learning, pages 843–856, 2020.
|
| 262 |
+
[29] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015.
|
| 263 |
+
[30] Jie Hu, L. Shen, and G. Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7132–7141, 2018.
|
| 264 |
+
[31] S. Woo, Jongchan Park, Joon-Young Lee, and In-So Kweon. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision, pages 3–19, 2018.
|
| 265 |
+
[32] Yongming Rao, Jiwen Lu, and J. Zhou. Attention-aware deep reinforcement learning for video face recognition. In IEEE International Conference on Computer Vision, pages 3931–3940, 2017.
|
| 266 |
+
[33] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, undefinedukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998–6008, 2017.
|
| 267 |
+
[34] Yanhong Zeng, Jianlong Fu, and Hongyang Chao. Learning joint spatial-temporal transformations for video inpainting. In Proceedings of the European Conference on Computer Vision, pages 528–543, 2020.
|
| 268 |
+
[35] A. Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, M. Dehghani, Matthias Minderer, G. Heigold, S. Gelly, Jakob Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
|
| 269 |
+
[36] Md Amirul Islam, Sen Jia, and Neil D. B. Bruce. How much position information do convolutional neural networks encode? In International Conference on Learning Representations, 2020.
|
| 270 |
+
[37] Xiangxiang Chu, Zhi Tian, Bo Zhang, Xinlong Wang, Xiaolin Wei, Huaxia Xia, and Chunhua Shen. Conditional positional encodings for vision transformers. arXiv preprint arXiv:2102.10882, 2021.
|
| 271 |
+
[38] Michael Ruogu Zhang, James Lucas, Geoffrey E. Hinton, and Jimmy Ba. Lookahead optimizer: k steps forward, 1 step back. In Advances in Neural Information Processing Systems, pages 9597–9608, 2019.
|
| 272 |
+
[39] 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.
|
| 273 |
+
[40] Weijian Li, Viet-Duy Nguyen, Haofu Liao, Matt Wilder, Ke Cheng, and Jiebo Luo. Patch transformer for multi-tagging whole slide histopathology images. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 532–540, 2019.
|
| 274 |
+
[41] Zeyu Gao, Pargorn Puttapirat, Jiangbo Shi, and Chen Li. Renal cell carcinoma detection and subtyping with minimal point-based annotation in whole-slide images. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 439– 448, 2020.
|
md/train/LKoMTwTuQnC/LKoMTwTuQnC.md
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Chasing Sparsity in Vision Transformers: An End-to-End Exploration
|
| 2 |
+
|
| 3 |
+
Tianlong Chen1, Yu Cheng2, Zhe $\mathbf { G a n } ^ { 2 }$ , Lu Yuan2, Lei Zhang3, Zhangyang Wang1 1University of Texas at Austin, 2Microsoft Corporation, 3International Digital Economy Academy {tianlong.chen,atlaswang}@utexas.edu,{yu.cheng,zhe.gan,luyuan}@microsoft.com leizhangcn@ieee.org
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Vision transformers (ViTs) have recently received explosive popularity, but their enormous model sizes and training costs remain daunting. Conventional posttraining pruning often incurs higher training budgets. In contrast, this paper aims to trim down both the training memory overhead and the inference complexity, without sacrificing the achievable accuracy. We carry out the first-of-its-kind comprehensive exploration, on taking a unified approach of integrating sparsity in ViTs “from end to end”. Specifically, instead of training full ViTs, we dynamically extract and train sparse subnetworks, while sticking to a fixed small parameter budget. Our approach jointly optimizes model parameters and explores connectivity throughout training, ending up with one sparse network as the final output. The approach is seamlessly extended from unstructured to structured sparsity, the latter by considering to guide the prune-and-grow of self-attention heads inside ViTs. We further co-explore data and architecture sparsity for additional efficiency gains by plugging in a novel learnable token selector to adaptively determine the currently most vital patches. Extensive results on ImageNet with diverse ViT backbones validate the effectiveness of our proposals which obtain significantly reduced computational cost and almost unimpaired generalization. Perhaps most surprisingly, we find that the proposed sparse (co-)training can sometimes improve the ViT accuracy rather than compromising it, making sparsity a tantalizing “free lunch”. For example, our sparsified DeiT-Small at $( 5 \%$ , $5 0 \%$ ) sparsity for (data, architecture), improves $\mathbf { 0 . 2 8 \% }$ top-1 accuracy, and meanwhile enjoys ${ \bf 4 9 . 3 2 \% }$ FLOPs and ${ \bf 4 . 4 \bar { 0 } \% }$ running time savings. Our codes are available at https: //github.com/VITA-Group/SViTE.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Recent years have seen substantial efforts devoted to scaling deep networks to enormous sizes. Parameter counts are frequently measured in billions rather than millions, with the time and financial outlay necessary to train these models growing in concert. The trend undoubtedly continues with the recent forefront of transformers [1–3] for computer vision tasks. By leveraging self-attention, reducing weight sharing such as convolutions, and feeding massive training data, vision transformers have established many new state-of-the-art (SOTA) records in image classification [1, 2], object detection [4–7], image enhancement [8, 9], and image generation [10–12]. Existing vision transformers and variants, despite the impressive empirical performance, have in general suffered from gigantic parameter-counts, heavy run-time memory usages, and tedious training. That naturally calls for the next step research of slimming their inference and training, without compromising the performance.
|
| 12 |
+
|
| 13 |
+
Model compression and efficient learning are no strangers to deep learning researchers, although their exploration in the emerging vision transformer field remains scarce [13]. Among the large variety of compression means [14], sparsity has been one of the central themes since the beginning [15].
|
| 14 |
+
|
| 15 |
+
Conventional approaches first train dense networks, and then prune a large portion of parameters in the trained networks to zero. Those methods significantly reduce the inference complexity. However, the price is to cost even more significant computational resources and memory footprints at training, since they commonly require (multiple rounds of) re-training to restore the accuracy loss [15–17]. That price becomes particularly prohibitive for vision transformers, whose vanilla one-pass training is already much more tedious, slow, and unstable compared to training standard convolutional networks.
|
| 16 |
+
|
| 17 |
+
An emerging subfield has explored the prospect of directly training smaller, sparse subnetworks in place of the full networks without sacrificing performance. The key idea is to reuse the sparsity pattern found through pruning and train a sparse network from scratch. The seminal work of lottery ticket hypothesis (LTH) [18] demonstrated that standard dense networks contain sparse matching subnetworks (sometimes called “winning tickets”) capable of training in isolation to full accuracy. In other words, we could have trained smaller networks from the start if only we had known which subnetworks to choose. Unfortunately, LTH requires to empirically find these intriguing subnetworks by an iterative pruning procedure [18–27] , which still cannot get rid of the expensiveness of posttraining pruning. In view of that, follow-up works reveal that sparsity patterns might emerge at the initialization [28, 29], the early stage of training [30, 31], or in dynamic forms throughout training [32–34] by updating model parameters and architecture typologies simultaneously. These efforts shed light on the appealing prospect of “end to end” efficiency from training to inference, by involving sparsity throughout the full learning lifecycle.
|
| 18 |
+
|
| 19 |
+
This paper presents the first-of-its-kind comprehensive exploration of integrating sparsity in vision transformers (ViTs) “from end to end”. With (dynamic) sparsity as the unified tool, we can improve the inference efficiency from both model and data perspectives, while also saving training memory costs. Our innovative efforts are unfolded along with the following three thrusts:
|
| 20 |
+
|
| 21 |
+
• From Dense to (Dynamic) Sparse: Our primary quest is to find sparse ViTs without sacrificing the achievable accuracy, and meanwhile trimming down the training memory overhead. To meet this challenging demand, we draw inspirations from the latest sparse training works [34, 35] that dynamically extract and train sparse subnetworks instead of training the full models. Sticking to a fixed small parameter budget, our technique jointly optimizes model parameters and explores connectivity throughout the entire training process. We term our first basic approach as Sparse Vision Transformer Exploration (SViTE).
|
| 22 |
+
|
| 23 |
+
• From Unstructured to Structured: Most sparse training works [32, 33, 36–39, 38, 34, 40, 41, 35] restricted discussion to unstructured sparsity. To attain structured sparsity which is more hardware-friendly, unlike classical channel pruning available for convolutional networks, we customize a first-order importance approximation [16, 42] to guide the pruneand-grow of self-attention heads inside ViTs. This seamlessly extends SViTE to its second variant of Structured Sparse Vision Transformer Exploration $\mathbf { \left( S ^ { 2 } V i T E \right) }$ .
|
| 24 |
+
|
| 25 |
+
• From Model to Data: We further conduct a unified co-exploration towards joint data and architecture sparsity. That is by plugging in a novel learnable token selector to determine the most vital patch embeddings in the current input sample. The resultant framework of Sparse Vision Transformer Co-Exploration $\mathbf { \eta } ( \mathbf { S } \mathbf { V i T E } +$ ) remains to be end-to-end trainable and can gain additional efficiency.
|
| 26 |
+
|
| 27 |
+
Extensive experiments are conducted on ImageNet with DeiT-Tiny/Small/Base. Results of substantial computation savings and nearly undamaged accuracies consistently endorse our proposals’ effectiveness. Perhaps most impressively, we find that the sparse (co-)training can even improve the ViT accuracy rather than compromising it, making sparsity a tantalizing “free lunch”. For example, applying $\mathrm { S V i T E { + } }$ on DeiT-Small produces superior compressed ViTs at $5 0 \%$ model sparsity plus $5 \%$ data sparsity, saving $4 9 . 3 2 \%$ FLOPs and $4 . 4 \mathrm { { \bar { 0 } } \% }$ running time, while attaining a surprising improvement of $0 . 2 8 \%$ accuracy; even when the data sparsity increases to $1 0 \%$ (the model sparsity unchanged), there is still no accuracy degradation, meanwhile saving $5 2 . 3 8 \%$ FLOPs and $7 . { \bar { 6 3 \% } }$ running time.
|
| 28 |
+
|
| 29 |
+
# 2 Related Work
|
| 30 |
+
|
| 31 |
+
Vision Transformer. Transformer [43] stems from natural language processing (NLP) applications. The Vision Transformer (ViT) [1] pioneered to leverage a pure transformer, to encode an image by splitting it into a sequence of patches, projecting them into token embeddings, and feeding them to transformer encoders. With sufficient training data, ViT is able to outperform convolution neural networks on various image classification benchmarks [1, 44]. Many ViT variants have been proposed since then. For example, DeiT [2] and T2T-ViT [45] are proposed to enhance ViT’s training data efficiency, by leveraging teacher-student and better crafted architectures respectively. In addition to image classification, ViT has attracted wide attention in diverse computer vision tasks, including object detection [4–7], segmentation [46, 47], enhancement [8, 9], image generation [10–12], video understanding [48, 49], vision-language [50–57] and 3D point cloud [58].
|
| 32 |
+
|
| 33 |
+
Despite the impressive empirical performance, ViTs are generally heavy to train, and the trained models remain massive. That naturally motivates the study to reduce ViT inference and training costs, by considering model compression means. Model compression has been well studied in both computer vision and NLP applications [59–61, 42, 62, 21]. Two concurrent works [13, 63] made initial attempts towards ViT post-training compression by pruning the intermediate features and tokens respectively, but did not jointly consider weight pruning nor efficient training. Another loosely related field is the study of efficient attention mechanisms [64, 10, 52, 65–75]. They mainly reduce the calculation complexity for self-attention modules via various approximations such as low-rank decomposition. Our proposed techniques represent an orthogonal direction and can be potentially combined with them, which we leave as future work. Another latest concurrent work [76] introduced an interpretable module to dynamically and gracefully drop the redundant patches, gaining not only inference efficiency but also interpretability. Being a unique and orthogonal effort from ours, their method did not consider the training efficiency yet.
|
| 34 |
+
|
| 35 |
+
Pruning and Sparse Training. Pruning is well-known to effectively reduce deep network inference costs [77, 15]. It can be roughly categorized into two groups: $( i )$ unstructured pruning by removing insignificant weight elements per certain criterion, such as weight magnitude [78, 15], gradient [16] and hessian [79]; $( i i )$ structured pruning [80–82] by remove model sub-structures, e.g., channels [80, 81] and attention heads [42], which are often more aligned with hardware efficiency. All above require training the full dense model first, usually for several train-prune-retrain rounds.
|
| 36 |
+
|
| 37 |
+
The recent surge of sparse training seeks to adaptively identify high-quality sparse subnetworks and train only them. Starting from scratch, those methods learn to optimize the model weights together with sparse connectivity simultaneously. [32, 33] first introduced the Sparse Evolutionary Training (SET) technique [32], reaching superior performance compared to training with fixed sparse connectivity [83, 36]. [37–39] leverages “weight reallocation" to improve performance of obtained sparse subnetworks. Furthermore, gradient information from the backward pass is utilized to guide the update of the dynamic sparse connectivity [38, 34], which produces substantial performance gains. The latest investigations [40, 41, 35] demonstrate that more exhaustive exploration in the connectivity space plays a crucial role in the quality of found sparse subnetworks. Current sparse training methods mostly focus on convolutional networks. Most of them discuss unstructured sparsity, except a handful [84, 30] considering training convolutional networks with structured sparsity.
|
| 38 |
+
|
| 39 |
+
# 3 Methodology
|
| 40 |
+
|
| 41 |
+
Our SViTE method (and its variants $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { V i T E }$ and $\mathrm { S V i T E { + } }$ ) is inspired from state-of-the-art sparse training approaches [34, 35] in CNNs. This section presents the sparse exploration of ViT architectures, then shows the detailed procedure of input token selection for extra efficiency gains.
|
| 42 |
+
|
| 43 |
+
# 3.1 Sparse ViT Exploration
|
| 44 |
+
|
| 45 |
+
Revisiting sparse training. Sparse training starts from a randomly sparsified model; after optimizing several iterations, it shrinks a portion of parameters based on pre-defined pruning criterion, and activates new connections w.r.t. grow indicators. After upgrading the sparse topology, it trains the new subnetwork until the next update of the connectivity. An illustration of the overall procedure is shown in Figure 1. The key factors of sparse training are $\bullet$ sparsity distribution, $\otimes$ update schedule, $\otimes$ pruning and $\bullet$ grow criterion.
|
| 46 |
+
|
| 47 |
+
Notations. For a consistent description, we follow the standard notations in [34, 35]. Let $\mathcal { D }$ be the training dataset. $b _ { t } \sim \mathcal { D }$ is a randomly sampled data batch for iteration $t$ . $f _ { W } ( \cdot )$ represents the model with parameters $W = ( W ^ { ( 1 ) } , \cdots , W ^ { ( L ) } )$ , where $W ^ { ( l ) } \in \mathbb { R } ^ { N _ { l } } , 1 \le l \le L , N _ { l }$ is the number of prunable parameters in the $l _ { \mathrm { t h } }$ layer, and $L$ denotes the number of transformer layers. Note that the first linear projection layer and the classifier of ViT [1, 2] are not sparsified in our framework. As illust W (l)Q rated in Figure 1(bottom-left), are the weights of the self-atte $W _ { Q } ^ { ( l ) } = \{ W _ { Q } ^ { ( l , h ) } \} _ { h = 1 } ^ { H }$ , W (l)K $W _ { K } ^ { ( l ) } = \{ W _ { K } ^ { ( l , h ) } \} _ { h = 1 } ^ { H }$ , $W _ { V } ^ { ( l ) } = \{ W _ { V } ^ { ( l , h ) } \} _ { h = 1 } ^ { H }$ $l _ { \mathrm { t h } }$ $W ^ { ( l , 1 ) }$ $W ^ { ( l , 2 ) }$ $W ^ { ( l , 3 ) }$ perceptron (MLP) module in the collectively represent all the para $l _ { \mathrm { t h } }$ layer, andters in the $W ^ { ( l ) } =$ $( W _ { Q } ^ { ( l ) } , W _ { K } ^ { ( l ) } , W _ { V } ^ { ( l ) } , \bar { W } ^ { ( l , 1 ) } , W ^ { ( l , 2 ) } , W ^ { ( \bar { l } , 3 ) } )$ $l _ { \mathrm { t h } }$ where $H$ denotes the number of attention heads, and $Q ^ { ( l ) }$ , , and $V ^ { ( l ) }$ are the corresponding input and intermediate features, respectively. Each sparse layer only maintains a fraction $s _ { l } \in ( 0 , 1 )$ of its connections, and the overall sparsity of a sparse subnetwork is calculated as the ratio of pruned elements to the total parameter counts, i.e., $\frac { \sum _ { l } s _ { l } \times N _ { l } } { \sum _ { l } N _ { l } }$
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: The overall procedure of our proposed sparse ViT exploration framework. Upper Figure: first training ViT for $\Delta \mathrm { T }$ iterations, then performing prune-and-grow strategies to explore critical sparse connectivities, repreating until convergence. Bottom Left Figure: enforcing either structured or unstructured sparsity to transformer layers in ViT. Bottom Right Figure: first scoring each input embedding and applying the learnable top- $k$ selection to identify the most informative tokens.
|
| 51 |
+
|
| 52 |
+
Sparse Vision Transformer Exploration (SViTE). SViTE explores the unstructured sparse topology in vision transformers. To be specific, we adopt Erdo¨s-Re´nyi [32] as our $\bullet$ sparsity distribution. The number of parameters in the sparse layer is scaled by $\begin{array} { r } { 1 - \frac { n _ { l - 1 } + n _ { l } } { n _ { l - 1 } \times n _ { l } } } \end{array}$ , where $n _ { l }$ is the number of neurons at layer l. This distribution allocates higher sparsities to the layers with more parameters by scaling the portion of remaining weights with the sum of the number of output and input neurons/channels. For the $\otimes$ update schedule, it contains: (i) the update interval $\Delta \mathrm { T }$ , which is the number of training iterations between two sparse topology updates; $( i i )$ the end iteration $\mathrm { T _ { e n d } }$ , indicating when to stop updating the sparsity connectivity, and we set $\mathrm { T _ { e n d } }$ to $8 0 \%$ of total training iterations in our experiments; $( i i i )$ the initial fraction $\alpha$ of connections that can be pruned or $5 0 \%$ $( i v )$ a decay schedule of the fraction of changeable connections, where a cosine annealing is used, following [34, 35]. During $\begin{array} { r } { \dot { f } _ { \mathrm { d e c a y } } ( t , \alpha , \mathrm { T } _ { \mathrm { e n d } } ) = \frac { \alpha } { 2 } ( 1 + \cos ( \frac { t \times \pi } { \mathrm { T } _ { \mathrm { e n d } } } ) ) } \end{array}$
|
| 53 |
+
each connectivity update, we choose the weight magnitude as the pruning indicator, and gradient magnitude as $\bullet$ the grow indicator. Specifically, we eliminate the parameters with the layer-wise smallest weight values by applying a binary mask $m _ { \mathrm { p r u n e } }$ , then grow new connections with the highest magnitude gradients by generating a new binary mask $m _ { \mathrm { g r o w } }$ . Both masks are employed to $W ^ { ( l ) }$ via the element-wise dot product, and note that the number of non-zero elements in $m _ { \mathrm { p r u n e } }$ and $m _ { \mathrm { g r o w } }$ are equal and fixed across the overall procedure. Newly added connections are not activated in the last sparse topology, and are initialized to zero since it produces better performance as demonstrated in [34, 35].
|
| 54 |
+
|
| 55 |
+
Infrequent gradient calculation [34] is adopted in our case, which computes the gradients in an online manner and only stores the top gradient values. As illustrated in [34], such fashion amortizes the extra effort of gradient calculation, and makes it still proportional to $1 - s$ as long as $\Delta \mathrm { T } \geq { \frac { 1 } { 1 - s } }$ where $s$ is the overall sparsity.
|
| 56 |
+
|
| 57 |
+
Structured Sparse Vision Transformer Exploration $\mathbf { ( S ^ { 2 } V i T E ) }$ . Although models with unstructured sparsity achieve superior performance, structured sparsity [80–82] is much more hardware friendly and brings practical efficiency on realistic platforms, which motivates us to propose Structured Sparse ViT Exploration $( \mathrm { S ^ { 2 } V i T E } )$ . We inherit the design of $\bullet$ sparsity distribution and $\otimes$ update schedule from the unstructured SViTE, and a round-up function is used to eliminate decimals in the parameter counting. The key differences lie in the new $\otimes$ pruning and $\bullet$ grow strategies.
|
| 58 |
+
|
| 59 |
+
Pruning criterion: Let $A _ { ( l , h ) }$ denote features computed from the self-attention head {W (l,h)Q , $\{ W _ { Q } ^ { ( \mathit { l } , h ) } , W _ { K } ^ { ( \mathit { l } , h ) } , W _ { V } ^ { ( \mathit { l } , h ) } \}$ and input embeddings $X ^ { ( l ) }$ , as shown in Figure 1. We perform the Taylor expansion to the loss function [16, 42], and derive a proxy score for head importance blow:
|
| 60 |
+
|
| 61 |
+
# Algorithm 1 Sparse ViT Co-Exploration $\mathrm { ( S V i T E + ) }$ .
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathcal { T } _ { p } ^ { ( l , h ) } = \bigg | A _ { ( l , h ) } ^ { \mathrm { T } } \cdot \frac { \partial \mathcal { L } ( X ^ { ( l ) } ) } { \partial A _ { ( l , h ) } } \bigg | ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\mathcal { L } ( \cdot )$ is the cross-entropy loss as used in ViT. During each topology update, we remove attention heads with the smallest $\mathcal { T } _ { p } ^ { ( l , h ) }$ . For MLPs, we score neurons with $\ell _ { 1 }$ -norm of their associated weight vectors [85], and drop insignificant neurons. For example, the $j _ { \mathrm { t h } }$ neuron of $W ^ { ( l , 1 ) }$ in Figure 1 has an importance score kW (l,1)j,· k $W _ { j , \cdot } ^ { ( l , 1 ) }$ is the $j _ { \mathrm { t h } }$ row $W ^ { ( l , 1 ) }$ , where
|
| 68 |
+
|
| 69 |
+
Initialize: ViT model $f _ { W }$ , Dataset $\mathcal { D }$ , Sparsity distribution $\begin{array} { r c l } { \mathbb { S } } & { = } & { \{ s _ { 1 } , \dots , s _ { L } \} } \end{array}$ , Update schedule $\{ \Delta \mathrm { T } , \mathrm { T _ { e n d } } , \alpha , f _ { \mathrm { d e c a y } } \}$ , Learning rate $\eta$
|
| 70 |
+
1: Initialize $f _ { W }$ with random sparsity $\mathbb { S }$ . Highly reduced parameter count.
|
| 71 |
+
2: for each training iteration $t$ do
|
| 72 |
+
3: Sampling a batch $b _ { t } \sim \mathcal { D }$
|
| 73 |
+
4: Scoring the input token embeddings and selecting the top- $k$ informative tokens . Token selection
|
| 74 |
+
5: if $\mathbf { \chi } _ { t }$ mod $\Delta \mathrm { T } = = 0 \ \mathrm { \Omega }$ ) and $t < \mathrm { T _ { e n d } }$ then
|
| 75 |
+
6: for each layer $l$ do
|
| 76 |
+
7: $\rho = f _ { \mathrm { d e c a y } } ( t , \alpha , \mathrm { T } _ { \mathrm { e n d } } ) \cdot ( 1 - s _ { l } ) \cdot N _ { l }$
|
| 77 |
+
8: Performing prune-and-grow with portion $\rho$ w.r.t. certain criterion, generating masks $m _ { \mathrm { p r u n e } }$ and $m _ { \mathrm { g r o w } }$ to update $f _ { W }$ ’s sparsity patterns $\triangleright$ Connectivity exploration
|
| 78 |
+
9: end for
|
| 79 |
+
10: else
|
| 80 |
+
11: $\begin{array} { r l r l } { W = W - \eta \cdot \nabla _ { W } \mathcal { L } _ { t } } & { { } } & { \triangleright U p d a t i n g \ W e i g h t s } \end{array}$
|
| 81 |
+
12: end if
|
| 82 |
+
13: end for
|
| 83 |
+
14: return a sparse ViT with a trained token selector
|
| 84 |
+
|
| 85 |
+
Grow criterion: Similar to [34, 35], we active the new units with the highest
|
| 86 |
+
|
| 87 |
+
magnitude gradients, such as $\| \frac { \partial \bar { \mathcal { L } } ( X ^ { ( l ) } ) } { \partial A _ { ( l , h ) } } \| _ { \ell _ { 1 } }$ k\`1 and $\| \frac { \partial \mathcal { L } ( X ^ { ( l ) } ) } { \partial W _ { j , \cdot } ^ { ( l , 1 ) } } \| _ { \ell _ { 1 } }$ for the $h _ { \mathrm { t h } }$ attention head and the $j _ { \mathrm { t h } }$ neuron of the MLP $( W ^ { ( l , 1 ) } )$ , respectively. The gradients are calculated in the same manner as the one in unstructured SViTE, and newly added units are also initialized to zero.
|
| 88 |
+
|
| 89 |
+
# 3.2 Data and Architecture Sparsity Co-Exploration for Higher Efficiency
|
| 90 |
+
|
| 91 |
+
Besides exploring sparse transformer architectures, we further slim the dimension of input token embeddings for extra efficiency bonus by leveraging a learnable token selector, as presented in Figure 1. Meanwhile, the introduced data sparsity also serves as an implicit regularization for ViT training, which potentially leads to improved generalization ability, as evidenced in Table 6. Note that, due to skip connections, the number of input tokens actually determines
|
| 92 |
+
|
| 93 |
+
Algorithm 2 The top- $k$ selector in a PyTorch-like style.
|
| 94 |
+
|
| 95 |
+
def topk_selector(logits, k, tau, ${ \dot { \mathsf { d i m } } } = - 1 \cdot$ ):
|
| 96 |
+
|
| 97 |
+
# Maintain tokens with the top-\$k\$ highest scores gumbels $=$ -torch.empty_like(logits).exponential_().log() gumbels $=$ (logits $^ +$ gumbels) / tau # tau is the temperature y_soft $=$ gumbels.softmax(dim) # Straight through index $=$ y_soft.topk(k, dim $\mathbf { \Psi } _ { 1 } =$ dim)[1] y_hard $=$ scatter(logits, index, k) ret $=$ y_hard - y_soft.detach() $^ +$ y_soft return ret
|
| 98 |
+
|
| 99 |
+
the dimension of intermediate features, which substantially contributes to the overall computation cost. In other words, the slimmed input token embeddings directly result in compressed intermediate features, and bring substantial efficiency gains.
|
| 100 |
+
|
| 101 |
+
Table 1: Details of training configurations in our experiments, mainly following the settings in [2].
|
| 102 |
+
|
| 103 |
+
<table><tr><td>Backbone</td><td>Update Schedule{△T,Tend,α,fdecay}</td><td>Batch Size</td><td>Epochs</td><td>Inherited Settings from DeiT[2]</td></tr><tr><td>DeiT-Tiny</td><td>{20000,1200000,0.5,cosine}</td><td>512</td><td>600</td><td>AdamW, 0.0005 × batchsize,cosine decay</td></tr><tr><td>DeiT-Small</td><td>{15000,1200000,0.5,cosine}</td><td>512</td><td>600</td><td>warmup 5 epochs,0.05 weight decay</td></tr><tr><td>DeiT-Base</td><td>{7000,600000,0.5,cosine}</td><td>1024</td><td>600</td><td>0.1 label smoothing,augmentations, etc.</td></tr></table>
|
| 104 |
+
|
| 105 |
+
For the input tokens $X ^ { ( 1 ) } \in \mathbb { R } ^ { n \times d }$ , where $n$ denotes the number of tokens to be shrunk, and $d$ is the dimension of each token embedding that keeps unchanged. As shown in Figure 1, all token embeddings are passed through a learnable scorer function which is parameterized by an MLP in our experiments. Then, a selection of the top- $k$ importance scores $( 1 \leq k \leq d )$ is applied on top of it, aiming to preserve the significant tokens and remove the useless ones. To optimize parameters of the scorer function, we introduce the popular Gumbel-Softmax [86, 87] and straight-through tricks [88] to enable gradient back-propagation through the top- $k$ selection, which provides an efficient solution to draw samples from a discrete probability distribution. A detailed implementation is in Algorithm 2.
|
| 106 |
+
|
| 107 |
+
The full pipeline of data and architecture co-exploration is summarized in Algorithm 1. We term this approach $\mathrm { S V i T E { + } }$ . We first feed the randomly sampled data batch to the token selector and pick the top- $k$ informative token embeddings. Then, we alternatively train the sparse ViT for $\Delta \mathrm { T }$ iterations and perform prune-and-grow to explore the sparse connectivity in ViTs dynamically. In the end, a sparse ViT model with a trained token selector is returned and ready for evaluation.
|
| 108 |
+
|
| 109 |
+
# 4 Experiments
|
| 110 |
+
|
| 111 |
+
Baseline pruning methods. We extend several effective pruning methods from CNN compression as our strong baselines. Unstructured pruning: $( i )$ One-shot weight Magnitude Pruning (OMP) [15], which removes insignificant parameters with the globally smallest weight values; (ii) Gradually Magnitude Pruning (GMP) [17], which seamlessly incorporates gradual pruning techniques within the training process by eliminating a few small magnitude weights per iteration; and (iii) Taylor Pruning (TP) [16], which utilizes the first-order approximation of the training loss to estimate units’ importance for model sparsification. Structured pruning: Salience-based Structured Pruning (SSP). We draw inspiration from [42, 85], and remove sub-modules in ViT (e.g., self-attention heads) by leveraging their weight, activation, and gradient information. Moreover, due to the repetitive architecture of ViT, we can easily reduce the number of transformer layers to create a smaller dense ViT (Small-Dense) baseline that has similar parameter counts to the pruned ViT model.
|
| 112 |
+
|
| 113 |
+
Implementation details. Our experiments are conducted on ImageNet with DeiTTiny/Small/Base backbones. The detailed training configurations are listed in Table 1, which mainly follows the default setups in [2]. All involved customized hyperparameters are tuned via grid search (later shown in Figure 3). For a better exploration of sparsity connectivities, we increase training epochs to 600 for all experiments. GMP [17] has an additional hyperparameter, i.e., the pruning schedule, which starts from $\frac { 1 } { 6 }$ and ends at ${ \frac { \overline { { \frac { 1 } { 2 } } } } { 2 } }$ of the training epochs with 20 times pruning in total. More details are referred to Appendix A1.
|
| 114 |
+
|
| 115 |
+
Training time measuring protocol. We strictly measure the running time saving of
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
The Overall Performance of SViTE, S 2ViTE, and SViTE+
|
| 119 |
+
Figure 2: Top-1 accuracy $( \% )$ over FLOPs $( \times 1 0 ^ { 1 0 } )$ on ImageNet of our methods, i.e., SViTE, $\mathrm { S ^ { 2 } V i T E }$ , and ${ \mathrm { S V i T E } } +$ compared to DeiT baselines, trained on Imagenet-1K only.
|
| 120 |
+
|
| 121 |
+
(sparse) vision transformers on the ImageNet-1K task using CUDA benchmark mode. To be specific, we separately calculate the time elapsed during each iteration, to eliminate the impact of the hardware environment as much as possible. Note that the time for the data I/O is excluded.
|
| 122 |
+
|
| 123 |
+
Highlight of our findings. The overall performance of SViTE, $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { V i T E }$ , and $\mathrm { S V i T E { + } }$ on DeiT backbones are summarized in Figure 2. We highlight some takeaways below.
|
| 124 |
+
|
| 125 |
+
Takeaways: ❶ SViTE produces sparse DeiTs with enhanced generalization and substantial reduced FLOPs, compared to its dense counterpart $( { \star } )$ . ${ \mathrm { S V i T E } } +$ further improves the performance of SViTE by selecting the most vital patches. ❷ $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { V i T E }$ achieves matched accuracy on DeiT-Small, and significantly enhances performance on DeiT-Base. Meanwhile, its structural sparsity brings considerable running time savings. $\otimes$ Appropriate data and architecture sparsities can effectively regularize ViT training, leading to a new SOTA win-win between ViT accuracy and efficiency.
|
| 126 |
+
|
| 127 |
+
# 4.1 SViTE with Unstructured Sparsity
|
| 128 |
+
|
| 129 |
+
We perform SViTE to mine vital unstructured sparsity in DeiTs [2]. Solid lines in Figure 2 record the top-1 test-set accuracy over FLOPs on ImageNet-1K of SViTE-Small and SViTE-Base with a range of sparsity from $3 0 \%$ to $7 0 \%$ . In general, we observe that SViTE generates superior sparse ViTs with both accuracy and efficiency gains. Table 2, 3, and 5 present the comparison between SViTE and various pruning baselines. From these extensive results, we draw several consistent observations. First, compared to the dense baselines, SViTE-Tiny, -Small, and -Base obtain $2 5 . 5 6 \% \sim 3 4 . 1 6 \%$ , $4 6 . 2 6 \% \sim 5 5 . 4 4 \%$ , and $4 7 . 9 5 \% \sim 5 7 . 5 0 \%$ FLOPs reduction, respectively, at $3 0 \% \sim 6 0 \%$ sparsity levels with only a negligible accuracy drop within $0 . 5 \%$ . It verifies the effectiveness of our proposal, and indicates severe parameter redundancy in ViT. Second, our SViTE models from dynamic explorations consistently surpass other competitive baseline methods, including OMP, GMP, TP, and Small-Dense by a substantial performance margin. Among all the baseline approaches, GMP that advocates a gradual pruning schedule achieves the best accuracy with all three DeiT backbones. Third, in Figure 2, both SViTE-Small (blue solid line) and SViTE-Base (green solid line) show an improved trade-off between accuracy and efficiency, compared to their dense DeiT counterparts. Interestingly, we also observe that with similar parameter counts, a large sparse ViT consistently outperforms the corresponding smaller dense ViT. A possible explanation is those appropriate sparse typologies regularize network training and lead to enhanced generalization, which coincides with recent findings of critical subnetworks (i.e., winning tickets) in dense CNNs [89, 22] and NLP transformer [21, 90] models.
|
| 130 |
+
|
| 131 |
+
Table 2: Results of SViTE-Tiny on ImageNet-1K. Accuracies $( \% )$ within/out of parenthesis are the reproduced/reported [2] performance.
|
| 132 |
+
|
| 133 |
+
<table><tr><td>Models</td><td>Sparsity (#Para.)</td><td>FLOPs Saving</td><td>Accuracy (%)</td></tr><tr><td>DeiT-Tiny</td><td>0% (5.72M)</td><td>0%</td><td>72.20 (71.80)</td></tr><tr><td>SViTE-Tiny</td><td>30% (4.02M)</td><td>25.56%</td><td>71.78</td></tr><tr><td>OMP</td><td>30% (4.02M)</td><td>25.56%</td><td>68.35</td></tr><tr><td>GMP</td><td>30% (4.02M)</td><td>25.56%</td><td>69.56</td></tr><tr><td>TP</td><td>30% (4.02M)</td><td>25.56%</td><td>68.38</td></tr><tr><td>SViTE-Tiny</td><td>40% (3.46M)</td><td>34.16%</td><td>71.75</td></tr><tr><td>OMP</td><td>40% (3.46M)</td><td>34.16%</td><td>66.52</td></tr><tr><td>GMP</td><td>40% (3.46M)</td><td>34.15%</td><td>68.36</td></tr><tr><td>TP</td><td>40% (3.46M)</td><td>34.17%</td><td>65.45</td></tr><tr><td>Small-Dense</td><td>0% (3.94M)</td><td>32.54%</td><td>67.33</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 3: Results of SViTE-Small on ImageNet-1K. Accuracies $( \% )$ within/out of parenthesis are the reproduced/reported [2] performance.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Models</td><td>Sparsity (#Para.)</td><td>FLOPs Saving</td><td>Accuracy (%)</td></tr><tr><td>DeiT-Small</td><td>0% (22.1M)</td><td>0%</td><td>79.90 (79.78)</td></tr><tr><td>SViTE-Small</td><td>50% (11.1M)</td><td>46.26%</td><td>79.72</td></tr><tr><td>OMP</td><td>50% (11.1M)</td><td>46.25%</td><td>76.32</td></tr><tr><td>GMP</td><td>50% (11.1M)</td><td>46.26%</td><td>76.88</td></tr><tr><td>TP</td><td>50% (11.1M)</td><td>46.26%</td><td>76.30</td></tr><tr><td> SViTE-Small</td><td>60% (8.9M)</td><td>55.44%</td><td>79.41</td></tr><tr><td>OMP</td><td>60% (8.9M)</td><td>55.44%</td><td>75.32</td></tr><tr><td>GMP</td><td>60% (8.9M)</td><td>55.44%</td><td>76.79</td></tr><tr><td>TP</td><td>60% (8.9M)</td><td>55.44%</td><td>74.50</td></tr><tr><td>Small-Dense</td><td>0% (11.4M)</td><td>49.32%</td><td>73.93</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 4: Results of $\mathrm { S ^ { 2 } V i T E }$ with structured sparsity on ImageNet-1K with DeiT-Tiny/Small/Base. Accuracies $( \% )$ within/out of parenthesis are the reproduced/reported [2] performance.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Models</td><td>Sparsity (%)</td><td>Parameters</td><td>FLOPs Saving</td><td>Running Time Reduced|Top-1 Accuracy (%)</td><td></td></tr><tr><td>DeiT-Tiny (Dense)</td><td>0%</td><td>5.72M</td><td>0%</td><td>0%</td><td>72.20 (71.80)</td></tr><tr><td>SViTE-Tiny (Unstructured)</td><td>30%</td><td>4.02M</td><td>25.56%</td><td>0%</td><td>71.78</td></tr><tr><td>SSP-Tiny (Structured)</td><td>30%</td><td>4.21M</td><td>23.69%</td><td>10.57%</td><td>68.59</td></tr><tr><td>S2ViTE-Tiny (Structured)</td><td>30%</td><td>4.21M</td><td>23.69%</td><td>10.57%</td><td>70.12</td></tr><tr><td>DeiT-Small (Dense)</td><td>0%</td><td>22.1M</td><td>0%</td><td>0%</td><td>79.90 (79.78)</td></tr><tr><td>SViTE-Small (Unstructured)</td><td>40%</td><td>13.3M</td><td>36.73%</td><td>0%</td><td>80.26</td></tr><tr><td>SSP-Small (Structured)</td><td>40%</td><td>14.6M</td><td>31.63%</td><td>22.65%</td><td>77.74</td></tr><tr><td>S²ViTE-Small (Structured)</td><td>40%</td><td>14.6M</td><td>31.63%</td><td>22.65%</td><td>79.22</td></tr><tr><td>DeiT-Base (Dense)</td><td>0%</td><td>86.6M</td><td>0%</td><td>0%</td><td>81.80 (80.98)</td></tr><tr><td>SViTE-Base (Unstructured)</td><td>40%</td><td>52.0M</td><td>38.30%</td><td>0%</td><td>81.56</td></tr><tr><td>SSP-Base (Structured)</td><td>40%</td><td>56.8M</td><td>33.13%</td><td>24.70%</td><td>80.08</td></tr><tr><td>S2ViTE-Base (Structured)</td><td>40%</td><td>56.8M</td><td>33.13%</td><td>24.70%</td><td>82.22</td></tr></table>
|
| 142 |
+
|
| 143 |
+
# 4.2 $\mathbf { S } ^ { 2 }$ ViTE with Structured Sparsity
|
| 144 |
+
|
| 145 |
+
For more practical benefits, we investigate sparse DeiTs with structured sparsity. Results are summarized in Table 4. Besides the obtained $2 3 . { \bar { 7 } } 9 \% \sim 3 3 . 6 3 \%$ FLOPs savings, ${ \mathsf { S } } ^ { \tilde { 2 } }$ ViTE-Tiny, $S ^ { 2 }$ ViTE
|
| 146 |
+
|
| 147 |
+
Small, and $S ^ { 2 }$ ViTE-Base enjoy an extra $1 0 . 5 7 \%$ , $2 2 . 6 5 \%$ , and $2 4 . 7 0 \%$ running time reduction, respectively, from $3 0 \% \sim \hat { 4 } 0 \%$ structured sparsity with competitive top-1 accuracies. Furthermore, $\mathrm { S ^ { 2 } V i T E }$ consistently outperforms the baseline structured pruning method (SSP), which again demonstrates the superior sparse connectivity learned from dynamic sparse training.
|
| 148 |
+
|
| 149 |
+
The most impressive results come from $S ^ { 2 }$ ViTE-Base at $4 0 \%$ structured sparsity. It even surpasses the dense DeiT base model by $0 . 4 2 \% \sim 1 . 2 4 \%$ accuracy with $3 4 . 4 1 \%$ parameter counts, $3 3 . 1 3 \%$ FLOPs, and $2 4 . 7 0 \%$ running time reductions. We conclude that $( i )$ an adequate sparsity from $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { V i T E }$ boosts ViT’s generalization ability, which can be regarded as an implicit regularization; $( i i )$ larger ViTs (e.g., DeiT-Base) tend to have more superfluous self-attention heads, and are more amenable to structural sparsification from $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { V i T E }$ , based on Figure 2 where dash lines denote the overall performance of $\hat { \mathbf { S } ^ { 2 } }$ ViTE-Small and $S ^ { 2 }$ ViTE-Base with a range of sparsity from $3 0 \%$ to $7 0 \%$ .
|
| 150 |
+
|
| 151 |
+
Table 5: Results of SViTE-Base on ImageNet-1K. Accuracies $( \% )$ within/out of parenthesis are the reproduced/reported [2] performance.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Models</td><td>Sparsity (#Para.)</td><td>FLOPs Saving|Accuracy (%)</td><td></td></tr><tr><td>DeiT-Base</td><td>0% (86.6M)</td><td>0%</td><td>81.80 (80.98)</td></tr><tr><td>SViTE-Base</td><td>50% (43.4M)</td><td>47.95%</td><td>81.51</td></tr><tr><td>OMP</td><td>50% (43.4M)</td><td>47.94%</td><td>80.26</td></tr><tr><td>GMP</td><td>50% (43.4M)</td><td>47.95%</td><td>80.79</td></tr><tr><td>TP</td><td>50% (43.4M)</td><td>47.94%</td><td>80.55</td></tr><tr><td>SViTE-Base</td><td>60% (34.8M)</td><td>57.50%</td><td>81.28</td></tr><tr><td>OMP</td><td>60% (34.8M)</td><td>57.50%</td><td>80.25</td></tr><tr><td>GMP</td><td>60% (34.8M)</td><td>57.50%</td><td>80.44</td></tr><tr><td>TP</td><td>60% (34.8M)</td><td>57.49%</td><td>80.37</td></tr><tr><td>Small-Dense</td><td>0% (44.0M)</td><td>49.46%</td><td>78.59</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 6: Results of SViTE $^ +$ -Small on ImageNet-1K. Accuracies $( \% )$ within/out of parenthesis are the reproduced/reported [2] performance.
|
| 156 |
+
|
| 157 |
+
<table><tr><td></td><td></td><td>#Tokens (%)|Time ReducedFLOPs Saving|Accuracy (%)</td><td></td></tr><tr><td colspan="4">SViTE+-Small 50% Unstructured Sparsity</td></tr><tr><td>100%</td><td>0%</td><td>46.26%</td><td>79.72</td></tr><tr><td>95%</td><td>4.40%</td><td>49.32%</td><td>80.18</td></tr><tr><td>90%</td><td>7.63%</td><td>52.38%</td><td>79.91</td></tr><tr><td>70%</td><td>19.77%</td><td>63.95%</td><td>77.90</td></tr><tr><td colspan="4">S²ViTE+-Small 40% Structured Sparsity</td></tr><tr><td>100%</td><td>22.65%</td><td>31.63%</td><td>79.22</td></tr><tr><td>95%</td><td>27.17%</td><td>37.76%</td><td>78.44</td></tr><tr><td>90%</td><td>29.21%</td><td>41.50%</td><td>78.16</td></tr><tr><td>70%</td><td>39.10%</td><td>54.96%</td><td>74.77</td></tr></table>
|
| 158 |
+
|
| 159 |
+
# 4.3 $\mathbf { S V i T E { + } }$ with Data and Architecture Sparsity Co-Exploration
|
| 160 |
+
|
| 161 |
+
In this section, we study data and architecture sparsity co-exploration for ViTs, i.e., $\mathrm { S V i T E { + } }$ . Blessed by the reduced input token embeddings, even ViTs with unstructured sparsity can have running time savings. The benefits are mainly from the shrunk input and intermediate feature dimensions. Without loss of generality, we consider SViTE $+ \cdot$ -Small with $5 0 \%$ unstructured sparsity and ${ \mathrm { S ^ { 2 } V i T E } } +$ -Small with $4 0 \%$ structured sparsity as examples. As shown in Table 6 and Figure 2, SViTE+-Small at $5 0 \%$ unstructured sparsity is capable of abandoning $5 \% \sim 1 0 \%$ tokens while achieving $4 . 4 0 \% \sim 7 . 6 3 \%$ running time and $4 9 . 3 2 \% \sim 5 2 . 3 8 \%$ FLOPs savings, with even improved top-1 testing accuracy. It again demonstrates that data sparsity as an implicit regularizer plays a beneficial role in ViT training. However, slimming input and intermediate embedding is less effective when incorporated with $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { V i T E }$ , suggesting that aggressively removing structural sub-modules hurts ViT’s generalization.
|
| 162 |
+
|
| 163 |
+
# 4.4 Ablation and Generalization Study of SViTEs
|
| 164 |
+
|
| 165 |
+
Update interval in SViTE. The length of the update interval $\Delta \mathrm { T }$ controls one of the essential tradeoffs in our proposed dynamic sparse exploration, since $\Delta \mathrm { T }$ multiplying the number of updates is the pre-defined $\mathrm { T _ { e n d } }$ . On the one hand, a larger updated interval (i.e., smaller update frequency) produces a more well-trained model for improved estimation of units’ importance. On the other hand, a larger update frequency (i.e., smaller $\Delta \mathrm { T }$ ) allows more sufficient exploration of sparse connectivities, which potentially generates higher-quality sparse subnetworks, as demonstrated in [35]. We evaluate this factor in our SViTE context, and collect the results in Figure 3 (Left). We observe that $\Delta \mathrm { T } = 2 0 0 0 0$ works the best for SViTE-Tiny, and both larger and smaller $\Delta \mathrm { T }$ degrade the performance.
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 3: Accuracy of SViTE-Tiny with $5 0 \%$ unstructured sparsity. Left: ablation studies of the update interval $( \bar { \Delta \mathrm { T } } )$ ; Right: ablations studies of the adopted batch size $( b )$ .
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Dense DeiT-Base
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
-Base with $4 0 \%$ Structured Sparsity
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
SViTE-Base with $4 0 \%$ Unstructured Sparsity
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 4: Attention probabilities for DeiT-Base, $S ^ { 2 }$ ViTE-Base, and SViTE-Base models with 12 layers (rows) and 12 heads (columns) using visualization tools provided in [94]. Attention maps are averaged over 100 test samples from ImageNet-1K to present head behavior and remove the dependence on the input content. The black square is the query pixel. indicates pruned attention heads. Zoom-in for better visibility.
|
| 181 |
+
Figure 5: Learned patch selection patterns of SViTE $+$ -Small at $1 0 \%$ data and $5 0 \%$ architecture sparsity levels. $\widehat { \mathbb { I } }$ indicates removed inessential patches.
|
| 182 |
+
|
| 183 |
+
Batch size in SViTE. Besides the update interval $\Delta \mathrm { T }$ , batch size (b) also affects the aforementioned trade-off, especially for the data-hungry ViT training. We investigate different batch sizes in Figure 3 (Right), and find that $b = 5 1 2$ outperforms other common options for SViTE-Tiny.
|
| 184 |
+
|
| 185 |
+
Generalization study of SViTE and its variants. It is worth mentioning that our proposed frameworks (SViTE, $\mathrm { S ^ { 2 } V i T E }$ , $\mathrm { S V i T E { + } }$ ) are independent of the backbone architectures, and can be easily plugged in other vision transformer models [91, 45, 92, 93]. We implemented both SViTE and ${ \bar { \mathbf { S } } } ^ { 2 }$ ViTE on TNT-S [91]. SViTE-TNT-S gains 0.13 accuracy improvements (Ours: 81.63 v.s. TNT-S: 81.50) and $3 7 . 5 4 \%$ FLOPs savings at $4 0 \%$ unstructured sparsity; $S ^ { 2 }$ ViTE-TNT-S obtains $3 2 . 9 6 \%$ FLOPs and $2 3 . 7 1 \%$ running time reductions at $4 0 \%$ structured sparsity with almost unimpaired accuracy (Ours: 81.34 v.s. TNT-S:81.50).
|
| 186 |
+
|
| 187 |
+
# 4.5 Visualization
|
| 188 |
+
|
| 189 |
+
Sparse connectivity patterns. We provide unit-wise and element-wise heatmap visualizations for SViTE-Base with $4 0 \%$ structured sparsity in Figure A7 (in Appendix). Similarly, element-wise heatmap visualizations of SViTE-Base with $5 0 \%$ unstructured sparsity are displayed in Figure A6. We find that even unstructured sparsity exploration can develop obvious structural patterns (i.e., “vertical lines” in mask heatmaps), which implies a stronger potential for hardware speedup [95].
|
| 190 |
+
|
| 191 |
+
Self-attention heatmaps. As shown in Figure 4, we utilize tools in [94] to visualize attention maps of (sparse) ViTs. Multiple attention heads show similar behaviors, which implies the structural redundancy. Fortunately, $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { V i T E }$ eliminates unnecessary heads to some extent. With regard to SViTE-Base’s visual results, it seems to activate fewer attention heads for predictions (darker colors mean larger values), compared to the ones of dense DeiT-Base. We also observe that in the bottom layers, the attention probabilities are more centered at several heads; while in the top layers, the attention probabilities are more uniformly distributed. This kind of tendency is well preserved by our sparse ViT (SViTE) from Dense ViTs.
|
| 192 |
+
|
| 193 |
+
Learned patch selection patterns. Figure 5 presents the learned behaviors of our token selector in SViTE+. We observe that the useless removed patches are typically distributed around the main object or in the background. Meanwhile, the patches within the objects of interest are largely persevered, which evidences the effectiveness of our learned patch token selector.
|
| 194 |
+
|
| 195 |
+
# 5 Conclusion and Discussion of Broader Impact
|
| 196 |
+
|
| 197 |
+
In this work, we introduce sparse ViT exploration algorithms, SViTE, and its variants $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { V i T E }$ and ${ \mathrm { S V i T E } } +$ , to explore high-quality sparse patterns in both ViT’s architecture and input token embeddings, alleviating training memory bottleneck and pursuing inference ultra-efficiency (e.g., running time and FLOPs). Comprehensive experiments on ImageNet validate the effectiveness of our proposal. Our informative visualizations further demonstrate that $\mathrm { S V i T E { + } }$ is capable of mining crucial connections and input tokens by eliminating redundant units and dropping useless token embeddings. Future work includes examining the performance of our sparse ViTs on incoming hardware accelerators [96–100], which will provide better supports for sparsity.
|
| 198 |
+
|
| 199 |
+
This work is scientific in nature, and we do not believe it has immediate negative societal impacts. Our findings of sparse vision transformers are highly likely to reduce both memory and energy costs substantially, leading to economic deployment in real-world applications (e.g., on smartphones).
|
| 200 |
+
|
| 201 |
+
# Acknowledgment
|
| 202 |
+
|
| 203 |
+
Z.W. is in part supported by an NSF RTML project (#2053279).
|
| 204 |
+
|
| 205 |
+
# References
|
| 206 |
+
|
| 207 |
+
[1] 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.
|
| 208 |
+
[2] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
|
| 209 |
+
[3] Kai Han, Yunhe Wang, Hanting Chen, Xinghao Chen, Jianyuan Guo, Zhenhua Liu, Yehui Tang, An Xiao, Chunjing Xu, Yixing Xu, et al. A survey on visual transformer. arXiv preprint arXiv:2012.12556, 2020.
|
| 210 |
+
[4] Minghang Zheng, Peng Gao, Xiaogang Wang, Hongsheng Li, and Hao Dong. End-to-end object detection with adaptive clustering transformer. arXiv preprint arXiv:2011.09315, 2020.
|
| 211 |
+
[5] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pages 213–229. Springer, 2020.
|
| 212 |
+
[6] Zhigang Dai, Bolun Cai, Yugeng Lin, and Junying Chen. Up-detr: Unsupervised pre-training for object detection with transformers. arXiv preprint arXiv:2011.09094, 2020.
|
| 213 |
+
[7] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable {detr}: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2021.
|
| 214 |
+
[8] Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020.
|
| 215 |
+
[9] Fuzhi Yang, Huan Yang, Jianlong Fu, Hongtao Lu, and Baining Guo. Learning texture transformer network for image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5791–5800, 2020.
|
| 216 |
+
[10] Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018.
|
| 217 |
+
[11] Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. 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 1691–1703. PMLR, 13–18 Jul 2020.
|
| 218 |
+
[12] Yifan Jiang, Shiyu Chang, and Zhangyang Wang. Transgan: Two transformers can make one strong gan. arXiv preprint arXiv:2102.07074, 2021.
|
| 219 |
+
[13] Mingjian Zhu, Kai Han, Yehui Tang, and Yunhe Wang. Visual transformer pruning, 2021.
|
| 220 |
+
[14] Yu Cheng, Duo Wang, Pan Zhou, and Tao Zhang. A survey of model compression and acceleration for deep neural networks. arXiv preprint arXiv:1710.09282, 2017.
|
| 221 |
+
[15] Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In International Conference on Learning Representations, 2016.
|
| 222 |
+
[16] 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.
|
| 223 |
+
[17] Michael Zhu and Suyog Gupta. To prune, or not to prune: exploring the efficacy of pruning for model compression. arXiv preprint arXiv:1710.01878, 2017.
|
| 224 |
+
[18] Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations, 2018.
|
| 225 |
+
[19] Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M Roy, and Michael Carbin. Linear mode connectivity and the lottery ticket hypothesis. arXiv preprint arXiv:1912.05671, 2019.
|
| 226 |
+
[20] Zhenyu Zhang, Xuxi Chen, Tianlong Chen, and Zhangyang Wang. Efficient lottery ticket finding: Less data is more. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 12380–12390. PMLR, 18–24 Jul 2021.
|
| 227 |
+
[21] Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Zhangyang Wang, and Michael Carbin. The lottery ticket hypothesis for pre-trained bert networks. arXiv preprint arXiv:2007.12223, 2020.
|
| 228 |
+
[22] Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Michael Carbin, and Zhangyang Wang. The lottery tickets hypothesis for supervised and self-supervised pre-training in computer vision models. arXiv preprint arXiv:2012.06908, 2020.
|
| 229 |
+
[23] Xuxi Chen, Zhenyu Zhang, Yongduo Sui, and Tianlong Chen. {GAN}s can play lottery tickets too. In International Conference on Learning Representations, 2021.
|
| 230 |
+
[24] Haoyu Ma, Tianlong Chen, Ting-Kuei Hu, Chenyu You, Xiaohui Xie, and Zhangyang Wang. Good students play big lottery better. arXiv preprint arXiv:2101.03255, 2021.
|
| 231 |
+
[25] Zhe Gan, Yen-Chun Chen, Linjie Li, Tianlong Chen, Yu Cheng, Shuohang Wang, and Jingjing Liu. Playing lottery tickets with vision and language. arXiv preprint arXiv:2104.11832, 2021.
|
| 232 |
+
[26] Tianlong Chen, Yongduo Sui, Xuxi Chen, Aston Zhang, and Zhangyang Wang. A unified lottery ticket hypothesis for graph neural networks. arXiv preprint arXiv:2102.06790, 2021.
|
| 233 |
+
[27] Tianlong Chen, Yu Cheng, Zhe Gan, Jingjing Liu, and Zhangyang Wang. Ultra-dataefficient gan training: Drawing a lottery ticket first, then training it toughly. arXiv preprint arXiv:2103.00397, 2021.
|
| 234 |
+
[28] Namhoon Lee, Thalaiyasingam Ajanthan, and Philip Torr. Snip: Single-shot network pruning based on connection sensitivity. In International Conference on Learning Representations, 2019.
|
| 235 |
+
[29] Chaoqi Wang, Guodong Zhang, and Roger Grosse. Picking winning tickets before training by preserving gradient flow. In International Conference on Learning Representations, 2020.
|
| 236 |
+
[30] Haoran You, Chaojian Li, Pengfei Xu, Yonggan Fu, Yue Wang, Xiaohan Chen, Richard G. Baraniuk, Zhangyang Wang, and Yingyan Lin. Drawing early-bird tickets: Toward more efficient training of deep networks. In International Conference on Learning Representations, 2020.
|
| 237 |
+
[31] Xiaohan Chen, Yu Cheng, Shuohang Wang, Zhe Gan, Zhangyang Wang, and Jingjing Liu. Earlybert: Efficient bert training via early-bird lottery tickets. arXiv preprint arXiv:2101.00063, 2020.
|
| 238 |
+
[32] Decebal Constantin Mocanu, Elena Mocanu, Peter Stone, Phuong H Nguyen, Madeleine Gibescu, and Antonio Liotta. Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science. Nature communications, 9(1):1–12, 2018.
|
| 239 |
+
[33] Shiwei Liu, Decebal Constantin Mocanu, Amarsagar Reddy Ramapuram Matavalam, Yulong Pei, and Mykola Pechenizkiy. Sparse evolutionary deep learning with over one million artificial neurons on commodity hardware. Neural Computing and Applications, 2020.
|
| 240 |
+
[34] 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.
|
| 241 |
+
[35] Shiwei Liu, Lu Yin, Decebal Constantin Mocanu, and Mykola Pechenizkiy. Do we actually need dense over-parameterization? in-time over-parameterization in sparse training. arXiv preprint arXiv:2102.02887, 2021.
|
| 242 |
+
[36] Utku Evci, Fabian Pedregosa, Aidan Gomez, and Erich Elsen. The difficulty of training sparse neural networks. arXiv preprint arXiv:1906.10732, 2019.
|
| 243 |
+
[37] Hesham Mostafa and Xin Wang. Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization. In International Conference on Machine Learning, 2019.
|
| 244 |
+
[38] Tim Dettmers and Luke Zettlemoyer. Sparse networks from scratch: Faster training without losing performance. arXiv preprint arXiv:1907.04840, 2019.
|
| 245 |
+
[39] Shiwei Liu, Decebal Constantin Mocanu, Yulong Pei, and Mykola Pechenizkiy. Selfish sparse rnn training. arXiv preprint arXiv:2101.09048, 2021.
|
| 246 |
+
[40] Siddhant Jayakumar, Razvan Pascanu, Jack Rae, Simon Osindero, and Erich Elsen. Top-kast: Top-k always sparse training. Advances in Neural Information Processing Systems, 33, 2020.
|
| 247 |
+
[41] Md Aamir Raihan and Tor M Aamodt. Sparse weight activation training. arXiv preprint arXiv:2001.01969, 2020.
|
| 248 |
+
[42] Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one?, 2019.
|
| 249 |
+
[43] 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, pages 5998–6008, 2017.
|
| 250 |
+
[44] Jianyuan Guo, Kai Han, Han Wu, Chang Xu, Yehui Tang, Chunjing Xu, and Yunhe Wang. Cmt: Convolutional neural networks meet vision transformers. arXiv preprint arXiv:2107.06263, 2021.
|
| 251 |
+
[45] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Zihang Jiang, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021.
|
| 252 |
+
[46] Huiyu Wang, Yukun Zhu, Hartwig Adam, Alan Yuille, and Liang-Chieh Chen. Max-deeplab: End-to-end panoptic segmentation with mask transformers. arXiv preprint arXiv:2012.00759, 2020.
|
| 253 |
+
[47] Yuqing Wang, Zhaoliang Xu, Xinlong Wang, Chunhua Shen, Baoshan Cheng, Hao Shen, and Huaxia Xia. End-to-end video instance segmentation with transformers. arXiv preprint arXiv:2011.14503, 2020.
|
| 254 |
+
[48] Yanhong Zeng, Jianlong Fu, and Hongyang Chao. Learning joint spatial-temporal transformations for video inpainting. In European Conference on Computer Vision, pages 528–543. Springer, 2020.
|
| 255 |
+
[49] Luowei Zhou, Yingbo Zhou, Jason J Corso, Richard Socher, and Caiming Xiong. End-to-end dense video captioning with masked transformer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8739–8748, 2018.
|
| 256 |
+
[50] Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. arXiv preprint arXiv:1908.02265, 2019.
|
| 257 |
+
[51] Hao Tan and Mohit Bansal. Lxmert: Learning cross-modality encoder representations from transformers. arXiv preprint arXiv:1908.07490, 2019.
|
| 258 |
+
[52] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Universal image-text representation learning. In European Conference on Computer Vision, pages 104–120. Springer, 2020.
|
| 259 |
+
[53] Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. Vl-bert: Pre-training of generic visual-linguistic representations. arXiv preprint arXiv:1908.08530, 2019.
|
| 260 |
+
[54] Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. Visualbert: A simple and performant baseline for vision and language. arXiv preprint arXiv:1908.03557, 2019.
|
| 261 |
+
[55] Gen Li, Nan Duan, Yuejian Fang, Ming Gong, and Daxin Jiang. Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 11336–11344, 2020.
|
| 262 |
+
[56] Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In European Conference on Computer Vision, pages 121–137. Springer, 2020.
|
| 263 |
+
[57] Luowei Zhou, Hamid Palangi, Lei Zhang, Houdong Hu, Jason Corso, and Jianfeng Gao. Unified vision-language pre-training for image captioning and vqa. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13041–13049, 2020.
|
| 264 |
+
[58] Hengshuang Zhao, Li Jiang, Jiaya Jia, Philip Torr, and Vladlen Koltun. Point transformer. arXiv preprint arXiv:2012.09164, 2020.
|
| 265 |
+
[59] Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. In International Conference on Learning Representations, 2020.
|
| 266 |
+
[60] Fu-Ming Guo, Sijia Liu, Finlay S Mungall, Xue Lin, and Yanzhi Wang. Reweighted proximal pruning for large-scale language representation. arXiv preprint arXiv:1909.12486, 2019.
|
| 267 |
+
[61] Prakhar Ganesh, Yao Chen, Xin Lou, Mohammad Ali Khan, Yin Yang, Deming Chen, Marianne Winslett, Hassan Sajjad, and Preslav Nakov. Compressing large-scale transformer-based models: A case study on bert. arXiv preprint arXiv:2002.11985, 2020.
|
| 268 |
+
[62] J. S. McCarley, Rishav Chakravarti, and Avirup Sil. Structured pruning of a bert-based question answering model. arXiv preprint arXiv:1910.06360, 2019.
|
| 269 |
+
[63] Yehui Tang, Kai Han, Yunhe Wang, Chang Xu, Jianyuan Guo, Chao Xu, and Dacheng Tao. Patch slimming for efficient vision transformers. arXiv preprint arXiv:2106.02852, 2021.
|
| 270 |
+
[64] Pengchuan Zhang, Xiyang Dai, Jianwei Yang, Bin Xiao, Lu Yuan, Lei Zhang, and Jianfeng Gao. Multi-scale vision longformer: A new vision transformer for high-resolution image encoding. arXiv preprint arXiv:2103.15358, 2021.
|
| 271 |
+
[65] Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
|
| 272 |
+
[66] Nikita Kitaev, Łukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020.
|
| 273 |
+
[67] Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In International Conference on Machine Learning, pages 3744–3753. PMLR, 2019.
|
| 274 |
+
[68] Aurko Roy, Mohammad Saffar, Ashish Vaswani, and David Grangier. Efficient content-based sparse attention with routing transformers. Transactions of the Association for Computational Linguistics, 9:53–68, 2021.
|
| 275 |
+
[69] Jack W Rae, Anna Potapenko, Siddhant M Jayakumar, and Timothy P Lillicrap. Compressive transformers for long-range sequence modelling. arXiv preprint arXiv:1911.05507, 2019.
|
| 276 |
+
[70] Jonathan Ho, Nal Kalchbrenner, Dirk Weissenborn, and Tim Salimans. Axial attention in multidimensional transformers. arXiv preprint arXiv:1912.12180, 2019.
|
| 277 |
+
[71] Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In International Conference on Machine Learning, pages 5156–5165. PMLR, 2020.
|
| 278 |
+
[72] 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.
|
| 279 |
+
[73] Yi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen, Dara Bahri, Philip Pham, Jinfeng Rao, Liu Yang, Sebastian Ruder, and Donald Metzler. Long range arena: A benchmark for efficient transformers. arXiv preprint arXiv:2011.04006, 2020.
|
| 280 |
+
[74] Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey. arXiv preprint arXiv:2009.06732, 2020.
|
| 281 |
+
[75] Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Selfattention with linear complexity, 2020.
|
| 282 |
+
[76] Bowen Pan, Yifan Jiang, Rameswar Panda, Zhangyang Wang, Rogerio Feris, and Aude Oliva. Ia-red2: Interpretability-aware redundancy reduction for vision transformers, 2021.
|
| 283 |
+
[77] Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems, pages 598–605, 1990.
|
| 284 |
+
[78] Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 1135–1143. Curran Associates, Inc., 2015.
|
| 285 |
+
[79] Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In D. S. Touretzky, editor, Advances in Neural Information Processing Systems 2, pages 598–605. Morgan-Kaufmann, 1990.
|
| 286 |
+
[80] 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, pages 2736–2744, 2017.
|
| 287 |
+
[81] 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, 2017.
|
| 288 |
+
[82] Hao Zhou, Jose M Alvarez, and Fatih Porikli. Less is more: Towards compact cnns. In European Conference on Computer Vision, pages 662–677. Springer, 2016.
|
| 289 |
+
[83] Decebal Constantin Mocanu, Elena Mocanu, Phuong H Nguyen, Madeleine Gibescu, and Antonio Liotta. A topological insight into restricted boltzmann machines. Machine Learning, 104(2-3):243–270, 2016. [84] Sangkug Lym, Esha Choukse, Siavash Zangeneh, Wei Wen, Sujay Sanghavi, and Mattan Erez. Prunetrain: fast neural network training by dynamic sparse model reconfiguration. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, pages 1–13, 2019.
|
| 290 |
+
[85] Brian R Bartoldson, Ari S Morcos, Adrian Barbu, and Gordon Erlebacher. The generalizationstability tradeoff in neural network pruning. arXiv preprint arXiv:1906.03728, 2019. [86] Emit J. Gumbel. Statistical theory of extreme values and some practical applications. The Journal of the Royal Aeronautical Society, 58(527):792–793, 1954.
|
| 291 |
+
[87] Chris J Maddison, Daniel Tarlow, and Tom Minka. $\mathbf { A } ^ { * }$ sampling. arXiv preprint arXiv:1411.0030, 2014.
|
| 292 |
+
[88] Penghang Yin, Jiancheng Lyu, Shuai Zhang, Stanley Osher, Yingyong Qi, and Jack Xin. Understanding straight-through estimator in training activation quantized neural nets. arXiv preprint arXiv:1903.05662, 2019.
|
| 293 |
+
[89] Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M Roy, and Michael Carbin. The lottery ticket hypothesis at scale. arXiv preprint arXiv:1903.01611, 2019.
|
| 294 |
+
[90] Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019.
|
| 295 |
+
[91] Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. Transformer in transformer. arXiv preprint arXiv:2103.00112, 2021.
|
| 296 |
+
[92] Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122, 2021.
|
| 297 |
+
[93] Daquan Zhou, Bingyi Kang, Xiaojie Jin, Linjie Yang, Xiaochen Lian, Zihang Jiang, Qibin Hou, and Jiashi Feng. Deepvit: Towards deeper vision transformer. arXiv preprint arXiv:2103.11886, 2021.
|
| 298 |
+
[94] Jean-Baptiste Cordonnier, Andreas Loukas, and Martin Jaggi. On the relationship between selfattention and convolutional layers. In International Conference on Learning Representations, 2020.
|
| 299 |
+
[95] Erich Elsen, Marat Dukhan, Trevor Gale, and Karen Simonyan. Fast sparse convnets. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 14629–14638, 2020.
|
| 300 |
+
[96] Peiqi Wang, Yu Ji, Chi Hong, Yongqiang Lyu, Dongsheng Wang, and Yuan Xie. Snrram: An efficient sparse neural network computation architecture based on resistive random-access memory. In 2018 55th ACM/ESDA/IEEE Design Automation Conference (DAC), pages 1–6, 2018.
|
| 301 |
+
[97] Mike Ashby, Christiaan Baaij, Peter Baldwin, Martijn Bastiaan, Oliver Bunting, Aiken Cairncross, Christopher Chalmers, Liz Corrigan, Sam Davis, Nathan van Doorn, et al. Exploiting unstructured sparsity on next-generation datacenter hardware. None, 2019.
|
| 302 |
+
[98] Chen Liu, Guillaume Bellec, Bernhard Vogginger, David Kappel, Johannes Partzsch, Felix Neumärker, Sebastian Höppner, Wolfgang Maass, Steve B Furber, Robert Legenstein, et al. Memory-efficient deep learning on a spinnaker 2 prototype. Frontiers in neuroscience, 12:840, 2018.
|
| 303 |
+
[99] Song Han, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A. Horowitz, and William J. Dally. Eie: Efficient inference engine on compressed deep neural network. In 2016 ACM/IEEE 43rd Annual International Symposium on Computer Architecture (ISCA), pages 243–254, 2016.
|
| 304 |
+
[100] Yu-Hsin Chen, Tien-Ju Yang, Joel Emer, and Vivienne Sze. Eyeriss v2: A flexible accelerator for emerging deep neural networks on mobile devices. IEEE Journal on Emerging and Selected Topics in Circuits and Systems, 9(2):292–308, 2019.
|
md/train/MBH29cOeohr/MBH29cOeohr.md
ADDED
|
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fact-driven Logical Reasoning
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Logical reasoning deeply relies on accurate, clearly presented clue forms which
|
| 11 |
+
2 are usually modeled as entity-like knowledge in existing studies. However, in
|
| 12 |
+
3 real hierarchical reasoning motivated machine reading comprehension (MRC),
|
| 13 |
+
4 such one-side modeling are insufficient for those indispensable local complete
|
| 14 |
+
5 facts or events when only "global" knowledge is really paid attention to. Thus, in
|
| 15 |
+
6 view of language being a complete knowledge/clue carrier, we propose a general
|
| 16 |
+
7 formalism to support representing logic units by extracting backbone constituents
|
| 17 |
+
8 of the sentence such as the subject-verb-object formed "facts", covering both global
|
| 18 |
+
9 and local knowledge pieces that are necessary as the basis for logical reasoning.
|
| 19 |
+
10 Beyond building the ad-hoc graphs, we propose a more general and convenient
|
| 20 |
+
11 fact-driven approach to construct a supergraph on top of our newly defined fact
|
| 21 |
+
12 units, and enhance the supergraph with further explicit guidance of local question
|
| 22 |
+
13 and option interactions. Experiments on two challenging logical reasoning MRC
|
| 23 |
+
14 benchmarks show that our proposed model, FOCAL REASONER, outperforms the
|
| 24 |
+
15 baseline models dramatically.
|
| 25 |
+
|
| 26 |
+
# 16 1 Introduction
|
| 27 |
+
|
| 28 |
+
17 Machine reading comprehension (MRC) requires machine to answer question according to given
|
| 29 |
+
18 passage [1, 2, 2, 3, 4]. Logical reasoning [5] from MRC accounts for human intuition about entailment
|
| 30 |
+
19 of sentences and reflects the semantic relations between sentential constituents [6]. Recently, there is
|
| 31 |
+
20 a surging trend of research into logical reasoning ability, among which ReClor [7] and LogiQA [5] are
|
| 32 |
+
21 two representative datasets introduced to promote the development of logical reasoning, where logical
|
| 33 |
+
22 reasoning questions are selected from standardized exams such as GMAT1, requiring models to read
|
| 34 |
+
23 and comprehend the complicated logical relationships. Similar to the standard question-answering
|
| 35 |
+
24 (QA)-based MRC tasks in form, our concerned logical reasoning QA tasks contain three elements:
|
| 36 |
+
25 passage, question and the candidate options as examples shown in Figure 1.
|
| 37 |
+
|
| 38 |
+
MRC models usually exploit a pre-trained language model (PrLM) as a key encoder for effective contextualized representation. Meanwhile, the major challenge of logical reasoning is to uncover logical structures, and reasoning with the candidate options and questions to predict the correct answer. However, it is difficult for PrLMs to capture the logical structure inherent in the texts since logical supervision is rarely available during pre-training. Existing logical reasoning has shown serious dependence on knowledge-like clues. This is due to the lengthy, noisy text in human language which is though a natural carrier of knowledge but does not provide a clean, exact knowledge form. Thus, an increasing interest is using graph networks to model the entity-aware relationships in the passages [8, 9, 10, 11]. However, all these methods may insufficiently capture indispensable logical units from two perspectives. First, they mostly focus on entity-aware commonsense knowledge, but pay little attention to those non-entity, non-commonsense clues [12]. Second, when existing models
|
| 39 |
+
|
| 40 |
+
Figure 1: Two examples from LogiQA and ReClor respectively are illustrated. There are arguments and relations between arguments. Both are emphasized by different colors: arguments, relations. Key words in questions are highlighted in Purple. Key options are highlighted in gray.
|
| 41 |
+
|
| 42 |
+
<table><tr><td>Question</td><td>Passage</td><td>Answer</td></tr><tr><td>iExample1i From this we know</td><td>Xiao Wang is taller than Xiao Li, Xiao Zhao is taller than Xiao Qian, Xiao Li isshorter than Xiao Sun,and</td><td>A. Xiao Li is shorter than Xiao Zhao. B. Xiao Wang is taller than Xiao Zhao. C. Xiao Sun is shorter than Xiao Wang.</td></tr><tr><td>iExample 21</td><td>Xiao Sun is shorter than Xiao Qian. .... .A large enough comet colliding</td><td>D. Xiao Sun is taller than Xiao Zhao. A. Many other animal species from same era did not become extinct at the same time the dinosaurs did.</td></tr><tr><td>Which one of the follow- ing statements,most seriously weakens theargument?</td><td>with Earth could have caused a cloud of dust that enshrouded the planet and cooled the climate long enough to result in the dinosaurs' demise.</td><td>B. It cannot be determined from dinosaur skeletons whether the animals died from the effects of a dust cloud. C.The consequences for vegetation and animals of a comet colliding with Earth are not fully understood. D.Various species of animals from the same era and similar to them in habitat and physiology did not become extinct.</td></tr></table>
|
| 43 |
+
|
| 44 |
+
37 extract predicate logic inside language into knowledge, they only exploit quite limited predicates like
|
| 45 |
+
38 hasA and isA but ignore a broad range of predicates in real language. From either of the perspectives,
|
| 46 |
+
39 the existing methods actually only concern about those "global" knowledge that keeps valid across
|
| 47 |
+
40 the entire data, without sufficient "local" perception of complete facts or events in the given specific
|
| 48 |
+
41 part of MRC task. We argue such insufficient modeling on logic units roots from the ignorance of
|
| 49 |
+
42 language itself being the complete knowledge/clue carrier. Thus, we propose extracting a kind of
|
| 50 |
+
43 broad facts according to backbone constituents of a sentence to effectively cover such indispensable
|
| 51 |
+
44 logic reasoning basis, filling the gap of local, non-commonsense, non-entity, or even non-knowledge
|
| 52 |
+
45 clues in existing methods as shown in Figure 2. For example, these units may reflect the facts of who
|
| 53 |
+
46 did what to whom, or who is what in Figure 3. Such groups can be defined as "fact unit" following
|
| 54 |
+
47 [13] in Definition 1. The fact units are further organized into a supergraph following Definition 2.
|
| 55 |
+
48 Definition 1 (Fact Unit) Given an triplet $T ~ = ~ \{ E _ { 1 } , P , E _ { 2 } \}$ , where $E _ { 1 }$ and $E _ { 2 }$ are arguments
|
| 56 |
+
49 (including entity and non-entity), $P$ is the predicate between them, a fact unit $F$ is the set of all
|
| 57 |
+
50 entities in $T$ and their corresponding relations.
|
| 58 |
+
|
| 59 |
+
Definition 2 (Supergraph) A supergraph is a structure made of fact units (regarded as subgraphs) 52 as the vertices, and the relations between fact units as undirected edges.
|
| 60 |
+
|
| 61 |
+
53 As shown in Figure 2, we regard the defined
|
| 62 |
+
54 fact as the results of syntactic processing, rather
|
| 63 |
+
55 than those from semantic role labeling (SRL) as
|
| 64 |
+
56 in previous study, thus the proposed fact also
|
| 65 |
+
57 extends the processing means in existing work.
|
| 66 |
+
58 Correspondingly, in this work, we propose
|
| 67 |
+
59 a fact-driven logical reasoning model, called
|
| 68 |
+
60 FOCAL REASONER, which builds supergraphs
|
| 69 |
+
61 on top of fact units as the basis for logical
|
| 70 |
+
62 reasoning, to capture both global connections
|
| 71 |
+
63 between facts and the local concepts or actions
|
| 72 |
+
64 inside the fact. In addition, we strengthen our
|
| 73 |
+
65 model by the question-option-aware interaction.
|
| 74 |
+
66 Specifically, we explicitly reformulate questions
|
| 75 |
+
67 with negation expressions to compensate for the
|
| 76 |
+
68 insensitiveness of PrLMs, all of which are interacted in our supergraph. Such resulted FOCAL
|
| 77 |
+
69 REASONER is evaluated on two challenging logical reasoning benchmarks including ReClor, LogiQA,
|
| 78 |
+
70 and one dialogue reasoning dataset Mutual for generalizability, achieving new state-of-the-art results.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: Our "fact" V.S. existing approaches.
|
| 82 |
+
|
| 83 |
+
# 71 2 Related Work
|
| 84 |
+
|
| 85 |
+
72 Machine Reading Comprehension Recent years have witnessed massive researches on Machine
|
| 86 |
+
73 Reading Comprehension, which has become one of the most important areas of NLP [14, 15, 16,
|
| 87 |
+
74 17, 18, 19, 20, 21, 22]. Despite the success of MRC models on various datasets such as CNN/Daily
|
| 88 |
+
75 Mail [1], SQuAD [2], RACE [3] and so on, researchers began to rethink to what extent does the
|
| 89 |
+
76 problem been solved. Nowadays, there are massive researches into the reasoning ability of machines.
|
| 90 |
+
77 According to [23, 24, 25], reasoning abilities can be broadly categorized into (1) commonsense
|
| 91 |
+
78 reasoning [26, 27, 28, 29]; (2) numerical reasoning [30]; (3) multi-hop reasoning [31] and (4) logical
|
| 92 |
+
79 reasoning [5, 7], among which logical reasoning is essential in human intelligence but has merely
|
| 93 |
+
80 been delved into. Natural Language Inference (NLI) [32, 33, 34] is a task closely related to logical
|
| 94 |
+
81 reasoning. However, it has two obvious drawbacks in measuring logical reasoning abilities. One is
|
| 95 |
+
82 that it only has three logical types which are entailment, contradiction and neutral. The other is its
|
| 96 |
+
83 limitation on sentence-level reasoning. Hence, it is important to research more comprehensive and
|
| 97 |
+
84 deeper logical reasoning abilities.
|
| 98 |
+
85 Logical Reasoning in MRC There are two
|
| 99 |
+
86 main kinds of features in language data that
|
| 100 |
+
87 would be the necessary basis for logical
|
| 101 |
+
88 reasoning: 1) knowledge: global facts that
|
| 102 |
+
89 keep consistency regardless of the context,
|
| 103 |
+
90 such as commonsense, mostly derived from
|
| 104 |
+
91 named entities; 2) non-knowledge: local facts
|
| 105 |
+
92 or events that may be sensitive to the context,
|
| 106 |
+
93 mostly derived from detailed language. Existing
|
| 107 |
+
94 works have made progress in improving logical
|
| 108 |
+
95 reasoning ability [8, 9, 10, 11, 12, 38]. However,
|
| 109 |
+
96 these approaches are barely satisfactory as they
|
| 110 |
+
97 mostly focus on the global facts such as typical
|
| 111 |
+
98 entity or sentence-level relations, which are
|
| 112 |
+
99 obviously not sufficient. In this work, we
|
| 113 |
+
100 strengthen the basis for logical reasoning by
|
| 114 |
+
101 unifying both types of the features as "facts".
|
| 115 |
+
102 Different from previous studies that focus on
|
| 116 |
+
103 the knowledge components, we propose a fact
|
| 117 |
+
104 driven logical reasoning framework that builds
|
| 118 |
+
105 supergraphs on top of fact units to capture both
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: An example of constructed supergraph. In contrast, the dotted vertices and edges are focused in most existing studies [35, 36, 37].
|
| 122 |
+
|
| 123 |
+
06 global connections between entity-aware facts and the local concepts or events inside the fact.
|
| 124 |
+
|
| 125 |
+
# 107 3 Approaches
|
| 126 |
+
|
| 127 |
+
108 In this section, we will describe our method in detail. The overall architecture of the model is shown
|
| 128 |
+
109 in Figure 4 . We first construct a supergraph from the raw text based on the fact units extracted.
|
| 129 |
+
110 Then we conduct reasoning over the supergraph with question-option guided approaches to learn and
|
| 130 |
+
111 update the features, which are further incorporated in answer prediction.
|
| 131 |
+
|
| 132 |
+
# 112 3.1 Supergraph Construction
|
| 133 |
+
|
| 134 |
+
13 Figure 5 illustrates our method for constructing a supergraph from raw text inputs. The first step is
|
| 135 |
+
14 to obtain triplets that constitute a fact unit. To keep the framework generic, we use a fairly simple
|
| 136 |
+
15 fact unit extractor based on the syntactic relations. Given a context consisting multiple sentences, we
|
| 137 |
+
116 first conduct dependency parsing of each sentence. After that, we extract the subject, the predicate,
|
| 138 |
+
117 and the object tokens to get the "Argument-Predicate-Argument" triplets corresponding to
|
| 139 |
+
18 each sentence in the context.
|
| 140 |
+
119 With the obtained triplets, the fact units are organized in the form of Levi graph [39], which turns
|
| 141 |
+
120 arguments and predicates all into nodes. An original fact unit is in the form of $F = ( V , E , R )$ ,
|
| 142 |
+
121 where $V$ is the set of the arguments, $E$ is the set of edges connected between arguments, and $R$ is
|
| 143 |
+
122 the relations of each edge which are predicates here. The corresponding Levi graph is denoted as
|
| 144 |
+
123 $F _ { l } = \left( V _ { L } , E _ { L } , R _ { L } \right)$ where $V _ { L } = V \cup R$ , which makes the originally directly connected arguments
|
| 145 |
+
124 be intermediately connected via relations. As for $R _ { L }$ , previous works such as [40, 41] designed three
|
| 146 |
+
125 types of edges $\dot { R } _ { L } = \{ d e f a u l t , r e v e r s e , s e l f \}$ to enhance information flow. Here in our settings,
|
| 147 |
+
126 we extend it into five types: default-in, default-out, reverse-in, reverse-out, self, corresponding to the
|
| 148 |
+
127 directions of edges towards the predicates.
|
| 149 |
+
128 We construct the supergraph by making connections between fact units $F _ { l }$ . In particular, we take
|
| 150 |
+
129 three strategies according to question-option, identical concept and co-reference information. (1) For
|
| 151 |
+
130 question-option pair, We initialize a global node $V _ { g }$ with its representation and connect it to all the fact
|
| 152 |
+
131 unit nodes. The edge type are set as global. The global node ensures that all fact units are connected
|
| 153 |
+
132 so that information can be exchanged during graph encoding. (2) There can be identical mentions
|
| 154 |
+
133 in different sentences, resulting in repeated nodes in fact units. We connect nodes corresponding
|
| 155 |
+
134 to the same non-pronoun arguments by edges with edge type same. (3) We conduct co-reference
|
| 156 |
+
135 resolution on context using an off-to-shelf model2 in order to identify arguments in fact units that
|
| 157 |
+
136 refer to the same one. We add edges with type coref between them. The final supergraph is denoted
|
| 158 |
+
137 as $S = ( F _ { l } \cup V _ { g } , E )$ where $E$ is the set of edges added with the previous three strategies.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 4: The framework or our model. For supergraph reasoning, in each iteration, each node selectively receives the message from the neighboring nodes to update its representation. The dashed circle means zero vector.
|
| 162 |
+
|
| 163 |
+
# 3.2 Encoder
|
| 164 |
+
|
| 165 |
+
# 3.2.1 Context Encoder
|
| 166 |
+
|
| 167 |
+
140 Our context encoder $F _ { C } ( . )$ is initialized with a pre-trained language model, i.e., RoBERTa-large
|
| 168 |
+
141 [42]. Question, context and option are concatenated and then fed into the encoder. If the question is
|
| 169 |
+
142 detected to contain negative meanings, we add a special token <pos> before the question, else we add
|
| 170 |
+
143 <neg>. In a whole, we get the hidden representation as following:
|
| 171 |
+
|
| 172 |
+
$\{ h _ { c , 0 } , . . . , h _ { c , l _ { c } + 1 } , h _ { q , 1 } , . . . , h _ { o , 1 } , . . . , h _ { o , l _ { o } + 1 } \} = F _ { C } ( \{ x _ { c , 0 } , . . . , x _ { c , l _ { c } + 1 } , x _ { q , 0 } , . . . , x _ { o , 1 } , . . . , x _ { o , l _ { o } + 1 } \} ) ,$ (1) where 44 $x _ { c , 0 } = < s >$ , $x _ { c , l _ { c } + 1 } = x _ { o , l _ { o } + 1 } = < / \mathrm { s } >$ , $x _ { q , 0 } = < \mathrm { p o s } > / < \mathrm { n e g } >$ and $h _ { i } \in \mathbb { R } ^ { d }$ , $d$ is the hidden size.
|
| 173 |
+
|
| 174 |
+
# 3.2.2 Supegraph Encoder
|
| 175 |
+
|
| 176 |
+
Graph Initialization $F _ { C } ( . )$ encodes each token in nodes $V _ { L }$ , and then the averaged hidden state is used as the initial representation of the original word of each node, because PrLMs like RoBERTa take subwords as input while our triplets extraction performs in word-level. For the global QA-context node, we averaged the embeddings of tokens in question and option for initialization. We also use a one-hot embedding layer to encode the relations between two nodes.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Which one of the following ......, most seriously weakens the argument? Various species of animals from the same era as dinosaurs and similar to them ... did not become extinct when the dinosaurs did.
|
| 180 |
+
Figure 5: The process of constructing the fact chain and its corresponding Levi graph form of an example in Figure 1. Entities and relations are illustrated in its corresponding color.
|
| 181 |
+
|
| 182 |
+
151 Graph Attention Network Based on the relational graph convolutional network [43] and given
|
| 183 |
+
152 the initial representation $h _ { i } ^ { 0 }$ for every node $v _ { i }$ , the feed-forward or the message-passing process with
|
| 184 |
+
153 information control can be written as:
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
h _ { i } ^ { ( l + 1 ) } = \mathrm { R e L U } ( \sum _ { r \in R _ { L } } \sum _ { v _ { j } \in \mathcal { N } _ { r } ( v _ { i } ) } g _ { q } ^ { ( l ) } \frac { 1 } { c _ { i , r } } w _ { r } ^ { ( l ) } h _ { j } ^ { ( l ) } ) ,
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
154 where $\mathcal { N } _ { r } ( v _ { i } )$ denotes the neighbors of node $v _ { i }$ under relation $r$ and $c _ { i , r }$ is the number of those nodes.
|
| 191 |
+
155 $w _ { r } ^ { ( l ) }$ is the learnable parameters of layer $l$ . $g _ { q } ^ { ( l ) }$ is a gated value between 0 and 1.
|
| 192 |
+
|
| 193 |
+
6 Through the graph encoder $F _ { G } ( . )$ , we then obtain the hidden representations of nodes in fact units as:
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\{ h _ { 0 } ^ { F } , . . . h _ { m } ^ { F } \} = F _ { G } ( \{ v _ { L , 0 } , . . . v _ { L , m } \} , E _ { L } ) .
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
158 These features are further concatenated to get the final node representation of the supergraph:
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
\{ h _ { 0 } ^ { S } , . . . h _ { m } ^ { S } \} = F _ { G } ( \{ h _ { 0 } ^ { F } , . . . h _ { m } ^ { F } \} , E _ { C } ) .
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
159 For node features on the supergraph, it is fused via the attention and gating mechanisms with the
|
| 206 |
+
160 original representations of the context encoder. Specifically, denoting the original whole sequence
|
| 207 |
+
161 representation after context encoder as $H ^ { C }$ , we apply attention mechanism to append the supergraph
|
| 208 |
+
162 representation to the original one:
|
| 209 |
+
|
| 210 |
+
$$
|
| 211 |
+
\tilde { H } = \mathrm { A t t n } ( H ^ { c } , K _ { f } , V _ { f } ) ,
|
| 212 |
+
$$
|
| 213 |
+
|
| 214 |
+
163 where $\{ K _ { f } , V _ { f } \}$ are packed from the learned representations of the supergraph. We compute
|
| 215 |
+
164 $\lambda \in [ 0 , \bar { 1 } ]$ to weigh the expected importance of supergraph representation of each source word:
|
| 216 |
+
|
| 217 |
+
$$
|
| 218 |
+
\lambda _ { 1 } = \sigma ( W _ { \lambda } \tilde { H } + U _ { \lambda } H ^ { C } ) ,
|
| 219 |
+
$$
|
| 220 |
+
|
| 221 |
+
where $W _ { \lambda }$ and $U _ { \lambda }$ are learnable parameters. $H ^ { C }$ and $\tilde { H }$ are then fused for an effective representation:
|
| 222 |
+
|
| 223 |
+
$$
|
| 224 |
+
H = H ^ { C } + \lambda \tilde { H } \in \mathbb { R } ^ { 4 \times d } .
|
| 225 |
+
$$
|
| 226 |
+
|
| 227 |
+
# 3.2.3 Question-Option-aware Interaction
|
| 228 |
+
|
| 229 |
+
Options have their inherent logical relations, which can be leveraged to aid answer prediction. Inspired by [44], we use an attention-based mechanism to gather option correlation information.
|
| 230 |
+
|
| 231 |
+
Specifically for an option 0 $O _ { i }$ , the information it get by interaction with option $O _ { j }$ is calculated as:
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
O _ { i } ^ { ( j ) } = [ O _ { i } ^ { q } - O _ { i } ^ { q } \mathrm { A t t n } ( O _ { i } ^ { q } , O _ { j } ^ { q } ; v ) ; O _ { i } ^ { q } \circ O _ { i } ^ { q } \mathrm { A t t n } ( O _ { i } ^ { q } , O _ { j } ^ { q } ; v ) ] ,
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
171 where $O _ { i } ^ { q }$ is the representation of the concatenation for the $i$ -th option and question after the context
|
| 238 |
+
172 encoder. Then the option-wise information are gathered to fuse the option correlation information:
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
\hat { O } _ { i } = \operatorname { t a n h } ( W _ { c } [ O _ { i } ^ { q } ; \{ O _ { i } ^ { ( j ) } \} _ { i \neq j } ] + b _ { c } ) ,
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
where 173 $\mathbf { W } _ { c } \in \mathbb { R } ^ { d \times 7 d }$ and $b _ { c } \in \mathbb { R } ^ { d }$ . Finally, a gating mechanism is used to fuse the option features:
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
O _ { i , : k } ^ { q } = g _ { i , : k } \circ O _ { i , : k } ^ { q } + ( 1 - g _ { i , : k } ) \circ \hat { O } _ { i , : k } ,
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
where the 174 $g _ { i , : k } = \sigma ( W _ { g } [ O _ { i , : k } ; O _ { i , : k } ^ { \widehat { q } } ; \widetilde { Q } ] + b _ { g } ) \in \mathbb { R } ^ { d }$ is the $i$ -th column of gate $g$
|
| 251 |
+
|
| 252 |
+
# 3.3 Hierarchical Decoder
|
| 253 |
+
|
| 254 |
+
176 To better incorporate the information obtained above, apart from getting the original pooled context
|
| 255 |
+
177 attended representation $h ^ { C } \in \mathbb { R } ^ { 4 \times d }$ , we combine the attended vectors ${ \bf \bar { \boldsymbol { O } } } ^ { f }$ and $H$ from the previous
|
| 256 |
+
178 encoder through a fusing layer.
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\begin{array} { r l } & { E _ { 1 } = \mathrm { R e L U } ( \mathrm { F C } ( [ h ^ { C } , H , h ^ { C } - H , h ^ { C } \circ H ] ) ) , } \\ & { E _ { 2 } = \mathrm { R e L U } ( \mathrm { F C } ( [ h ^ { C } , H , h ^ { C } - O ^ { f } , h ^ { C } \circ O ^ { f } ] ) ) , } \\ & { P = \sigma ( \mathrm { F C } ( [ E _ { 1 } , E _ { 2 } ] ) ) , } \\ & { C = P \circ H + ( 1 - P ) \circ O ^ { f } \in \mathbb { R } ^ { 4 \times d } . } \end{array}
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
179 Then another linear layer is applied for final prediction as $z = W _ { z } C + b _ { z } \in \mathbb { R } ^ { 4 }$ . We seek to minimize
|
| 263 |
+
180 the cross entropy loss over the correct decision $l$ by
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
\mathcal { L } _ { a n s } = - \log \operatorname { s o f t m a x } ( z ) _ { l } .
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
181 Logical Fact Regularization Inspired by [45], the embedding of the tail argument should be close
|
| 270 |
+
182 to the embedding of the head argument plus a relation-related vector in the hidden representation
|
| 271 |
+
183 space. Without loss of generality, we assume that in our settings, the summation of the subject vector
|
| 272 |
+
184 and the relation vector should be close to the object vector as much as possible, i.e.,
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
v _ { s u b j e c t } + v _ { r e l a t i o n } v _ { o b j e c t } .
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
185 In order to make the logical facts more of factual correctness, we introduce a regularization for the
|
| 279 |
+
186 extracted logical facts based on the hidden states of the sequence $h _ { i }$ where $i = 1 , \ldots , L$ and $L$ is the
|
| 280 |
+
187 total length of the sequence. The regularization is defined as:
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
L _ { l f r } = \sum _ { k = 1 } ^ { m } ( 1 - \cos ( h _ { s u b _ { k } } + h _ { r e l _ { k } } , h _ { o b j _ { k } } ) ) ,
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
where $m$ is the total number of logical fact triplets extracted from the context as well as the option and $k$ indicates the $k$ -th fact triplet.
|
| 287 |
+
|
| 288 |
+
Training Objective. During training, the overall loss for answer prediction is:
|
| 289 |
+
|
| 290 |
+
$$
|
| 291 |
+
\begin{array} { r } { \mathcal { L } = \alpha \mathcal { L } _ { a n s } + \beta \mathcal { L } _ { l f r } , } \end{array}
|
| 292 |
+
$$
|
| 293 |
+
|
| 294 |
+
where $\alpha$ and $\beta$ are two parameters. In our implementation, we set $\alpha = 1 . 0$ and $\beta = 0 . 5$
|
| 295 |
+
|
| 296 |
+
# 4 Experiments
|
| 297 |
+
|
| 298 |
+
# 4.1 Datasets
|
| 299 |
+
|
| 300 |
+
We conducted the experiments on three datasets. Two for specialized logical reasoning ability testing: ReClor [7] and LogiQA [5] and one for logical reasoning in dialogues: MuTual [46]. For more details, one can refer to Appendix A.
|
| 301 |
+
|
| 302 |
+
# 4.2 Implementation Details
|
| 303 |
+
|
| 304 |
+
We fine-tune RoBERTa as the backbone PrLM for FOCAL REASONER. The overall model is end-toend trained and updated by Adam [47] optimizer with an overall learning rate 8e-6 for ReClor and LogiQA, and 4e-6 for MuTual. The weight decay is 0.01. We set the warm-up proportion during training to 0.1. Graph encoders are implemented using DGL, an open-source lib of python. The layer number of the graph encoder is 2 for ReClor and 3 for LogiQA. The maximum sequence length is 256 for LogiQA and MuTual, and 384 for ReClor. The model is trained for 10 epochs with a total batch size 16 and an overall dropout rate 0.1 on 4 NVIDIA Tesla V100 GPUs, which takes around 2 hours for ReClor and 4 hours for LogiQA3.
|
| 305 |
+
|
| 306 |
+
Table 1: Experimental results of our model compared with baseline models on ReClor and LogiQA dataset. Test-E and Test-H denote Test-Easy and Test-Hard respectively. We performed Pitman’s permutation test [48] and found that our model significantly outperformed the baseline $_ { ( \mathrm { p < 0 . 0 5 } ) }$ .
|
| 307 |
+
|
| 308 |
+
<table><tr><td rowspan="2">Model</td><td colspan="4">ReClor</td><td colspan="2">LogiQA</td></tr><tr><td>Dev</td><td>Test</td><td>Test-E</td><td>Test-H</td><td>Dev</td><td>Test</td></tr><tr><td>Human [7]</td><td></td><td>63.00</td><td>57.10</td><td>67.20</td><td></td><td>86.00</td></tr><tr><td>BERT-Large[7]</td><td>53.80</td><td>49.80</td><td>72.00</td><td>32.30</td><td>34.10</td><td>31.03</td></tr><tr><td>XLNet-Large [7]</td><td>62.00</td><td>56.00</td><td>75.70</td><td>40.50</td><td>=</td><td>=</td></tr><tr><td>RoBERTa-Large [7]</td><td>62.60</td><td>55.60</td><td>75.50</td><td>40.00</td><td>35.02</td><td>35.33</td></tr><tr><td>DAGN[10]</td><td>65.20</td><td>58.20</td><td>76.14</td><td>44.11</td><td>35.48</td><td>38.71</td></tr><tr><td>DAGN_(Aug)[10]</td><td>65.80</td><td>58.30</td><td>75.91</td><td>44.46</td><td>36.87</td><td>39.32</td></tr><tr><td>FOCALREASONER</td><td>66.80</td><td>58.90</td><td>77.05</td><td>44.64</td><td>41.01</td><td>40.25</td></tr></table>
|
| 309 |
+
|
| 310 |
+
<table><tr><td rowspan="3">Model</td><td colspan="6">MuTual</td><td colspan="6">MuTualplus</td></tr><tr><td colspan="2">Dev Set</td><td colspan="2"></td><td colspan="2">Test Set</td><td colspan="2">Dev Set</td><td colspan="2"></td><td colspan="2">Test Set</td></tr><tr><td>R4@1</td><td>R4@2</td><td>MRR R4@1</td><td></td><td>R4@2 MRR</td><td></td><td>R4@1</td><td>R4@2</td><td>MRR</td><td>R4@1</td><td>R4@2 MRR</td><td></td></tr><tr><td>RoBERTabase [46]</td><td>69.5</td><td>87.8</td><td>82.4</td><td>71.3</td><td>89.2</td><td>83.6</td><td>62.2</td><td>85.3</td><td>78.2</td><td>62.6</td><td>86.6</td><td>78.7</td></tr><tr><td>-MC[46]</td><td>69.3</td><td>88.7</td><td>82.5</td><td>68.6</td><td>88.7</td><td>82.2</td><td>62.1</td><td>83.0</td><td>77.8</td><td>64.3</td><td>84.5</td><td>79.2</td></tr><tr><td>FOCAL REASONER</td><td>73.4</td><td>1 90.3</td><td>84.9</td><td>72.7</td><td>91.0</td><td>-84.6</td><td>63.7</td><td>86.1</td><td>79.1</td><td>65.5</td><td>84.3</td><td>-79.7</td></tr></table>
|
| 311 |
+
|
| 312 |
+
Table 2: Experimental results of our model compared with baseline PrLM on MuTual dataset.
|
| 313 |
+
|
| 314 |
+
# 206 4.3 Results
|
| 315 |
+
|
| 316 |
+
Tables 1 and 2 show the results on ReClor, LogiQA, and MuTual, respectively. All the best results are shown in bold. Based on our implemented baseline models (basically consistent with public results), we observe dramatic improvements on both of the logical reasoning benchmarks, e.g., on ReClor test set, FOCAL REASONER achieves $+ 4 . 2 \%$ on dev set and $+ 3 . 3 . \%$ on the test set. FOCAL REASONER also outperforms the prior best system $\mathrm { D A G N ^ { 4 } }$ , reaching $7 7 . 0 5 \%$ on the EASY subset, and $4 4 . 6 4 \%$ on the HARD subset. The performance suggests that FOCAL REASONER makes better use of logical structure inherent in the given context to perform reasoning than existing methods. On the dialogue reasoning dataset MuTual, our model achieves quite a jump compared with the RoBERTa-base $\mathrm { L } \mathbf { \bar { M } } ^ { 5 }$ This verifies our model’s generalizability on other downstream reasoning task settings.
|
| 317 |
+
|
| 318 |
+
In addition, Table 5 lists the accuracy of our model on the dev set of ReClor of different question types. Results show that our model can perform well on most of the question types, especially "Strengthen" and "Weaken". This means that our model can well interpret the question type from the question statement and make the correct choice corresponding to the question.
|
| 319 |
+
|
| 320 |
+
# 5 Analysis
|
| 321 |
+
|
| 322 |
+
# 5.1 Ablation Study
|
| 323 |
+
|
| 324 |
+
To dive into the effectiveness of different components in FOCAL REASONER, we conduct an ablation study which takes RoBERTa as the backbone on the ReClor dev set. Table 3 summarizes the results.
|
| 325 |
+
|
| 326 |
+
Supergraph reasoning: The first key component is the supergraph reasoning. We ablate the global atom and erase all the edges connected with it. The results suggest that the global atom indeed betters message propagation, leveraging performance from $6 4 . 6 \%$ to $6 6 . 8 \%$ . We also find that replacing the initial QA pair representation of the global atom with only question representation hurts the performance. In addition, without the logical fact regularization, the performance drops from $6 6 . 8 \%$
|
| 327 |
+
|
| 328 |
+

|
| 329 |
+
Figure 6: Accuracy of models on number of fact units on dev set of ReClor (left) and LogiQA (right).
|
| 330 |
+
|
| 331 |
+
229 to $6 4 . 2 \%$ , indicating its usefulness. For edge analysis, when (1) all edges are regarded as a single
|
| 332 |
+
230 type rather than the original designed 8 types in total and (2) co-reference edges are removed, the
|
| 333 |
+
231 accuracy drops to $6 3 . 7 \%$ and $6 4 . { \bar { 8 } } \%$ , respectively. It is proved that in our supergraph, edges link the
|
| 334 |
+
232 fact units in reasonable manners, which properly uncovers the logical structures.
|
| 335 |
+
233
|
| 336 |
+
234
|
| 337 |
+
235
|
| 338 |
+
236
|
| 339 |
+
237
|
| 340 |
+
238
|
| 341 |
+
239
|
| 342 |
+
240
|
| 343 |
+
241
|
| 344 |
+
242
|
| 345 |
+
243
|
| 346 |
+
244
|
| 347 |
+
245
|
| 348 |
+
246
|
| 349 |
+
247
|
| 350 |
+
248
|
| 351 |
+
249
|
| 352 |
+
250
|
| 353 |
+
251
|
| 354 |
+
|
| 355 |
+
Fact Units Variants Apart from our syntactically constructed fact units, there are another two ways in different granularities for construction. We replace the fact units with named entities which are used in previous works like [49]. The statistics of fact units and named entities of ReClor and LogiQA are stated in Table 4, from which we can infer that there are indeed more fact units than named entities. Thus using fact units can better incorporate the logical information within the context. When replacing all the fact units with named entities, we can see from Table 3 that it significantly decreases the performance. We also explore the performance using semantic role labeling the similar way as in [50]. We can see that SRL, leveraging a much more complex information as well as computation complexity, fails to achieve a performance as good as our original fact unit.
|
| 356 |
+
|
| 357 |
+
Table 3: Ablation results on the dev set of ReClor.
|
| 358 |
+
|
| 359 |
+
<table><tr><td>Model</td><td>Accuracy</td></tr><tr><td>FOCAL REASONER Supergraph Reasoning</td><td>66.8±0.13</td></tr><tr><td>- global node</td><td>64.6±0.32</td></tr><tr><td>- co-reference</td><td>64.8±0.24</td></tr><tr><td>- logical fact regularization</td><td></td></tr><tr><td>- QA context node → Q node</td><td>64.2±0.12 66.4±0.16</td></tr><tr><td>- question reformulation</td><td></td></tr><tr><td>- edge type</td><td>65.2±0.16 63.7±0.19</td></tr><tr><td>Fact Unit Variants</td><td></td></tr><tr><td> - named entity</td><td>62.8±0.26</td></tr><tr><td>- SRL</td><td>62.2±0.32</td></tr><tr><td>Interactions - interactions</td><td>65.5±0.52</td></tr></table>
|
| 360 |
+
|
| 361 |
+
# Interactions: We further experimented with
|
| 362 |
+
|
| 363 |
+
the query-option-interactions setting to see how it affects the performance. The results suggest that the features learned from the interaction process enhance the model. Considering that the logical relations between different options are a strong indicator of the right answer, this means that the model learns from a comparative reasoning strategy.
|
| 364 |
+
|
| 365 |
+
# 5.2 Effects of Fact Units Numbers
|
| 366 |
+
|
| 367 |
+
To inspect the effects of the number of fact units, we split the original dev set of ReClor and LogiQA into 5 subsets. The statistics of the fact unit distribution on the datasets are shown in Table 6. Numbers of fact units for most contexts in ReClor and LogiQA are in [3, 6) and $[ 0 , 3 )$ respectively.
|
| 368 |
+
|
| 369 |
+
<table><tr><td rowspan="2">Number</td><td colspan="2">ReClor</td><td colspan="2">LogiQA</td></tr><tr><td>Train</td><td>Dev</td><td>Train</td><td>Dev</td></tr><tr><td>Fact Unit Argument</td><td>14,895</td><td>1,665</td><td>20,676</td><td>1,981</td></tr><tr><td>Named Entity</td><td>9,495</td><td>984</td><td>12,439</td><td>1,515</td></tr></table>
|
| 370 |
+
|
| 371 |
+
Comparing the accuracies of RoBERTa-large baseline, prior SOTA DAGN and our proposed
|
| 372 |
+
|
| 373 |
+
Table 4: Statistics for fact unit entities and traditional named entities in datasets.
|
| 374 |
+
|
| 375 |
+
67 FOCAL REASONER in Figure 6, our model outperforms baseline models on all the divided subsets,
|
| 376 |
+
68 which demonstrates the effectiveness and robustness of our proposed method. Specifically, for ReClor,
|
| 377 |
+
69 FOCAL REASONER performers better when there are more fact units in the context, while for LogiQA,
|
| 378 |
+
70 FOCAL REASONER works better when the number of fact units locates in $[ 0 , 3 )$ and [9, 12). The
|
| 379 |
+
271 reason may lie in the difference in style of the two datasets. However, all the models include ours
|
| 380 |
+
272 struggle when the number of fact units is above certain thresholds, i.e., the logical structure is more
|
| 381 |
+
273 complicated, calling for better mechanisms to cope with.
|
| 382 |
+
|
| 383 |
+
Table 5: Accuracy on the dev set of ReClor corresponding to several representative question types. S: Strengthen, W: Weaken, I: Implication, CMP: Conclusion/Main Point, ER: Explain or Resolve, D: Dispute, R: Role, IF: Identify a Flaw, MS: Match Structures.
|
| 384 |
+
|
| 385 |
+
<table><tr><td>Model</td><td>S</td><td>W</td><td>I</td><td>CMP</td><td>ER</td><td>P</td><td>D</td><td>R</td><td>IF</td><td>MS</td></tr><tr><td>RoBERTalarge [7]</td><td>61.70</td><td>47.79</td><td>39.13</td><td>63.89</td><td>58.33</td><td>50.77</td><td>50.00</td><td>56.25</td><td>61.54</td><td>56.67</td></tr><tr><td>DAGN[10]</td><td>63.83</td><td>46.02</td><td>39.13</td><td>69.44</td><td>57.14</td><td>5385</td><td>46.67</td><td>62.50</td><td>62.39</td><td>56.67</td></tr><tr><td>FOCAL REASONER</td><td>65.96</td><td>51.33</td><td>43.48</td><td>72.22</td><td>67.86</td><td>53.85</td><td>50.00</td><td>62.50</td><td>62.39</td><td>60.0</td></tr></table>
|
| 386 |
+
|
| 387 |
+
# 5.3 Interpretability: a Case Study
|
| 388 |
+
|
| 389 |
+
We aim to interpret FOCAL REASONER’s reasoning process by analyzing the nodeto-node attention weights induced in the supergraph in Figure 7. We can see that our FOCAL REASONER can well bridge the reasoning process between context, question and option. Specifically, in the graph, "students rank $30 \%$ " attends strongly to "playing improve performance". Under the guidance of question
|
| 390 |
+
|
| 391 |
+
<table><tr><td>Dataset</td><td>[0,3)</td><td>[3,6)</td><td>[6,9)</td><td>[9,12)</td><td>)[12,00)</td></tr><tr><td>ReClor</td><td>37.2%</td><td>48.6%</td><td>12.6%</td><td>0.6%</td><td>1.2%</td></tr><tr><td>LogiQA</td><td>47.5%</td><td>37.5%</td><td>10.9%</td><td>3.5%</td><td>0.6%</td></tr></table>
|
| 392 |
+
|
| 393 |
+
Table 6: Distribution of fact unit number on dev set of the training datasets.
|
| 394 |
+
|
| 395 |
+
84 to select the option that weakens the statement and option interaction, our model is able to tell that "students rank $30 \%$ can play" mostly undermines the conclusion that "playing improves performance".
|
| 396 |
+
|
| 397 |
+
A recent survey in a key middle school showed that high school students in this school have a special preference for playing football, and it far surpasses other balls.The survey also found that students who regularly play football are better at academic performance than students who do not often play football.This shows that often playing football can improve students' academic performance.
|
| 398 |
+
|
| 399 |
+
A. Only high school students who are ranked in the top $30 \%$ of grades can often play football.
|
| 400 |
+
B. Regular football can exercise and maintain a strong learning energy.
|
| 401 |
+
C. Often playing football delays the study time.
|
| 402 |
+
D. Research has not proved that playing football can contribute to intellectual development.
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 7: An example of how our model reasons to get the final answer.
|
| 406 |
+
|
| 407 |
+
# 286 6 Conclusion
|
| 408 |
+
|
| 409 |
+
287 For logical reasoning arising from machine reading comprehension, it is well known that clear and
|
| 410 |
+
288 accurate forms like global knowledge are crucial. In this work, we make a finding that existing
|
| 411 |
+
289 studies miss focusing on quite a lot of non-knowledge parts which is also indispensable for better
|
| 412 |
+
290 reasoning. Thus we propose extracting a general form called "fact unit" to cover both global and
|
| 413 |
+
291 local logical units, hoping to shed light on the basis of structural modeling for logical reasoning.
|
| 414 |
+
292 Our proposed FOCAL REASONER not only better uncovers the logical structures within the context,
|
| 415 |
+
293 which can be a general method for other sophisticated reasoning tasks, but also better captures the
|
| 416 |
+
294 logical interactions between context and options. The experimental results verify the effectiveness of
|
| 417 |
+
295 our method.
|
| 418 |
+
|
| 419 |
+
References
|
| 420 |
+
[1] Karl Moritz Hermann, Tomáš Kocisk ˇ y, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa \` Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Proceedings of the 28th International Conference on Neural Information Processing Systems-Volume 1, pages 1693–1701, 2015.
|
| 421 |
+
[2] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2383–2392, Austin, Texas, November 2016. Association for Computational Linguistics.
|
| 422 |
+
[3] Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. RACE: Large-scale ReAding comprehension dataset from examinations. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 785–794, Copenhagen, Denmark, September 2017. Association for Computational Linguistics.
|
| 423 |
+
[4] Zhuosheng Zhang, Hai Zhao, and Rui Wang. Machine reading comprehension: The role of contextualized language models and beyond. arXiv preprint arXiv:2005.06249, 2020.
|
| 424 |
+
[5] Jian Liu, Leyang Cui, Hanmeng Liu, Dandan Huang, Yile Wang, and Yue Zhang. Logiqa: A challenge dataset for machine reading comprehension with logical reasoning. In Christian Bessiere, editor, Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, pages 3622–3628. International Joint Conferences on Artificial Intelligence Organization, 7 2020. Main track.
|
| 425 |
+
[6] Lucja Iwanska. Logical reasoning in natural language: It is all about knowledge. ´ Minds and Machines, 3(4):475–510, 1993.
|
| 426 |
+
[7] Weihao Yu, Zihang Jiang, Yanfei Dong, and Jiashi Feng. Reclor: A reading comprehension dataset requiring logical reasoning. In International Conference on Learning Representations (ICLR), April 2020.
|
| 427 |
+
[8] Michihiro Yasunaga, Hongyu Ren, Antoine Bosselut, Percy Liang, and Jure Leskovec. Qa-gnn: Reasoning with language models and knowledge graphs for question answering. In North American Chapter of the Association for Computational Linguistics (NAACL), 2021.
|
| 428 |
+
[9] Hongyu Ren and Jure Leskovec. Beta embeddings for multi-hop logical reasoning in knowledge graphs. Advances in Neural Information Processing Systems, 33, 2020.
|
| 429 |
+
[10] Yinya Huang, Meng Fang, Yu Cao, Liwei Wang, and Xiaodan Liang. DAGN: Discourse-aware graph network for logical reasoning. In NAACL, 2021.
|
| 430 |
+
[11] Siddharth Krishna, Alexander J Summers, and Thomas Wies. Local reasoning for global graph properties. In European Symposium on Programming, pages 308–335. Springer, Cham, 2020.
|
| 431 |
+
[12] Wanjun Zhong, Siyuan Wang, Duyu Tang, Zenan Xu, Daya Guo, Jiahai Wang, Jian Yin, Ming Zhou, and Nan Duan. AR-LSAT: Investigating Analytical Reasoning of Text. arXiv e-prints, page arXiv:2104.06598, April 2021.
|
| 432 |
+
[13] Ndapandula Nakashole and Tom Mitchell. Language-aware truth assessment of fact candidates. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1009–1019, 2014.
|
| 433 |
+
[14] Danqi Chen, Jason Bolton, and Christopher D Manning. A thorough examination of the cnn/daily mail reading comprehension task. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2358–2367, 2016.
|
| 434 |
+
[15] Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In ICLR 2017, 2017.
|
| 435 |
+
[16] Bhuwan Dhingra, Hanxiao Liu, Zhilin Yang, William Cohen, and Ruslan Salakhutdinov. Gatedattention readers for text comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1832–1846, 2017.
|
| 436 |
+
|
| 437 |
+
[17] Yiming Cui, Zhipeng Chen, Si Wei, Shijin Wang, Ting Liu, and Guoping Hu. Attentionover-attention neural networks for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 593–602, 2017. 48 [18] Linfeng Song, Zhiguo Wang, Mo Yu, Yue Zhang, Radu Florian, and Daniel Gildea. Exploring graph-structured passage representation for multi-hop reading comprehension with graph neural networks. arXiv preprint arXiv:1809.02040, 2018. [19] Minghao Hu, Furu Wei, Yuxing Peng, Zhen Huang, Nan Yang, and Dongsheng Li. Read $^ +$ verify: Machine reading comprehension with unanswerable questions. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 6529–6537, 2019. [20] Zhuosheng Zhang, Yuwei Wu, Junru Zhou, Sufeng Duan, Hai Zhao, and Rui Wang. SG-Net: Syntax-guided machine reading comprehension. In Proceedings of the Thirty-Fourth AAAI Conference on Artificial Intelligence (AAAI), 2020. [21] Seohyun Back, Sai Chetan Chinthakindi, Akhil Kedia, Haejun Lee, and Jaegul Choo. NeurQuRI: Neural question requirement inspector for answerability prediction in machine reading comprehension. In International Conference on Learning Representations, 2020. [22] Zhuosheng Zhang, Junjie Yang, and Hai Zhao. Retrospective reader for machine reading comprehension. arXiv preprint arXiv:2001.09694, 2020. [23] Divyansh Kaushik and Zachary C. Lipton. How much reading does reading comprehension require? a critical investigation of popular benchmarks. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 5010–5015, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. [24] Ming Zhou, Nan Duan, Shujie Liu, and Heung-Yeung Shum. Progress in neural nlp: Modeling, learning, and reasoning. Engineering, 6(3):275–290, 2020. [25] Danqi Chen, Jason Bolton, and Christopher D. Manning. A thorough examination of the CNN/Daily Mail reading comprehension task. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2358–2367, Berlin, Germany, August 2016. Association for Computational Linguistics. [26] Ernest Davis and Gary Marcus. Commonsense reasoning and commonsense knowledge in artificial intelligence. Communications of the ACM, 58(9):92–103, 2015. [27] Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Wen-tau Yih, and Yejin Choi. Abductive commonsense reasoning. In International Conference on Learning Representations, 2019. [28] Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. Commonsenseqa: A question answering challenge targeting commonsense knowledge. In NAACL-HLT (1), 2019. [29] Lifu Huang, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Cosmos qa: Machine reading comprehension with contextual commonsense reasoning. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2391–2401, 2019. [30] Dheeru Dua, Yizhong Wang, Pradeep Dasigi, Gabriel Stanovsky, Sameer Singh, and Matt Gardner. Drop: A reading comprehension benchmark requiring discrete reasoning over paragraphs. 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), pages 2368–2378, 2019. [31] Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William Cohen, Ruslan Salakhutdinov, and Christopher D Manning. Hotpotqa: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2369–2380, 2018.
|
| 438 |
+
|
| 439 |
+
[32] Samuel Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. A large annotated corpus for learning natural language inference. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 632–642, 2015.
|
| 440 |
+
[33] Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1112–1122, 2018.
|
| 441 |
+
[34] Yixin Nie, Adina Williams, Emily Dinan, Mohit Bansal, Jason Weston, and Douwe Kiela. Adversarial nli: A new benchmark for natural language understanding. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4885–4901, 2020. [35] Lin Qiu, Yunxuan Xiao, Yanru Qu, Hao Zhou, Lei Li, Weinan Zhang, and Yong Yu. Dynamically fused graph network for multi-hop reasoning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6140–6150, 2019.
|
| 442 |
+
5 [36] Ming Ding, Chang Zhou, Qibin Chen, Hongxia Yang, and Jie Tang. Cognitive graph for multi-hop reading comprehension at scale. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2694–2703, 2019.
|
| 443 |
+
[37] Jifan Chen, Shih-ting Lin, and Greg Durrett. Multi-hop question answering via reasoning chains. arXiv preprint arXiv:1910.02610, 2019. [38] Siyuan Wang, Wanjun Zhong, Duyu Tang, Zhongyu Wei, Zhihao Fan, Daxin Jiang, Ming Zhou, and Nan Duan. Logic-driven context extension and data augmentation for logical reasoning of text. arXiv preprint arXiv:2105.03659, 2021.
|
| 444 |
+
[39] Friedrich Wilhelm Levi. Finite geometrical systems: six public lectues delivered in February, 1940, at the University of Calcutta. University of Calcutta, 1942. [40] Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1506–1515, Copenhagen, Denmark, September 2017. Association for Computational Linguistics.
|
| 445 |
+
[41] Daniel Beck, Gholamreza Haffari, and Trevor Cohn. Graph-to-sequence learning using gated graph neural networks. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 273–283, Melbourne, Australia, July 2018. Association for Computational Linguistics.
|
| 446 |
+
[42] 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 e-prints, page arXiv:1907.11692, July 2019. [43] Michael Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne vanden Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. In Aldo Gangemi, Roberto Navigli, Maria-Esther Vidal, Pascal Hitzler, Raphaël Troncy, Laura Hollink, Anna Tordai, and Mehwish Alam, editors, The Semantic Web, pages 593–607. Springer International Publishing, 2018. [44] Qiu Ran, Peng Li, Weiwei Hu, and Jie Zhou. Option comparison network for multiple-choice reading comprehension. arXiv preprint arXiv:1903.03033, 2019. [45] Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 26. Curran Associates, Inc., 2013. [46] Leyang Cui, Yu Wu, Shujie Liu, Yue Zhang, and Ming Zhou. Mutual: A dataset for multi-turn dialogue reasoning. In Proceedings of the 58th Conference of the Association for Computational Linguistics. Association for Computational Linguistics, 2020.
|
| 447 |
+
[47] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
|
| 448 |
+
[48] Rotem Dror, Gili Baumer, Segev Shlomov, and Roi Reichart. The hitchhiker’s guide to testing statistical significance in natural language processing. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1383–1392. Association for Computational Linguistics, 2018.
|
| 449 |
+
[49] Jifan Chen, Shih-Ting Lin, and Greg Durrett. Multi-hop question answering via reasoning chains. ArXiv, abs/1910.02610, 2019.
|
| 450 |
+
[50] Wanjun Zhong, Jingjing Xu, Duyu Tang, Zenan Xu, Nan Duan, M. Zhou, Jiahai Wang, and Jian Yin. Reasoning over semantic-level graph for fact checking. In ACL, 2020.
|
| 451 |
+
|
| 452 |
+
# Checklist
|
| 453 |
+
|
| 454 |
+
1. For all authors...
|
| 455 |
+
|
| 456 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 457 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 5.2.
|
| 458 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No]
|
| 459 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 460 |
+
|
| 461 |
+
2. If you are including theoretical results...
|
| 462 |
+
|
| 463 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 464 |
+
|
| 465 |
+
3. If you ran experiments...
|
| 466 |
+
|
| 467 |
+
(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]
|
| 468 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 469 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 470 |
+
(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]
|
| 471 |
+
|
| 472 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 473 |
+
|
| 474 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 475 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 476 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 477 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 478 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 479 |
+
|
| 480 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 481 |
+
|
| 482 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 483 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 484 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/S1Bb3D5gg/S1Bb3D5gg.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING END-TO-END GOAL-ORIENTED DIALOG
|
| 2 |
+
|
| 3 |
+
Antoine Bordes, Y-Lan Boureau & Jason Weston
|
| 4 |
+
Facebook AI Research
|
| 5 |
+
New York, USA
|
| 6 |
+
{abordes, ylan, jase}@fb.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Traditional dialog systems used in goal-oriented applications require a lot of domain-specific handcrafting, which hinders scaling up to new domains. Endto-end dialog systems, in which all components are trained from the dialogs themselves, escape this limitation. But the encouraging success recently obtained in chit-chat dialog may not carry over to goal-oriented settings. This paper proposes a testbed to break down the strengths and shortcomings of end-to-end dialog systems in goal-oriented applications. Set in the context of restaurant reservation, our tasks require manipulating sentences and symbols in order to properly conduct conversations, issue API calls and use the outputs of such calls. We show that an end-to-end dialog system based on Memory Networks can reach promising, yet imperfect, performance and learn to perform non-trivial operations. We confirm those results by comparing our system to a hand-crafted slot-filling baseline on data from the second Dialog State Tracking Challenge (Henderson et al., 2014a). We show similar result patterns on data extracted from an online concierge service.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
The most useful applications of dialog systems such as digital personal assistants or bots are currently goal-oriented and transactional: the system needs to understand a user request and complete a related task with a clear goal within a limited number of dialog turns. The workhorse of traditional dialog systems is slot-filling (Lemon et al., 2006; Wang and Lemon, 2013; Young et al., 2013) which predefines the structure of a dialog state as a set of slots to be filled during the dialog. For a restaurant reservation system, such slots can be the location, price range or type of cuisine of a restaurant. Slot-filling has proven reliable but is inherently hard to scale to new domains: it is impossible to manually encode all features and slots that users might refer to in a conversation.
|
| 15 |
+
|
| 16 |
+
End-to-end dialog systems, usually based on neural networks (Shang et al., 2015; Vinyals and Le, 2015; Sordoni et al., 2015; Serban et al., 2015a; Dodge et al., 2016), escape such limitations: all their components are directly trained on past dialogs, with no assumption on the domain or dialog state structure, thus making it easy to automatically scale up to new domains. They have shown promising performance in non goal-oriented chit-chat settings, where they were trained to predict the next utterance in social media and forum threads (Ritter et al., 2011; Wang et al., 2013; Lowe et al., 2015) or movie conversations (Banchs, 2012). But the performance achieved on chit-chat may not necessarily carry over to goal-oriented conversations. As illustrated in Figure 1 in a restaurant reservation scenario, conducting goal-oriented dialog requires skills that go beyond language modeling, e.g., asking questions to clearly define a user request, querying Knowledge Bases (KBs), interpreting results from queries to display options to users or completing a transaction. This makes it hard to ascertain how well end-to-end dialog models would do, especially since evaluating chit-chat performance in itself is not straightforward (Liu et al., 2016). In particular, it is unclear if end-to-end models are in a position to replace traditional dialog methods in a goal-directed setting: can end-to-end dialog models be competitive with traditional methods even in the well-defined narrow-domain tasks where they excel? If not, where do they fall short?
|
| 17 |
+
|
| 18 |
+
This paper aims to make it easier to address these questions by proposing an open resource to test endto-end dialog systems in a way that 1) favors reproducibility and comparisons, and 2) is lightweight and easy to use. We aim to break down a goal-directed objective into several subtasks to test some crucial capabilities that dialog systems should have (and hence provide error analysis by design).
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
Figure 1: Goal-oriented dialog tasks. A user (in green) chats with a bot (in blue) to book a table at a restaurant. Models must predict bot utterances and API calls (in dark red). Task 1 tests the capacity of interpreting a request and asking the right questions to issue an API call. Task 2 checks the ability to modify an API call. Task 3 and 4 test the capacity of using outputs from an API call (in light red) to propose options (sorted by rating) and to provide extra-information. Task 5 combines everything.
|
| 22 |
+
|
| 23 |
+
In the spirit of the bAbI tasks conceived as question answering testbeds (Weston et al., 2015b), we designed a set of five tasks within the goal-oriented context of restaurant reservation. Grounded with an underlying KB of restaurants and their properties (location, type of cuisine, etc.), these tasks cover several dialog stages and test if models can learn various abilities such as performing dialog management, querying KBs, interpreting the output of such queries to continue the conversation or dealing with new entities not appearing in dialogs from the training set. In addition to showing how the set of tasks we propose can be used to test the goal-directed capabilities of an end-to-end dialog system, we also propose results on two additional datasets extracted from real interactions with users, to confirm that the pattern of results observed in our tasks is indeed a good proxy for what would be observed on real data, with the added benefit of better reproducibility and interpretability.
|
| 24 |
+
|
| 25 |
+
The goal here is explicitly not to improve the state of the art in the narrow domain of restaurant booking, but to take a narrow domain where traditional handcrafted dialog systems are known to perform well, and use that to gauge the strengths and weaknesses of current end-to-end systems with no domain knowledge. Solving our tasks requires manipulating both natural language and symbols from a KB. Evaluation uses two metrics, per-response and per-dialog accuracies, the latter tracking completion of the actual goal. Figure 1 depicts the tasks and Section 3 details them. Section 4 compares multiple methods on these tasks. As an end-to-end neural model, we tested Memory Networks (Weston et al., 2015a), an attention-based architecture that has proven competitive for non goal-oriented dialog (Dodge et al., 2016). Our experiments in Section 5 show that Memory Networks can be trained to perform non-trivial operations such as issuing API calls to KBs and manipulating entities unseen in training. We confirm our findings on real human-machine dialogs from the restaurant reservation dataset of the $2 ^ { n d }$ Dialog State Tracking Challenge, or DSTC2 (Henderson et al., 2014a), which we converted into our task format, showing that Memory Networks can outperform a dedicated slot-filling rule-based baseline. We also evaluate on a dataset of humanhuman dialogs extracted from an online concierge service that books restaurants for users. Overall, the per-response performance is encouraging, but the per-dialog one remains low, indicating that end-to-end models still need to improve before being able to reliably handle goal-oriented dialog.
|
| 26 |
+
|
| 27 |
+
Table 1: Data used in this paper. Tasks 1-5 were generated using our simulator and share the same KB. Task 6 was converted from the $2 ^ { n d }$ Dialog State Tracking Challenge (Henderson et al., 2014a). Concierge is made of chats extracted from a real online concierge service. (∗) Tasks 1-5 have two test sets, one using the vocabulary of the training set and the other using out-of-vocabulary words.
|
| 28 |
+
|
| 29 |
+
<table><tr><td></td><td>Tasks</td><td>T1</td><td>T2</td><td>T3</td><td>T4</td><td>T5</td><td>T6</td><td>Concierge</td></tr><tr><td rowspan="4">DIALOGS Average statistics</td><td>Number of utterances:</td><td>12</td><td>17</td><td>43</td><td>15</td><td>55</td><td>54</td><td>8</td></tr><tr><td>- user utterances</td><td>5</td><td>7</td><td>7</td><td>4</td><td>13</td><td>6</td><td>4</td></tr><tr><td>- bot utterances</td><td>7</td><td>10</td><td>10</td><td>4</td><td>18</td><td>8</td><td>4</td></tr><tr><td>- outputs from API calls</td><td>0</td><td>0</td><td>23</td><td>7</td><td>24</td><td>40</td><td>0</td></tr><tr><td rowspan="4">DATASETS</td><td>Vocabulary size</td><td></td><td></td><td>3,747</td><td></td><td></td><td>1,229</td><td>8.629</td></tr><tr><td>Candidate set size</td><td></td><td></td><td>4,212</td><td></td><td></td><td>2,406</td><td>11,482</td></tr><tr><td>Training dialogs</td><td></td><td></td><td>1,000</td><td></td><td></td><td>1,618</td><td>3,249</td></tr><tr><td>Validation dialogs</td><td></td><td></td><td>1,000</td><td></td><td></td><td>500</td><td>403</td></tr><tr><td>Tasks1-5 share the same data source</td><td>Test dialogs</td><td></td><td></td><td>1,000(*)</td><td></td><td></td><td>1,117</td><td>402</td></tr></table>
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
The most successful goal-oriented dialog systems model conversation as partially observable Markov decision processes (POMDP) (Young et al., 2013). However, despite recent efforts to learn modules (Henderson et al., 2014b), they still require many hand-crafted features for the state and action space representations, which restrict their usage to narrow domains. Our simulation, used to generate goal-oriented datasets, can be seen as an equivalent of the user simulators used to train POMDP (Young et al., 2013; Pietquin and Hastie, 2013), but for training end-to-end systems.
|
| 34 |
+
|
| 35 |
+
Serban et al. (2015b) list available corpora for training dialog systems. Unfortunately, no good resources exist to train and test end-to-end models in goal-oriented scenarios. Goal-oriented datasets are usually designed to train or test dialog state tracker components (Henderson et al., 2014a) and are hence of limited scale and not suitable for end-to-end learning (annotated at the state level and noisy). However, we do convert the Dialog State Tracking Challenge data into our framework. Some datasets are not open source, and require a particular license agreement or the participation to a challenge (e.g., the end-to-end task of DSTC4 (Kim et al., 2016)) or are proprietary (e.g., Chen et al. (2016)). Datasets are often based on interactions between users and existing systems (or ensemble of systems) like DSTC datasets, SFCore (Gašic et al., 2014) or ATIS (Dahl et al., 1994). This creates noise and makes it harder to interpret the errors of a model. Lastly, resources designed to connect dialog systems to users, in particular in the context of reinforcement learning, are usually built around a crowdsourcing setting such as Amazon Mechanical Turk, e.g., (Hixon et al., 2015; Wen et al., 2015; Su et al., 2015a;b). While this has clear advantages, it prevents reproducibility and consistent comparisons of methods in the exact same setting.
|
| 36 |
+
|
| 37 |
+
The closest resource to ours might be the set of tasks described in (Dodge et al., 2016), since some of them can be seen as goal-oriented. However, those are question answering tasks rather than dialog, i.e. the bot only responds with answers, never questions, which does not reflect full conversation.
|
| 38 |
+
|
| 39 |
+
# 3 GOAL-ORIENTED DIALOG TASKS
|
| 40 |
+
|
| 41 |
+
All our tasks involve a restaurant reservation system, where the goal is to book a table at a restaurant. The first five tasks are generated by a simulation, the last one uses real human-bot dialogs. The data for all tasks is available at http://fb.ai/babi. We also give results on a proprietary dataset extracted from an online restaurant reservation concierge service with anonymized users.
|
| 42 |
+
|
| 43 |
+
# 3.1 RESTAURANT RESERVATION SIMULATION
|
| 44 |
+
|
| 45 |
+
The simulation is based on an underlying KB, whose facts contain the restaurants that can be booked and their properties. Each restaurant is defined by a type of cuisine (10 choices, e.g., French, Thai), a location (10 choices, e.g., London, Tokyo), a price range (cheap, moderate or expensive) and a rating (from 1 to 8). For simplicity, we assume that each restaurant only has availability for a single party size (2, 4, 6 or 8 people). Each restaurant also has an address and a phone number listed in the KB.
|
| 46 |
+
|
| 47 |
+
The KB can be queried using API calls, which return the list of facts related to the corresponding restaurants. Each query must contain four fields: a location, a type of cuisine, a price range and a party size. It can return facts concerning one, several or no restaurant (depending on the party size).
|
| 48 |
+
|
| 49 |
+
Using the KB, conversations are generated in the format shown in Figure 1. Each example is a dialog comprising utterances from a user and a bot, as well as API calls and the resulting facts. Dialogs are generated after creating a user request by sampling an entry for each of the four required fields: e.g. the request in Figure 1 is [cuisine: British, location: London, party size: six, price range: expensive]. We use natural language patterns to create user and bot utterances. There are 43 patterns for the user and 20 for the bot (the user can use up to 4 ways to say something, while the bot always uses the same). Those patterns are combined with the KB entities to form thousands of different utterances.
|
| 50 |
+
|
| 51 |
+
# 3.1.1 TASK DEFINITIONS
|
| 52 |
+
|
| 53 |
+
We now detail each task. Tasks 1 and 2 test dialog management to see if end-to-end systems can learn to implicitly track dialog state (never given explicitly), whereas Task 3 and 4 check if they can learn to use KB facts in a dialog setting. Task 3 also requires to learn to sort. Task 5 combines all tasks.
|
| 54 |
+
|
| 55 |
+
Task 1: Issuing API calls A user request implicitly defines a query that can contain from 0 to 4 of the required fields (sampled uniformly; in Figure 1, it contains 3). The bot must ask questions for filling the missing fields and eventually generate the correct corresponding API call. The bot asks for information in a deterministic order, making prediction possible.
|
| 56 |
+
|
| 57 |
+
Task 2: Updating API calls Starting by issuing an API call as in Task 1, users then ask to update their requests between 1 and 4 times (sampled uniformly). The order in which fields are updated is random. The bot must ask users if they are done with their updates and issue the updated API call.
|
| 58 |
+
|
| 59 |
+
Task 3: Displaying options Given a user request, we query the KB using the corresponding API call and add the facts resulting from the call to the dialog history. The bot must propose options to users by listing the restaurant names sorted by their corresponding rating (from higher to lower) until users accept. For each option, users have a $2 5 \%$ chance of accepting. If they do, the bot must stop displaying options, otherwise propose the next one. Users always accept the option if this is the last remaining one. We only keep examples with API calls retrieving at least 3 options.
|
| 60 |
+
|
| 61 |
+
Task 4: Providing extra information Given a user request, we sample a restaurant and start the dialog as if users had agreed to book a table there. We add all KB facts corresponding to it to the dialog. Users then ask for the phone number of the restaurant, its address or both, with proportions $2 5 \%$ , $2 5 \%$ and $50 \%$ respectively. The bot must learn to use the KB facts correctly to answer.
|
| 62 |
+
|
| 63 |
+
Task 5: Conducting full dialogs We combine Tasks 1-4 to generate full dialogs just as in Figure 1.
|
| 64 |
+
Unlike in Task 3, we keep examples if API calls return at least 1 option instead of 3.
|
| 65 |
+
|
| 66 |
+
# 3.1.2 DATASETS
|
| 67 |
+
|
| 68 |
+
We want to test how well models handle entities appearing in the KB but not in the dialog training sets. We split types of cuisine and locations in half, and create two KBs, one with all facts about restaurants within the first halves and one with the rest. This yields two KBs of 4,200 facts and 600 restaurants each (5 types of cuisine $\times 5$ locations $\times 3$ price ranges $\times 8$ ratings) that only share price ranges, ratings and party sizes, but have disjoint sets of restaurants, locations, types of cuisine, phones and addresses. We use one of the KBs to generate the standard training, validation and test dialogs, and use the other KB only to generate test dialogs, termed Out-Of-Vocabulary (OOV) test sets.
|
| 69 |
+
|
| 70 |
+
For training, systems have access to the training examples and both KBs. We then evaluate on both test sets, plain and OOV. Beyond the intrinsic difficulty of each task, the challenge on the OOV test sets is for models to generalize to new entities (restaurants, locations and cuisine types) unseen in any training dialog – something natively impossible for embedding methods. Ideally, models could, for instance, leverage information coming from the entities of the same type seen during training.
|
| 71 |
+
|
| 72 |
+
We generate five datasets, one per task defined in 3.1.1. Table 1 gives their statistics. Training sets are relatively small (1,000 examples) to create realistic learning conditions. The dialogs from the training and test sets are different, never being based on the same user requests. Thus, we test if models can generalize to new combinations of fields. Dialog systems are evaluated in a ranking, not a generation, setting: at each turn of the dialog, we test whether they can predict bot utterances and API calls by selecting a candidate, not by generating it.1 Candidates are ranked from a set of all bot utterances and API calls appearing in training, validation and test sets (plain and OOV) for all tasks combined.
|
| 73 |
+
|
| 74 |
+
# 3.2 DIALOG STATE TRACKING CHALLENGE
|
| 75 |
+
|
| 76 |
+
Since our tasks rely on synthetically generated language for the user, we supplement our dataset with real human-bot dialogs. We use data from DSTC2 (Henderson et al., 2014a), that is also in the restaurant booking domain. Unlike our tasks, its user requests only require 3 fields: type of cuisine (91 choices), location (5 choices) and price range (3 choices). The dataset was originally designed for dialog state tracking hence every dialog turn is labeled with a state (a user intent $^ +$ slots) to be predicted. As our goal is to evaluate end-to-end training, we did not use that, but instead converted the data into the format of our 5 tasks and included it in the dataset as Task 6.
|
| 77 |
+
|
| 78 |
+
We used the provided speech transcriptions to create the user and bot utterances, and given the dialog states we created the API calls to the KB and their outputs which we added to the dialogs. We also added ratings to the restaurants returned by the API calls, so that the options proposed by the bots can be consistently predicted (by using the highest rating). We did use the original test set but use a slightly different training/validation split. Our evaluation differs from the challenge (we do not predict the dialog state), so we cannot compare with the results from (Henderson et al., 2014a).
|
| 79 |
+
|
| 80 |
+
This dataset has similar statistics to our Task 5 (see Table 1) but is harder. The dialogs are noisier and the bots made mistakes due to speech recognition errors or misinterpretations and also do not always have a deterministic behavior (the order in which they can ask for information varies).
|
| 81 |
+
|
| 82 |
+
# 3.3 ONLINE CONCIERGE SERVICE
|
| 83 |
+
|
| 84 |
+
Tasks 1-6 are, at least partially, artificial. This provides perfect control over their design (at least for Tasks 1-5), but no guarantee that good performance would carry over from such synthetic to more realistic conditions. To quantify this, we also evaluate the models from Section 4 on data extracted from a real online concierge service performing restaurant booking: users make requests through a text-based chat interface that are handled by human operators who can make API calls. All conversations are between native English speakers.
|
| 85 |
+
|
| 86 |
+
We collected around 4k chats to create this extra dataset, denoted Concierge. All conversations have been anonymized by (1) removing all user identifiers, (2) using the Stanford NER tagger to remove named entities (locations, timestamps, etc.), (3) running some manually defined regex to filter out any remaining salient information (phone numbers, etc.). The dataset does not contain results from API calls, but still records when operators made use of an external service (Yelp or OpenTable) to gather information. Hence, these have to be predicted, but without any argument (unlike in Task 2).
|
| 87 |
+
|
| 88 |
+
The statistics of Concierge are given in Table 1. The dialogs are shorter than in Tasks 1-6, especially since they do not include results of API calls, but the vocabulary is more diverse and so is the candidate set; the candidate set is made of all utterances of the operator appearing in the training, validation and test sets. Beyond the higher variability of the language used by human operators compared to bots, the dataset offers additional challenges. The set of user requests is much wider, ranging from managing restaurant reservations to asking for recommendations or specific information. Users do not always stay focused on the request. API calls are not always used (e.g., the operator might use neither Yelp nor OpenTable to find a restaurant), and facts about restaurants are not structured nor constrained as in a KB. The structure of dialogs is thus much more variable. Users and operators also make typos, spelling and grammar mistakes.
|
| 89 |
+
|
| 90 |
+
# 4 MODELS
|
| 91 |
+
|
| 92 |
+
To demonstrate how to use the dataset and provide baselines, we evaluate several learning methods on our goal-oriented dialog tasks: rule-based systems, classical information retrieval methods, supervised embeddings, and end-to-end Memory networks.
|
| 93 |
+
|
| 94 |
+
# 4.1 RULE-BASED SYSTEMS
|
| 95 |
+
|
| 96 |
+
Our tasks T1-T5 are built with a simulator so as to be completely predictable. Thus it is possible to hand-code a rule based system that achieves $100 \%$ on them, similar to the bAbI tasks of Weston et al. (2015b). Indeed, the point of these tasks is not to check whether a human is smart enough to be able to build a rule-based system to solve them, but to help analyze in which circumstances machine learning algorithms are smart enough to work, and where they fail.
|
| 97 |
+
|
| 98 |
+
However, the Dialog State Tracking Challenge task (T6) contains some real interactions with users. This makes rule-based systems less straightforward and not so accurate (which is where we expect machine learning to be useful). We implemented a rule-based system for this task in the following way. We initialized a dialog state using the 3 relevant slots for this task: cuisine type, location and price range. Then we analyzed the training data and wrote a series of rules that fire for triggers like word matches, positions in the dialog, entity detections or dialog state, to output particular responses, API calls and/or update a dialog state. Responses are created by combining patterns extracted from the training set with entities detected in the previous turns or stored in the dialog state. Overall we built 28 rules and extracted 21 patterns. We optimized the choice of rules and their application priority (when needed) using the validation set, reaching a validation per-response accuracy of $4 0 . 7 \%$ . We did not build a rule-based system for Concierge data as it is even less constrained.
|
| 99 |
+
|
| 100 |
+
# 4.2 CLASSICAL INFORMATION RETRIEVAL MODELS
|
| 101 |
+
|
| 102 |
+
Classical information retrieval (IR) models with no machine learning are standard baselines that often perform surprisingly well on dialog tasks (Isbell et al., 2000; Jafarpour et al., 2010; Ritter et al., 2011; Sordoni et al., 2015). We tried two standard variants:
|
| 103 |
+
|
| 104 |
+
TF-IDF Match For each possible candidate response, we compute a matching score between the input and the response, and rank the responses by score. The score is the TF–IDF weighted cosine similarity between the bag-of-words of the input and bag-of-words of the candidate response. We consider the case of the input being either only the last utterance or the entire conversation history, and choose the variant that works best on the validation set (typically the latter).
|
| 105 |
+
|
| 106 |
+
Nearest Neighbor Using the input, we find the most similar conversation in the training set, and output the response from that example. In this case we consider the input to only be the last utterance, and consider the training set as (utterance, response) pairs that we select from. We use word overlap as the scoring method. When several responses are associated with the same utterance in training, we sort them by decreasing co-occurence frequency.
|
| 107 |
+
|
| 108 |
+
# 4.3 SUPERVISED EMBEDDING MODELS
|
| 109 |
+
|
| 110 |
+
A standard, often strong, baseline is to use supervised word embedding models for scoring (conversation history, response) pairs. The embedding vectors are trained directly for this goal. In contrast, word embeddings are most well-known in the context of unsupervised training on raw text as in word2vec (Mikolov et al., 2013). Such models are trained by learning to predict the middle word given the surrounding window of words, or vice-versa. However, given training data consisting of dialogs, a much more direct and strongly performing training procedure can be used: predict the next response given the previous conversation. In this setting a candidate reponse $y$ is scored against the input $x$ : $\bar { f } ( x , y ) = \bar { ( } A x ) ^ { \top } B y$ , where $A$ and $B$ are $d \times V$ word embedding matrices, i.e. input and response are treated as summed bags-of-embeddings. We also consider the case of enforcing $A = B$ , which sometimes works better, and optimize the choice on the validation set.
|
| 111 |
+
|
| 112 |
+
The embeddings are trained with a margin ranking loss: $f ( x , y ) > m + f ( x , { \bar { y } } )$ , with $m$ the size of the margin, and we sample $N$ negative candidate responses $\bar { y }$ per example, and train with SGD. This approach has been previously shown to be very effective in a range of contexts (Bai et al., 2009;
|
| 113 |
+
|
| 114 |
+
Dodge et al., 2016). This method can be thought of as a classical information retrieval model, but where the matching function is learnt.
|
| 115 |
+
|
| 116 |
+
# 4.4 MEMORY NETWORKS
|
| 117 |
+
|
| 118 |
+
Memory Networks (Weston et al., 2015a; Sukhbaatar et al., 2015) are a recent class of models that have been applied to a range of natural language processing tasks, including question answering (Weston et al., 2015b), language modeling (Sukhbaatar et al., 2015), and non-goal-oriented dialog (Dodge et al., 2016). By first writing and then iteratively reading from a memory component (using hops) that can store historical dialogs and short-term context to reason about the required response, they have been shown to perform well on those tasks and to outperform some other end-to-end architectures based on Recurrent Neural Networks. Hence, we chose them as end-to-end model baseline.
|
| 119 |
+
|
| 120 |
+
We use the MemN2N architecture of Sukhbaatar et al. (2015), with an additional modification to leverage exact matches and types, described shortly. Apart from that addition, the main components of the model are (i) how it stores the conversation in memory, (ii) how it reads from the memory to reason about the response; and (iii) how it outputs the response. The details are given in Appendix A.
|
| 121 |
+
|
| 122 |
+
# 4.5 MATCH TYPE FEATURES TO DEAL WITH ENTITIES
|
| 123 |
+
|
| 124 |
+
Words denoting entities have two important traits: 1) exact matches are usually more appropriate to deal with them than approximate matches, and 2) they frequently appear as OOV words (e.g., the name of a new restaurant). Both are a challenge for embedding-based methods. Firstly, embedding into a low dimensional space makes it hard to differentiate between exact word matches, and matches between words with similar meaning (Bai et al., 2009). While this can be a virtue (e.g. when using synonyms), it is often a flaw when dealing with entities (e.g. failure to differentiate between phone numbers since they have similar embeddings). Secondly, when a new word is used (e.g. the name of a new restaurant) not seen before in training, no word embedding is available, typically resulting in failure (Weston et al., 2015a).
|
| 125 |
+
|
| 126 |
+
Both problems can be alleviated with match type features. Specifically, we augment the vocabulary with 7 special words, one for each of the KB entity types (cuisine type, location, price range, party size, rating, phone number and address). For each type, the corresponding type word is added to the candidate representation if a word is found that appears 1) as a KB entity of that type, 2) in the candidate, and 3) in the input or memory. Any word that matches as a KB entity can be typed even if it has never been seen before in training dialogs. These features allow the model to learn to rely on type information using exact matching words cues when OOV entity embeddings are not known, as long as it has access to a KB with the OOV entities. We assess the impact of such features for TF-IDF Match, Supervised Embeddings and Memory Networks.
|
| 127 |
+
|
| 128 |
+
# 5 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
Our main results across all the models and tasks are given in Table 2 (extra results are also given in Table 10 of Appendix D). The first 5 rows show tasks T1-T5, and rows 6-10 show the same tasks in the out-of-vocabulary setting. Rows 11 and 12 give results for the Dialog State Tracking Challenge task (T6) and Concierge respectively. Columns 2-7 give the results of each method tried in terms of per-response accuracy and per-dialog accuracy, the latter given in parenthesis. Per-response accuracy counts the percentage of responses that are correct (i.e., the correct candidate is chosen out of all possible candidates). Per-dialog accuracy counts the percentage of dialogs where every response is correct. Ultimately, if only one response is incorrect this could result in a failed dialog, i.e. failure to achieve the goal (in this case, of achieving a restaurant booking). Note that we test Memory Networks (MemNNs) with and without match type features, the results are shown in the last two columns. The hyperparameters for all models were optimized on the validation sets; values for best performing models are given in Appendix C.
|
| 131 |
+
|
| 132 |
+
The classical IR method TF-IDF Match performs the worst of all methods, and much worse than the Nearest Neighbor IR method, which is true on both the simulated tasks T1-T5 and on the real data of T6 and Concierge. Supplementing TF-IDF Match with match type features noticeably improves performance, which however still remains far behind Nearest Neighbor IR (adding bigrams to the
|
| 133 |
+
|
| 134 |
+
Table 2: Test results across all tasks and methods. For tasks T1-T5 results are given in the standard setup and the out-of-vocabulary (OOV) setup, where words (e.g. restaurant names) may not have been seen during training. Task T6 is the Dialog state tracking 2 task with real dialogs, and only has one setup. Best performing methods (or methods within $0 . 1 \%$ of best performing) are given in bold for the per-response accuracy metric, with the per-dialog accuracy given in parenthesis. (∗) For Concierge, an example is considered correctly answered if the correct response is ranked among the top 10 candidates by the bot, to accommodate the much larger range of semantically equivalent responses among candidates (see ex. in Tab. 7) . (†) We did not implement MemNNs+match type on Concierge, because this method requires a KB and there is none associated with it.
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Rule-based Systems</td><td colspan="2">TF-IDF Match</td><td rowspan="2">Nearest</td><td colspan="2">Supervised</td><td rowspan="2"></td><td colspan="3">Memory Networks</td></tr><tr><td>no type</td><td>+type</td><td>Neighbor</td><td>Embeddings</td><td>no match type</td><td></td><td>+ match type</td></tr><tr><td>T1: Issuing API calls</td><td>100 (100)</td><td>5.6 (0)</td><td>22.4(0)</td><td>55.1 (0)</td><td>100</td><td>(100)</td><td></td><td>99.9 (99.6)</td><td>100</td><td>(100)</td></tr><tr><td>T2: Updating API calls</td><td>100 (100)</td><td>3.4(0)</td><td>16.4(0)</td><td>68.3(0)</td><td>68.4</td><td>(0))</td><td>100</td><td>(100)</td><td>98.3</td><td>(83.9)</td></tr><tr><td>T3:Displaying options</td><td>100 (100)</td><td>8.0 (0)</td><td>8.0 (0)</td><td>58.8 (0)</td><td>64.9</td><td>(0)</td><td>74.9</td><td>(2.0)</td><td>74.9</td><td>(0)</td></tr><tr><td>T4:Providing information</td><td>100 (100)</td><td>9.5 (0)</td><td>17.8(0)</td><td>28.6 (0)</td><td>57.2</td><td>(0)</td><td>59.5</td><td>(3.0)</td><td>100</td><td>(100)</td></tr><tr><td>T5: Full dialogs</td><td>100 (100)</td><td>4.6 (0)</td><td>8.1(0)</td><td>57.1 (0)</td><td>75.4</td><td>(0)</td><td>96.1</td><td>(49.4)</td><td>93.4</td><td>(19.7)</td></tr><tr><td>T1(OOV): Issuing API calls</td><td>100 (100)</td><td>5.8 (0)</td><td>22.4(0)</td><td>44.1 (0)</td><td>60.0</td><td>(0)</td><td>72.3</td><td>(0)</td><td>96.5</td><td>(82.7)</td></tr><tr><td>T2(OOV): Updating API calls</td><td>100 (100)</td><td>3.5 (0)</td><td>16.8(0)</td><td>68.3 (0)</td><td>68.3</td><td>(0)</td><td>78.9</td><td>(0)</td><td>94.5</td><td>(48.4)</td></tr><tr><td>T3(OOV): Displaying options</td><td>100 (100)</td><td>8.3 (0)</td><td>8.3 (0)</td><td>58.8 (0)</td><td>65.0</td><td>(0)</td><td>74.4</td><td>(0)</td><td>75.2</td><td>(0)</td></tr><tr><td>T4(OOV): Providing inform.</td><td>100 (100)</td><td>9.8 (0)</td><td>17.2(0)</td><td>28.6 (0)</td><td>57.0</td><td>(0)</td><td>57.6</td><td>(0)</td><td>100</td><td>(100)</td></tr><tr><td>T5(OOV): Full dialogs</td><td>100 (100)</td><td>4.6(0)</td><td>9.0 (0)</td><td>48.4 (0)</td><td>58.2</td><td>(0)</td><td>65.5</td><td>(0)</td><td>77.7</td><td>(0)</td></tr><tr><td>T6: Dialog state tracking 2</td><td>33.3 0</td><td>1.6(0)</td><td>1.6 (0)</td><td>21.9 (0)</td><td>22.6</td><td>0</td><td>41.1</td><td>(0)</td><td>41.0</td><td>(0</td></tr><tr><td>Concierge(*)</td><td>n/a</td><td>1.1(0.2)</td><td>n/a</td><td>13.4(0.5)</td><td>14.6</td><td>(0.5)</td><td>16.7</td><td>(1.2)</td><td>n/a()</td><td></td></tr></table>
|
| 137 |
+
|
| 138 |
+
dictionary has no effect on performance). This is in sharp contrast to other recent results on datadriven non-goal directed conversations, e.g. over dialogs on Twitter (Ritter et al., 2011) or Reddit (Dodge et al., 2016), where it was found that TF-IDF Match outperforms Nearest Neighbor, as general conversations on a given subject typically share many words. We conjecture that the goal-oriented nature of the conversation means that the conversation moves forward more quickly, sharing fewer words per (input, response) pair, e.g. consider the example in Figure 1.
|
| 139 |
+
|
| 140 |
+
Supervised embeddings outperform classical IR methods in general, indicating that learning mappings between words (via word embeddings) is important. However, only one task (T1, Issuing API calls) is completely successful. In the other tasks, some responses are correct, as shown by the per-response accuracy, however there is no dialog where the goal is actually achieved (i.e., the mean dialogaccuracy is 0). Typically the model can provide correct responses for greeting messages, asking to wait, making API calls and asking if there are any other options necessary. However, it fails to interpret the results of API calls to display options, provide information or update the calls with new information, resulting in most of its errors, even when match type features are provided.
|
| 141 |
+
|
| 142 |
+
Memory Networks (without match type features) outperform classical IR and supervised embeddings across all of the tasks. They can solve the first two tasks (issuing and updating API calls) adequately. On the other tasks, they give improved results, but do not solve them. While the per-response accuracy is improved, the per-dialog accuracy is still close to 0 on T3 and T4. Some examples of predictions of the MemNN for T1-4 are given in Appendix B. On the OOV tasks again performance is improved, but this is all due to better performance on known words, as unknown words are simply not used without the match type features. As stated in Appendix C, optimal hyperparameters on several of the tasks involve 3 or 4 hops, indicating that iterative accessing and reasoning over the conversation helps, e.g. on T3 using 1 hop gives $6 4 . 8 \%$ while 2 hops yields $7 4 . 7 \%$ . Appendix B displays illustrative examples of Memory Networks predictions on T 1-4 and Concierge.
|
| 143 |
+
|
| 144 |
+
Memory Networks with match type features give two performance gains over the same models without match type features: (i) T4 (providing information) becomes solvable because matches can be made to the results of the API call; and (ii) out-of-vocabulary results are significantly improved as well. Still, tasks T3 and T5 are still fail cases, performance drops slightly on T2 compared to not using match type features, and no relative improvement is observed on T6. Finally, note that matching words on its own is not enough, as evidenced by the poor performance of TF-IDF matching; this idea must be combined with types and the other properties of the MemNN model.
|
| 145 |
+
|
| 146 |
+
Unsurprisingly, perfectly coded rule-based systems can solve the simulated tasks T1-T5 perfectly, whereas our machine learning methods cannot. However, it is not easy to build an effective rule-based system when dealing with real language on real problems, and our rule based system is outperformed by MemNNs on the more realistic task T6.
|
| 147 |
+
|
| 148 |
+
Overall, while the methods we tried made some inroads into these tasks, there are still many challenges left unsolved. Our best models can learn to track implicit dialog states and manipulate OOV words and symbols (T1-T2) to issue API calls and progress in conversations, but they are still unable to perfectly handle interpreting knowledge about entities (from returned API calls) to present results to the user, e.g. displaying options in T3. The improvement observed on the simulated tasks e.g. where MemNNs outperform supervised embeddings which in turn outperform IR methods, is also seen on the realistic data of T6 with similar relative gains. This is encouraging as it indicates that future work on breaking down, analysing and developing models over the simulated tasks should help in the real tasks as well. Results on Concierge confirm this observation: the pattern of relative performances of methods is the same on Concierge and on our series of tasks. This suggests that our synthetic data can indeed be used as an effective evaluation proxy.
|
| 149 |
+
|
| 150 |
+
# 6 CONCLUSION
|
| 151 |
+
|
| 152 |
+
We have introduced an open dataset and task set for evaluating end-to-end goal-oriented dialog learning methods in a systematic and controlled way. We hope this will help foster progress of end-toend conversational agents because (i) existing measures of performance either prevent reproducibility (different Mechanical Turk jobs) or do not correlate well with human judgements (Liu et al., 2016); (ii) the breakdown in tasks will help focus research and development to improve the learning methods; and (iii) goal-oriented dialog has clear utility in real applications. We illustrated how to use the testbed using a variant of end-to-end Memory Networks, which prove an effective model on these tasks relative to other baselines, but are still lacking in some key areas.
|
| 153 |
+
|
| 154 |
+
# ACKNOWLEDGMENTS
|
| 155 |
+
|
| 156 |
+
The authors would like to thank Martin Raison, Alex Lebrun and Laurent Landowski for their help with the Concierge data.
|
| 157 |
+
|
| 158 |
+
# REFERENCES
|
| 159 |
+
|
| 160 |
+
Bai, B., Weston, J., Grangier, D., Collobert, R., Sadamasa, K., Qi, Y., Chapelle, O., and Weinberger, K. (2009). Supervised semantic indexing. In Proceedings of ACM CIKM, pages 187–196. ACM.
|
| 161 |
+
Banchs, R. E. (2012). Movie-dic: a movie dialogue corpus for research and development. In Proceedings of the 50th Annual Meeting of the ACL.
|
| 162 |
+
Chen, Y.-N., Hakkani-Tür, D., Tur, G., Gao, J., and Deng, L. (2016). End-to-end memory networks with knowledge carryover for multi-turn spoken language understanding. In Proceedings of Interspeech.
|
| 163 |
+
Dahl, D. A., Bates, M., Brown, M., Fisher, W., Hunicke-Smith, K., Pallett, D., Pao, C., Rudnicky, A., and Shriberg, E. (1994). Expanding the scope of the atis task: The atis-3 corpus. In Proceedings of the workshop on Human Language Technology, pages 43–48. Association for Computational Linguistics.
|
| 164 |
+
Dodge, J., Gane, A., Zhang, X., Bordes, A., Chopra, S., Miller, A., Szlam, A., and Weston, J. (2016). Evaluating prerequisite qualities for learning end-to-end dialog systems. In Proc. of ICLR.
|
| 165 |
+
Gašic, M., Kim, D., Tsiakoulis, P., Breslin, C., Henderson, M., Szummer, M., Thomson, B., and Young, S. (2014). Incremental on-line adaptation of pomdp-based dialogue managers to extended domains. In Proceedings on InterSpeech.
|
| 166 |
+
Henderson, M., Thomson, B., and Williams, J. (2014a). The second dialog state tracking challenge. In 15th Annual Meeting of the Special Interest Group on Discourse and Dialogue, page 263.
|
| 167 |
+
Henderson, M., Thomson, B., and Young, S. (2014b). Word-based dialog state tracking with recurrent neural networks. In Proceedings of the 15th Annual Meeting of the Special Interest Group on Discourse and Dialogue (SIGDIAL), pages 292–299.
|
| 168 |
+
Hixon, B., Clark, P., and Hajishirzi, H. (2015). Learning knowledge graphs for question answering through conversational dialog. In Proceedings of the the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Denver, Colorado, USA.
|
| 169 |
+
Isbell, C. L., Kearns, M., Kormann, D., Singh, S., and Stone, P. (2000). Cobot in lambdamoo: A social statistics agent. In AAAI/IAAI, pages 36–41.
|
| 170 |
+
Jafarpour, S., Burges, C. J., and Ritter, A. (2010). Filter, rank, and transfer the knowledge: Learning to chat. Advances in Ranking, 10.
|
| 171 |
+
Kim, S., D’Haro, L. F., Banchs, R. E., Williams, J. D., and Henderson, M. (2016). The fourth dialog state tracking challenge. In Proceedings of the 7th International Workshop on Spoken Dialogue Systems (IWSDS).
|
| 172 |
+
Lemon, O., Georgila, K., Henderson, J., and Stuttle, M. (2006). An isu dialogue system exhibiting reinforcement learning of dialogue policies: generic slot-filling in the talk in-car system. In Proceedings of the 11th Conference of the European Chapter of the ACL: Posters & Demonstrations, pages 119–122.
|
| 173 |
+
Liu, C.-W., Lowe, R., Serban, I. V., Noseworthy, M., Charlin, L., and Pineau, J. (2016). How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023.
|
| 174 |
+
Lowe, R., Pow, N., Serban, I., and Pineau, J. (2015). The ubuntu dialogue corpus: A large dataset for research in unstructured multi-turn dialogue systems. arXiv preprint arXiv:1506.08909.
|
| 175 |
+
Lowe, R., Serban, I. V., Noseworthy, M., Charlin, L., and Pineau, J. (2016). On the evaluation of dialogue systems with next utterance classification. arXiv preprint arXiv:1605.05414.
|
| 176 |
+
Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013). Efficient estimation of word representations in vector space. arXiv:1301.3781.
|
| 177 |
+
Pietquin, O. and Hastie, H. (2013). A survey on metrics for the evaluation of user simulations. The knowledge engineering review, 28(01), 59–73.
|
| 178 |
+
Ritter, A., Cherry, C., and Dolan, W. B. (2011). Data-driven response generation in social media. In Proceedings of the Conference on Empirical Methods in Natural Language Processing.
|
| 179 |
+
Serban, I. V., Sordoni, A., Bengio, Y., Courville, A., and Pineau, J. (2015a). Building end-to-end dialogue systems using generative hierarchical neural network models. In Proc. of the AAAI Conference on Artificial Intelligence.
|
| 180 |
+
Serban, I. V., Lowe, R., Charlin, L., and Pineau, J. (2015b). A survey of available corpora for building data-driven dialogue systems. arXiv preprint arXiv:1512.05742.
|
| 181 |
+
Shang, L., Lu, Z., and Li, H. (2015). Neural responding machine for short-text conversation. arXiv preprint arXiv:1503.02364.
|
| 182 |
+
Sordoni, A., Galley, M., Auli, M., Brockett, C., Ji, Y., Mitchell, M., Nie, J.-Y., Gao, J., and Dolan, B. (2015). A neural network approach to context-sensitive generation of conversational responses. Proceedings of NAACL.
|
| 183 |
+
Su, P.-H., Vandyke, D., Gasic, M., Kim, D., Mrksic, N., Wen, T.-H., and Young, S. (2015a). Learning from real users: Rating dialogue success with neural networks for reinforcement learning in spoken dialogue systems. arXiv preprint arXiv:1508.03386.
|
| 184 |
+
Su, P.-H., Vandyke, D., Gasic, M., Mrksic, N., Wen, T.-H., and Young, S. (2015b). Reward shaping with recurrent neural networks for speeding up on-line policy learning in spoken dialogue systems. arXiv preprint arXiv:1508.03391.
|
| 185 |
+
Sukhbaatar, S., Szlam, A., Weston, J., and Fergus, R. (2015). End-to-end memory networks. Proceedings of NIPS.
|
| 186 |
+
Vinyals, O. and Le, Q. (2015). A neural conversational model. arXiv preprint arXiv:1506.05869.
|
| 187 |
+
Wang, H., Lu, Z., Li, H., and Chen, E. (2013). A dataset for research on short-text conversations. In EMNLP.
|
| 188 |
+
Wang, Z. and Lemon, O. (2013). A simple and generic belief tracking mechanism for the dialog state tracking challenge: On the believability of observed information. In Proceedings of the SIGDIAL 2013 Conference.
|
| 189 |
+
Wen, T.-H., Gasic, M., Mrksic, N., Su, P.-H., Vandyke, D., and Young, S. (2015). Semantically conditioned lstm-based natural language generation for spoken dialogue systems. arXiv preprint arXiv:1508.01745.
|
| 190 |
+
Weston, J., Chopra, S., and Bordes, A. (2015a). Memory networks. Proceedings of ICLR.
|
| 191 |
+
Weston, J., Bordes, A., Chopra, S., and Mikolov, T. (2015b). Towards ai-complete question answering: a set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698.
|
| 192 |
+
Young, S., Gasic, M., Thomson, B., and Williams, J. D. (2013). Pomdp-based statistical spoken dialog systems: A review. Proceedings of the IEEE, 101(5), 1160–1179.
|
| 193 |
+
|
| 194 |
+
# A MEMORY NETWORKS IMPLEMENTATION
|
| 195 |
+
|
| 196 |
+
Storing and representing the conversation history As the model conducts a conversation with the user, at each time step $t$ the previous utterance (from the user) and response (from the model) are appended to the memory. Hence, at any given time there are $c _ { 1 } ^ { u } , \ldots c _ { t } ^ { u }$ user utterances and $c _ { 1 } ^ { r } , \ldots . c _ { t - 1 } ^ { r }$ model responses stored (i.e. the entire conversation).2 The aim at time $t$ is to thus choose the next response $c _ { t } ^ { r }$ . We train on existing full dialog transcripts, so at training time we know the upcoming utterance $\boldsymbol { c } _ { t } ^ { r }$ and can use it as a training target. Following Dodge et al. (2016), we represent each utterance as a bag-of-words and in memory it is represented as a vector using the embedding matrix $A$ , i.e. the memory is an array with entries:
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
m = ( A \Phi ( c _ { 1 } ^ { u } ) , A \Phi ( c _ { 1 } ^ { r } ) \dots , A \Phi ( c _ { t - 1 } ^ { u } ) , A \Phi ( c _ { t - 1 } ^ { r } ) )
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
where $\Phi ( \cdot )$ maps the utterance to a bag of dimension $V$ (the vocabulary), and $A$ is a $d \times V$ matrix, where $d$ is the embedding dimension. We retain the last user utterance $c _ { t } ^ { u }$ as the “input” to be used directly in the controller. The contents of each memory slot $m _ { i }$ so far does not contain any information of which speaker spoke an utterance, and at what time during the conversation. We therefore encode both of those pieces of information in the mapping $\Phi$ by extending the vocabulary to contain $T = 1 0 0 0$ extra “time features” which encode the index $_ { i }$ into the bag-of-words, and two more features that encode whether the utterance was spoken by the user or the model.
|
| 203 |
+
|
| 204 |
+
Attention over the memory The last user utterance $c _ { t } ^ { u }$ is embedded using the same matrix $A$ giving $q = A \Phi ( c _ { t } ^ { u } )$ , which can also be seen as the initial state of the controller. At this point the controller reads from the memory to find salient parts of the previous conversation that are relevant to producing a response. The match between $q$ and the memories is computed by taking the inner product followed by a softmax: $p _ { i } = \mathrm { S o f t m a x } ( u ^ { \top } m _ { i } )$ , giving a probability vector over the memories. The vector that is returned back to the controller is then computed by $\begin{array} { r } { o = R \sum _ { i } ^ { } p _ { i } m _ { i } } \end{array}$ where $R$ is a $d \times d$ square matrix. The controller state is then updated with $q _ { 2 } = o + q$ . The memory can be iteratively reread to look for additional pertinent information using the updated state of the controller $q _ { 2 }$ instead of $q$ , and in general using $q _ { h }$ on iteration $h$ , with a fixed number of iterations $N$ (termed $N$ hops). Empirically we find improved performance on our tasks with up to 3 or 4 hops.
|
| 205 |
+
|
| 206 |
+
Choosing the response The final prediction is then defined as:
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
\hat { a } = \operatorname { S o f t m a x } \bigl ( { q _ { N + 1 } } ^ { \top } W \Phi ( y _ { 1 } ) , \ldots , { q _ { N + 1 } } ^ { \top } W \Phi ( y _ { C } ) \bigr )
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
where there are $C$ candidate responses in $y$ , and $W$ is of dimension $d \times V$ . In our tasks the set $_ y$ is a (large) set of candidate responses which includes all possible bot utterances and API calls.
|
| 213 |
+
|
| 214 |
+
The entire model is trained using stochastic gradient descent (SGD), minimizing a standard cross-entropy loss between $\hat { a }$ and the true label $a$ .
|
| 215 |
+
|
| 216 |
+
# B EXAMPLES OF PREDICTIONS OF A MEMORY NETWORK
|
| 217 |
+
|
| 218 |
+
Tables 3, 4, 5 and 6 display examples of predictions of the best performing Memory Network on full dialogs, Task 5, (with 3 hops) on test examples of Tasks 1-4 along with the values of the attention over each memory for each hop ${ p } _ { i }$ as defined in Sec. A). This model does not use match type features. Then, Table 7 displays an example of prediction of the best performing Memory Network on Concierge (with 2 hops) on a test example along with the values of the attention over each memory for each hop.
|
| 219 |
+
|
| 220 |
+
# C HYPERPARAMETERS
|
| 221 |
+
|
| 222 |
+
Tables 8 and 9 respectively display the values of the hyperparameters of the best Supervised Embeddings and Memory Networks selected for each task. These models were selected using the best validation validation sets.
|
| 223 |
+
|
| 224 |
+
# D ADDITIONAL RESULTS
|
| 225 |
+
|
| 226 |
+
Table 10 provides results for additional variants of supervised embeddings, using either a dictionary that includes all bigrams to leverage some word order information, or match type features. On some tasks, supervised embeddings perform better when the last user utterance is used as sole input, without the full dialog history (see Table 8). When no history is used, we slightly adapt match type features to only record type: a special word corresponding to type $T$ (e.g., phone, address, etc) is appended to the representation of a candidate if the candidate contains a word that appears in the knowledge base as an entity of type $T$ , regardless of whether the same word appeared earlier in the conversation. As seen on Table 10, match type features improve performance on out-of-vocabulary tasks 1 and 5, bringing it closer to that of Memory Networks without match type features, but still quite lagging Memory Networks with match type features. Bigrams slightly hurt rather than help performance, except in Task 5 in the standard in-vocabulary setup (performance is lower in the OOV setup).
|
| 227 |
+
|
| 228 |
+
Table 3: Task 1 (Issue API call) The model learns to direct its attention towards the 4 memories containing the information key to issue the API call. More hops help to strengthen this signal. <silence> is a special token used to indicate that the user did not speak at this turn – the model has to carry out the conversation with no additional input.
|
| 229 |
+
|
| 230 |
+
<table><tr><td>Time</td><td>Locutor</td><td colspan="3">Dialog History</td><td>Hop #1</td><td>Hop #2</td><td>Hop #3</td></tr><tr><td>1</td><td>User</td><td colspan="3">hi</td><td>.054</td><td>.016</td><td>.020</td></tr><tr><td>2</td><td>Bot</td><td colspan="3">hello what can i help you with today</td><td>.040</td><td>.024</td><td>.008</td></tr><tr><td>3</td><td>User</td><td colspan="3">may i have a table in paris</td><td>.099</td><td>.137</td><td>.141</td></tr><tr><td>4</td><td>Bot</td><td colspan="3">i'm on it</td><td>.048</td><td>.028</td><td>.004</td></tr><tr><td>5</td><td>User</td><td colspan="3"><silence></td><td>.181</td><td>.099</td><td>.037</td></tr><tr><td>6</td><td>Bot</td><td colspan="3">any preference on a type of cuisine</td><td>.056</td><td>.090</td><td>.014</td></tr><tr><td>7</td><td>User</td><td colspan="3">i love indian food</td><td>.159</td><td>.188</td><td>.238</td></tr><tr><td>8</td><td>Bot</td><td colspan="3">how many people would be in your party</td><td>.051</td><td>.022</td><td>.010</td></tr><tr><td>9</td><td>User</td><td colspan="3">we will be six</td><td>.129</td><td>.144</td><td>.114</td></tr><tr><td>10</td><td>Bot</td><td colspan="3">which price range are looking for</td><td>.039</td><td>.028</td><td>.006</td></tr><tr><td>11</td><td>User</td><td colspan="3">in a moderate price range please</td><td>.128</td><td>.213</td><td>.405</td></tr><tr><td>12</td><td>Bot</td><td colspan="3">ok let me look into some options for you</td><td>.016</td><td>.011</td><td>.003</td></tr><tr><td colspan="2">User input</td><td colspan="6"><silence></td></tr><tr><td colspan="2">Correct answer</td><td>api_call indian</td><td>paris</td><td>six moderate</td><td></td><td></td><td></td></tr><tr><td colspan="2">Predicted answer</td><td>api_call</td><td>indian paris six moderate</td><td></td><td>[Correct]</td><td></td><td></td></tr></table>
|
| 231 |
+
|
| 232 |
+
Table 4: Task 2 (Update API call) Out of the multiple memories from the current dialog, the model correctly focuses on the 2 important pieces: the original API call and the utterance giving the update.
|
| 233 |
+
|
| 234 |
+
<table><tr><td rowspan=1 colspan=1>Time</td><td rowspan=1 colspan=1>Locutor</td><td rowspan=1 colspan=3>Dialog history</td><td rowspan=1 colspan=1>Hop #1</td><td rowspan=1 colspan=1>Hop #2</td><td rowspan=1 colspan=1>Hop #3</td></tr><tr><td rowspan=2 colspan=1>34</td><td rowspan=2 colspan=1>UserBot</td><td rowspan=2 colspan=3>mayihavea table in parisi'm on it</td><td rowspan=1 colspan=1>.061</td><td rowspan=1 colspan=1>.072</td><td rowspan=1 colspan=1>.040</td></tr><tr><td rowspan=1 colspan=1>.026</td><td rowspan=1 colspan=1>.012</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=2 colspan=1>56</td><td rowspan=2 colspan=1>UserBot</td><td rowspan=5 colspan=3><silence>any preference on a type of cuisinei love indian foodhow many people would be in your partywe will be six</td><td rowspan=1 colspan=1>.087</td><td rowspan=1 colspan=1>.042</td><td rowspan=1 colspan=1>.012</td></tr><tr><td rowspan=1 colspan=1>.026</td><td rowspan=1 colspan=1>.023</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=6 colspan=1>789101112</td><td rowspan=6 colspan=1>UserBotUserBotUserBot</td><td rowspan=1 colspan=1>i</td><td rowspan=1 colspan=1>.081</td><td rowspan=1 colspan=1>.070</td><td rowspan=1 colspan=1>.055</td></tr><tr><td rowspan=1 colspan=2>how</td><td rowspan=1 colspan=1>.025</td><td rowspan=1 colspan=1>.006</td><td rowspan=2 colspan=1>.001.018</td></tr><tr><td rowspan=4 colspan=3>we will be sixwhich price range are looking forin a moderate price range pleaseok let me look into some options for you</td><td rowspan=1 colspan=1>.059</td><td rowspan=2 colspan=1>.051.043</td><td rowspan=2 colspan=1>.018.004</td></tr><tr><td rowspan=1 colspan=1>.038</td></tr><tr><td rowspan=1 colspan=1>.080</td><td rowspan=1 colspan=1>.095</td><td rowspan=1 colspan=1>.096</td></tr><tr><td rowspan=1 colspan=1>.025</td><td rowspan=1 colspan=1>.042</td><td rowspan=1 colspan=1>.003</td></tr><tr><td rowspan=1 colspan=1>13</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=3><silence></td><td rowspan=1 colspan=1>.127</td><td rowspan=1 colspan=1>.069</td><td rowspan=1 colspan=1>.032</td></tr><tr><td rowspan=1 colspan=1>14</td><td rowspan=1 colspan=1>Bot</td><td rowspan=2 colspan=3>api_call indian paris six moderateinstead could it be with french food</td><td rowspan=1 colspan=1>.062</td><td rowspan=1 colspan=1>.113</td><td rowspan=1 colspan=1>.043</td></tr><tr><td rowspan=4 colspan=1>15161718</td><td rowspan=4 colspan=1>UserBotUserBot</td><td rowspan=4 colspan=3>instead could it be with french foodsure is there anything else to updatenook let me look into some options for you</td><td rowspan=1 colspan=1>.188</td><td rowspan=1 colspan=1>.311</td><td rowspan=1 colspan=1>.683</td></tr><tr><td rowspan=1 colspan=1>.016</td><td rowspan=1 colspan=1>.007</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=2 colspan=1>.028.011</td><td rowspan=1 colspan=1>.013</td><td rowspan=1 colspan=1>.007</td></tr><tr><td rowspan=1 colspan=1>.006</td><td rowspan=1 colspan=1>.000</td></tr><tr><td rowspan=1 colspan=2>User input</td><td rowspan=1 colspan=6><silence></td></tr><tr><td rowspan=1 colspan=2>Correct answer</td><td rowspan=1 colspan=6>api__callfrenchparissix moderate</td></tr><tr><td rowspan=1 colspan=2>Predictedanswer</td><td rowspan=1 colspan=4>api_callfrench paris six moderate [Correct]</td><td rowspan=1 colspan=2></td></tr></table>
|
| 235 |
+
|
| 236 |
+
Table 5: Task 3 (Displaying options) The model knows it has to display options but the attention is wrong: it should attend on the ratings to select the best option (with highest rating). It cannot learn that properly and match type features do not help. It is correct here by luck, the task is not solved overall (see Tab. 2). We do not show all memories in the table, only those with meaningful attention.
|
| 237 |
+
|
| 238 |
+
<table><tr><td>Time</td><td>Locutor</td><td>Dialog history</td><td></td><td>Hop #1</td><td>Hop #2</td><td>Hop #3</td></tr><tr><td>14</td><td>Bot</td><td></td><td>api_call indian paris six moderate</td><td>.012</td><td>.000</td><td>.000</td></tr><tr><td>15</td><td>User</td><td></td><td>instead could it be with french food</td><td>.067</td><td>.103</td><td>.147</td></tr><tr><td>20</td><td>Bot</td><td></td><td>api_call french paris six moderate</td><td>.012</td><td>.000</td><td>.000</td></tr><tr><td>21</td><td>User</td><td>resto_1</td><td>r_phone rest_1_phone</td><td>.018</td><td>.004</td><td>.000</td></tr><tr><td>23</td><td>User</td><td>resto_1</td><td>1 r_cuisine french</td><td>.029</td><td>.005</td><td>.000</td></tr><tr><td>24</td><td>User</td><td>resto_1</td><td>r_location paris</td><td>.060</td><td>.292</td><td>.094</td></tr><tr><td>25</td><td>User</td><td>resto_1</td><td>r_number six</td><td>.050</td><td>.298</td><td>.745</td></tr><tr><td>26</td><td>User</td><td>resto_1</td><td>r_price moderate</td><td>.060</td><td>.090</td><td>.002</td></tr><tr><td>27</td><td>User</td><td>resto_1</td><td>r_rating 6</td><td>.016</td><td>.002</td><td>.000</td></tr><tr><td>30</td><td>User</td><td>resto_2</td><td>r_cuisine french</td><td>.031</td><td>.007</td><td>.000</td></tr><tr><td>31</td><td>User</td><td>resto_2</td><td>r_location paris</td><td>.040</td><td>.081</td><td>.004</td></tr><tr><td>32</td><td>User</td><td>resto_2</td><td>r_number six</td><td>.020</td><td>.012</td><td>.000</td></tr><tr><td>33</td><td>User</td><td>resto_2</td><td>r_price moderate</td><td>.029</td><td>.009</td><td>.000</td></tr><tr><td>37</td><td>User</td><td>resto_3</td><td>r_cuisine french</td><td>.014</td><td>.001</td><td>.000</td></tr><tr><td>38</td><td>User</td><td>resto_3</td><td>r_location paris</td><td>.028</td><td>.016</td><td>.001</td></tr><tr><td>39</td><td>User</td><td>resto_3</td><td>r_number six</td><td>.024</td><td>.022</td><td>.004</td></tr><tr><td>40</td><td>User</td><td>resto_3</td><td>r_price moderate</td><td>.039</td><td>.015</td><td>.001</td></tr><tr><td colspan="2">User input</td><td colspan="6"><silence></td></tr><tr><td colspan="2">Correct answer</td><td colspan="6">what do you think of this option:resto_1</td></tr><tr><td colspan="2">Predictedanswer</td><td colspan="6">what do you think of this option:resto_1 [Correct]</td></tr></table>
|
| 239 |
+
|
| 240 |
+
Table 6: Task 4 (Providing extra-information) The model knows it must display a phone or an address, but, as explained in Section A the embeddings mix up the information and make it hard to distinguish between different phone numbers or addresses, making answering correctly very hard. As shown in the results of Tab. 2, this problem can be solved by adding match type features, that allow to emphasize entities actually appearing in the history. The attention is globally wrong here.
|
| 241 |
+
|
| 242 |
+
<table><tr><td rowspan=1 colspan=1>Time</td><td rowspan=1 colspan=1>Locutor</td><td rowspan=1 colspan=2>Dialog history</td><td rowspan=1 colspan=2>Hop #1</td><td rowspan=1 colspan=1>Hop #2</td><td rowspan=1 colspan=1>Hop #3</td></tr><tr><td rowspan=2 colspan=1>1415</td><td rowspan=1 colspan=1>Bot</td><td rowspan=2 colspan=2>api_call indian paris six moderateinstead could it be with french food</td><td rowspan=1 colspan=2>.006</td><td rowspan=1 colspan=1>.000</td><td rowspan=1 colspan=1>.000</td></tr><tr><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=2>.024</td><td rowspan=1 colspan=1>.011</td><td rowspan=1 colspan=1>.007</td></tr><tr><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>Bot</td><td rowspan=1 colspan=2>api_call french paris six moderate</td><td rowspan=1 colspan=2>.005</td><td rowspan=1 colspan=1>.000</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>21</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=2>resto_1 r_phone resto_l_phone</td><td rowspan=1 colspan=2>.011</td><td rowspan=1 colspan=1>.005</td><td rowspan=1 colspan=1>.004</td></tr><tr><td rowspan=1 colspan=1>22</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=2>resto_1 r_address resto_1_address</td><td rowspan=1 colspan=2>.018</td><td rowspan=1 colspan=1>.004</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>23</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>.r_cuisine french</td><td rowspan=1 colspan=2>.018</td><td rowspan=1 colspan=1>.003</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>24</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>r_location paris</td><td rowspan=1 colspan=2>.068</td><td rowspan=1 colspan=1>.091</td><td rowspan=1 colspan=1>.108</td></tr><tr><td rowspan=1 colspan=1>25</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>r_number six</td><td rowspan=1 colspan=2>.086</td><td rowspan=1 colspan=1>.078</td><td rowspan=1 colspan=1>.020</td></tr><tr><td rowspan=1 colspan=1>26</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>r_price moderate</td><td rowspan=1 colspan=2>.070</td><td rowspan=1 colspan=1>.225</td><td rowspan=1 colspan=1>.369</td></tr><tr><td rowspan=1 colspan=1>27</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_1</td><td rowspan=1 colspan=1>r_rating 6</td><td rowspan=1 colspan=2>.014</td><td rowspan=1 colspan=1>.006</td><td rowspan=1 colspan=1>.008</td></tr><tr><td rowspan=1 colspan=1>28</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_phone resto_2_phone</td><td rowspan=1 colspan=2>.015</td><td rowspan=1 colspan=1>.009</td><td rowspan=1 colspan=1>.006</td></tr><tr><td rowspan=1 colspan=1>29</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_address resto_2_address</td><td rowspan=1 colspan=2>.014</td><td rowspan=1 colspan=1>.004</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>31</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_location paris</td><td rowspan=1 colspan=2>.075</td><td rowspan=1 colspan=1>.176</td><td rowspan=1 colspan=1>.193</td></tr><tr><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_number six</td><td rowspan=1 colspan=2>.100</td><td rowspan=1 colspan=1>.126</td><td rowspan=1 colspan=1>.026</td></tr><tr><td rowspan=1 colspan=1>33</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_2</td><td rowspan=1 colspan=1>r_price moderate</td><td rowspan=1 colspan=2>.038</td><td rowspan=1 colspan=1>.090</td><td rowspan=1 colspan=1>.167</td></tr><tr><td rowspan=1 colspan=1>35</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>r_phone resto_3_phone</td><td rowspan=1 colspan=2>.004</td><td rowspan=1 colspan=1>.001</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>36</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>r_address resto_3_address</td><td rowspan=1 colspan=2>.005</td><td rowspan=1 colspan=1>.002</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=1>37</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>resto_3 r_location paris</td><td rowspan=1 colspan=2>.028</td><td rowspan=1 colspan=1>.028</td><td rowspan=1 colspan=1>.026</td></tr><tr><td rowspan=1 colspan=1>39</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>resto_3 r_number six</td><td rowspan=1 colspan=2>.039</td><td rowspan=1 colspan=1>.013</td><td rowspan=1 colspan=1>.002</td></tr><tr><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>User</td><td rowspan=1 colspan=1>resto_3</td><td rowspan=1 colspan=1>resto_3 r_price moderate</td><td rowspan=1 colspan=2>.018</td><td rowspan=1 colspan=1>.008</td><td rowspan=1 colspan=1>.013</td></tr><tr><td rowspan=1 colspan=1>42</td><td rowspan=1 colspan=1>Bot</td><td rowspan=2 colspan=2>what do you think of this option: resto_1let's do it</td><td rowspan=1 colspan=2>.074</td><td rowspan=1 colspan=1>.001</td><td rowspan=1 colspan=1>.000</td></tr><tr><td rowspan=2 colspan=1>4344</td><td rowspan=2 colspan=1>UserBot</td><td rowspan=1 colspan=2>.032</td><td rowspan=1 colspan=1>.004</td><td rowspan=1 colspan=1>.001</td></tr><tr><td rowspan=1 colspan=2>great let me do the reservation</td><td rowspan=1 colspan=2>.003</td><td rowspan=1 colspan=1>.000</td><td rowspan=1 colspan=1>.000</td></tr><tr><td rowspan=1 colspan=2>User input</td><td rowspan=3 colspan=6>do you have itsaddresshere it is resto_1_addresshereitis:resto_8_address [Incorrect]</td></tr><tr><td rowspan=1 colspan=2>Correctanswer</td><td rowspan=2 colspan=3>here it is resto_1_addresshereitis:resto_8_address</td></tr><tr><td rowspan=1 colspan=2>Predictedanswer</td></tr></table>
|
| 243 |
+
|
| 244 |
+
Table 7: Concierge Data The model is also able to learn from human-human dialogs. <person>, <org>, <number> and <date> are special tokens used to anonymize the data. We report the top 5 answers predicted by the model. They are all semantically equivalent. Note that the utterances, while all produced by humans, are not perfect English ("rservation", "I’ll check into it")
|
| 245 |
+
|
| 246 |
+
<table><tr><td>Time</td><td>Locutor</td><td>Dialog History</td><td>Hop #1</td><td>Hop #2</td></tr><tr><td>1</td><td>User</td><td>hey concierge</td><td>.189</td><td>.095</td></tr><tr><td>2</td><td>User</td><td>could you check if i can get a rservation at <org> <date> for brunch</td><td>.209</td><td>.178</td></tr><tr><td>134</td><td>User</td><td><number> people</td><td>.197</td><td>.142</td></tr><tr><td>5</td><td>User</td><td><silence></td><td>.187</td><td>.167</td></tr><tr><td></td><td>Bot</td><td>hi <person> unfortunately <org> is fully booked for <date></td><td>.225</td><td>.410</td></tr><tr><td>User input</td><td></td><td>and there's <number> people on the waiting list when'sthe earliestavailability</td><td></td><td></td></tr><tr><td colspan="2">Correctanswer</td><td colspan="3">i'll check</td></tr><tr><td colspan="2">Pred.answer#1</td><td>i'm on it</td><td>[Incorrect]</td><td></td></tr><tr><td colspan="2">Pred.answer #2</td><td>i'll find out</td><td colspan="2">[Incorrect]</td></tr><tr><td colspan="2">Pred.answer #3</td><td>i'll take a look</td><td colspan="2">[Incorrect]</td></tr><tr><td colspan="2">Pred.answer #4</td><td>i'll check</td><td colspan="2">[Correct]</td></tr><tr><td colspan="2"></td><td></td><td colspan="2"></td></tr><tr><td colspan="2">Pred.answer #5</td><td>i'll check into it</td><td colspan="2">[Incorrect]</td></tr></table>
|
| 247 |
+
|
| 248 |
+
Table 8: Hyperparameters of Supervised Embeddings. When Use History is True, the whole conversation history is concatenated with the latest user utterance to create the input. If False, only the latest utterance is used as input.
|
| 249 |
+
|
| 250 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>Learning Rate</td><td rowspan=1 colspan=1>Margin m</td><td rowspan=1 colspan=1>Embedding Dim d</td><td rowspan=1 colspan=1>Negative Cand. N</td><td rowspan=1 colspan=1>Use History</td></tr><tr><td rowspan=2 colspan=1>Task 1Task 2</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>100</td><td rowspan=3 colspan=1>TrueFalseFalseFalseTrue</td></tr><tr><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>100</td></tr><tr><td rowspan=1 colspan=1>Task 3Task 4Task 5</td><td rowspan=1 colspan=1>0.010.0010.01</td><td rowspan=1 colspan=1>0.10.10.01</td><td rowspan=1 colspan=1>12812832</td><td rowspan=1 colspan=1>10001000100</td></tr><tr><td rowspan=1 colspan=1>Task 6</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>False</td></tr><tr><td rowspan=1 colspan=1>Concierge</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>False</td></tr></table>
|
| 251 |
+
|
| 252 |
+
Table 9: Hyperparameters of Memory Networks. The longer and more complex the dialogs are, the more hops are needed.
|
| 253 |
+
|
| 254 |
+
<table><tr><td>Task</td><td>Learning Rate</td><td>Margin m</td><td>Embedding Dimd</td><td>Negative Cand. N</td><td>Nb Hops</td></tr><tr><td>Task 1</td><td>0.01</td><td>0.1</td><td>128</td><td>100</td><td>1</td></tr><tr><td>Task 2</td><td>0.01</td><td>0.1</td><td>32</td><td>100</td><td>1</td></tr><tr><td>Task 3</td><td>0.01</td><td>0.1</td><td>32</td><td>100</td><td>3</td></tr><tr><td>Task 4</td><td>0.01</td><td>0.1</td><td>128</td><td>100</td><td>2</td></tr><tr><td>Task 5</td><td>0.01</td><td>0.1</td><td>32</td><td>100</td><td>3</td></tr><tr><td>Task 6</td><td>0.01</td><td>0.1</td><td>128</td><td>100</td><td>4</td></tr><tr><td>Concierge</td><td>0.001</td><td>0.1</td><td>128</td><td>100</td><td>2</td></tr></table>
|
| 255 |
+
|
| 256 |
+
Table 10: Test results across all tasks and methods. For tasks T1-T5 results are given in the standard setup and the out-of-vocabulary (OOV) setup, where words (e.g. restaurant names) may not have been seen during training. Task T6 is the Dialog state tracking 2 task with real dialogs, and only has one setup. Best performing methods (or methods within $0 . 1 \%$ of best performing) are given in bold for the per-response accuracy metric, with the per-dialog accuracy given in parenthesis.
|
| 257 |
+
|
| 258 |
+
<table><tr><td rowspan="2">Task</td><td colspan="4">Supervised Embeddings</td><td rowspan="2"></td><td colspan="3">Memory Networks + match type</td></tr><tr><td>no match type no bigram</td><td>+ match type no bigram</td><td></td><td>+bigrams no match type</td><td colspan="3"> no match type</td></tr><tr><td>T1: Issuing API calls</td><td>100</td><td>(100) 83.2</td><td>(0)</td><td>98.6</td><td>(92.4)</td><td>99.9</td><td>(99.6)</td><td>100 (100)</td></tr><tr><td>T2: Updating API calls</td><td>68.4 (0)</td><td>68.4</td><td>(0)</td><td>68.3 (0)</td><td>100</td><td>(100)</td><td>98.3</td><td>(83.9)</td></tr><tr><td>T3:Displaying options</td><td>64.9 (0)</td><td>64.9</td><td>(0)</td><td>64.9 (0)</td><td></td><td>74.9 (2.0)</td><td>74.9</td><td>(0)</td></tr><tr><td>T4:Providing information</td><td>57.2 (0)</td><td>57.2</td><td>(0)</td><td>57.3 (0)</td><td>59.5</td><td>(3.0)</td><td>100</td><td>(100)</td></tr><tr><td>T5: Full dialogs</td><td>75.4 0)</td><td>76.2</td><td>(0)</td><td>83.4 (0)</td><td></td><td>96.1 (49.4)</td><td>93.4</td><td>(19.7)</td></tr><tr><td>T1(OOV): Issuing API calls</td><td>60.0 (0)</td><td>67.2</td><td>(0)</td><td>58.8 (0)</td><td></td><td>72.3 (0)</td><td>96.5</td><td>(82.7)</td></tr><tr><td>T2(OOV): Updating API calls</td><td>68.3 (0)</td><td>68.3</td><td>(0)</td><td>68.3</td><td>(0)</td><td>78.9 (0)</td><td>94.5</td><td>(48.4)</td></tr><tr><td>T3(OOV): Displaying options</td><td>65.0 (0)</td><td>65.0</td><td>(0)</td><td>62.1 (0)</td><td></td><td>74.4 (0)</td><td>75.2</td><td>(0)</td></tr><tr><td>T4(OOV): Providing inform.</td><td>57.0 (0)</td><td>57.1</td><td>(0)</td><td>57.0 (0)</td><td></td><td>57.6 (0)</td><td>100</td><td>(100)</td></tr><tr><td>T5(OOV): Full dialogs</td><td>58.2 0)</td><td>64.4</td><td>(0)</td><td>50.4</td><td>(0)</td><td>65.5 (0)</td><td>77.7</td><td>(0)</td></tr><tr><td>T6: Dialog state tracking 2</td><td>22.6 0)</td><td>22.1</td><td>(0)</td><td>21.8</td><td>(0)</td><td>41.1 (0)</td><td></td><td>41.0 (0)</td></tr></table>
|
md/train/S1sRrN-CW/S1sRrN-CW.md
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REVISITING KNOWLEDGE BASE EMBEDDING AS TEN-SOR DECOMPOSITION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We study the problem of knowledge base (KB) embedding, which is usually addressed through two frameworks—neural KB embedding and tensor decomposition. In this work, we theoretically analyze the neural embedding framework and subsequently connect it with tensor based embedding. Specifically, we show that in neural KB embedding the two commonly adopted optimization solutions— margin-based and negative sampling losses—are closely related to each other. We also reach the closed-form tensor that is implicitly approximated by popular neural KB approaches, revealing the underlying connection between neural and tensor based KB embedding models. Grounded in the theoretical results, we further present a tensor decomposition based framework KBTD to directly approximate the derived closed form tensor. Under this framework, the neural KB embedding models, such as NTN (Socher et al., 2013), TransE (Bordes et al., 2013), Bilinear (Jenatton et al., 2012), and DISTMULT (Yang et al., 2015), are unified into a general tensor optimization architecture. Finally, we conduct experiments on the link prediction task in WordNet and Freebase, empirically demonstrating the effectiveness of the KBTD framework.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Knowledge bases (KBs) power many of semantic-oriented techniques and applications, such as question answering and intelligent personal assistant. A classical example is the automatic answer to the query “Who is Barack Obama’s wife” by KB-supported search engines. Most if not all of KBs achieve this by storing the facts about the world in the form of RDF triplets (W3C, 1999), wherein a triplet (subject, predicate, object), in short $( s , r , o )$ , records a piece of fact about the relation between the two entities—the subject and object. To automatically construct Web-scale KBs with billions of facts (triplets), a significant line of effort has been devoted to knowledge base embedding—the technique of encoding entities and their relational information into latent representations (Bordes et al., 2011; 2013; Socher et al., 2013; Yang et al., 2015).
|
| 12 |
+
|
| 13 |
+
In particular, the direction of neural embedding has been extensively explored for learning representations for KBs, offering state-of-the-art performance for validating and completing unseen facts (Yang et al., 2015). Briefly, given a KB represented by triplets $T = \{ ( s , r , o ) \}$ , neural embedding models take these known triplets as positive instances and corrupted triplets $\{ ( \boldsymbol { s } ^ { \prime } , \boldsymbol { r } , o ^ { \prime } ) \}$ as negative ones. For each triplet, a scoring function $f ( s , r , o )$ — parameterized with a neural network—is designed to project the associated entities $s , o$ and their relational information $r$ into a scalar. Most of the existing models are then trained through two popular choices of loss functions, including the margin-based ranking loss by NTN (Socher et al., 2013), TransE (Bordes et al., 2013), and DISTMULT (Yang et al., 2015), as well as several practices of the Negative Sampling loss (Mikolov et al., 2013) by Bilinear (or LFM) (Jenatton et al., 2012) and CONV (Toutanova et al., 2015). In addition, another line of KB embedding is focused on tensor decomposition based frameworks, such as RESCAL (Nickel et al., 2011; 2012).
|
| 14 |
+
|
| 15 |
+
Notwithstanding the rapid development and progress of KB embedding techniques, insights concerning their underlying mechanisms are to date sorely lacking. For example, a natural question that arises is what are the relationships or differences between the margin-based ranking loss and the negative sampling loss for neural KB embedding. Moreover, what is the quantity that is optimized by conventional neural KB embedding models? With an eye toward comprehensively understanding
|
| 16 |
+
|
| 17 |
+
Table 1: Knowledge Base Embedding.
|
| 18 |
+
|
| 19 |
+
<table><tr><td rowspan=1 colspan=1>local margin-based loss (ReLU)</td><td rowspan=1 colspan=4>max(0,f(s,r,o')- f(s,r,o)+ γ)</td></tr><tr><td rowspan=1 colspan=1>local margin-based loss (Softplus)</td><td rowspan=1 colspan=1>log (</td><td rowspan=1 colspan=2>log(1+ ef(s',r,o')-f(s,r,)+γ)</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>local negative sampling loss</td><td rowspan=1 colspan=1>log(</td><td rowspan=1 colspan=3>log(1+ef(s'ro')-f(s,r)+ef(s'r,0')+e-f(s,r,o))</td></tr><tr><td rowspan=1 colspan=1>closed-form tensor</td><td rowspan=1 colspan=1>log</td><td rowspan=1 colspan=1>2|E|Xs,r.o(b(do+d,)</td><td rowspan=1 colspan=2></td></tr></table>
|
| 20 |
+
|
| 21 |
+
See detailed notations in Sections 3 and 4. A brief introduction is listed below:
|
| 22 |
+
• $( s , r , o )$ & $( s ^ { \prime } , r , o ^ { \prime } )$ : the known and corrupted triplets, respectively; • $E$ & $R$ : the entity and relation sets of a given knowledge base, with s, $o \in E$ and $r \in R$ ; • $\mathcal { X } \in \{ 0 , 1 \} ^ { E \times R \times E }$ : a three-way binary tensor, with $\mathcal { X } _ { s , r , o } = 1$ indicating $( s , r , o ) \in T$ and otherwise 0; • $\begin{array} { r } { d _ { s , r } ^ { \mathrm { o u t } } = \sum _ { o } \mathcal { X } _ { s , r , o } } \end{array}$ & $\begin{array} { r } { d _ { o , r } ^ { \mathrm { i n } } = \sum _ { s } \mathcal { X } _ { s , r , o } } \end{array}$ : the out- $/ \mathrm { i n } \cdot$ - degree of entity $s / o$ under relation $r$ , respectively; • $b$ : the number of negative samples.
|
| 23 |
+
|
| 24 |
+
KB embedding, we investigate (1) the connection between margin-based ranking loss and negative sampling loss in neural KB models, (2) the relationship between neural KB models and classical tensor-based KB models, and (3) the universal framework for KB learning.
|
| 25 |
+
|
| 26 |
+
Contributions. In this work, we unveil two fundamentals of KB embedding, according to which we further present a tensor decomposition based KB embedding framework—KBTD, yielding significant outperformance over neural KB embedding models in most cases.
|
| 27 |
+
|
| 28 |
+
First, with softplus’ smooth approximation to ReLU in the margin-based loss (Dugas et al., 2001), we show that the margin-based loss is closely connected to the negative sampling loss (See rows 2 & 3 in Table 1). In specific, both losses aim to encourage positive triplets $( s , r , o )$ and penalize corrupted ones $( s ^ { \prime } , \bar { r } , o ^ { \prime } )$ , and the slight difference lies in the extra reward or penalization to corresponding triplets in the negative sampling loss.
|
| 29 |
+
|
| 30 |
+
Second, we derive the closed form tensor (See row 4 in Table 1) whose entry is implicitly fitted (approximated) by scoring function $f ( s , r , o )$ , when optimizing neural KB embedding models through the negative sampling loss. This closed form generalizes the ultimate objective of previous attempts on designing various scoring functions, such as NTN, TransE, Bilinear, and DISTMULT. This finding also links the neural KB embedding framework with the tensor-based KB embedding approach.
|
| 31 |
+
|
| 32 |
+
Third, building upon the discoveries, we propose a tensor decomposition based KB embedding framework, KBTD, to directly fit the closed form tensor with by leveraging the scoring functions proposed in several popular neural models. Our extensive experiments on WordNet and FreeBase demonstrate the outstanding performance of KBTD over the conventional margin-based neural framework. In addition, we point out the limitation of dissimilarity/distance based scoring function design, which is wildly adopted by the TransE/H/R/D models (Bordes et al., 2013; Wang et al., 2014; Lin et al., 2015; Ji et al., 2015).
|
| 33 |
+
|
| 34 |
+
The rest of this paper is organized as follows. Section 2 discusses related work. Section 3 unveils the connection between the margin-based ranking loss and the negative sampling loss. Section 4 performs the theoretical analysis and subsequently presents our KBTD framework. Section 5 introduces the detailed experiments on the link prediction task for KBs. Section 6 concludes this paper.
|
| 35 |
+
|
| 36 |
+
# 2 RELATED WORK
|
| 37 |
+
|
| 38 |
+
Knowledge base embedding is being extensively explored and developed over the last few years, during which the major breakthroughs are resulted from the neural embedding and tensor factorization models (Bordes et al., 2013; Nickel et al., 2012). Our work focuses on understanding the fundamentals of neural KB embedding, as well as its connection with tensor models.
|
| 39 |
+
|
| 40 |
+
Neural KB Embedding: Loss Functions. Neural knowledge base embedding is usually formulated as an optimization problem with different loss functions. The majority of existing KB models employ the margin-based ranking loss, which was first proposed (Collobert et al., 2011) for addressing the efficiency issue of softmax (Bengio et al., 2003) in the field of natural language models. A brief collection of recent margin-based KB embedding methods include the SE, Unstructured, and SME models (Bordes et al., 2011; 2012; 2014), SLM and NTN (Socher et al., 2013), DISTMULT (Yang et al., 2015), TransE (Bordes et al., 2013), TransH (Wang et al., 2014), TransR (Lin et al., 2015), TransD (Ji et al., 2015), and ProjE (Shi & Weninger, 2017). In addition, there are several models— Bilinear model (Jenatton et al., 2012) and CONV (Toutanova et al., 2015)—that adopt the negative sampling (NE) loss. Our work contributes to this line of research by providing the relationship between margin-based and negative sampling based KB embedding models.
|
| 41 |
+
|
| 42 |
+
Neural KB Embedding: Scoring Functions. As summarized in (Yang et al., 2015), given a KB represented by a list of triplets, neural models learn embeddings by utilizing a neural network, wherein the first layer projects the two entities of each triplet into latent low-dimensional vectors, and the second layer leverages a scoring function to operate on each pair of entity vectors with relationspecific parameters. The major difference between neural KB models lie in the various ways that they design the scoring functions — TransE, NTN, Bilinear, and DISTMULT (See details in Table 3 of Section 5). To date, few attempts have been conducted to understand any common grounds behind these models. Our work furthers this direction by proposing a general tensor decomposition framework (KBTD) which unifies existing neural KB models.
|
| 43 |
+
|
| 44 |
+
Tensor Decomposition for KB Embedding. Tensor decomposition has seen successes in structural and relational learning over decades (Kolda & Bader, 2009; Sun et al., 2006). Recent years also witness the natural application of this technique on learning KB embeddings, including the BCTF model (Sutskever et al., 2009), and RESCAL (Nickel et al., 2011). In this work, we show the closed relationship between tensor decomposition based KB embedding and neural KB embedding models.
|
| 45 |
+
|
| 46 |
+
# 3 CONNECTING MARGIN-BASED LOSS WITH NEGATIVE SAMPLING LOSS
|
| 47 |
+
|
| 48 |
+
Given a KB with entity set $E$ and relation set $R$ , represented by a set of triplets $T = \{ ( s , r , o ) \}$ with $s , o \in E$ and $r \in R$ , the goal of neural KB models is to learn a scoring function $f ( s , r , o )$ which evaluates an arbitrary triplet and outputs a scalar to measure the acceptability of this triplet, where high/low score indicates that the input triplet tends to be correct/wrong. As summarized by (Yang et al., 2015), most existing scoring functions can be unified by a neural network, where the first layer projects the two entities of each triplet into latent low-dimensional vectors, and the second layer applies either linear or bilinear transformation (or both) on entity vectors with relation-specific parameters.
|
| 49 |
+
|
| 50 |
+
The scoring function is then fitted to a loss function to learn the representations of both entities and relations. The majority of neural KB embedding models adopt either a margin-based ranking loss or a negative sampling loss. Both loss functions leverage the known triplets $T$ as positive samples and the corrupted triplets $T ^ { \prime }$ as the negative ones. Following the literature, given a known triplet $( s , r , o ) \in T$ , its corrupted triplets $\mathbf { \Phi } _ { T _ { ( s , r , o ) } ^ { \prime } } ^ { - }$ are constructed by replacing either the subject entity $s$ or the object entity $t$ with an arbitrary entity from $E$ , i.e., $T _ { ( s , r , o ) } ^ { \prime } = \{ ( s ^ { \prime } , r , o ) | s ^ { \prime } \in E \} \cup$ $\{ ( s , r , o ^ { \prime } ) | o ^ { \prime } \in E \}$ . Given both positive and corrupted triplets, the objective of the margin-based ranking loss is to minimize:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathcal { L } _ { \mathrm { M A R G I N } } = \sum _ { ( s , r , o ) \in T } \sum _ { ( s ^ { \prime } , r , o ^ { \prime } ) \in T _ { ( s , r , o ) } ^ { \prime } } \operatorname* { m a x } \left( 0 , \gamma + f ( s ^ { \prime } , r , o ^ { \prime } ) - f ( s , r , o ) \right) .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Its challenge lies in, however, the second summation, which takes $O ( | E | )$ complexity to enumerate the whole entity set $E$ and is extremely time demanding. Therefore, in practice, the second summation is commonly approximated with sampling and the sample size is usually set to one (Bordes et al., 2013). Considering the local loss function $\ell _ { \mathrm { M A R G I N } } ( s , \dot { r } , o )$ for each positive triplet $( s , r , o )$ associated with one (sampled) corrupted triplet $( s ^ { \prime } , r , o ^ { \prime } )$ , the $\operatorname* { m a x } ( 0 , \cdot )$ loss can be smoothly approximated by the softplus function (Dugas et al., 2001), that is:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\begin{array} { r l } & { \ell _ { \mathrm { M A R G I N } } ( s , r , o ) = \operatorname* { m a x } \left( 0 , \gamma + f ( s ^ { \prime } , r , o ^ { \prime } ) - f ( s , r , o ) \right) } \\ & { \qquad \approx \log \left( 1 + e ^ { \gamma + f ( s ^ { \prime } , r , o ^ { \prime } ) - f ( s , r , o ) } \right) . } \end{array}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
On the other hand, the negative sampling loss aims to optimize the following objective:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\mathcal { L } _ { \mathrm { N E G } } = - \sum _ { ( s , r , o ) \in T } \left( \log \sigma ( f ( s , r , o ) ) + b \mathbb { E } _ { ( s ^ { \prime } , r , o ^ { \prime } ) \sim T _ { ( s , r , o ) } ^ { \prime } } \left[ \log \sigma ( - f ( s ^ { \prime } , r , o ^ { \prime } ) ) \right] \right) ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $b$ is the number of negative samples and $\sigma ( \cdot )$ is the sigmoid function. Similarly, the expectation term can be replaced with its Monte Carlo approximation. To align with our previous
|
| 69 |
+
|
| 70 |
+
discussion on the margin-based ranking loss, we also set negative sample size $b = 1$ and derive the local objective for a certain positive triplet $( s , r , o )$ to be:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\begin{array} { r l } & { \ell _ { \mathrm { N E G } } ( s , r , o ) = - \log \sigma ( f ( s , r , o ) ) - \log \sigma ( - f ( s ^ { \prime } , r , o ^ { \prime } ) ) } \\ & { \phantom { \ell _ { \mathrm { N E G } } ( s , r , o ) = - \log \sigma ( f ( s , r , o ) ) - \log \sigma ( - f ( s ^ { \prime } , r , o ^ { \prime } ) ) } = \log \left( 1 + e ^ { f ( s ^ { \prime } , r , o ^ { \prime } ) - f ( s , r , o ) } + e ^ { f ( s ^ { \prime } , r , o ^ { \prime } ) } + e ^ { - f ( s , r , o ) } \right) . } \end{array}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
Eq. 1 and Eq. 3 reveal the close relationship between margin-based ranking loss and negative sampling loss in neural KB embedding. First, observed from the similar term $e ^ { f ( s ^ { \prime } , r , o ^ { \prime } ) - f ( s , r , o ) }$ , both loss functions implicitly encourage positive triplets to have relatively higher scores than the corrupted ones. Second, the extra term $e ^ { f ( s ^ { \prime } , r , o ^ { \prime } ) } \bar { + } e ^ { - f ( s , r , o ) }$ in the negative sampling loss suggests that in addition to the implicit comparison, it explicitly rewards the positive triplets to have high scores, and also encourages the corrupted ones to have low scores.
|
| 77 |
+
|
| 78 |
+
# 4 UNIFYING NEURAL KB EMBEDDING AS TENSOR DECOMPOSITION
|
| 79 |
+
|
| 80 |
+
From the above section, we observe that the margin-based loss and negative sampling loss share very similar form. In this section, we unify existing neural KB embedding models by assuming a general scoring function $f : E \times R \times E \to \mathbb { R }$ and the use of negative sampling loss. We present a theoretical analysis in Section 4.1, followed by our KBTD framework which formally defines KB embedding problem as a tensor decomposition problem in Section 4.2. Additionally, the connection between KBTD and classical tensor decomposition models (Nickel et al., 2011; 2012) is discussed in Section 4.2.
|
| 81 |
+
|
| 82 |
+
# 4.1 THEORETICAL ANALYSIS OF NEURAL KB EMBEDDING
|
| 83 |
+
|
| 84 |
+
To facilitate our analysis, we represent the KB triplets as a three-way binary tensor $ { \mathcal { X } } \_ { } \in$ $\{ 0 , 1 \} ^ { E \times R \times E }$ , where $\mathcal { X } _ { s , r , o } ~ = ~ 1$ indicates $( s , r , o ) \in T$ , while $\mathcal { X } _ { s , r , o } ~ = ~ 0$ for non-existing or unknown triplets. The loss function $\mathcal { L } _ { \mathrm { N E G } }$ in Eq. 2 can be re-formatted with $\mathcal { X } _ { s , r , o }$ as
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
- \sum _ { s , r , o } \chi _ { s , r , o } \left\{ \log \sigma \left( f ( s , r , o ) \right) + \frac { b } { 2 } \mathbb { E } _ { o ^ { \prime } \sim P _ { N } } \left[ \log \sigma \left( - f ( s , r , o ^ { \prime } ) \right) \right] + \frac { b } { 2 } \mathbb { E } _ { s ^ { \prime } \sim P _ { N } } \left[ \log \sigma \left( - f ( s ^ { \prime } , r , o ) \right) \right] \right\} ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $P _ { N }$ is a uniform distribution over all entities, i.e., $\begin{array} { r } { { P _ { N } } ( \cdot ) = \frac { 1 } { | E | } } \end{array}$ . We further break down the summation and arrive at the following form:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r l } { { \mathcal { L } _ { \mathrm { N E G } } = - \sum _ { s , r , o } \chi _ { s , r , o } \log \sigma ( f ( s , r , o ) ) } } \\ & { \quad - \frac { b } { 2 } ( \sum _ { s , r } d _ { o , r } ^ { \mathrm { o u t } } \mathbb { E } _ { o ^ { \prime } \sim P _ { N } } [ \log \sigma ( - f ( s , r , o ^ { \prime } ) ) ] + \sum _ { r , o } d _ { o , r } ^ { \mathrm { i n } } \mathbb { E } _ { s ^ { \prime } \sim P _ { N } } [ \log \sigma ( - f ( s ^ { \prime } , r , o ) ) ] ) , } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $d _ { s , r } ^ { \mathrm { o u t } } = \textstyle \sum _ { o } \mathcal { X } _ { s , r , o }$ is the out-degree of entity $s$ under relation $r$ , and $\begin{array} { r } { d _ { o , r } ^ { \mathrm { i n } } = \sum _ { s } \mathcal { X } _ { s , r , o } } \end{array}$ is the in-degree of entity $o$ under relation $r$ . Then we explicitly express the two expectation terms:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { \mathbb { E } _ { \sigma ^ { \prime } \sim P _ { N } } \left[ \log \sigma \left( - f ( s , r , \sigma ^ { \prime } ) \right) \right] = \displaystyle \sum _ { \sigma ^ { \prime } } \frac { 1 } { | E | } \log \sigma \left( - f ( s , r , \sigma ^ { \prime } ) \right) } \\ & { \qquad = \displaystyle \frac { 1 } { | E | } \log \sigma \left( - f ( s , r , \sigma ) \right) + \displaystyle \sum _ { \sigma ^ { \prime } \neq \sigma } \frac { 1 } { | E | } \log \sigma \left( - f ( s , r , \sigma ^ { \prime } ) \right) } \\ & { \mathbb { E } _ { s ^ { \prime } \sim P _ { N } } \left[ \log \sigma \left( - f ( s ^ { \prime } , r , \sigma ) \right) \right] = \displaystyle \frac { 1 } { | E | } \log \sigma \left( - f ( s , r , \sigma ) \right) + \displaystyle \sum _ { s ^ { \prime } \neq s } \frac { 1 } { | E | } \log \sigma \left( - f ( s ^ { \prime } , r , \sigma ) \right) . } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Then, by utilizing the above expectation terms, the local loss function for each specific triplet $( s , r , o )$ in Eq. 4 can be defined as
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\ell ( s , r , o ) = - \mathcal { X } _ { s , r , o } \log \sigma \left( f ( s , r , o ) \right) - \frac { b \cdot \left( d _ { s , r } ^ { \mathrm { o u t } } + d _ { o , r } ^ { \mathrm { i n } } \right) } { 2 \left. E \right. } \log \sigma \left( - f ( s , r , o ) \right) .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Table 2: The comparison between RESCAL and our KBTD framework with parameters $\Theta$ initialized in the bilinear way, that is, $\Theta = \{ \pmb { a } _ { 1 } , \cdot \cdot \cdot , \pmb { a } _ { | E | } , \pmb { W } _ { 1 } , \cdot \cdot \cdot , \pmb { W } _ { | R | } \}$ .
|
| 109 |
+
|
| 110 |
+
<table><tr><td>RESCAL</td><td> mine∑s,ro (xs,ro-asTWrat)²</td></tr><tr><td>KBTD</td><td> mine ∑s,roWs,r, (Us,ro - asT Wrat)²</td></tr></table>
|
| 111 |
+
|
| 112 |
+
The work in (Levy & Goldberg, 2014) suggested that for sufficient large embedding dimensionality, each individual $f ( s , r , o )$ can assume a value independence1. Following this assumption enables us to treat the objective $\mathcal { L }$ as a function of independent $f ( s , r , o )$ terms. The partial derivative with respect to $f ( s , \overline { { r } } , o )$ can be taken as:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\frac { \partial \mathcal { L } } { \partial f ( s , r , o ) } = \frac { \partial \ell ( s , r , o ) } { \partial f ( s , r , o ) } = - \mathcal { X } _ { s , r , o } \sigma \left( - f ( s , r , o ) \right) + \frac { b \cdot \left( d _ { s , r } ^ { \mathrm { o u t } } + d _ { o , r } ^ { \mathrm { i n } } \right) } { \left| E \right| } \sigma \left( f ( s , r , o ) \right) .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
By setting the derivative to zero, we have
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
e ^ { 2 f ( s , r , o ) } - \left( \frac { 2 \left| E \right| \mathcal { X } _ { s , r , o } } { b \cdot \left( d _ { s , r } ^ { \mathrm { o u t } } + d _ { o , r } ^ { \mathrm { i n } } \right) } - 1 \right) e ^ { f ( s , r , o ) } - \frac { 2 \left| E \right| \mathcal { X } _ { s , r , o } } { b \cdot \left( d _ { s , r } ^ { \mathrm { o u t } } + d _ { o , r } ^ { \mathrm { i n } } \right) } = 0 ,
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
which implies
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
f ( s , r , o ) = \log \left( \frac { 2 \left. E \right. \mathcal { X } _ { s , r , o } } { b \cdot \left( d _ { s , r } ^ { \mathrm { o u t } } + d _ { o , r } ^ { \mathrm { i n } } \right) } \right) .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
The RHS of Eq. 5 defines a “transformed” tensor based on $\mathcal { X }$ , and the LHS of Eq. 5 implies a regression problem, i.e., try to fit the $( s , r , o )$ -entry of the transformed tensor with the scoring function ${ \bar { f } } ( s , r , o )$ . In next section, we formally define this problem and then propose our KBTD framework.
|
| 131 |
+
|
| 132 |
+
# 4.2 KBTD: NEURAL KB EMBEDDING AS TENSOR DECOMPOSITION
|
| 133 |
+
|
| 134 |
+
In this section, we formalize the KB embedding problem analyzed in Section 4.1 as a tensor decomposition problem. We further present our framework—KBTD—to learn latent embedding for KB entities and relations. Its connection with classical tensor decomposition methods is also discussed.
|
| 135 |
+
|
| 136 |
+
First, as mentioned at the end of Section 4.1, RHS of Eq. 5 defines a transformed tensor based on $\mathcal { X }$ . Here we denote it to be tensor $\mathcal { V } \in \mathbb { R } ^ { | E | \times | R | \times | E | }$ , with the $( s , r , o )$ -entry defined to be
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\mathcal { V } _ { s , r , o } = \log \left( \frac { 2 \left| E \right| \mathcal { X } _ { s , r , o } } { b \cdot \left( d _ { s , r } ^ { \mathrm { o u t } } + d _ { o , r } ^ { \mathrm { i n } } \right) } \right) .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Second, our discussion in Section 4.1 actually implies a weighted tensor decomposition problem. This is mainly due to the negative sampling mechanism — we only care about positive triplets and corrupted triplets. This mechanism can be characterized by a binary tensor $\mathcal { W } \in \{ 0 , 1 \} ^ { | E | \times | R | \times | E | }$ , wherein $\bar { \mathcal { W } _ { s , r , o } } = 1$ if and only if $( s , r , o )$ is either a positive triplet or a corrupted triplet. Given the definition of tensor $\mathcal { V }$ and tensor $\mathcal { W }$ , we can formalize the following tensor decomposition problem:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\operatorname* { m i n } _ { \Theta } \sum _ { s , r , o } \mathcal { W } _ { s , r , o } \left( \mathcal { V } _ { s , r , o } - f _ { \Theta } ( s , r , o ) \right) ^ { 2 } ,
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where $f _ { \Theta }$ is the scoring function parameterized by $\Theta$ .
|
| 149 |
+
|
| 150 |
+
Revisiting RESCAL (Nickel et al., 2011; 2012). Before introducing how we optimize Eq. 7, we would like to discuss the connection between KBTD and RESCAL—a classical tensor decomposition model for KB embedding. Table 2 lists the optimization problems solved by RESCAL and our framework, in which the scoring function in Eq. 7 is initialized as a bilinear function, i.e., $f ( s , r , o ) = \pmb { a } _ { s } ^ { \top } \pmb { W } _ { r } \pmb { a } _ { o }$ , where $\mathbf { a } _ { s } , \pmb { a } _ { o } \in \bar { \mathbb { R } } ^ { d }$ and $W _ { r } \in \mathbb { R } ^ { \bar { d } \times d }$ . We observe the following connections and differences between them. First, both models explain a RDF triplet $( s , r , o )$ through the latent
|
| 151 |
+
|
| 152 |
+
# Algorithm 1: The KBTD Framework
|
| 153 |
+
|
| 154 |
+
input: Training set $T = \{ ( s , r , o ) \}$ , entity and relation set $E$ and $R$ , corrupted triplets multiplier $\lambda$ , mini-batch size $B$ output: Models parameters $\Theta$ , including entity and relation embeddings 1 Initialize model parameters $\Theta$ ; 2 while do $/ \star$ Sample a mini-batch of size $B$ \*/ 3 $T _ { b a t c h } \gets \mathrm { s a m p l e } ( T , B )$ ; $/ \star \delta { \sf a m p 1 } \mathrm { e }$ corrupted triplets for this mini-batch \*/ 4 $T _ { b a t c h } ^ { \prime } \gets \emptyset$ ; 5 for $( s , r , o ) \in T _ { b a t c h }$ do 6 for $i = 1$ to $\lambda$ do 7 s0 ← sample $( E )$ ; 8 o0 ← sample(E); 9 $T _ { b a t c h } ^ { \prime } \gets T _ { b a t c h } ^ { \prime } \cup ( s ^ { \prime } , r , o ) \cup ( s , r , o ^ { \prime } ) ;$ 10 Update parameter Θ w.r.t. P(s,r,o)∈Tbatch∪T 0 $\begin{array} { r } { \sum _ { ( s , r , o ) \in T _ { b a t c h } \cup T _ { b a t c h } ^ { \prime } } \left( \mathcal { V } _ { s , r , o } - f _ { \Theta } ( s , r , o ) \right) ^ { 2 } ; } \end{array}$
|
| 155 |
+
|
| 156 |
+
representations $\mathbf { \delta } _ { a _ { s } , a _ { o } }$ and $W _ { r }$ . To learn the representations, however, RESCAL directly factorizes the binary tensor $\mathcal { X }$ , while our model decomposes a transformed real-value tensor $\mathcal { V }$ . Second, KBTD also differs with RESCAL in the way they treat the unobserved triplets. Notice that given a KB of observed (positive) triplets, the unobserved triples includes both positive and negative ones. This issue is known as the one-class problem (Moya & Hush, 1996; Pan et al., 2008). Two common solutions to this problem are AMAN (all missing as negative) and AMAU (all missing as unknown). The RESCAL model simply adopts the AMAN strategy by assuming all unobserved triplets as negative ones. However, our model is able to implicitly compromise between AMAN and AMAU by only treating corrupted triplets as negative.
|
| 157 |
+
|
| 158 |
+
KBTD Learning. The detailed optimization procedure for KBTD is described in Algorithm 1. We optimize the objective function in Eq. 7 using mini-batch stochastic gradient descent with AdaGrad (Duchi et al., 2011). At each main iteration (Line 3-10), we first sample a mini-batch of positive triplets (Line 4) and then sample their corrupted triplets whose size is controlled by a multiplier $\lambda$ (Line 6-10). The parameters are updated with respect to the sampled positive triplets as well as corresponding corrupted ones. In this setting, we avoid generating the dense tensors $\mathcal { V }$ and $\mathcal { W }$ , which may in practice result in memory issues.
|
| 159 |
+
|
| 160 |
+
There is a computational issue that comes from the log operator. For an unobserved triplet $( s , r , o )$ (i.e., $\mathcal { X } _ { s , r , o } = 0 \mathrm { , }$ ), $\mathcal { V } _ { s , r , o } = \log 0 = - \infty$ . Previously, two approaches have been proposed for addressing it (Levy & Goldberg, 2014). One is to smooth the logarithm by adding a small constant to tensor $\mathcal { X }$ , generating a dense tensor. The other one is to apply an additional shifted-truncated operator, that is, $\operatorname* { m a x } ( \mathcal { V } _ { s , r , o } - c , 0 )$ , generating a sparse tensor with the loss of certain information. Due to the obvious drawbacks, we instead propose to use a simple and effective solution, wherein the operation $\log x$ is replaced with $\log ( \epsilon + \bar { x } )$ with $\epsilon$ as a tunable parameter.
|
| 161 |
+
|
| 162 |
+
# 5 EXPERIMENTS
|
| 163 |
+
|
| 164 |
+
In this section, we evaluate the proposed KBTD framework on the canonical link prediction task against several popular KB embedding methods on two datasets extracted from WordNet and FreeBase. In this task, we are given a KB with a certain fraction of triplets removed, and our target is to predict these missing triplets. We first introduce our experimental setup in Section 5.1, followed by detailed discussion on experimental results in Section 5.2.
|
| 165 |
+
|
| 166 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 167 |
+
|
| 168 |
+
Datasets. We use WordNet (WN18) and FreeBase (FB15k) datasets as introduced in (Bordes et al., 2013) where WN18 consists of 151, 442 triplets with 40,943 entities and 18 relations, and FB15k contains 592,213 triplets with 14,951 entities and 1,345 relations. We use the same training/validation/test split as in (Bordes et al., 2013; Yang et al., 2015).
|
| 169 |
+
|
| 170 |
+
Table 3: Scoring Functions and Parameters.
|
| 171 |
+
|
| 172 |
+
<table><tr><td rowspan=1 colspan=1>Model Name</td><td rowspan=1 colspan=3>ParametersΘ</td><td rowspan=1 colspan=3>Scoring Function fe(s,r,o)</td></tr><tr><td rowspan=1 colspan=1>NTN</td><td rowspan=1 colspan=3>{1,,|R1,W[:.k]V1,.,|R|,,V1,.,|R|,a1,.,|Ei}</td><td rowspan=1 colspan=1>ur tanh(asW1:k]lao+Vr</td><td rowspan=1 colspan=1>asao</td><td rowspan=1 colspan=1>+br</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>{w1,..,R,a.,E}</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>-llas+wr-all</td></tr><tr><td rowspan=1 colspan=1>Bilinear</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>{W1,..,|R,a1.,E</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>aWrao</td></tr><tr><td rowspan=1 colspan=1>DISTMULT</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>{w1...,|,a1...,E</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>adiag(wr)ao</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 4: Experimental Results on the WN18 Dataset.
|
| 175 |
+
|
| 176 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Results from Neural KB Embedding</td><td rowspan=1 colspan=2>Results from our KBTD framework</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>HITS@10</td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>HITS @10</td></tr><tr><td rowspan=1 colspan=1>NTN</td><td rowspan=1 colspan=1>0.53</td><td rowspan=1 colspan=1>66.10</td><td rowspan=1 colspan=1>0.85</td><td rowspan=1 colspan=1>90.50</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=1>0.38</td><td rowspan=1 colspan=1>90.90</td><td rowspan=1 colspan=1>0.39</td><td rowspan=1 colspan=1>82.18</td></tr><tr><td rowspan=1 colspan=1>Bilinear</td><td rowspan=1 colspan=1>0.89</td><td rowspan=1 colspan=1>92.80</td><td rowspan=1 colspan=1>0.92</td><td rowspan=1 colspan=1>94.62</td></tr><tr><td rowspan=1 colspan=1>DISTMULT</td><td rowspan=1 colspan=1>0.83</td><td rowspan=1 colspan=1>94.20</td><td rowspan=1 colspan=1>0.81</td><td rowspan=1 colspan=1>94.62</td></tr></table>
|
| 177 |
+
|
| 178 |
+
Table 5: Experimental Results on the FB15k Dataset.
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Results from Neural KB Embedding</td><td rowspan=1 colspan=2>Results fromourKBTD framework</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>HITS@10</td><td rowspan=1 colspan=1>MRR</td><td rowspan=1 colspan=1>HITS@10</td></tr><tr><td rowspan=1 colspan=1>NTN</td><td rowspan=1 colspan=1>0.25</td><td rowspan=1 colspan=1>41.40</td><td rowspan=1 colspan=1>0.37</td><td rowspan=1 colspan=1>59.06</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=1>0.31</td><td rowspan=1 colspan=1>53.90</td><td rowspan=1 colspan=1>0.30</td><td rowspan=1 colspan=1>49.94</td></tr><tr><td rowspan=1 colspan=1>Bilinear</td><td rowspan=1 colspan=1>0.31</td><td rowspan=1 colspan=1>51.90</td><td rowspan=1 colspan=1>0.31</td><td rowspan=1 colspan=1>54.95</td></tr><tr><td rowspan=1 colspan=1>DISTMULT</td><td rowspan=1 colspan=1>0.35</td><td rowspan=1 colspan=1>57.70</td><td rowspan=1 colspan=1>0.35</td><td rowspan=1 colspan=1>59.91</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Baselines. We compare our proposed framework with TransE (Bordes et al., 2013), NTN (Socher et al., 2013), Bilinear (Jenatton et al., 2012) and DISTMULT (Yang et al., 2015). The original TransE model is based on dissimilarity/distance function. To fit our framework, we define the scoring function for TransE to be negative dissimilarity/distance function, i.e., $f ( s , r , o ) ~ =$ $- \left\| \pmb { a } _ { s } + \pmb { a } _ { r } - \pmb { a } _ { o } \right\| _ { 2 } ^ { 2 }$ . For NTN, Bilinear and DISTMULT, we inherit the scoring functions from their paper. The detailed scoring functions as well as their parameters are listed in Table 3. For the meaning of parameters and the intuition behind scoring functions, readers can refer to the original papers.
|
| 183 |
+
|
| 184 |
+
Evaluation Protocol. We exactly follow the experimental procedure and treatment used in TransE (Bordes et al., 2013) and DISTMULT (Yang et al., 2015). For each triplet $( s , r , o )$ in the test set, the subject entity $s$ is replaced with each of entities from entity set $E$ in turn. We apply corresponding scoring function $f$ on those corrupted triplets and then sort them in non-increasing order to get the rank of the correct triplet. This procedure is then repeated for the object entity $o$ . For evaluation metrics, we consider Mean Reciprocal Rank (MRR) which is defined to be an average of the reciprocal rank of the correct triplets over all test triplets, and $H I T S @ I O$ (top-10 accuracy). If possible, we list the experimental results reported in (Yang et al., 2015) directly. In addition, we apply the filtered setting from (Bordes et al., 2013; Yang et al., 2015) in evaluation. In this setting, for one certain test triplet $( s , r , o )$ , we removed from the list of corrupted triplets all the triplets which appear in training, validation, or test set, except $( s , r , o )$ itself. This setting, for example, can avoid cases where lots of triplets in training set rank above the one of interest.
|
| 185 |
+
|
| 186 |
+
Implementation Details. All the models in our framework were implemented using PyTorch in a machine with one 12GB GPU. Since the complexities of the aforementioned approaches vary a lot, in order to achieve the best accuracy for all the models, we cross-validate using the validation set to find the best hyperparameters. We found that, except for TransE on WN18, all the methods on both datasets can share the same hyper-parameters: (1) dimensionality $d = 1 0 0$ ; (2) smoothing parameter $\epsilon = 0 . 0 1$ ; (3) multiplier $\lambda$ mentioned in Algorithm 1 was set to 2; (4) the learning rate of AdaGrad algorithm was set to 0.1 (0.01 for TransE on WN18); (5) $\ell _ { 2 }$ -regularization applied to all the parameters using the weight 0.0001; (6) the mini-batch size is set to 2,048 (4,800 for TransE on WN18); (6) $b = 1$ in Eq. 6 (200 for TransE on WN18). For the additional hyper-parameter in NTN method, i.e., the number of slices $k$ , was set to 2. We allow all the algorithms to run at most 10,000 epochs over the training data, and the best model was selected by early stopping using $\mathrm { H I T S } @ 1 0$ score on the validation sets. By taking advantages of GPU computation, every training experiment can be finished within 4 hours.
|
| 187 |
+
|
| 188 |
+
Table 6: Model Complexity in terms of #Parameters. $d$ is the embedding dimension, and $k$ in NTN is the number of slices.
|
| 189 |
+
|
| 190 |
+
<table><tr><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=3># Parameters</td></tr><tr><td rowspan=1 colspan=1>NTN</td><td rowspan=1 colspan=3>O(R|d²k +|E|d)</td></tr><tr><td rowspan=1 colspan=1>TransE</td><td rowspan=1 colspan=3>O(Rd+Ed)</td></tr><tr><td rowspan=1 colspan=1>Bilinear</td><td rowspan=1 colspan=3>O(R|d² +E|d)</td></tr><tr><td rowspan=1 colspan=1>DISTMULT</td><td rowspan=1 colspan=1>O(R</td><td rowspan=1 colspan=1>d+</td><td rowspan=1 colspan=1>Ed)</td></tr></table>
|
| 191 |
+
|
| 192 |
+
# 5.2 EXPERIMENTAL RESULTS
|
| 193 |
+
|
| 194 |
+
Table 4 and Table 5 list the overall results on the WN18 and FB15k datasets for several popular models under both our KBTD framework and the neural KB embedding framework, respectively. In general, we have the following key observations and insights:
|
| 195 |
+
|
| 196 |
+
(1) On the WN18 dataset, the KBTD framework achieves the best performance among most cases. In terms of MRR, KBTD outperforms all baselines except DISTMULT with an impressive improvement up to $6 0 . 4 \%$ (0.85 v.s. 0.53) on NTN. In terms of $\mathrm { H I T S } @ 1 0$ , KBTD outperforms baselines except TransE with an improvement up to $3 6 . 9 \%$ (90.50 v.s. 66.10) on NTN. Similar results can also be observed on the FB15k dataset in Table 5. In terms of both MRR and $\mathrm { H I T S } @ 1 0 .$ , KBTD outperforms all baselines except TransE with an improvement greater than $4 2 . 7 \%$ on NTN.
|
| 197 |
+
|
| 198 |
+
(2) It is notable that KBTD outperforms NTN by large margins on both datasets. We conjecture that this comes from the very high model complexity of NTN, as suggested by Table 6. In our KBTD framework, we reduce the previously considered margin-based ranking problem in the original NTN to a simple regression problem. As a result, KBTD enables the efficient training procedure to significantly boost up NTN with respect to both the MRR and $\mathrm { H I T S } @ 1 0$ metrics.
|
| 199 |
+
|
| 200 |
+
(3) It is also worth noting that under the KBTD framework, most models generate comparable or better results than their neural KB embedding versions. In terms of $\mathrm { H I T S } @ 1 0$ , KBTD underperforms TransE by $9 . 6 \%$ (82.18 v.s. 90.90) on WN18 and $7 . 3 \%$ (49.94 v.s. 53.90) on $\mathrm { F B } 1 5 \mathrm { k }$ . We attribute this underperformance to the constraint on TransE’s scoring function. As showed in Table 3, when instantiating the KBTD framework with TransE, the scoring function is set to be the negative dissimilarity function— $\begin{array} { r } { \mathbf { \sigma } _ { - } f ( s , r , o ) = - \left. \mathbf { a } _ { s } + \mathbf { w } _ { r } - \mathbf { a } _ { o } \right. _ { 2 } ^ { 2 } } \end{array}$ , which is for sure non-positive. However, the tensor $\mathcal { V }$ in Eq. 7 that KBTD aims to fit allows both positive and negative entries. In specific, for the observed triplets and a moderate $b$ , tensor entries are usually positive; for the corrupted triplets and a small $\epsilon$ , tensor entries reach negative values. On the contrary, the scoring functions of NTN, Bilinear, and DISTMULT are able to model both positive and negative tensor entries. That said, the non-positive constraint of TransE’s scoring function limits its ability to learn better latent KB representations in this link prediction task.
|
| 201 |
+
|
| 202 |
+
# 6 CONCLUSION
|
| 203 |
+
|
| 204 |
+
In this work, we provide a theoretical analysis of conventional neural KB embedding models and unveil the link between them and tensor-based KB embedding models. We show that the existing neural KB models can be unified into one tensor decomposition framework. We further propose the KBTD framework to directly fit the derived closed-form tensor. Our extensive experiments suggest that KBTD achieves consistent performance improvements over NTN, Bilinear, and DISTMULT under the neural KB embedding framework.
|
| 205 |
+
|
| 206 |
+
For further work, one interesting direction is to exploit efficient and scalable algorithms that extend KBTD to web-scale KBs. Another direction is to leverage the effective techniques from the matrix factorization community to enhance our tensor framework, such as the usage of bias terms and rich contextual information.
|
| 207 |
+
|
| 208 |
+
# REFERENCES
|
| 209 |
+
|
| 210 |
+
Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. Rand-walk: A latent variable model approach to word embeddings. Transactions of the Association for Computational Linguistics (TACL), 4, 2016.
|
| 211 |
+
|
| 212 |
+
Yoshua Bengio, Rejean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic´ language model. Journal of machine learning research, 3(Feb):1137–1155, 2003.
|
| 213 |
+
|
| 214 |
+
Antoine Bordes, Jason Weston, Ronan Collobert, Yoshua Bengio, et al. Learning structured embeddings of knowledge bases. In AAAI ’11, volume 6, pp. 6, 2011.
|
| 215 |
+
|
| 216 |
+
Antoine Bordes, Xavier Glorot, Jason Weston, and Yoshua Bengio. Joint learning of words and meaning representations for open-text semantic parsing. In AISTATS ’12, pp. 127–135, 2012.
|
| 217 |
+
|
| 218 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In NIPS ’13, pp. 2787–2795, 2013.
|
| 219 |
+
|
| 220 |
+
Antoine Bordes, Xavier Glorot, Jason Weston, and Yoshua Bengio. A semantic matching energy function for learning with multi-relational data. Machine Learning, 94(2):233–259, 2014.
|
| 221 |
+
|
| 222 |
+
Ronan Collobert, Jason Weston, Leon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel ´ Kuksa. Natural language processing (almost) from scratch. Journal of Machine Learning Research, 12(Aug):2493–2537, 2011.
|
| 223 |
+
|
| 224 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 225 |
+
|
| 226 |
+
Charles Dugas, Yoshua Bengio, Franc¸ois Belisle, Claude Nadeau, and Ren ´ e Garcia. Incorporating ´ second-order functional knowledge for better option pricing. In NIPS ’01, pp. 472–478, 2001.
|
| 227 |
+
|
| 228 |
+
Rodolphe Jenatton, Nicolas L Roux, Antoine Bordes, and Guillaume R Obozinski. A latent factor model for highly multi-relational data. In NIPS ’12, pp. 3167–3175, 2012.
|
| 229 |
+
|
| 230 |
+
Guoliang Ji, Shizhu He, Liheng Xu, Kang Liu, and Jun Zhao. Knowledge graph embedding via dynamic mapping matrix. In ACL ’15, pp. 687–696, 2015.
|
| 231 |
+
|
| 232 |
+
Tamara G Kolda and Brett W Bader. Tensor decompositions and applications. SIAM review, 51(3): 455–500, 2009.
|
| 233 |
+
|
| 234 |
+
Omer Levy and Yoav Goldberg. Neural word embedding as implicit matrix factorization. In NIPS ’14, pp. 2177–2185, 2014.
|
| 235 |
+
|
| 236 |
+
Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. Learning entity and relation embeddings for knowledge graph completion. In AAAI ’15, pp. 2181–2187, 2015.
|
| 237 |
+
|
| 238 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NIPS ’13, pp. 3111–3119, 2013.
|
| 239 |
+
|
| 240 |
+
Mary M. Moya and Don R. Hush. Network constraints and multi-objective optimization for oneclass classification. Neural Networks, 9(3):463–474, April 1996.
|
| 241 |
+
|
| 242 |
+
Maximilian Nickel, Volker Tresp, and Hans-Peter Kriegel. A three-way model for collective learning on multi-relational data. In ICML ’11, pp. 809–816, 2011.
|
| 243 |
+
|
| 244 |
+
Maximilian Nickel, Volker Tresp, and Hans-Peter Kriegel. Factorizing yago: scalable machine learning for linked data. In WWW ’12, pp. 271–280, 2012.
|
| 245 |
+
|
| 246 |
+
Rong Pan, Yunhong Zhou, Bin Cao, Nathan N Liu, Rajan Lukose, Martin Scholz, and Qiang Yang. One-class collaborative filtering. In ICDM ’08, pp. 502–511, 2008.
|
| 247 |
+
|
| 248 |
+
Baoxu Shi and Tim Weninger. Proje: Embedding projection for knowledge graph completion. In AAAI ’17, pp. 1236–1242, 2017.
|
| 249 |
+
|
| 250 |
+
Richard Socher, Danqi Chen, Christopher D Manning, and Andrew Ng. Reasoning with neural tensor networks for knowledge base completion. In NIPS ’13, pp. 926–934, 2013.
|
| 251 |
+
|
| 252 |
+
Jimeng Sun, Dacheng Tao, and Christos Faloutsos. Beyond streams and graphs: dynamic tensor analysis. In KDD ’06, pp. 374–383, 2006.
|
| 253 |
+
|
| 254 |
+
Ilya Sutskever, Joshua B Tenenbaum, and Ruslan R Salakhutdinov. Modelling relational data using bayesian clustered tensor factorization. In NIPS ’09, pp. 1821–1828, 2009.
|
| 255 |
+
|
| 256 |
+
Kristina Toutanova, Danqi Chen, Patrick Pantel, Hoifung Poon, Pallavi Choudhury, and Michael Gamon. Representing text for joint embedding of text and knowledge bases. In EMNLP ’15, volume 15, pp. 1499–1509, 2015.
|
| 257 |
+
|
| 258 |
+
W3C. Resource description framework (RDF) model and syntax specification. https://www. w3.org/TR/PR-rdf-syntax/, 1999. [Online; accessed Oct. 25, 2017].
|
| 259 |
+
|
| 260 |
+
Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph embedding by translating on hyperplanes. In AAAI ’14, pp. 1112–1119, 2014.
|
| 261 |
+
|
| 262 |
+
Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. In ICLR’ 15, 2015.
|
md/train/SJxSOJStPr/SJxSOJStPr.md
ADDED
|
@@ -0,0 +1,555 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A NEURAL DIRICHLET PROCESS MIXTURE MODEL FOR TASK-FREE CONTINUAL LEARNING
|
| 2 |
+
|
| 3 |
+
Soochan Lee, Junsoo Ha, Dongsu Zhang & Gunhee Kim
|
| 4 |
+
Department of Computer Science, Seoul National University, Seoul, Republic of Korea {soochan.lee,junsoo.ha}@vision.snu.ac.kr,{96lives,gunhee}@snu.ac.kr http://vision.snu.ac.kr/projects/cn-dpm
|
| 5 |
+
|
| 6 |
+
# ABSTRACT
|
| 7 |
+
|
| 8 |
+
Despite the growing interest in continual learning, most of its contemporary works have been studied in a rather restricted setting where tasks are clearly distinguishable, and task boundaries are known during training. However, if our goal is to develop an algorithm that learns as humans do, this setting is far from realistic, and it is essential to develop a methodology that works in a task-free manner. Meanwhile, among several branches of continual learning, expansion-based methods have the advantage of eliminating catastrophic forgetting by allocating new resources to learn new data. In this work, we propose an expansion-based approach for task-free continual learning. Our model, named Continual Neural Dirichlet Process Mixture (CN-DPM), consists of a set of neural network experts that are in charge of a subset of the data. CN-DPM expands the number of experts in a principled way under the Bayesian nonparametric framework. With extensive experiments, we show that our model successfully performs task-free continual learning for both discriminative and generative tasks such as image classification and image generation.
|
| 9 |
+
|
| 10 |
+
# 1 INTRODUCTION
|
| 11 |
+
|
| 12 |
+
Humans consistently encounter new information throughout their lifetime. The way the information is provided, however, is vastly different from that of conventional deep learning where each minibatch is iid-sampled from the whole dataset. Data points adjacent in time can be highly correlated, and the overall distribution of the data can shift drastically as the training progresses. Continual learning (CL) aims at imitating incredible human’s ability to learn from a non-iid stream of data without catastrophically forgetting the previously learned knowledge.
|
| 13 |
+
|
| 14 |
+
Most CL approaches (Aljundi et al., 2018; 2017; Lopez-Paz & Ranzato, 2017; Kirkpatrick et al., 2017; Rusu et al., 2016; Shin et al., 2017; Yoon et al., 2018) assume that the data stream is explicitly divided into a sequence of tasks that are known at training time. Since this assumption is far from realistic, task-free CL is more practical and demanding but has been largely understudied with only a few exceptions of (Aljundi et al., 2019a;b). In this general CL, not only is explicit task definition unavailable but also the data distribution gradually shifts without a clear task boundary.
|
| 15 |
+
|
| 16 |
+
Meanwhile, existing CL methods can be classified into three different categories (Parisi et al., 2019): regularization, replay, and expansion methods. Regularization and replay approaches address the catastrophic forgetting by regularizing the update of a specific set of weights or replaying the previously seen data, respectively. On the other hand, the expansion methods are different from the two approaches in that it can expand the model architecture to accommodate new data instead of fixing it beforehand. Therefore, the expansion methods can bypass catastrophic forgetting by preventing pre-existing components from being overwritten by the new information. The critical limitation of prior expansion methods, however, is that the decisions of when to expand and which resource to use heavily rely on explicitly given task definition and heuristics.
|
| 17 |
+
|
| 18 |
+
In this work, our goal is to propose a novel expansion-based approach for task-free CL. Inspired by the Mixture of Experts (MoE) (Jacobs et al., 1991), our model consists of a set of experts, each of which is in charge of a subset of the data in a stream. The model expansion (i.e., adding more experts) is governed by the Bayesian nonparametric framework, which determines the model complexity by the data, as opposed to the parametric methods that fix the model complexity before training. We formulate the task-free CL as an online variational inference of Dirichlet process mixture models consisting of a set of neural experts; thus, we name our approach as the Continual Neural Dirichlet Process Mixture (CN-DPM) model.
|
| 19 |
+
|
| 20 |
+
We highlight the key contributions of this work as follows.
|
| 21 |
+
|
| 22 |
+
• We are one of the first to propose an expansion-based approach for task-free CL. Hence, our model not only prevents catastrophic forgetting but also applies to the setting where no task definition and boundaries are given at both training and test time. Our model named CN-DPM consists of a set of neural network experts, which are expanded in a principled way built upon the Bayesian nonparametrics that have not been adopted in general CL research.
|
| 23 |
+
• Our model can deal with both generative and discriminative tasks of CL. With several benchmark experiments of CL literature on MNIST, SVHN, and CIFAR 10/100, we show that our model successfully performs multiple types of CL tasks, including image classification and generation.
|
| 24 |
+
|
| 25 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 26 |
+
|
| 27 |
+
# 2.1 CONTINUAL LEARNING
|
| 28 |
+
|
| 29 |
+
Parisi et al. (2019) classify CL approaches into three branches: regularization (Kirkpatrick et al., 2017; Aljundi et al., 2018), replay (Shin et al., 2017) and expansion (Aljundi et al., 2017; Rusu et al., 2016; Yoon et al., 2018) methods. Regularization and replay approaches fix the model architecture before training and prevent catastrophic forgetting by regularizing the change of a specific set of weights or replaying previously learned data. Hybrids of replay and regularization also exist, such as Gradient Episodic Memory (GEM) (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019a). On the other hand, methods based on expansion add new network components to learn new data. Conceptually, such direction has the following advantages compared to the first two: (i) catastrophic forgetting can be eliminated since new information is not overwritten on pre-existing components and (ii) the model capacity is determined adaptively depending on the data.
|
| 30 |
+
|
| 31 |
+
Task-Free Continual Learning. All the works mentioned above heavily rely on explicit task definition. However, in real-world scenarios, task definition is rarely given at training time. Moreover, the data domain may gradually shift without any clear task boundary. Despite its importance, taskfree CL has been largely understudied; to the best of our knowledge, there are only a few works (Aljundi et al., 2019a;b; Rao et al., 2019), each of which is respectively based on regularization, replay, and a hybrid of replay and expansion. Specifically, Aljundi et al. (2019a) extend MAS (Aljundi et al., 2018) by adding heuristics to determine when to update the importance weights with no task definition. In their following work (Aljundi et al., 2019b), they improve the memory management algorithm of GEM (Lopez-Paz & Ranzato, 2017) such that the memory elements are carefully selected to minimize catastrophic forgetting. While focused on unsupervised learning, Rao et al. (2019) is a parallel work that shares several similarities with our method, e.g., model expansion and short-term memory. However, due to their model architecture, expansion is not enough to stop catastrophic forgetting; consequently, generative replay plays a crucial role in Rao et al. (2019). As such, it can be categorized as a hybrid of replay and expansion. More detailed comparison between our method and Rao et al. (2019) is deferred to Appendix M.
|
| 32 |
+
|
| 33 |
+
# 2.2 DIRICHLET PROCESS MIXTURE MODELS
|
| 34 |
+
|
| 35 |
+
We briefly review the Dirichlet process mixture (DPM) model (Antoniak, 1974; Ferguson, 1983), and a variational method to approximate the posterior of DPM models in an online setting: Sequential Variational Approximation (SVA) (Lin, 2013). For a more detailed review, refer to Appendix A.
|
| 36 |
+
|
| 37 |
+
Dirichlet Process Mixture (DPM). The DPM model is often applied to clustering problems where the number of clusters is not known in advance. The generative process of a DPM model is
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
x _ { n } \sim p ( x ; \theta _ { n } ) , \theta _ { n } \sim G , G \sim \mathrm { D P } ( \alpha , G _ { 0 } ) ,
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $x _ { n }$ is the $n$ -th data, and $\theta _ { n }$ is the $n$ -th latent variable sampled from $G$ , which itself is a distribution sampled from a Dirichlet process (DP). The DP is parameterized by a concentration parameter $\alpha$ and a base distribution $G _ { 0 }$ . The expected number of clusters is proportional to $\alpha$ , and $G _ { 0 }$ is the marginal distribution of $\theta$ when $G$ is marginalized out. Since $G$ is discrete with probability 1 (Teh, 2010), same values can be sampled multiple times for $\theta$ . If $\theta _ { n } = \theta _ { m }$ , the two data points $x _ { n }$ and $x _ { m }$ belong to the same cluster. An alternative formulation uses the variable $z _ { n }$ that indicates to which cluster the $n$ -th data belongs such that $\theta _ { n } = \phi _ { z _ { n } }$ where $\phi _ { k }$ is the parameter of the $k$ -th cluster. In the context of this paper, $\phi _ { k }$ refers to the parameters of the $k$ -th expert.
|
| 44 |
+
|
| 45 |
+
Approximation of the Posterior of DPM Models. Since the exact inference of the posterior of DPM models is infeasible, approximate inference methods are applied. Among many approximation methods, we adopt the Sequential Variational Approximation (SVA) (Lin, 2013). While the data is given one by one, SVA sequentially determines $\rho _ { n }$ and $\nu _ { k }$ , which are the variational approximation for the distribution of $z _ { n }$ and $\phi _ { k }$ respectively. Since $\rho _ { n }$ satisfies $\textstyle \sum _ { k } \rho _ { n , k } = 1$ and $\rho _ { n , k } \ > = 0$ , $\rho _ { n , k }$ can be interpreted as the probability of $n$ -th data belonging to $k$ -th cluster and is often called responsibility. $\rho _ { n + 1 }$ and $\nu ^ { ( n + 1 ) }$ at step $n + 1$ are computed as:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { r l } & { \rho _ { n + 1 , k } \propto \left\{ ( \sum _ { i = 1 } ^ { n } \rho _ { i , k } ) \int _ { \phi } p ( x _ { n + 1 } | \phi ) \nu _ { k } ^ { ( n ) } ( d \phi ) \right. \mathrm { ~ i f ~ } 1 \leq k \leq K } \\ & { \qquad \quad \alpha \int _ { \phi } p ( x _ { n + 1 } | \phi ) G _ { 0 } ( d \phi ) \qquad \mathrm { i f ~ } k = K + 1 } \\ & { \qquad \quad \nu _ { k } ^ { ( n + 1 ) } ( d \phi ) \propto \left\{ G _ { 0 } ( d \phi ) \prod _ { i = 1 } ^ { n + 1 } p ( x _ { i } | \phi ) ^ { \rho _ { i , k } } \right. \quad \mathrm { i f ~ } 1 \leq k \leq K } \\ & { \qquad \quad \left. G _ { 0 } ( d \phi ) p ( x _ { n + 1 } | \phi ) ^ { \rho _ { n + 1 , k } } \right. \quad \mathrm { i f ~ } k = K + 1 } \end{array} .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
In practice, SVA adds a new component only when $\rho _ { K + 1 }$ is greater than a certain threshold $\epsilon$ . If $G _ { 0 }$ and $p ( x _ { i } | \phi )$ are not a conjugate pair, stochastic gradient descent (SGD) is used to find the MAP estimation $\hat { \phi }$ with a learning rate of $\lambda$ instead of calculating the whole distribution $\nu _ { k }$ :
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r } { \hat { \phi } _ { k } ^ { ( n + 1 ) } \gets \hat { \phi } _ { k } ^ { ( n ) } + \lambda ( \nabla _ { \hat { \phi } _ { k } ^ { ( n ) } } \log G _ { 0 } ( \hat { \phi } _ { k } ^ { ( n ) } ) + \nabla _ { \hat { \phi } _ { k } ^ { ( n ) } } \log p ( x | \hat { \phi } _ { k } ^ { ( n ) } ) ) . } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
DPM for Discriminative Tasks. DPM can be extended to discriminative tasks where each data point is an input-output pair $( x , y )$ , and the goal is to learn the conditional distribution $p ( y | x )$ . To use DPM, which is a generative model, for discriminative tasks, we first learn the joint distribution $p ( x , y )$ and induce the conditional distribution from it: $\begin{array} { r } { p ( y | x ) = p ( x , y ) / \int _ { y } p ( x , y ) } \end{array}$ . The joint distribution modeled by each component can be decomposed as $p ( x , y | z ) = \bar { p ( y | x , z ) } p ( x | z )$ (Rasmussen & Ghahramani, 2002; Shahbaba & Neal, 2009).
|
| 58 |
+
|
| 59 |
+
DPM in Related Fields. Recent works of Nagabandi et al. (2019) and Jerfel et al. (2019) exploit the DPM framework to add new components without supervision in the meta-learning context. Nagabandi et al. (2019) apply DPM to the model-based reinforcement learning to predict the next state from a given state-action pair. When a new task appears, they add a component under the DPM framework to handle predictions in the new task. Jerfel et al. (2019) apply DPM to online metalearning. Extending MAML (Finn et al., 2017), they assume that similar tasks can be grouped into a super-task in which the parameter initialization is shared among tasks. DPM is exploited to find the super-tasks and the parameter initialization for each super-task. Therefore, it can be regarded as a meta-level CL method. These works, however, lack generative components, which are often essential to infer the responsible component at test time, as will be described in the next section. As a consequence, it is not straightforward to extend their algorithms to other CL settings beyond modelbased RL or meta-learning. In contrast, our method implements a DPM model that is applicable to general task-free CL.
|
| 60 |
+
|
| 61 |
+
# 3 APPROACH
|
| 62 |
+
|
| 63 |
+
We aim at general task-free CL, where the number of tasks and task descriptions are not available at both training and test time. We even consider the case where the data stream cannot be split into separate tasks in Appendix F. All of the existing expansion methods are not task-free since they require task definition at training (Aljundi et al., 2017) or even at test time (Rusu et al., 2016; Xu & Zhu, 2018; Li et al., 2019). We propose a novel expansion method that automatically determines when to expand and which component to use. We first deal with generative tasks and generalize them into discriminative ones.
|
| 64 |
+
|
| 65 |
+
# 3.1 CONTINUAL LEARNING AS MODELING OF THE MIXTURE DISTRIBUTION
|
| 66 |
+
|
| 67 |
+
We can formulate a CL scenario as a stream of data involving different tasks $\mathcal { D } _ { 1 } , \mathcal { D } _ { 2 } , . . .$ where each task $\mathcal { D } _ { k }$ is a set of data sampled from a (possibly) distinct distribution $p ( x | z = k )$ . If $K$ tasks are given so far, the overall distribution is expressed as the mixture distribution:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
p ( x ) = \sum _ { k = 1 } ^ { K } p ( x | z = k ) p ( z = k ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $p ( z = k )$ can be approximated by $N _ { k } / N$ where $N _ { k } = | \mathcal { D } _ { k } |$ and $\begin{array} { r } { N = \sum _ { k } N _ { k } } \end{array}$ . The goal of CL is to learn the mixture distribution in an online manner. Regularization and replay methods directly model the approximate distribution $p ( x ; \phi )$ parameterized by a single component $\phi$ and update it to fit the overall distribution $p ( x )$ . When updating $\phi$ , however, they do not have full access to all the previous data, and thus the information of previous tasks is at risk of being lost as more tasks are learned. Another way to solve $\mathrm { C L }$ is to use a mixture model: approximating each $p ( x | z = k )$ with $p ( x ; \phi _ { k } )$ . If we learn a new task distribution $p ( x | z = K + \bar { 1 } )$ with new parameter $\phi _ { K + 1 }$ and leave the existing parameters intact, we can preserve the knowledge of the previous tasks. The expansion-based CL methods follow this idea.
|
| 74 |
+
|
| 75 |
+
Similarly, in the discriminative task, the goal of CL is to model the overall conditional distribution, which is a mixture of task-wise conditional distribution $p ( y | x , z = k )$ :
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
p ( \boldsymbol { y } | \boldsymbol { x } ) = \sum _ { k = 1 } ^ { K } p ( \boldsymbol { y } | \boldsymbol { x } , z = k ) p ( z = k | \boldsymbol { x } ) .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Prior expansion methods use expert networks each of which models a task-wise conditional distribution $p ( \boldsymbol { y } | \boldsymbol { x } ; \phi _ { k } ) ^ { 1 }$ . However, a new problem arises in expansion methods: choosing the right expert given $x$ , i.e., $p ( z | x )$ in Eq.(6). Existing methods assume that explicit task descriptor $z$ is given, which is generally not true in human-like learning scenarios. That is, we need a gating mechanism that can infer $p ( z | x )$ only from $x$ (i.e., which expert should process $x$ ). With the gating, the model prediction naturally reduces to the sum of expert outputs weighted by the gate values, which is the mixture of experts (MoE) (Jacobs et al., 1991) formulation: $\begin{array} { r } { \bar { p ( \boldsymbol { y } | \boldsymbol { x } ) } \approx \sum _ { k } \bar { p ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \phi } _ { k } ) } p ( \boldsymbol { z } = k | \boldsymbol { x } ) } \end{array}$ .
|
| 82 |
+
|
| 83 |
+
However, it is not possible to use a single gate network as in Shazeer et al. (2017) to model $p ( z | x )$ in CL; since the gate network is a classifier that finds the correct expert for a given data, training it in an online setting causes catastrophic forgetting. Thus, one possible solution to replace a gating network is to couple each expert $k$ with a generative model that represents $p ( x | z = \bar { k } )$ as in Rasmussen & Ghahramani (2002) and Shahbaba & Neal (2009). As a result, we can build a gating mechanism without catastrophic forgetting as
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
p ( y | x ) \approx \sum _ { k } p ( y | x ; \phi _ { k } ^ { D } ) p ( z = k | x ) \approx \sum _ { k } p ( y | x ; \phi _ { k } ^ { D } ) \frac { p ( x ; \phi _ { k } ^ { G } ) p ( z = k ) } { \sum _ { k ^ { \prime } } p ( x ; \phi _ { k ^ { \prime } } ^ { G } ) p ( z = k ^ { \prime } ) } ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $p ( z = k ) \approx N _ { k } / N$ . We also differentiate the notation for the parameters of discriminative models for classification and generative models for gating by the superscript $D$ and $G$ .
|
| 90 |
+
|
| 91 |
+
If we know the true assignment of $z$ , which is the case of task-based $\mathrm { C L }$ , we can independently train a discriminative model (i.e., $p ( \boldsymbol { y } | \boldsymbol { x } ; \phi _ { k } ^ { D } ) )$ and a generative model (i.e., $p ( x ; \phi _ { k } ^ { G } ) )$ for each task $k$ . In task-free CL, however, $z$ is unknown, so the model needs to infer the posterior $p ( z | x , y )$ . Even worse, the total number of experts is unknown beforehand. Therefore, we propose to employ a Bayesian nonparametric framework, specifically the Dirichlet process mixture (DPM) model, which can fit a mixture distribution with no prefixed number of components. We use SVA described in section 2.2 to approximate the posterior in an online setting. Although SVA is originally designed for the generative tasks, it is easily applicable to discriminative tasks by making each component $k$ to model $p ( x , y | z ) = p ( y | x , z ) p ( \bar { x } | z )$ .
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 1: Overview of our CN-DPM model. Each expert $k$ (blue boxes) contains a discriminative component for modeling $p ( \boldsymbol { y } | \boldsymbol { x } ; \phi _ { k } ^ { D } )$ and a generative component for modeling $p ( x ; \phi _ { k } ^ { G } )$ , jointly representing $p ( x , y ; \phi _ { k } )$ . We also keep the assigned data count $N _ { k }$ per expert. (a) During training, each sample $( x , y )$ coming in a sequence is evaluated by every expert to calculate the responsibility $\rho _ { k }$ of each expert. If $\rho _ { K + 1 }$ is high enough, i.e., none of the existing experts is responsible, the data is stored into short-term memory (STM). Otherwise, it is learned by the corresponding expert. When STM is full, a new expert is created from the data in STM. (b) Since CN-DPM is a generative model, we first compute the joint distribution $p ( x , y )$ for a given $x$ , from which it is trivial to infer $p ( y | x )$ .
|
| 95 |
+
|
| 96 |
+
# 3.2 THE CONTINUAL NEURAL DIRICHLET PROCESS MIXTURE (CN-DPM) MODEL
|
| 97 |
+
|
| 98 |
+
The proposed approach for task-free CL, named Continual Neural Dirichlet Process Mixture (CNDPM) model, consists of a set of experts, each of which is associated with a discriminative model (classifier) and a generative model (density estimator). More specifically, the classifier models $p ( y | x , z \ = \ k )$ , for which we can adopt any classifier or regressor using deep neural networks, while the density estimator describes the marginal likelihood $p ( x | z = k \bar { ) }$ , for which we can use any explicit density model such as VAEs (Kingma & Welling, 2014) and PixelRNN (Oord et al., 2016). We respectively denote the classifier and the density estimator of expert $k$ as $p ( y | x ; \phi _ { k } ^ { D } )$ and $p ( x ; \phi _ { k } ^ { G } )$ , where $\phi _ { k } ^ { D }$ and $\phi _ { k } ^ { G }$ are the parameters of the models. Finally, the prediction $p ( y | x )$ can be obtained from Eq.(7) by plugging in the output of the classifier and the density estimator. Note that the number of experts is not prefixed but expanded via the DPM framework. Figure 1 illustrates the overall training and inference process of our model.
|
| 99 |
+
|
| 100 |
+
Training. We assume that samples sequentially arrive one at a time during training. For a new sample, we first decide whether the sample should be assigned to an existing expert or a new expert should be created for it. Suppose that samples up to $( x _ { n } , y _ { n } )$ are sequentially processed and $K$ experts are already created when a new sample $( x _ { n + 1 } , y _ { n + 1 } )$ arrives. We compute the responsibility ρn+1,k as follows:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\rho _ { n + 1 , k } \propto \left\{ \begin{array} { l l } { ( \sum _ { i = 1 } ^ { n } \rho _ { i , k } ) p ( y _ { n + 1 } | x _ { n + 1 } ; \hat { \phi } _ { k } ^ { D } ) p ( x _ { n + 1 } ; \hat { \phi } _ { k } ^ { G } ) } & { \mathrm { i f ~ } 1 \leq k \leq K } \\ { \alpha p ( y _ { n + 1 } | x _ { n + 1 } ; \hat { \phi } _ { 0 } ^ { D } ) p ( x _ { n + 1 } ; \hat { \phi } _ { 0 } ^ { G } ) \mathrm { ~ w h e r e ~ } \hat { \phi } _ { 0 } \sim G _ { 0 } ( \phi ) } & { \mathrm { i f ~ } k = K + 1 } \end{array} \right.
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $G _ { 0 }$ is a distribution corresponding to the weight initialization. If arg $\textstyle \operatorname* { m a x } _ { k } \rho _ { n + 1 , k } \neq K + 1$ , the sample is assigned to the existing experts proportional to $\rho _ { n + 1 , k }$ , and the parameters of the experts are updated with the new sample by Eq.(4) such that $\hat { \phi } _ { k }$ is the MAP approximation given the data assigned up to the current time step. Otherwise, we create a new expert.
|
| 107 |
+
|
| 108 |
+
Short-Term Memory. However, it is not a good idea to create a new expert immediately and initialize it to be the MAP estimation given $x _ { n + 1 }$ . Since both the classifier and density estimator of an expert are neural networks, training the new expert with only a single example leads to severe overfitting. To mitigate this issue, we employ short-term memory (STM) to collect sufficient data before creating a new expert. When a data point is classified as new, we store it to the STM. Once the STM reaches its maximum capacity $M$ , we stop the data inflow for a while and train a new expert with the data in the STM for multiple epochs until convergence. We call this procedure sleep phase. After sleep, the STM is emptied, and the newly trained expert is added to the expert pool. During the subsequent wake phase, the expert is learned from the data assigned to it. This STM trick assumes that the data in the STM belong to the same expert. We empirically find that this assumption is acceptable in many CL settings where adjacent data are highly correlated. The overall training procedure is described in Algorithm 1. Note that we use $\rho _ { n , 0 }$ instead of $\rho _ { n , K + 1 }$ in the algorithm for brevity.
|
| 109 |
+
|
| 110 |
+
Inference. At test time, we infer $p ( y | x )$ from the collaboration of the learned experts as in Eq.(7).
|
| 111 |
+
|
| 112 |
+
Techniques for Practicality. Naively adding a new expert has two major problems: (i) the number of parameters grows unnecessarily large as the experts redundantly learn common features and (ii) there is no positive transfer of knowledge between experts. Therefore, we propose a simple method to share parameters between experts. When creating a new expert, we add lateral connections to the features of the previous experts similar to Rusu et al. (2016). To prevent catastrophic forgetting in the existing experts, we block the gradient from the new expert. In this way, we can greatly reduce the number of parameters while allowing positive knowledge transfer. More techniques such as sparse regularization in Yoon et al. (2018) can be employed to reduce redundant parameters further. As they are orthogonal to our approach, we do not use such techniques in our experiments. Another effective technique that we use in the classification experiments is adding a temperature parameter to the classifier. Since the range of $\log p ( x | z )$ is far broader than $\log p ( y | x , z )$ , the classifier has almost no effect without proper scaling. Thus, we can increase overall accuracy by adjusting the relative importance of images and labels. We also introduce an algorithm to prune redundant experts in Appendix D, and discuss further practical issues of CN-DPM in Appendix B.
|
| 113 |
+
|
| 114 |
+
<table><tr><td colspan="3">Algorithm1 Training of the Continual Neural Dirichlet Process Mixture (CD-NDP) Model</td></tr><tr><td>Require: Data (x1,y1),.,(xN,yN), concen- 12: tration α,base measure Go, short-term memory capacity M,learning rate 入</td><td>13: 14:</td><td>M←{xn}UM if |M| ≥ M then {Add new expert} 𝜙K+1 ←FindMAP(M,Go)</td></tr><tr><td>1: M ← 0 {Short-term memory} 2:K←O {Number of experts}</td><td></td><td>Nk+1←|M|;M←0</td></tr><tr><td></td><td></td><td>K←K+1</td></tr><tr><td>3:No ← α; Φo ← Sample(Go)</td><td></td><td>end if</td></tr><tr><td></td><td></td><td></td></tr><tr><td>4:for n=1 to N do</td><td></td><td>else {Update existing experts}</td></tr><tr><td>5:</td><td>for k= O to K do</td><td></td></tr><tr><td>6:</td><td>lk ←p(ynlxn;R)p(xn;E)</td><td>for k=1 to K do</td></tr><tr><td>7:</td><td>Pn,k←Nklk</td><td>Nk←Nk +Pn,k</td></tr><tr><td>8:</td><td>end for</td><td>k←k+pn,k入Vloglk</td></tr><tr><td>9:</td><td>Pn,0:K ← Pn,0:k/∑k=0 Pnk K</td><td>end for</td></tr><tr><td>10:</td><td>if arg maxk Pn,k = O then</td><td>23:</td></tr><tr><td>11:</td><td></td><td>end if</td></tr><tr><td></td><td>{Save xn to short-term memory}</td><td>24: 25: end for</td></tr></table>
|
| 115 |
+
|
| 116 |
+
# 4 EXPERIMENTS
|
| 117 |
+
|
| 118 |
+
We evaluate the proposed CN-DPM model in task-free CL with four benchmark datasets. Appendices include more detailed model architecture, additional experiments, and analyses.
|
| 119 |
+
|
| 120 |
+
# 4.1 CONTINUAL LEARNING SCENARIOS
|
| 121 |
+
|
| 122 |
+
A CL scenario defines a sequence of tasks where the data distribution for each task is assumed to be different from others. Below we describe the task-free CL scenarios used in the experiments. At both train and test time, the model cannot access the task information. Unless stated otherwise, each task is presented for a single epoch (i.e., a completely online setting) with a batch size of 10.
|
| 123 |
+
|
| 124 |
+
Split-MNIST (Zenke et al., 2017). The MNIST dataset (LeCun et al., 1998) is split into five tasks, each containing approximately 12K images of two classes, namely (0/1, 2/3, 4/5, 6/7, 8/9). We conduct both classification and generation experiments in this scenario.
|
| 125 |
+
|
| 126 |
+
Table 1: Test scores and the numbers of parameters in task-free CL on Split-MNIST, MNIST-SVHN, and Split-CIFAR100 scenarios. Note that iid- $^ { \ast }$ baselines are not CL methods.
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Method</td><td colspan="2">Split-MNIST</td><td colspan="2">Split-MNIST(Gen.)</td><td colspan="2">MNIST-SVHN</td><td colspan="2">Split-CIFAR100</td></tr><tr><td></td><td>Acc. (%)</td><td>Param.</td><td>bits/dim</td><td>Param.</td><td>Acc. (%)</td><td>Param.</td><td>Acc. (%)</td><td>Param.</td></tr><tr><td>iid-offline</td><td>98.63</td><td>478K</td><td>0.1806</td><td>988K</td><td>96.69</td><td>11.2M</td><td>73.80</td><td>11.2M</td></tr><tr><td>iid-online</td><td>96.18</td><td>478K</td><td>0.2156</td><td>988K</td><td>95.24</td><td>11.2M</td><td>20.46</td><td>11.2M</td></tr><tr><td>Fine-tune</td><td>19.43</td><td>478K</td><td>0.2817</td><td>988K</td><td>83.35</td><td>11.2M</td><td>2.43</td><td>11.2M</td></tr><tr><td>Reservoir</td><td>85.69</td><td>478K</td><td>0.2234</td><td>988K</td><td>94.12</td><td>11.2M</td><td>10.01</td><td>11.2M</td></tr><tr><td>CN-DPM</td><td>93.23</td><td>524K</td><td>0.2110</td><td>970K</td><td>94.46</td><td>7.80M</td><td>20.10</td><td>19.2M</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Table 2: Performance comparison on Split-CIFAR10 with various scenario length.
|
| 131 |
+
|
| 132 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Split-CIFAR10 Acc. (%)</td><td rowspan="2">Param.</td></tr><tr><td>0.2 Epoch</td><td>1 Epoch</td><td>10 Epochs</td></tr><tr><td>iid-offline</td><td>93.17</td><td>93.17</td><td>93.17</td><td>11.2M</td></tr><tr><td>iid-online</td><td>36.65</td><td>62.79</td><td>83.19</td><td>11.2M</td></tr><tr><td>Fine-tune</td><td>12.68</td><td>18.08</td><td>19.31</td><td>11.2M</td></tr><tr><td>Reservoir</td><td>37.09</td><td>44.00</td><td>43.82</td><td>11.2M</td></tr><tr><td>GSS</td><td>33.56</td><td>1</td><td>1</td><td>11.2M</td></tr><tr><td>CN-DPM</td><td>41.78</td><td>45.21</td><td>46.98</td><td>4.60M</td></tr></table>
|
| 133 |
+
|
| 134 |
+
Table 3: Dissecting the performance of CN-DPM.
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Acc. Type</td><td>Split-CIFAR10</td><td>Split-CIFAR100</td></tr><tr><td>Classifier (init)</td><td>88.20</td><td>55.42</td></tr><tr><td>Classifier (final)</td><td>88.20</td><td>55.24</td></tr><tr><td>Gating (VAEs)</td><td>48.18</td><td>31.14</td></tr></table>
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 2: Split-CIFAR10 (0.2 Epoch).
|
| 142 |
+
Figure 3: Split-CIFAR100.
|
| 143 |
+
|
| 144 |
+
MNIST-SVHN (Shin et al., 2017). It is a two-stage scenario where the first consists of MNIST, and the second contains SVHN (Netzer et al., 2011). This scenario is different from Split-MNIST; in Split-MNIST, new classes are introduced when transitioning into a new task, whereas the two stages in MNIST-SVHN share the same set of class labels and have different input domains.
|
| 145 |
+
|
| 146 |
+
Split-CIFAR10 and Split-CIFAR100. In Split-CIFAR10, we split CIFAR10 (Krizhevsky & Hinton, 2009) into five tasks in the same manner as Split-MNIST. For Split-CIFAR100, we build 20 tasks, each containing five classes according to the pre-defined superclasses in CIFAR100. The training sets of CIFAR10 and CIFAR100 consist of 50K examples each. Note that most of the previous works (Rebuffi et al., 2017; Zenke et al., 2017; Lopez-Paz & Ranzato, 2017; Aljundi et al., 2019c; Chaudhry et al., 2019a), except Maltoni & Lomonaco (2019), use task information at test time in Split-CIFAR100 experiments. They assign distinct output heads for each task and utilize the task identity to choose the responsible output head at both training and test time. Knowing the right output head, however, the task reduces to 5-way classification. Therefore, our setting is far more difficult than the prior works since the model has to perform 100-way classification only from the given input.
|
| 147 |
+
|
| 148 |
+
# 4.2 COMPARED METHODS
|
| 149 |
+
|
| 150 |
+
All the following baselines use the same base network that will be discussed in section 4.3.
|
| 151 |
+
|
| 152 |
+
iid-offline and iid-online. iid-offline shows the maximum performance achieved by combining standard training techniques such as data augmentation, learning rate decay, multiple iterations (up to 100 epochs), and larger batch size. iid-online is the model trained with the same number of epoch and batch size with other CL baselines.
|
| 153 |
+
|
| 154 |
+
Fine-tune. As a popular baseline in the previous works, the base model is naively trained as data enters.
|
| 155 |
+
|
| 156 |
+
Reservoir. As Chaudhry et al. (2019b) show that simple experience replay (ER) can outperform most CL methods, we test the ER with reservoir sampling as a strong baseline. Reservoir sampling randomly chooses a fixed number of samples with a uniform probability from an indefinitely long stream of data, and thus, it is suitable for managing the replay memory in task-free CL. At each training step, the model is trained using a mini-batch from the data stream and another one of the same sizes from the memory.
|
| 157 |
+
|
| 158 |
+
Gradient-Based Sample Selection (GSS). Aljundi et al. (2019b) propose a sampling method called GSS that diversifies the gradients of the samples in the replay memory. Since it is designed to work in task-free settings, we report the scores in their paper for comparison.
|
| 159 |
+
|
| 160 |
+
# 4.3 MODEL ARCHITECTURE
|
| 161 |
+
|
| 162 |
+
Split-MNIST. Following Hsu et al. (2018), we use a simple two-hidden-layer MLP classifier with ReLU activation as the base model for classification. The dimension of each layer is 400. For generation experiments, we use VAE, whose encoder and decoder have the same hidden layer configuration with the classifier. Each expert in CN-DPM has a similar classifier and VAE with smaller hidden dimensions. The first expert starts with 64 hidden units per layer and adds 16 units when a new expert is added. For classification, we adjust hyperparameter $\alpha$ such that five experts are created. For generation, we set $\alpha$ to produce 12 experts since more experts produce a better score. We set the memory size in both Reservoir and CN-DPM to 500 for classification and 1000 for generation.
|
| 163 |
+
|
| 164 |
+
MNIST-SVHN and Split-CIFAR10/100. We use ResNet-18 (He et al., 2016) as the base model. In CN-DPM, we use a 10-layer ResNet for the classifier and a CNN-based VAE. The encoder and the decoder of VAE have two CONV layers and two FC layers. We set $\alpha$ such that 2, 5, and 20 experts are created for each scenario. The memory sizes in Reservoir, GSS, and CN-DPM are set to 500 for MNIST-SVHN and 1000 for Split-CIFAR10/100. More details can be found in Appendix C.
|
| 165 |
+
|
| 166 |
+
# 4.4 RESULTS OF TASK-FREE CONTINUAL LEARNING
|
| 167 |
+
|
| 168 |
+
All reported numbers in our experiments are the average of 10 runs. Table 1 and 2 show our main experimental results. In every setting, CN-DPM outperforms the baselines by significant margins with reasonable parameter usage. Table 2 and Figure 2 shows the results of Split-CIFAR10 experiments. Since Aljundi et al. (2019b) test GSS using only 10K examples of CIFAR10, which is 1/5 of the whole train set, we follow their setting (denoted by $0 . 2 ~ E p o c h )$ for a fair comparison. We also test a Split-CIFAR10 variant where each task is presented for 10 epochs. The accuracy and the training graph of GSS are excerpted from the original paper, where the accuracy is the average of three runs, and the graph is from one of the runs. In Figure 2, the bold line represents the average of 10 runs (except GSS, which is a single run), and the faint lines are the individual runs. Surprisingly, Reservoir even surpasses the accuracy of GSS and proves to be a simple but powerful CL method.
|
| 169 |
+
|
| 170 |
+
One interesting observation in Table 2 is that the performance of Reservoir degrades as each task is extended up to 10 epochs. This is due to the nature of replay methods; since the same samples are replayed repeatedly as representatives of the previous tasks, the model tends to be overfitted to the replay memory as training continues. This degradation is more severe when the memory size is small, as presented in Appendix I. Our CN-DPM, on the other hand, uses the memory to buffer recent examples temporarily, so there is no such overfitting problem. This is also confirmed by the CN-DPM’s accuracy consistently increasing as learning progresses.
|
| 171 |
+
|
| 172 |
+
In addition, CN-DPM is particularly strong compared to other baselines when the number of tasks increases. For example, Reservoir, which performs reasonably well in other tasks, scores poorly in Split-CIFAR100, which involves 20 tasks and 100 classes. Even with the large replay memory of size 1000, the Reservoir suffers from the shortage of memory (e.g., only 50 slots per task). In contrast, CN-DPM’s accuracy is more than double of Reservoir and comparable to that of iid-online.
|
| 173 |
+
|
| 174 |
+
Table 3 analyzes the accuracy of CN-DPM in Split-CIFAR10/100. We assess the performance and forgetting of individual components. At the end of each task, we measure the test accuracy of the responsible classifier and report the average of such task-wise classifier accuracies as Classifier (init).
|
| 175 |
+
|
| 176 |
+
We report the average of the task-wise accuracies after learning all tasks as Classifier (final). With little difference between the two scores, we confirm that forgetting barely occurs in the classifiers. In addition, we report the gating accuracy measured after training as Gating $( V A E s )$ , which is the accuracy of the task identification performed jointly by the VAEs. The relatively low gating accuracy suggests that CN-DPM has much room for improvement through better density estimates.
|
| 177 |
+
|
| 178 |
+
Overall, CN-DPM does not suffer from catastrophic forgetting, which is a major problem in regularization and replay methods. As a trade-off, however, choosing the right expert arises as another problem in CN-DPM. Nonetheless, the results show that this new direction is especially promising when the number of tasks is very large.
|
| 179 |
+
|
| 180 |
+
# 5 CONCLUSION
|
| 181 |
+
|
| 182 |
+
In this work, we formulated expansion-based task-free CL as learning of a Dirichlet process mixture model with neural experts. We demonstrated that the proposed CN-DPM model achieves great performance in multiple task-free settings, better than the existing methods. We believe there are several interesting research directions beyond this work: (i) improving the accuracy of expert selection, which is the main bottleneck of our method, and (ii) applying our method to different domains such as natural language processing and reinforcement learning.
|
| 183 |
+
|
| 184 |
+
# ACKNOWLEDGMENTS
|
| 185 |
+
|
| 186 |
+
We thank Chris Dongjoo Kim and Yookoon Park for helpful discussion and advice. This work was supported by Video Analytics Center of Excellence in AIX center of SK telecom, Institute of Information & communications Technology Planning & Evaluation (IITP) grant (No.2019-0-01082, SW StarLab) and Basic Science Research Program through National Research Foundation of Korea (NRF) funded by the Korea government (MSIT) (2017R1E1A1A01077431). Gunhee Kim is the corresponding author.
|
| 187 |
+
|
| 188 |
+
# REFERENCES
|
| 189 |
+
|
| 190 |
+
Rahaf Aljundi, Punarjay Chakravarty, and Tinne Tuytelaars. Expert gate: Lifelong learning with a network of experts. In CVPR, 2017.
|
| 191 |
+
|
| 192 |
+
Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In ECCV, 2018.
|
| 193 |
+
|
| 194 |
+
Rahaf Aljundi, Klaas Kelchtermans, and Tinne Tuytelaars. Task-Free continual learning. In CVPR, 2019a.
|
| 195 |
+
|
| 196 |
+
Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. In NeurIPS, 2019b.
|
| 197 |
+
|
| 198 |
+
Rahaf Aljundi, Marcus Rohrbach, and Tinne Tuytelaars. Selfless sequential learning. In ICLR, 2019c.
|
| 199 |
+
|
| 200 |
+
Charles E. Antoniak. Mixtures of dirichlet processes with applications to bayesian nonparametric problems. Ann. Stat., 2(6):1152–1174, 1974.
|
| 201 |
+
|
| 202 |
+
David Blei and Michael Jordan. Variational inference for dirichlet process mixtures. Bayesian Anal., 1(1):121–143, 2006.
|
| 203 |
+
|
| 204 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In ICLR, 2015.
|
| 205 |
+
|
| 206 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. In ICLR, 2019a.
|
| 207 |
+
|
| 208 |
+
Arslan Chaudhry, Marcus Rohrbach, Mohamed Elhoseiny, Thalaiyasingam Ajanthan, Puneet K. Dokania, Philip H. S. Torr, and Marc’Aurelio Ranzato. On tiny episodic memories in continual learning. arXiv, (1902.10486v4), 2019b.
|
| 209 |
+
|
| 210 |
+
Michael D. Escobar and Mike West. Bayesian density estimation and inference using mixtures. J. Am. Stat. Assoc., 90(430):577–588, 1995.
|
| 211 |
+
|
| 212 |
+
Thomas S. Ferguson. Bayesian density estimation by mixtures of normal distributions. In Recent advances in statistics, pp. 287–302. Academic Press, 1983.
|
| 213 |
+
|
| 214 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017.
|
| 215 |
+
|
| 216 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 217 |
+
|
| 218 |
+
Yen-Chang Hsu, Yen-Cheng Liu, Anita Ramasamy, and Zsolt Kira. Re-evaluating continual learning scenarios: A categorization and case for strong baselines. In NeurIPS, Continual Learning Workshop, 2018.
|
| 219 |
+
|
| 220 |
+
Robert A. Jacobs, Michael I. Jordan, Steven J. Nowlan, and Geoffrey E. Hinton. Adaptive mixtures of local experts. Neural Comput., 3:79–87, 1991.
|
| 221 |
+
|
| 222 |
+
Ghassen Jerfel, Erin Grant, Thomas Griffiths, and Katherine Heller. Reconciling meta-learning and continual learning with online mixtures of tasks. In NeurIPS, 2019.
|
| 223 |
+
|
| 224 |
+
Diederik P. Kingma and Max Welling. Auto-Encoding variational bayes. In ICLR, 2014.
|
| 225 |
+
|
| 226 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. PNAS, 2017.
|
| 227 |
+
|
| 228 |
+
A Krizhevsky and G Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
|
| 229 |
+
|
| 230 |
+
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.
|
| 231 |
+
|
| 232 |
+
Xilai Li, Yingbo Zhou, Tianfu Wu, Richard Socher, and Caiming Xiong. Learn to grow: A continual structure learning framework for overcoming catastrophic forgetting. In ICML, 2019.
|
| 233 |
+
|
| 234 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE TPAMI, 40(12):2935–2947, 2017.
|
| 235 |
+
|
| 236 |
+
Dahua Lin. Online learning of nonparametric mixture models via sequential variational approximation. In NeurIPS, 2013.
|
| 237 |
+
|
| 238 |
+
David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In NeurIPS, 2017.
|
| 239 |
+
|
| 240 |
+
Steven Maceachern. Estimating normal means with a conjugate style dirichlet process prior. Commun. Stat. - Simul. Comput., 23(3):727–741, 1994.
|
| 241 |
+
|
| 242 |
+
Davide Maltoni and Vincenzo Lomonaco. Continuous learning in single-incremental-task scenarios. Neural Networks, 116:56–73, 2019.
|
| 243 |
+
|
| 244 |
+
Anusha Nagabandi, Chelsea Finn, and Sergey Levine. Deep online learning via Meta-Learning: continual adaptation for Model-Based RL. In ICLR, 2019.
|
| 245 |
+
|
| 246 |
+
Radford M. Neal. Markov chain sampling methods for dirichlet process mixture models. J. Comput. Graph. Stat., 2000.
|
| 247 |
+
|
| 248 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NeurIPS, Workshop on Deep Learning and Unsupervised Feature Learning, 2011.
|
| 249 |
+
|
| 250 |
+
Aaron Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In ICML, 2016.
|
| 251 |
+
|
| 252 |
+
German I. Parisi, Ronald Kemker, Jose L. Part, and Christopher Kanan. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54–71, 2019.
|
| 253 |
+
|
| 254 |
+
Dushyant Rao, Francesco Visin, Andrei Rusu, Razvan Pascanu, Yee Whye Teh, and Raia Hadsell. Continual unsupervised representation learning. In NeurIPS, 2019.
|
| 255 |
+
|
| 256 |
+
Carl Edward Rasmussen and Zoubin Ghahramani. Infinite mixtures of gaussian process experts. In NeurIPS, 2002.
|
| 257 |
+
|
| 258 |
+
Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph Lampert. iCaRL: incremental classifier and representation learning. In CVPR, 2017.
|
| 259 |
+
|
| 260 |
+
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. In NeurIPS, 2016.
|
| 261 |
+
|
| 262 |
+
Jonathan Schwarz, Jelena Luketina, Wojciech Czarnecki, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. In ICML, 2018.
|
| 263 |
+
|
| 264 |
+
Babak Shahbaba and Radford Neal. Nonlinear models using dirichlet process mixtures. J. Mach. Learn. Res., 2009.
|
| 265 |
+
|
| 266 |
+
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. In ICLR, 2017.
|
| 267 |
+
|
| 268 |
+
Hanul Shin, Jung Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In NeurIPS, 2017.
|
| 269 |
+
|
| 270 |
+
Yee Whye Teh. Dirichlet process. Springer, Encyclopedia of Machine Learning:280–287, 2010.
|
| 271 |
+
|
| 272 |
+
Gido M. van de Ven and Andreas S. Tolias. Generative replay with feedback connections as a general strategy for continual learning. arXiv, (1809.10635v2), 2018.
|
| 273 |
+
|
| 274 |
+
Lianming Wang and David Dunson. Fast bayesian inference in dirichlet process mixture models. J. Comput. Graph. Stat., 20(1):196–216, 2011.
|
| 275 |
+
|
| 276 |
+
Ju Xu and Zhanxing Zhu. Reinforced continual learning. In NeurIPS, 2018.
|
| 277 |
+
|
| 278 |
+
Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. In ICLR, 2018.
|
| 279 |
+
|
| 280 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In ICML, 2017.
|
| 281 |
+
|
| 282 |
+
# A REVIEW OF DIRICHLET PROCESS MIXTURE MODEL
|
| 283 |
+
|
| 284 |
+
We review the Dirichlet process mixture (DPM) model and a variational method to approximate the posterior of DPM models in an online setting: Sequential Variational Approximation (SVA) (Lin, 2013).
|
| 285 |
+
|
| 286 |
+
Dirichlet Process. Dirichlet process (DP) is a distribution over distributions that are defined over infinitely many dimensions. DP is parameterized by a concentration parameter $\alpha \in \mathbb { R } ^ { + }$ and a base distribution $G _ { 0 }$ . For a distribution $G$ sampled from $\mathrm { D P } ( \alpha , G _ { 0 } )$ , the following holds for any finite measurable partition $\{ A _ { 1 } , A _ { 2 } , . . . , A _ { K } \}$ of probability space $\Theta$ (Teh, 2010):
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
( G ( A _ { 1 } ) , . . . , G ( A _ { K } ) ) \sim \mathrm { D i r } ( \alpha G _ { 0 } ( A _ { 1 } ) , . . . , \alpha G _ { 0 } ( A _ { K } ) ) .
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
The stick-breaking process is often used as a more intuitive construction of DP:
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
G = \sum _ { k = 1 } ^ { \infty } \left( v _ { k } \prod _ { l = 1 } ^ { k - 1 } ( 1 - v _ { l } ) \right) \delta _ { \phi _ { k } , } v _ { k } \sim \mathrm { B e t a } ( 1 , \alpha ) , \phi _ { k } \sim G _ { 0 } .
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Initially, we start with a stick of length one, which represents the total probability. At each step $k$ , we cut a proportion $v _ { k }$ off from the remaining stick (probability) and assign it to the atom $\phi _ { k }$ sampled from the base distribution $G _ { 0 }$ . This formulation shows DP is discrete with probability 1 (Teh, 2010). In our problem setting, $G$ is a distribution over expert’s parameter space and has positive probability only at the countably many $\phi _ { k }$ , which are independently sampled from the base distribution.
|
| 299 |
+
|
| 300 |
+
Dirichlet Process Mixture (DPM) Model. The DPM model is often applied to clustering problems where the number of clusters is not known in advance. The generative process of DPM model is
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
x _ { n } \sim p ( \theta _ { n } ) , \theta _ { n } \sim G , G \sim \mathrm { D P } ( \alpha , G _ { 0 } ) ,
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
where $x _ { n }$ is the $n$ -th data, and $\theta _ { n }$ is the $n$ -th latent variable sampled from $G$ , which itself is a distribution sampled from a Dirichlet process (DP). Since $G$ is discrete with probability 1, the same values can be sampled multiple times for $\theta$ . If $\theta _ { n } = \theta _ { m }$ , the two data points $x _ { n }$ and $x _ { m }$ belong to the same cluster. An alternative formulation uses the indicator variable $z _ { n }$ that indicates to which cluster the $n$ -th data belongs such that $\theta _ { n } = \phi _ { z _ { n } }$ where $\phi _ { k }$ is the parameter of $k$ -th cluster. The data $x _ { n }$ is sampled from a distribution parameterized by $\theta _ { n }$ . For a DP Gaussian mixture model as an example, each $\theta = \{ \mu , \sigma ^ { 2 } \}$ parameterizes a Gaussian distribution.
|
| 307 |
+
|
| 308 |
+
The Posterior of DPM Models. The posterior of a DPM model for given $\theta _ { 1 } , . . . , \theta _ { n }$ is also a DP (Teh, 2010):
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
G | \theta _ { 1 } , . . . , \theta _ { n } \sim \mathrm { D P } \left( \alpha + n , \frac { \alpha } { \alpha + n } G _ { 0 } + \frac { 1 } { \alpha + n } \sum _ { i = 1 } ^ { n } \delta ( \theta _ { i } ) \right) .
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+
tion The base distribution of the posterior, which is a weighted average of $\textstyle { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } \delta ( \theta _ { i } )$ , is in fact the predictive distribution of $\theta _ { n + 1 }$ given $G _ { 0 }$ $\theta _ { 1 : n }$ and the empirical distribu- (Teh, 2010):
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\theta _ { n + 1 } | \theta _ { 1 } , . . . , \theta _ { n } \sim \frac { \alpha } { \alpha + n } G _ { 0 } + \frac { 1 } { \alpha + n } \sum _ { i = 1 } ^ { n } \delta ( \theta _ { i } ) .
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
If we additionally condition $x _ { n }$ and reflect the likelihood, we obtain (Neal, 2000):
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\theta _ { n + 1 } | \theta _ { 1 } , . . . , \theta _ { n } , x _ { n + 1 } \sim { \frac { 1 } { Z } } \left( { \frac { \alpha } { \alpha + n } } \int p ( x _ { n + 1 } | \theta ) d G _ { 0 } ( \theta ) + { \frac { 1 } { \alpha + n } } \sum _ { i = 1 } ^ { n } p ( x _ { n + 1 } | \theta _ { i } ) \delta ( \theta _ { i } ) \right) ,
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
where $Z$ is the normalizing constant. Note that $\theta _ { n + 1 }$ is independent from $x _ { 1 : n }$ given $\theta _ { 1 : n }$
|
| 327 |
+
|
| 328 |
+
Approximation of the Posterior of DPM Models. Since the exact inference of the posterior of DPM models is infeasible, approximate inference methods are adopted such as Markov chain Monte Carlo (MCMC) (Maceachern, 1994; Escobar & West, 1995; Neal, 2000) or variational inference (Blei & Jordan, 2006; Wang & Dunson, 2011; Lin, 2013). Among many variational methods, the Sequential Variational Approximation (SVA) (Lin, 2013) approximates the posterior as
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
p ( G | x _ { 1 : n } ) = \sum _ { z _ { 1 : n } } p ( z _ { 1 : n } | x _ { 1 : n } ) p ( G | x _ { 1 : n } , z _ { 1 : n } ) \approx q ( G | \rho , \nu ) = \sum _ { z _ { 1 : n } } \Big ( \prod _ { i = 1 } ^ { n } \rho _ { i , z _ { i } } \Big ) q _ { \nu } ^ { ( z ) } ( G | z _ { 1 : n } ) ,
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
where $p ( z _ { 1 : n } | x _ { 1 : n } )$ is represented by the product of individual variational probabilities $\rho _ { z _ { i } }$ for $z _ { i }$ , which greatly simplifies the distribution. Moreover, $p ( G | x _ { 1 : n } , z _ { 1 : n } )$ is approximated by a stochastic process $q _ { \nu } ^ { ( z ) } ( G | z _ { 1 : n } )$ . Sampling from $q _ { \nu } ^ { ( z ) } ( G | z _ { 1 : n } )$ is equivalent to constructing a distribution as
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\beta _ { 0 } D ^ { \prime } + \sum _ { k = 1 } ^ { K } \beta _ { k } \delta _ { \phi _ { k } } , D ^ { \prime } \sim \mathrm { D P } ( \alpha G _ { 0 } ) , ( \beta _ { 0 } , \dots , \beta _ { K } ) \sim \mathrm { D i r } ( \alpha , | C _ { 1 } ^ { ( z ) } | , \dots , | C _ { K } ^ { ( z ) } | ) , \phi _ { k } \sim \nu _ { k } ,
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
$\{ C _ { 1 } ^ { ( z ) } , C _ { 2 } ^ { ( z ) } , . . . , C _ { K } ^ { ( z ) } \}$ is the partition of $x _ { 1 : n }$ characterized by $z$
|
| 341 |
+
|
| 342 |
+
The approximation yields the following tractable predictive distribution:
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
q ( \theta ^ { \prime } | \rho , \nu ) = \mathbb { E } _ { q ( G | \rho , \nu ) } [ p ( \theta ^ { \prime } | G ) ] = \frac { \alpha } { \alpha + n } G _ { 0 } ( \theta ^ { \prime } ) + \sum _ { k = 1 } ^ { K } \frac { \sum _ { i = 1 } ^ { n } \rho _ { i , k } } { \alpha + n } \nu _ { k } ( \theta ^ { \prime } ) .
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
SVA uses this predictive distribution for sequential approximation of the posterior of $z$ and $\phi$ .
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
\begin{array} { r l } & { p ( z _ { n + 1 } , \phi ^ { ( n + 1 ) } | x _ { 1 : n + 1 } ) \propto p ( x _ { n + 1 } | z _ { n + 1 } , \phi ^ { ( n + 1 ) } ) p ( z _ { n + 1 } , \phi ^ { ( n + 1 ) } | x _ { 1 : n } ) } \\ & { \qquad \approx p ( x _ { n + 1 } | z _ { n + 1 } , \phi ^ { ( n + 1 ) } ) q ( z _ { n + 1 } , \phi ^ { ( n + 1 ) } | \rho _ { 1 : n } , \nu ^ { ( n ) } ) . } \end{array}
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
While the data is given one by one, SVA sequentially updates the variational parameters; the following $\rho _ { n + 1 }$ and $\nu ^ { ( n + 1 ) }$ at step $n + 1$ minimizes the $\mathrm { K L }$ divergence between $q ( z _ { n + 1 } , \phi ^ { ( n + 1 ) } | \rho _ { 1 : n + 1 } , \nu ^ { ( n + 1 ) } )$ and the posterior:
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
\begin{array} { r l } & { \rho _ { n + 1 , k } \propto \left\{ ( \sum _ { i = 1 } ^ { n } \rho _ { i , k } ) \int _ { \theta } p ( x _ { n + 1 } | \theta ) \nu _ { k } ^ { ( n ) } ( d \theta ) \right. \mathrm { ~ i f ~ } 1 \leq k \leq K } \\ & { \left. \alpha \int _ { \theta } p ( x _ { n + 1 } | \theta ) G _ { 0 } ( d \theta ) \right. \mathrm { ~ i f ~ } k = K + 1 } \\ & { \nu _ { k } ^ { ( n + 1 ) } ( d \theta ) \propto \left\{ G _ { 0 } ( d \theta ) \prod _ { i = 1 } ^ { n + 1 } p ( x _ { i } | \theta ) ^ { \rho _ { i , k } } \right. \mathrm { ~ i f ~ } 1 \leq k \leq K } \\ & { \left. G _ { 0 } ( d \theta ) p ( x _ { n + 1 } | \theta ) ^ { \rho _ { n + 1 , k } } \right. \mathrm { ~ i f ~ } k = K + 1 } \end{array} .
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
In practice, SVA adds a new component only when $\rho _ { n + 1 , K + 1 }$ is greater than a threshold $\epsilon$ . It uses stochastic gradient descent to find and maintain the MAP estimation of parameters instead of calculating the whole distribution $\nu _ { k }$ :
|
| 361 |
+
|
| 362 |
+
$$
|
| 363 |
+
\begin{array} { r } { \hat { \phi } _ { k } ^ { ( n + 1 ) } \gets \hat { \phi } _ { k } ^ { ( n ) } + \lambda _ { n } ( \nabla _ { \hat { \phi } _ { k } ^ { ( n ) } } \log G _ { 0 } ( \hat { \phi } _ { k } ^ { ( n ) } ) + \nabla _ { \hat { \phi } _ { k } ^ { ( n ) } } \log p ( x | \hat { \phi } _ { k } ^ { ( n ) } ) ) , } \end{array}
|
| 364 |
+
$$
|
| 365 |
+
|
| 366 |
+
where $\lambda _ { k } ^ { ( n ) }$ is a learning rate of component $k$ at step $n$ , which decreases as in the Robbins-Monro algorithm.
|
| 367 |
+
|
| 368 |
+
# B PRACTICAL ISSUES OF CN-DPM
|
| 369 |
+
|
| 370 |
+
CN-DPN is designed based on strong theoretical foundations, including the nonparametric Bayesian framework. In this section, we further discuss some practical issues of CN-DPM with intuitive explanations.
|
| 371 |
+
|
| 372 |
+
Bounded expansion of CN-DPM. The number of components in the DPM model is determined by the data distribution and the concentration parameter. If the true distribution consists of $K$ clusters, the number of effective components converges to $K$ under an appropriate concentration parameter $\alpha$ . Typically, the number of components is bounded by $O ( \alpha \log N )$ (Teh, 2010). Experiments in Appendix H empirically show that CN-DPM does not blindly increase the number of experts.
|
| 373 |
+
|
| 374 |
+
The continued increase in model capacity. Our model capacity keeps increasing as it learns new tasks. However, we believe this is one of the strengths of our method, since it may not make sense to use a fixed-capacity neural network to learn an indefinitely long sequence of tasks. The underlying assumption of using a fixed-capacity model is that the pre-set model capacity is adequate (at least not insufficient) to learn the incoming tasks. On the other hand, CN-DPM approaches the problem in a different direction: start small and add more as needed. This property is essential in task-free settings where the total number of tasks is not known. If there are too many tasks than expected, a fixed-capacity model would not be able to learn them successfully. Conversely, if there are fewer tasks than expected, resources would be wasted. We argue that expansion is a promising direction since it does not need to fix the model capacity beforehand. Moreover, we also introduce an algorithm to prune redundant experts in Appendix D,
|
| 375 |
+
|
| 376 |
+
Generality of the concentration parameter. The concentration parameter controls how sensitive the model is to new data. In other words, it determines the level of discrepancy between tasks, that makes the tasks modeled by distinct components. As an example, suppose that we are designing a hand-written alphabet classifier that continually learns in the real world. In the development, we only have the character images for half of the alphabets, i.e., from $\mathbf { \dot { a } } _ { } ^ { \dagger }$ to $\cdot _ { \mathrm { m } } \cdot$ . If we can find a good concentration parameter $\alpha$ for the data from $\mathbf { \dot { a } } _ { } ^ { \dagger }$ to $\cdot _ { \mathrm { m } } \cdot$ , the same $\alpha$ can work well with novel alphabets (i.e., from $\cdot _ { \mathrm { n } } \cdot$ to $\cdot _ { z } ,$ ) because the alphabets would have a similar level of discrepancies between tasks. Therefore, we do not need to access the whole data to determine $\alpha$ if the discrepancy between tasks is steady.
|
| 377 |
+
|
| 378 |
+
# C MODEL ARCHITECTURES AND EXPERIMENTAL DETAILS
|
| 379 |
+
|
| 380 |
+
# C.1 BASE MODELS
|
| 381 |
+
|
| 382 |
+
# C.1.1 SPLIT-MNIST
|
| 383 |
+
|
| 384 |
+
Following Hsu et al. (2018), we use two-hidden-layer MLP classifier with 400 hidden units per layer. For generation tasks, we use a simple VAE with the two-hidden-layer MLP encoder and decoder, where each layer contains 400 units. The dimension of the latent code is set to 32. We use ReLU for all intermediate activation functions.
|
| 385 |
+
|
| 386 |
+
# C.1.2 MNIST-SVHN AND SPLIT-CIFAR10/100
|
| 387 |
+
|
| 388 |
+
We use ResNet-18 (He et al., 2016). The input images are transformed to $3 2 \times 3 2$ RGB images.
|
| 389 |
+
|
| 390 |
+
# C.2 CN-DPM
|
| 391 |
+
|
| 392 |
+
# C.2.1 SPLIT-MNIST
|
| 393 |
+
|
| 394 |
+
For the classifiers in experts, we use a smaller version of the base MLP classifier. In the first expert, we set the number of hidden units per layer to 64. In the second or later experts, we introduce 16 new units per layer which are connected to the lower layers of the existing experts. For the encoder and decoder of VAEs, we use a two-layer MLP. The encoder is expanded in the same manner as the classifier. However, we do not share the parameters beyond the encoders; with a latent code of dimension 16, we use the two-hidden-layer MLP decoder as done in the classifier. For generation tasks, we double the size; for example, we set the size of initial and additional hidden units to 128 and 32, respectively.
|
| 395 |
+
|
| 396 |
+
# C.2.2 SPLIT-CIFAR10/100
|
| 397 |
+
|
| 398 |
+
The ResNet-18 base network has eight residual blocks. After passing through 2 residual blocks, the width and height of the feature are halved, and the number of channels is doubled. The initial number of channels is set to 64.
|
| 399 |
+
|
| 400 |
+
For the classifiers in CN-DPM, we use a smaller version of ResNet that has only four residual blocks and resizes the feature every block. The initial number of channels is set to 20 in the first expert, and four initial channels are added with a new expert. Thus, 4, 8, 16, and 32 channels are added for the four blocks. The first layer of each block is connected to the last layer of the previous block of prior experts.
|
| 401 |
+
|
| 402 |
+
For the VAEs, we use a simple CNN-based VAEs. The encoder has two $3 \times 3$ convolutions followed by two fully connected layers. Each convolution is followed by $2 \times 2$ max-pool and ReLU activation. The numbers of channels and hidden units are doubled after each layer. In the first expert, the first convolution outputs 32 channels, while four new channels are added with each new expert.
|
| 403 |
+
|
| 404 |
+
As done for the VAE in Split-MNIST, each expert’s VAE has an unshared decoder with a 64- dimensional latent code. The decoder is the mirrored encoder where $3 \times 3$ convolution is replaced by $4 \times 4$ transposed convolution with a stride of 2.
|
| 405 |
+
|
| 406 |
+
# C.2.3 MNIST-SVHN
|
| 407 |
+
|
| 408 |
+
For the classifier, we use ResNet-18 with 32 channels for the first expert and additional 32 channels for each new expert. We use the same VAE as in Split-CIFAR10.
|
| 409 |
+
|
| 410 |
+
# C.3 EXPERIMENTAL DETAILS
|
| 411 |
+
|
| 412 |
+
We use the classifier temperature parameter of 0.01 for Split-MNIST, Split-CIFAR10/100, and no temperature parameter on MNIST-SVHN. Weight decay 0.00001 has been used for every model in the paper. Gradients are clipped by value with a threshold of 0.5. All the CN-DPM models are trained by Adam optimizer. During the sleep phase, we train the new expert for multiple epochs with a batch size of 50. In classification tasks, we improve the density estimation of VAEs by sampling 16 latent codes and averaging the ELBOs, following Burda et al. (2015).
|
| 413 |
+
|
| 414 |
+
# C.3.1 SPLIT-MNIST
|
| 415 |
+
|
| 416 |
+
The learning rate of 0.0001 and 0.0004 has been used for the classifier and VAE of each expert in the classification task. We use learning rate 0.003 for the VAE of each expert in generation task. In the generation task, we decay the learning rate of the expert by 0.003 before it enters the wake phase. Following the existing works in VAE literature, we use binarized MNIST for the generation experiments. VAEs are trained to maximize Bernoulli log-likelihood in the generation task, while Gaussian log-likelihood is used for the classification task.
|
| 417 |
+
|
| 418 |
+
# C.3.2 SPLIT-CIFAR10
|
| 419 |
+
|
| 420 |
+
The learning rate of 0.005 and 0.0002 has been used for the classifier and VAE of each expert in CIFAR10. We decay the learning rate of the expert by 0.1 before it enters the wake phase. VAEs are trained to maximize Gaussian log-likelihood.
|
| 421 |
+
|
| 422 |
+
# C.3.3 SPLIT-CIFAR100
|
| 423 |
+
|
| 424 |
+
The learning rate of 0.0002 and 0.0001 has been used for the classifier and VAE of each expert in CIFAR10. We decay the learning rate of the expert by 0.2 before it enters the wake phase. VAEs are trained to maximize Gaussian log-likelihood.
|
| 425 |
+
|
| 426 |
+
# C.3.4 MNIST-SVHN
|
| 427 |
+
|
| 428 |
+
The learning rate of 0.0001 and 0.0003 has been used for the classifier and VAE of each expert in CIFAR10. We decay the learning rates of classifier and VAE of each expert by 0.5 and 0.1 before it enters the wake phase. VAEs are trained to maximize Gaussian log-likelihood.
|
| 429 |
+
|
| 430 |
+
# D PRUNING REDUNDANT EXPERTS
|
| 431 |
+
|
| 432 |
+
Lin (2013) propose a simple algorithm to prune and merge redundant components in DPM models. Following the basic principle of the algorithm, we provide a pruning algorithm for CN-DPM. First, we need to measure the similarities between experts to choose which expert to prune. We compute the log-likelihood $l _ { n k } = p ( x _ { n } , y _ { n } | \hat { \phi } _ { k } )$ of each expert $k$ for data $\left( x _ { 1 : N } , y _ { 1 : N } \right)$ . As a result, we can obtain $K$ vectors with $N$ dimensions. We define the similarity $s ( \boldsymbol { k } , \boldsymbol { k } ^ { \prime } )$ between two experts $k$ and $k ^ { \prime }$ as the cosine similarity between the two corresponding vectors $l . \boldsymbol { k }$ and ${ \mathit { l } } . _ { k ^ { \prime } }$ , i.e., $\begin{array} { r } { s ( k , k ^ { \prime } ) = \frac { l \cdot k \cdot l _ { \cdot k ^ { \prime } } } { | l _ { \cdot k } | | l _ { \cdot k ^ { \prime } } | } } \end{array}$ . If the similarity is greater than a certain threshold $\epsilon$ , we remove one of the experts with smaller $\begin{array} { r } { N _ { k } = \sum _ { n } \rho _ { n , k } . } \end{array}$ . The $N _ { k }$ data of the removed expert are added to the remaining experts.
|
| 433 |
+
|
| 434 |
+
Figure 4 shows an example of an expert pruning. We test CN-DPM on Split-MNIST with an $\alpha$ higher than the optimal value such that more than five experts are created. In this case, seven experts are created. If we build a similarity matrix as shown in Figure 4b, we can see which pair of experts are similar. We then threshold the matrix at 0.9 in Figure 4c and choose expert pairs (2/3) and $( 5 / 6 )$ for pruning. Comparing $N _ { k }$ within each pair, we can finally choose to prune expert 3 and 6. After pruning, the test accuracy marginally drops from $8 7 . 0 7 \%$ to $8 6 . 0 1 \%$ .
|
| 435 |
+
|
| 436 |
+

|
| 437 |
+
Figure 4: An example of the expert pruning in the Split-MNIST scenario.
|
| 438 |
+
|
| 439 |
+
# E COMPARISON WITH TASK-BASED METHODS ON SPLIT-MNIST
|
| 440 |
+
|
| 441 |
+
Table 4 compares our method with task-based methods for Split-MNIST classification. All the numbers except for our CN-DPM are excerpted from Hsu et al. (2018), in which all methods are trained for four epochs per task with a batch size of 128. Our method is trained for four epochs per task with a batch size of 10. The model architecture used in compared methods is the same as our baselines: a two-hidden-layer MLP with 400 hidden units per layer. All compared methods use a single output head, and the task information is given at training time but not at test time. For CN-DPM, we test two training settings where the first one uses task information to select experts, while the second one infers the responsible expert by the DPM principle. Task information is not given at test time in both cases.
|
| 442 |
+
|
| 443 |
+
Notice that regularization methods often suffer from catastrophic forgetting while replay methods yield decent accuracies. Even though the task-free condition is a far more difficult setting, the performance of our method is significantly better than regularization and replay methods that exploit the task description. If task information is available at train time, we can utilize it to improve the performance even more.
|
| 444 |
+
|
| 445 |
+
Table 4: Comparison with task-based methods on Split-MNIST classification. We report the average of 10 runs with $\pm$ standard error of the mean. The numbers except ours are from Hsu et al. (2018).
|
| 446 |
+
|
| 447 |
+
<table><tr><td>Type</td><td>Method</td><td>Task labels</td><td>Accuracy (%)</td></tr><tr><td rowspan="5">Regularization</td><td>EWC (Kirkpatrick et al.,2017)</td><td><<></td><td>19.80 ± 0.05</td></tr><tr><td>Online EWC (Schwarz et al.,2018)</td><td></td><td>19.77 ± 0.04</td></tr><tr><td>SI (Zenke et al., 2017)</td><td></td><td>19.67 ± 0.09</td></tr><tr><td>MAS (Aljundi et al., 2018)</td><td><</td><td>19.52 ± 0.04</td></tr><tr><td>LwF (Li & Hoiem, 2017)</td><td>√</td><td>24.17 ± 0.33</td></tr><tr><td rowspan="3">Replay</td><td>GEM (Lopez-Paz & Ranzato,2017)</td><td><</td><td>92.20 ± 0.12</td></tr><tr><td>DGR (Shin et al.,2017)</td><td>√</td><td>91.24 ± 0.33</td></tr><tr><td>RtF (van de Ven & Tolias,2018)</td><td>√</td><td>92.56 ± 0.21</td></tr><tr><td rowspan="2">Expansion</td><td>CN-DPM</td><td>√</td><td>93.81 ± 0.07</td></tr><tr><td>CN-DPM</td><td>×</td><td>93.70 ± 0.07</td></tr><tr><td></td><td>Upper bound (iid)</td><td></td><td>97.53 ± 0.30</td></tr></table>
|
| 448 |
+
|
| 449 |
+
Table 5: Fuzzy Split-MNIST
|
| 450 |
+
|
| 451 |
+
<table><tr><td>Method</td><td>Acc. (%)</td><td>Param.</td></tr><tr><td>Fine-tune</td><td>28.41± 0.52</td><td>478K</td></tr><tr><td>Reservoir</td><td>88.64±0.48</td><td>478K</td></tr><tr><td>CN-DPM</td><td>93.22 ± 0.07</td><td>524K</td></tr></table>
|
| 452 |
+
|
| 453 |
+

|
| 454 |
+
Figure 5: Scenario configuration of Fuzzy Split-MNIST
|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
Figure 6: Examples of generation samples by CN-DPM trained on Split-MNIST.
|
| 458 |
+
|
| 459 |
+
# F FUZZY SPLIT-MNIST
|
| 460 |
+
|
| 461 |
+
In addition, we experiment with the case where the task boundaries are not clearly defined, which we call Fuzzy-Split-MNIST. Instead of discrete task boundaries, we have transition stages between tasks where the data of existing and new tasks are mixed, but the proportion of the new task linearly increases. This condition adds another level of difficulty since it makes the methods unable to rely on clear task boundaries. The scenario is visualized in Figure 5. As shown in Table 5, CN-DPM can perform continual learning without task boundaries.
|
| 462 |
+
|
| 463 |
+
# G GENERATION OF SAMPLES
|
| 464 |
+
|
| 465 |
+
Even in discriminative tasks where the goal is to model $p ( y | x )$ , CN-DPM learns the joint distribution $p ( x , y )$ . Since CN-DPM is a complete generative model, it can generate $( x , y )$ pairs. To e first, i.e., ample oose $z$ from exper $p ( z )$ whiven led by the c first sample egorical distribution from the generator $\begin{array} { r } { \mathrm { C a t } ( \frac { N _ { 1 } } { N } , \frac { N _ { 2 } } { N } , . . . , \frac { N _ { K } } { N } ) } \end{array}$ $z = k$ $x$ $p ( x ; \phi _ { k } ^ { G } )$ , and then sample $y$ from the discriminator $p ( \boldsymbol { y } | \boldsymbol { x } ; \phi _ { k } ^ { D } )$ . Figure 6 presents 50 sample examples generated from a CN-DPM trained on Split-MNIST for a single epoch. We observe that CN-DPM successfully generates examples of all tasks with no catastrophic forgetting.
|
| 466 |
+
|
| 467 |
+
# H EXPERIMENTS WITH LONGER CONTINUAL LEARNING SCENARIOS
|
| 468 |
+
|
| 469 |
+
We present experiments with much longer continual learning scenarios on Split-MNIST, SplitCIFAR10 and Split-CIFAR100 in Table 6, 7 and 8, respectively. We report the average of 10 runs with $\pm$ standard error of the mean. To compare with the default 1-epoch scenario, we carry out experiments that repeat each task 10 times, which are denoted 10 Epochs. In addition, we also present the results of repeating the whole scenario 10 times, which are denoted 1 Epoch $\times I 0$ . For example, in Split-MNIST, the 10 Epochs scenario consists of 10-epoch 0/1, 10-epoch 2/3, ..., 10-epoch 8/9 tasks. On the other hand, the 1 Epoch $\times I 0$ scenario revisits each task multiple times, i.e., 1-epoch 0/1, 1-epoch 2/3, ..., 1-epoch 8/9, 1-epoch 0/1, ..., 1-epoch $8 / 9$ . We use the same hyperparameters tuned for the 1-epoch scenario.
|
| 470 |
+
|
| 471 |
+
We find that the accuracy of Reservoir drops as the length of each task increases. As mentioned in the main text, this phenomenon seems to be caused by overfitting on the samples in the replay memory. Since only a small number of examples in the memory represent each task, replaying them for a long period degrades the performance. On the other hand, the performance of our CN-DPM improves as the learning process is extended.
|
| 472 |
+
|
| 473 |
+
In the 1 Epoch $\times I O$ setting, CN-DPM shows similar performance with 10 Epoch since the model sees each data point 10 times in both scenarios. On the other hand, Reservoir’s scores in the 1 Epoch $\times I 0$ largely increase compared to both 1 Epoch and 10 Epoch This difference can be explained by how the replay memory changes while training progresses. In the 10 Epoch setting, if a task is finished, it is not visited again. Therefore, the examples of the task in the replay memory monotonically decreases, and the remaining examples are replayed repeatedly. As the training progresses, the model is overfitted to the old examples in the memory and fails to generalize in the old tasks. In contrast, in $I { E p o c h } \times I O$ setting, each task is revisited multiple times, and each time a task is revisited, the replay memory is also updated with the new examples of the task. Therefore, the overfitting problem in the old tasks is greatly relieved.
|
| 474 |
+
|
| 475 |
+
Another important remark is that CN-DPM does not blindly increase the number of experts. If we add a new expert at every constant steps, we would have 10 times more experts in the longer scenarios. However, this is not the case. CN-DPM determines whether it needs a new expert on a data-by-data basis such that the number of experts is determined by the task distribution, not by the length of training.
|
| 476 |
+
|
| 477 |
+
Table 6: Experiments with longer training episodes on Split-MNIST
|
| 478 |
+
|
| 479 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">1Epoch</td><td colspan="2">10 Epochs</td><td colspan="2">1 Epoch ×10</td></tr><tr><td>Acc. (%)</td><td>Param.</td><td>Acc. (%)</td><td>Param.</td><td>Acc. (%)</td><td>Param.</td></tr><tr><td>iid-offline</td><td>98.63 ± 0.01</td><td>478K</td><td>98.63 ± 0.01</td><td>478K</td><td>98.63 ± 0.01</td><td>478K</td></tr><tr><td>iid-online</td><td>96.18 ± 0.19</td><td>478K</td><td>97.67 ± 0.05</td><td>478K</td><td>97.67 ± 0.05</td><td>478K</td></tr><tr><td>Fine-tune</td><td>19.43 ± 0.02</td><td>478K</td><td>19.68 ± 0.01</td><td>478K</td><td>20.27± 0.26</td><td>478K</td></tr><tr><td>Reservoir</td><td>85.69 ± 0.48</td><td>478K</td><td>78.82 ± 0.71</td><td>478K</td><td>92.06 ± 0.11</td><td>478K</td></tr><tr><td>CN-DPM</td><td>93.23±0.09</td><td>524K</td><td>94.39 ± 0.04</td><td>524K</td><td>94.15 ± 0.04</td><td>616K</td></tr></table>
|
| 480 |
+
|
| 481 |
+
Table 7: Experiments with longer training episodes on Split-CIFAR10
|
| 482 |
+
|
| 483 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">1Epoch</td><td colspan="2">10Epochs</td><td colspan="2">1 Epoch ×10</td></tr><tr><td>Acc. (%)</td><td>Param.</td><td>Acc. (%)</td><td>Param.</td><td>Acc. (%)</td><td>Param.</td></tr><tr><td>iid-offline</td><td>93.17± 0.03</td><td>11.2M</td><td>93.17± 0.03</td><td>11.2M</td><td>93.17± 0.03</td><td>11.2M</td></tr><tr><td>iid-online</td><td>62.79 ± 1.30</td><td>11.2M</td><td>83.19 ±0.27</td><td>11.2M</td><td>83.19 ±0.27</td><td>11.2M</td></tr><tr><td>Fine-tune</td><td>18.08 ± 0.13</td><td>11.2M</td><td>19.31 ± 0.03</td><td>11.2M</td><td>19.33 ± 0.03</td><td>11.2M</td></tr><tr><td>Reservoir</td><td>44.00 ± 0.92</td><td>11.2M</td><td>43.82 ± 0.53</td><td>11.2M</td><td>51.44 ± 0.42</td><td>11.2M</td></tr><tr><td>CN-DPM</td><td>45.21 ± 0.18</td><td>4.60M</td><td>46.98 ± 0.18</td><td>4.60M</td><td>47.10 ± 0.16</td><td>4.60M</td></tr></table>
|
| 484 |
+
|
| 485 |
+
# I EXPERIMENTS WITH DIFFERENT MEMORY SIZES
|
| 486 |
+
|
| 487 |
+
In Split-CIFAR10/100 experiments in the main text, we set the memory size of Reservoir and CNDPM to 1000, following Aljundi et al. (2019b). Table 9 compares the experimental results with different memory sizes of 500 and 1000 on Split-CIFAR10/100. Compared to Reservoir, whose performance drops significantly with smaller memory, CN-DPM’s accuracy drop is relatively marginal.
|
| 488 |
+
|
| 489 |
+
Table 8: Experiments with longer training episodes on Split-CIFAR100
|
| 490 |
+
|
| 491 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">1 Epoch</td><td colspan="2">10 Epochs</td><td colspan="2">1Epoch ×10</td></tr><tr><td>Acc. (%)</td><td>Param.</td><td>Acc. (%)</td><td>Param.</td><td>Acc. (%)</td><td>Param.</td></tr><tr><td>iid-offline</td><td>73.80 ± 0.11</td><td>11.2M</td><td>73.80 ± 0.11</td><td>11.2M</td><td>73.80 ± 0.11</td><td>11.2M</td></tr><tr><td>iid-online</td><td>20.46± 0.30</td><td>11.2M</td><td>54.58±0.27</td><td>11.2M</td><td>54.58±0.27</td><td>11.2M</td></tr><tr><td>Fine-tune</td><td>2.43±0.05</td><td>11.2M</td><td>3.99 ± 0.03</td><td>11.2M</td><td>4.30±0.02</td><td>11.2M</td></tr><tr><td>Reservoir</td><td>10.01 ± 0.35</td><td>11.2M</td><td>6.61± 0.20</td><td>11.2M</td><td>14.53 ± 0.35</td><td>11.2M</td></tr><tr><td>CN-DPM</td><td>20.10± 0.12</td><td>19.2M</td><td>20.95 ±0.09</td><td>19.2M</td><td>20.67± 0.13</td><td>19.2M</td></tr></table>
|
| 492 |
+
|
| 493 |
+
Table 9: Experiments with different memory sizes.
|
| 494 |
+
|
| 495 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Memory</td><td colspan="2">Split-CIFAR10 Acc. (%)</td><td colspan="2">Split-CIFAR100 Acc. (%)</td></tr><tr><td>1Epoch</td><td>10 Epoch</td><td>1 Epoch</td><td>10 Epoch</td></tr><tr><td>Reservoir</td><td>500</td><td>33.53 ± 1.03</td><td>34.46 ± 0.49</td><td>6.24±0.25</td><td>4.99 ± 0.09</td></tr><tr><td>CN-DPM</td><td>500</td><td>43.07 ± 0.16</td><td>47.01± 0.22</td><td>19.17 ± 0.13</td><td>20.77 ± 0.11</td></tr><tr><td>Reservoir</td><td>1000</td><td>44.00 ±0.92</td><td>43.82 ± 0.53</td><td>10.01± 0.35</td><td>6.61± 0.20</td></tr><tr><td>CN-DPM</td><td>1000</td><td>45.21± 0.18</td><td>46.98 ± 0.18</td><td>20.10 ± 0.12</td><td>20.95 ± 0.09</td></tr></table>
|
| 496 |
+
|
| 497 |
+
# J THE EFFECT OF CONCENTRATION PARAMETER
|
| 498 |
+
|
| 499 |
+
Table 10 shows the results of CN-DPM on Split-MNIST classification according to the concentration parameter $\alpha$ , which defines the prior of how sensitive CN-DPM is to new data. With a higher $\alpha$ , an expert tends to be created more easily. In the experiment reported in the prior sections, we set $\log \alpha = - 4 0 0$ . At $\log \alpha = - 6 0 0$ , too few experts are created, and the accuracy is rather low. As $\alpha$ increases, the number of experts grows along with the accuracy. Although the CN-DPM model is task-free and automatically decides the task assignments to experts, we still need to tune the concentration parameter to find the best balance point between performance and model capacity, as all Bayesian nonparametric models require.
|
| 500 |
+
|
| 501 |
+
Table 10: The effects of concentration parameter $\alpha$ .
|
| 502 |
+
|
| 503 |
+
<table><tr><td>loga</td><td>Acc. (%)</td><td>Experts</td><td>Param.</td></tr><tr><td>-600</td><td>54.04 ± 2.22</td><td>3.20 ± 0.13</td><td>362K</td></tr><tr><td>-400</td><td>93.23 ± 0.09</td><td>5.00± 0.00</td><td>524K</td></tr><tr><td>80</td><td>93.54 ± 0.21</td><td>14.4 ± 1.35</td><td>1.44M</td></tr></table>
|
| 504 |
+
|
| 505 |
+

|
| 506 |
+
Figure 7: The effects of concentration parameter $\alpha$ .
|
| 507 |
+
|
| 508 |
+
# K THE EFFECT OF PARAMETER SHARING
|
| 509 |
+
|
| 510 |
+
Table 11 compares when the parameters are shared between experts and when they are not shared. By sharing the parameters, we could reduce the number of parameters by approximately $38 \%$ without sacrificing accuracy.
|
| 511 |
+
|
| 512 |
+
Table 11: The effects of parameter sharing.
|
| 513 |
+
|
| 514 |
+
<table><tr><td>Model</td><td>Acc. (%)</td><td>Experts</td><td>Param.</td></tr><tr><td>CN-DPM</td><td>93.23± 0.09</td><td>5</td><td>524K</td></tr><tr><td>CN-DPM w/o PS</td><td>93.30 ± 0.24</td><td>5</td><td>839K</td></tr></table>
|
| 515 |
+
|
| 516 |
+
# L TRAINING GRAPHS
|
| 517 |
+
|
| 518 |
+
Figure 8 shows the training graphs of our experiments. In addition to the performance metrics, we present the number of experts in CN-DPM and compare the total number of parameters with the baselines. The bold lines represent the average of the 10 runs while the faint lines represent individual runs.
|
| 519 |
+
|
| 520 |
+
Figure 9 and Figure 10 show how the accuracy of each task changes during training. We also present the average accuracy of learned tasks at the bottom right.
|
| 521 |
+
|
| 522 |
+
# M COMPARISON WITH THE CURL
|
| 523 |
+
|
| 524 |
+
Continual Unsupervised Representation Learning (CURL) (Rao et al., 2019) is a parallel work that shares some characteristics with our CN-DPM in terms of model expansion and short-term memory. However, there are several key differences that distinguish our method from CURL, which will be elaborated in this section. Following the notations of Rao et al. (2019), here $y$ denotes the cluster assignment, and $z$ denotes the latent variable.
|
| 525 |
+
|
| 526 |
+
1. The Generative Process. The primary goal of CURL is to continually learn a unified latent representation $z$ , which is shared across all tasks. Therefore, the generative model of CURL explicitly consists of the latent variable $z$ as summarized as follows:
|
| 527 |
+
|
| 528 |
+
$$
|
| 529 |
+
\begin{array} { r } { \iota ( x , y , z ) = p ( y ) p ( z | y ) p ( x | z ) \mathrm { ~ w h e r e ~ } y \sim \mathrm { C a t } ( \pi ) , z \sim { \mathcal N } ( \mu _ { z } ( y ) , \sigma _ { z } ^ { 2 } ( y ) ) , x \sim \mathrm { B e r n o u l l i } ( \mu _ { x } ( z ) ) . } \end{array}
|
| 530 |
+
$$
|
| 531 |
+
|
| 532 |
+
The overall distribution of $z$ is the mixture of Gaussians, and $z$ includes the information of $y$ such that $x$ and $y$ are conditionally independent given $z$ . Then, $z$ is fed into a single decoder network $\mu _ { x }$ to generate the mean of $x$ , which is modeled by a Bernoulli distribution. On the other hand, the generative version of CN-DPM, which does not include classifiers, has a simpler generative process:
|
| 533 |
+
|
| 534 |
+
$$
|
| 535 |
+
p ( x , y ) = p ( y ) p ( x | y ) { \mathrm { ~ w h e r e ~ } } y \sim \operatorname { C a t } ( \pi ) , x \sim p ( x | y ) .
|
| 536 |
+
$$
|
| 537 |
+
|
| 538 |
+
The choice of $p ( x | y )$ here is not necessarily restricted to VAEs (Kingma & Welling, 2014); one may use other kinds of explicit density models such as PixelRNN (Oord et al., 2016). Even if we use VAEs to model $p ( x | y )$ , the generative process is different from CURL:
|
| 539 |
+
|
| 540 |
+
$$
|
| 541 |
+
p ( x , y , z ) = p ( y ) p ( z ) p ( x | y , z ) { \mathrm { ~ w h e r e ~ } } y \sim \operatorname { C a t } ( \pi ) , z \sim \mathcal { N } ( 0 , I ) , x \sim { \mathrm { B e r n o u l l i } } ( \mu _ { x } ^ { y } ( z ) ) .
|
| 542 |
+
$$
|
| 543 |
+
|
| 544 |
+
Unlike CURL, CN-DPM generates $y$ and $z$ independently and maintains a separate decoder $\mu _ { x } ^ { y }$ for each cluster $y$ .
|
| 545 |
+
|
| 546 |
+
2. The Necessity for Generative Replay in CURL. CURL periodically saves a copy of its parameters and use it to generate samples of learned distribution. The generated samples are played together with new data such that the main model does not forget previously learned knowledge. This process is called generative replay. The generative replay is an essential element in CURL, unlike our CN-DPM. CURL assumes a factorized variational posterior $q ( y , z | x ) = q ( y | x ) q ( z | x , y )$ where $q ( y | x )$ and $q ( z | x , y )$ are modeled by separate output heads of the encoder neural network. However, the output head for $\dot { \mathbf { \zeta } } q ( y | x )$ is basically a gating network that could be vulnerable to catastrophic forgetting, as mentioned in Section 3.1. Moreover, CURL shares a single decoder $\mu _ { x }$ across all tasks. As a consequence, expansion alone is not enough to stop catastrophic forgetting, and CURL needs another CL method to prevent catastrophic forgetting in the shared components. This is the main reason why the generative replay is crucial in CURL. As shown in the ablation test of Rao et al. (2019), the performance of CURL drops without the generative replay. In contrast, the components of CN-DPM are separated for each task (although they may share low-level representations) such that no additional treatment is needed.
|
| 547 |
+
|
| 548 |
+

|
| 549 |
+
Figure 8: Full training graphs.
|
| 550 |
+
|
| 551 |
+

|
| 552 |
+
Figure 9: Accuracy for each task in Split-CIFAR10.
|
| 553 |
+
|
| 554 |
+

|
| 555 |
+
Figure 10: Accuracy for each task in Split-CIFAR100.
|
md/train/SklD9yrFPS/SklD9yrFPS.md
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEURAL TANGENTS: FAST AND EASY INFINITE NEURAL NETWORKS IN PYTHON
|
| 2 |
+
|
| 3 |
+
Roman Novak∗, Lechao Xiao∗, Jiri Hron†, Jaehoon Lee,
|
| 4 |
+
|
| 5 |
+
Alexander A. Alemi, Jascha Sohl-Dickstein, Samuel S. Schoenholz∗
|
| 6 |
+
|
| 7 |
+
Google Brain, †University of Cambridge
|
| 8 |
+
|
| 9 |
+
{romann, xlc}@google.com, jh2084@cam.ac.uk, {jaehlee, alemi, jaschasd, schsam}@google.com
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
NEURAL TANGENTS is a library for working with infinite-width neural networks. It provides a high-level API for specifying complex and hierarchical neural network architectures. These networks can then be trained and evaluated either at finitewidth as usual or in their infinite-width limit. Infinite-width networks can be trained analytically using exact Bayesian inference or using gradient descent via the Neural Tangent Kernel. Additionally, NEURAL TANGENTS provides tools to study gradient descent training dynamics of wide but finite networks in either function space or weight space.
|
| 14 |
+
|
| 15 |
+
The entire library runs out-of-the-box on CPU, GPU, or TPU. All computations can be automatically distributed over multiple accelerators with near-linear scaling in the number of devices. NEURAL TANGENTS is available at
|
| 16 |
+
|
| 17 |
+
www.github.com/google/neural-tangents
|
| 18 |
+
|
| 19 |
+
We also provide an accompanying interactive Colab notebook1.
|
| 20 |
+
|
| 21 |
+
# 1 INTRODUCTION
|
| 22 |
+
|
| 23 |
+
Deep neural networks (DNNs) owe their success in part to the broad availability of high-level, flexible, and efficient software libraries like Tensorflow (Abadi et al., 2015), Keras (Chollet et al., 2015), PyTorch.nn (Paszke et al., 2017), Chainer (Tokui et al., 2015; Akiba et al., 2017), JAX (Bradbury et al., 2018a), and others. These libraries enable researchers to rapidly build complex models by constructing them out of smaller primitives. The success of new machine learning approaches will similarly depend on developing sophisticated software tools to support them.
|
| 24 |
+
|
| 25 |
+
# 1.1 INFINITE-WIDTH BAYESIAN NEURAL NETWORKS
|
| 26 |
+
|
| 27 |
+
Recently, a new class of machine learning models has attracted significant attention, namely, deep infinitely wide neural networks. In the infinite-width limit, a large class of Bayesian neural networks become Gaussian Processes (GPs) with a specific, architecture-dependent, compositional kernel; these models are called Neural Network Gaussian Processes (NNGPs). This correspondence was first established for shallow fully-connected networks by Neal (1994) and was extended to multilayer setting in (Lee et al., 2018; Matthews et al., 2018b). Since then, this correspondence has been expanded to a wide range of nonlinearities (Matthews et al., 2018a; Novak et al., 2019) and architectures including those with convolutional layers (Garriga-Alonso et al., 2019; Novak et al., 2019), residual connections (Garriga-Alonso et al., 2019), pooling (Novak et al., 2019), as well as graph neural networks (Du et al., 2019). The results for individual architectures have subsequently been generalized, and it was shown that a GP correspondence holds for a general class of networks that can be mapped to so-called tensor programs in (Yang, 2019). The recurrence relationship defining the NNGP kernel has additionally been extensively studied in the context of mean field theory and initialization (Cho & Saul, 2009; Daniely et al., 2016; Poole et al., 2016; Schoenholz et al., 2016; Yang & Schoenholz, 2017; Xiao et al., 2018; Li & Nguyen, 2019; Pretorius et al., 2018; Hayou et al., 2018; Karakida et al., 2018; Blumenfeld et al., 2019; Hayou et al., 2019).
|
| 28 |
+
|
| 29 |
+
# 1.2 INFINITE-WIDTH NEURAL NETWORKS TRAINED BY GRADIENT DESCENT
|
| 30 |
+
|
| 31 |
+
In addition to enabling a closed form description of Bayesian neural networks, the infinite-width limit has also very recently provided insights into neural networks trained by gradient descent. In the last year, several papers have shown that randomly initialized neural networks trained with gradient descent are characterized by a distribution that is related to the NNGP, and is described by the so-called Neural Tangent Kernel (NTK) (Jacot et al., 2018; Lee et al., 2019; Chizat et al., 2019), a kernel which was implicit in some earlier papers (Li & Liang, 2018; Allen-Zhu et al., 2018; Du et al., 2018a;b; Zou et al., 2019). In addition to this “function space” perspective, a dual, “weight space” view on the wide network limit was proposed in Lee et al. (2019) which showed that networks under gradient descent were well-described by the first-order Taylor series about their initial parameters.
|
| 32 |
+
|
| 33 |
+
# 1.3 PROMISE AND PRACTICAL BARRIERS TO WORKING WITH INFINITE-WIDTH NETWORKS
|
| 34 |
+
|
| 35 |
+
Combined, these discoveries established infinite-width networks as useful theoretical tools to understand a wide range of phenomena in deep learning. Furthermore, the practical utility of these models has been proven by achieving state-of-the-art performance on image classification benchmarks among GPs without trainable kernels (Garriga-Alonso et al., 2019; Novak et al., 2019; Arora et al., 2019a), and by their ability to match or exceed the performance of finite width networks in some situations, especially for fully- and locally-connected model families (Lee et al., 2018; Novak et al., 2019; Arora et al., 2019b).
|
| 36 |
+
|
| 37 |
+
However, despite their utility, using NNGPs and NTK-GPs is arduous and can require weeks-tomonths of work by seasoned practitioners. Kernels corresponding to neural networks must be derived by hand on a per-architecture basis. Overall, this process is laborious and error prone, and is reminiscent of the state of neural networks before high quality Automatic Differentiation (AD) packages proliferated.
|
| 38 |
+
|
| 39 |
+
# 1.4 SUMMARY OF CONTRIBUTIONS
|
| 40 |
+
|
| 41 |
+
In this paper, we introduce a new open-source software library called NEURAL TANGENTS targeting JAX (Bradbury et al., 2018a) to accelerate research on infinite limits of neural networks. The main features of NEURAL TANGENTS are:2
|
| 42 |
+
|
| 43 |
+
• A high-level neural network API for specifying complex, hierarchical, models. Networks specified using this API can have their infinite-width NNGP kernel and NTK evaluated analytically (§2.1, Listings $1 , 2 , 3 , \ S \mathrm { B } . 2 )$ .
|
| 44 |
+
• Functions to approximate infinite-width kernels by Monte Carlo sampling for networks whose kernels cannot be constructed analytically. These methods are agnostic to the neural network library used to build the network and are therefore quite versatile (§2.2, Figure 2, $\ S _ { \mathrm { B } . 5 ) }$ .
|
| 45 |
+
• An API to analytically perform inference using infinite-width networks either by computing the Bayesian posterior or by computing the result of continuous gradient descent with an MSE loss. The API additionally includes tools to perform inference by numerically solving the ODEs corresponding to: continuous gradient descent, with-or-without momentum, on arbitrary loss functions, at finite or infinite time (§2.1, Figure 1, §B.4).
|
| 46 |
+
• Functions to compute arbitrary-order Taylor series approximations to neural networks about a given setting of parameters to explore the weight space perspective on the infinite-width limit (§B.6, Figure 6).
|
| 47 |
+
• Leveraging XLA, our library runs out-of-the-box on CPU, GPU, or TPU. Kernel computations can automatically be distributed over multiple accelerators with near-perfect scaling (§3.2, Figure 5, §B.3).
|
| 48 |
+
|
| 49 |
+
We begin with three short examples (§2) that demonstrate the ease, efficiency, and versatility of performing calculations with infinite networks using NEURAL TANGENTS. With a high level view of the library in hand, we then dive into a number of technical aspects of our library (§3).
|
| 50 |
+
|
| 51 |
+
# 1.5 BACKGROUND
|
| 52 |
+
|
| 53 |
+
We briefly describe the NNGP (§1.1) and NTK (§1.2). NNGP. Neural networks are often structured as affine transformations followed by pointwise applications of nonlinearities. Let $z _ { i } ^ { l } ( x )$ describe the $i ^ { \mathrm { { t h } } }$ pre-activation following a linear transformation in $l ^ { \mathrm { t h } }$ layer of a neural network. At initialization, the parameters of the network are randomly distributed and so central-limit theorem style arguments can be used to show that the pre-activations become Gaussian distributed with mean zero and are therefore described entirely by their covariance matrix $\mathcal { K } ( x , x ^ { \prime } ) = \mathbb { E } [ z _ { i } ^ { l } ( x ) z _ { i } ^ { l } ( x ^ { \prime } ) ]$ . This describes a NNGP with the kernel, $\boldsymbol { \kappa } ( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } )$ . One can use the NNGP to make Bayesian posterior predictions at a test point, $x$ , which are Gaussian distributed with with mean $\mu ( x ) \overset { \cdot } { = } \mathcal { K } ( x , \overset { \cdot } { \mathcal { X } } ) \mathcal { K } ( \mathcal { X } , \overset { \cdot } { \mathcal { X } } ) ^ { - 1 } \mathcal { Y }$ and variance $\overset { \vartriangle } { \boldsymbol { \sigma } ^ { 2 } } ( \boldsymbol { x } ) = \boldsymbol { { K } } ( \boldsymbol { x } , \boldsymbol { x } ) - \boldsymbol { { K } } ( \boldsymbol { x } , \boldsymbol { \mathcal { X } } ) \boldsymbol { { K } } ( \boldsymbol { \mathcal { X } } , \boldsymbol { \mathcal { X } } ) ^ { - 1 } \boldsymbol { { K } } ( \boldsymbol { \mathcal { X } } , \boldsymbol { x } )$ , where $( \mathcal { X } , \mathcal { Y } )$ is the training set of inputs and targets respectively. NTK. When neural networks are optimized using continuous gradient descent with learning rate $\eta$ on mean squared error (MSE) loss, the function evaluated on training points evolves as $\bar { \partial _ { t } } f _ { t } ( \boldsymbol { \mathcal { X } } ) \stackrel { } { = } - \eta J _ { t } ( \boldsymbol { \mathcal { X } } ) \boldsymbol { \bar { J } } _ { t } ( \boldsymbol { \mathcal { X } } ) ^ { T } \left( f _ { t } ( \boldsymbol { \mathcal { X } } ) - \boldsymbol { \mathcal { Y } } \right)$ where $J _ { t } ( \mathcal { X } )$ is the Jacobian of the output $f _ { t }$ evaluated at $\mathcal { X }$ and $\Theta _ { t } ( \chi , \chi ) = J _ { t } ( \chi ) J _ { t } ( \chi ) ^ { T }$ is the NTK. In the infinite-width limit, the NTK remains constant ( $\Theta _ { t } = \Theta$ ) throughout training and the time-evolution of the outputs can be solved in closed form as a Gaussian with mean $f _ { t } ( x ) { \overset { \vartriangle } { = } } \Theta ( x , \chi ) \Theta ( \chi , \chi ) ^ { - 1 } \left( I - \exp \left[ { \bar { - } } \eta \Theta ( \chi , \chi ) t \right] \right) \mathcal { V }$ .
|
| 54 |
+
|
| 55 |
+
# 2 EXAMPLES
|
| 56 |
+
|
| 57 |
+
We begin by applying NEURAL TANGENTS to several example tasks. While these tasks are designed for pedagogy rather than research novelty, they are nonetheless emblematic of problems regularly faced in research. We emphasize that without NEURAL TANGENTS, it would be necessary to derive the kernels for each architecture by hand.
|
| 58 |
+
|
| 59 |
+
# 2.1 INFERENCE WITH AN INFINITELY WIDE NEURAL NETWORK
|
| 60 |
+
|
| 61 |
+
We begin by training an infinitely wide neural network with gradient descent and comparing the result to training an ensemble of wide-but-finite networks. This example is worked through in detail in the Colab notebook.3
|
| 62 |
+
|
| 63 |
+
We train on a synthetic dataset with training data drawn from the process $y _ { i } = \sin ( x _ { i } ) + \epsilon _ { i }$ with $x _ { i } \sim \mathrm { U n i f o r m } ( - \pi , \pi )$ and $\epsilon _ { i } \sim \mathcal { N } ( 0 , \sigma ^ { 2 } )$ independently and identically distributed. To train an infinite neural network with Erf activations4 on this data using gradient descent and an MSE loss we write the following:
|
| 64 |
+
|
| 65 |
+
<table><tr><td> from neural_tangents import predict, stax</td></tr><tr><td>init_fn,apply_fn,kernel_fn = stax.serial(</td></tr><tr><td>stax.Dense(2048,W_std=1.5,b_std=0.05),stax.Erf(),</td></tr><tr><td>stax.Dense(2048,W_std=1.5,b_std=0.05),stax.Erf(),</td></tr><tr><td>stax.Dense(1,W_std=1.5,b_std=0.05))</td></tr><tr><td>y_mean,y_var = predict.gp_inference(kernel_fn,x_train,y_train,x_test,'ntk',</td></tr><tr><td>diag_reg=1e-4, compute_cov=True)</td></tr></table>
|
| 66 |
+
|
| 67 |
+
The above code analytically generates the predictions that would result from performing gradient descent for an infinite amount of time. However, it is often desirable to investigate finite-time learning dynamics of deep networks. This is also supported in NEURAL TANGENTS as illustrated in the following snippet:
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 1: Training dynamics for an ensemble of finite-width networks compared with an infinite network. Left: Mean and variance of the train and test MSE loss evolution throughout training. Right: Comparison between the predictions of the trained infinite network and the respective ensemble of finite-width networks. The shaded region and the dashed lines denote two standard deviations of uncertainty in the predictions for the infinite network and the ensemble respectively.
|
| 71 |
+
|
| 72 |
+
predict_fn $=$ predict.gradient_descent_mse_gp(kernel_fn, x_train, y_train, x_test, 'ntk', diag_reg=1e-4, compute_cov=True) y_mean, y_var $=$ predict_fn $t = 1 0 0$ ) # Predict the distribution at $t ~ = ~ 1 0 0$ .
|
| 73 |
+
|
| 74 |
+
The above specification set the hidden layer widths to 2048, which has no effect on the infinite width network inference, but the init_fn and apply_fn here correspond to ordinary finite width networks. In Figure 1 we compare the result of this exact inference with training an ensemble of one-hundred of these finite-width networks by looking at the training curves and output predictions of both models. We see excellent agreement between exact inference using the infinite-width model and the result of training an ensemble using gradient descent.
|
| 75 |
+
|
| 76 |
+
# 2.2 AN INFINITELY WIDERESNET
|
| 77 |
+
|
| 78 |
+
The above example considers a relatively simple network on a synthetic task. In practice we may want to consider real-world architectures, and see how close they are to their infinite-width limit. For this task we study a variant of an infinite-channel Wide Residual Network (Zagoruyko & Komodakis, 2016) (WRN-28- $\infty$ ). We first define both finite and infinite models within Listing 1.
|
| 79 |
+
|
| 80 |
+
We now study how quickly the kernel of the finite-channel WideResNet approaches its infinite channel limit. We explore two different axes along which convergence takes place: first, as a function of the number of channels (as measured by the widening factor, $k$ ) and second as a function of the number of finite-network Monte Carlo samples we average over. NEURAL TANGENTS makes it easy to compute MC averages of finite kernels using the following snippet:
|
| 81 |
+
|
| 82 |
+
<table><tr><td>kernel_fn = nt.monte_carlo_kernel_fn(init_fn,apply_fn,rng_key,n_samples) sampled_kernel = kernel_fn(x,x)</td></tr></table>
|
| 83 |
+
|
| 84 |
+
The convergence is shown in Figure 2. We see that as both the number of samples is increased or the network is made wider, the empirical kernel approaches the kernel of the infinite network. As noted in Novak et al. (2019), for any finite widening factor the MC estimate is biased. Here, however, the bias is small relative to the variance and the distance to the empirical kernel decreases with the number of samples.
|
| 85 |
+
|
| 86 |
+
# 2.3 COMPARISON OF NEURAL NETWORK ARCHITECTURES AND TRAINING SET SIZES
|
| 87 |
+
|
| 88 |
+
The above examples demonstrate how one might construct a complicated architecture and perform inference using NEURAL TANGENTSNext we train a range of architectures on CIFAR-10 and compare ˙ their performance as a function of dataset size. In particular, we compare a fully-connected network, a convolutional network whose penultimate layer vectorizes the image, and the wide-residual network described above. In each case, we perform exact infinite-time inference using the analytic infinitewidth NNGP or NTK. For each architecture we perform a hyperparameter search over the depth of the network, selecting the depth that maximizes the marginal log likelihood on the training set.
|
| 89 |
+
|
| 90 |
+
<table><tr><td>def WideResNetBlock(channels,strides=(1,1),channel_mismatch=False): Main = stax.serial(stax.Relu(),stax.Conv(channels,(3,3),strides,padding='SAME'),</td></tr><tr><td>stax.Relu(),stax.Conv(channels,(3,3),padding='SAME'))</td></tr><tr><td>Shortcut = (stax.Identity() if not channel_mismatch else</td></tr><tr><td>stax.Conv(channels,(3,3),strides,padding='SAME'))</td></tr><tr><td>return stax.serial(stax.FanOut(2),stax.parallel(Main, Shortcut),stax.FanInSum())</td></tr><tr><td>def WideResNetGroup(n,channels,strides=(1,1)):</td></tr><tr><td>blocks = [WideResNetBlock(channels,strides,channel_mismatch=True)] for _ in range(n - 1):</td></tr><tr><td>blocks += [WideResNetBlock(channels,(1,1))]</td></tr><tr><td>return stax.serial(*blocks)</td></tr><tr><td>def WideResNet(block_size,k,num_classes):</td></tr><tr><td>return stax.serial(stax.Conv(16,(3,3),padding='SAME'),</td></tr><tr><td>WideResNetGroup(block_size,int(16 * k)),</td></tr><tr><td>WideResNetGroup(block_size,int(32 * k),(2,2)),</td></tr><tr><td></td></tr><tr><td>WideResNetGroup(block_size,int(64 * k),(2,2)),</td></tr><tr><td>stax.GlobalAvgPool(),stax.Dense(num_classes))</td></tr></table>
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Listing 1: Definition of an infinitely WideResNet. This snippet simultaneously defines a finite ( init_fn, apply_fn ) and an infinite ( kernel_fn ) model. This model is used in Figures 2 and 3.
|
| 94 |
+
Figure 2: Convergence of the Monte Carlo (MC) estimates of the WideResNet WRN-28- $k$ (where $k$ is the widening factor) NNGP and NTK kernels (computed with monte_carlo_kernel_fn ) to their analytic values (WRN-28- $\mathbf { \nabla } \cdot \infty$ , computed with kernel_fn ), as the network gets wider by increasing the widening factor (vertical axis) and as more random networks are averaged over (horizontal axis). Experimental detail. The kernel is computed in 32-bit precision on a $1 0 0 \times 5 0$ batch of $8 \times 8$ -downsampled CIFAR10 (Krizhevsky, 2009) images. For sampling efficiency, for NNGP the output of the penultimate layer was used, and for NTK the output layer was assumed to be of dimension 1 (all logits are i.i.d. conditioned on a given input). The displayed distance is the relative Frobenius norm squared, i.e. $\| \mathcal { K } - \mathcal { K } _ { k , n } \| _ { \mathrm { F } } ^ { 2 } / \| \mathcal { K } \| _ { \mathrm { F } } ^ { 2 }$ , where $k$ is the widening factor and $n$ is the number of samples.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 3: CIFAR-10 classification with varying neural network architectures. NEURAL TANGENTS simplify experimentation with architectures. Here we use infinite time NTK inference and full Bayesian NNGP inference for CIFAR-10 for Fully Connected (FC, Listing 3), Convolutional network without pooling (CONV, Listing 2), and Wide Residual Network w/ pooling (WRESNET, Listing 1). As is common in prior work (Lee et al., 2018; Novak et al., 2019), the classification task is treated as MSE regression on zero-mean targets like $( - 0 . 1 , \ldots , - 0 . 1 , 0 . 9 , - 0 . 1 , \ldots , - 0 . 1 )$ . For each training set size, the best model in the family is selected by minimizing the mean negative marginal log-likelihood (NLL, right) on the training set.
|
| 98 |
+
|
| 99 |
+
The results are shown in Figure 3. We see that in each case the performance of the model increases approximately logarithmically in the size of the dataset. Moreover, we observe a clear hierarchy of performance, especially at large dataset size, in terms of architecture (FC < CONV $<$ WRESNET w/ pooling).
|
| 100 |
+
|
| 101 |
+
# 3 IMPLEMENTATION: TRANSFORMING TENSOR OPS TO KERNEL OPS
|
| 102 |
+
|
| 103 |
+
Neural networks are compositions of basic tensor operations such as: dense or convolutional affine transformations, application of pointwise nonlinearities, pooling, or normalization. For most networks without weight tying between layers the kernel computation can also be written compositionally and there is a direct correspondence between tensor operations and kernel operations (see $\ S$ for an example). The core logic of NEURAL TANGENTS is a set of translation rules, that sends each tensor operation acting on a finite-width layer to a corresponding transformation of the kernel for an infinite-width network. This is illustrated in Figure 4 for a simple convolutional architecture. In the associated table, we compare tensor operations (second column) with corresponding transformations of the NT and NNGP kernel tensors (third and fourth column respectively). See $\ S _ { \mathrm { D } }$ for a list of all tensor operations for which translation rules are currently implemented.
|
| 104 |
+
|
| 105 |
+
One subtlety to consider when designing networks is that most infinite-width results require nonlinear transformations to be preceded by affine transformations (either dense or convolutional). This is because infinite-width results often assume that the pre-activations of nonlinear layers are approximately Gaussian. Randomness in weights and biases causes the output of infinite affine layers to satisfy this Gaussian requirement. Fortunately, prefacing nonlinear operations with affine transformations is common practice when designing neural networks and NEURAL TANGENTS will raise an error if this requirement is not satisfied.
|
| 106 |
+
|
| 107 |
+
# 3.1 A TASTE OF TENSOR-TO-KERNEL OPS TRANSLATION
|
| 108 |
+
|
| 109 |
+
To get some intuition behind the translation rules, we consider the case of a nonlinearity followed by a dense layer. Let $z = z \left( \mathcal { X } , \theta \right) \in \mathbb { R } ^ { d \times n }$ be the preactivations resulting from $d$ distinct inputs at a node in some hidden layer of a neural network. Suppose $z$ has NNGP kernel and NTK given by
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\mathcal { K } _ { z } = \mathbb { E } _ { \theta } \left[ z _ { i } z _ { i } ^ { T } \right] , \quad \Theta _ { z } = \mathbb { E } _ { \theta } \left[ \frac { \partial z _ { i } } { \partial \theta } \left( \frac { \partial z _ { i } } { \partial \theta } \right) ^ { T } \right]
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $z _ { i } ~ \in ~ \mathbb { R } ^ { d }$ is the $i ^ { \mathrm { { t h } } }$ neuron and $\theta$ are the parameters in the network up until $z$ . Here $d$ is the cardinality of the network inputs $\mathcal { X }$ and $n$ is the number of neurons in the $z$ node. We nonlinear interactions between spatially-distant pixels at shallow depths (left). Values are rep• Pooling enforces translation-invariant Figure 4: An example of the translation of a convolutional neural network into a sequence of on a 2K/4K train/validation subsets of CIFAR10. See §A.7.3 for experimental details.• For other architectures we use a Monte Carlo approach. Sampling finite random networks of a given architecture and predictions in both CNNs and CNN-kernel operations. We demonstrate how the compositional nature of a typical NN computation on its empirically computing the output covariance allows to performance.inputs induces a corresponding compositional computation on the NNGP and NT kernels. Presented 1. Global aver(biased) estimate converges to the true CNN-GP covariance in • Shallow CNN models can perform is a 2-hidden-layer 1D CNN with nonlinearity $\phi$ pooling: take h = 1d1d. Then, performing regression on the 10-dimensional outputs $z ^ { 2 }$ nstantiated networks) and #channels, both in terms of variance Frobenius distance and the GP accuracy.rse than fully-connectedernatives due to failing to capture for each of the 4 (1, 2, 3, 4) inputs $x$ from the dataset $\mathcal { X }$ 2 (attaching a fully-connected layer . To declutter notation, unit weight K 1 ⌘ d2Figure 2: Validation accuracy (left) of an MC-Figure 2: Validation accuracy (left) of annon-linear interactions between and zero bias variances are assumed in all layers. Top: recursive output $( z ^ { 2 } )$ ↵,↵0 + b . P increases with n M (i.e. channNN-GP increases with n M (i.e. c only to the center pixel of the output) computation in the CNN times number of sa(right) to the exactimes numbe(right) to the(top) induces a respective recursive NNGP kernel $( \bar { \tilde { \mathcal { K } } } ^ { 2 } \otimes I _ { 1 0 } )$ roaches that of the exact CNN-GP (not shown), while the des. The dark band in the left plot corresponds to ill-condd approaches that of the exact CNN-GP (not shown), whilecreases. The dark band in the left plot corresponds to ill- computation (NTK computation being tional layer.8 This approach takes all pixel-pixel covariances into consideration and m of KL+1 when the number of outer products contributing to KL+1 approximately equals i of KL+1 when the number of outer products contributing to KL+1 approximately eqFigure 1: Different dimensionality collapsing strategies described in §3. Validation accuraUnder review as a conference paper at ICLR 2019Under review as a conference paper at ICLR 2019similar, not shown). Bottom: explicit listing of tensor and corresponding kernel ops in each layer. the kernel translation invariant. However, it requires O |X |2d2 memory to computValues reported are for a 3-layer model applied to a 2K/4K train/validation subset of CIValues reported are for a 3-layer model applied to a 2K/4K train/validation subset § invariance of the kernel. CNN-GP with zero padding ( 3.1) outperforms an analogous C4. Computing the NN-GP covarianceSee Table 1 for operation definitions. Illustration and description adapted from Figure 3 in Novak et al. (2019).
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
ubsampling, zero or no padding(not always necessary to track the whole 4x4x10x10 covariance.)
|
| 119 |
+
|
| 120 |
+
<table><tr><td>Layer</td><td>Tensor Op</td><td>NNGP Op</td><td>NTK Op</td></tr><tr><td>0 (input)</td><td>y=x</td><td>K=xxT</td><td>0°=0</td></tr><tr><td>O (pre-activations)</td><td>z° = Conv (y°)</td><td>=A(x°)</td><td>=+A(0°)</td></tr><tr><td>1 (activations)</td><td>y¹=(2°)</td><td>K1=T(xo)</td><td>01=↑(x0)①0</td></tr><tr><td>1 (pre-activations)</td><td>z1 = Conv (y1)</td><td>K1 =A(x1)</td><td>1=¹+A(01)</td></tr><tr><td>2 (activations)</td><td>y²=(21)</td><td>K²=T(x1)</td><td>0²=T(x1)0θ1</td></tr><tr><td>2 (readout)</td><td>z² = Dense o Flatten (y2)</td><td>K² = Tr(K²)</td><td>² =² +Tr(0²)</td></tr></table>
|
| 121 |
+
|
| 122 |
+
assume $z$ e↵ 2 ⇥ L+1 ⇤ 2 the Monte Carlo-GP (MC-GP) kernel, the Monte Carlo-GP (MC-GP) kernel,depth, as information becomes more uniformly spatially distributed (Xiao et al., 2018). CNNNN-GP with no pooling can be computed using is a mean zero multivariate Gaussian. We wish to compute the kernel corresponding to $h =$ Dense $\bigl ( \sigma _ { \omega } , \sigma _ { b } \bigr ) \bigl ( \phi ( z ) \bigr )$ nonlinear interactions between spatialby computing the kernels of $y = \phi ( z )$ 1 n1 M ls at shand $h =$ b epths (lefDense $\left( \sigma _ { \omega } , \sigma _ { b } \right) \left( y \right)$ • For other archiSampling finiteseparately. Here,
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
h = \mathrm { D e n s e } ( \sigma _ { \omega } , \sigma _ { b } ) ( y ) \equiv \left( 1 / \sqrt { n } \right) \sigma _ { \omega } W y + \sigma _ { b } \beta ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
covariance Froand the variables $W _ { i j }$ distanceand $\beta _ { i }$ analogous to §2 (Lee et a the GP accuracy.are i.i.d. Gaussian $\mathcal { N } ( 0 , 1 )$ tthews et al., 2018b).n!1 n,M 1 n!1 n,M 1 pool 2! X ⇥ L+1 ⇤ 2(#NN instantiations). We will compute kernel operations - denoted $\phi ^ { * }$ and Dense $( \sigma _ { \omega } , \sigma _ { b } ) ^ { * }$ For finite width networks, the uncertainty i⇥For finite width networks, the uncerta1 d2Figure 2: Validation accuracy (left) of an MFigure 2: Validation accuracy (left) o - induced by the tensor operations $\phi$ Kn,M is Var K⇤ 1y in Kn,M is V⇥ l ⇤ 1↵0 1 ↵,↵0 -CNN-GP incren MC-CNN-GPand Dense $( \sigma _ { \omega } , \sigma _ { b } )$ ✓ Kn (✓) /M .l= Var✓ Kn (✓)lM (i.e. channh n ⇥ M (i.e. c5. Finally, 4 MONTE CARLO EVALUATION OF INTRACT ✓ n / finite n, Kl is also a biased estimate of Kl , wher ✓ n finite n, Kl is also a biased estimate of Kl ,This approach corresponds to applying global av(right) to the exact kernel decreases. The dark band i(right) to the exact kernel decreases. The dark bwe will compute the kernel operation associated with the composition $( \mathrm { D e n s e } ( \sigma _ { \omega } , \dot { \sigma _ { b } } ) \circ \phi ) ^ { * } \stackrel { \cdot } { = }$ Dense $( \sigma _ { \omega } , \sigma _ { b } ) ^ { * } \circ \phi ^ { * }$ .
|
| 129 |
+
|
| 130 |
+
to traditional randomis nearly constais nearly csample-samdownsampled to downsampFirst we compute the NNGP and NT kernels for $y$ ature methods (Rafor constant Mn. stant for constant e covariance of the⇥ 8. See Figure d to 8 ⇥ 8. See Fi. To compute $\mathcal { K } _ { y }$ & Recht, 2007), the core idea is to instann,M us treat M n as the effective sample size fWe thus treat M n as the effective sampleor O d2 per covariance entry in an itera similar results with other architectures a7 for similar results with other architectunote that from its definition,
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { r } { \mathcal { K } _ { y } = \mathcal { K } _ { \phi ( z ) } = \mathbb { E } _ { \theta } \left[ \phi ( z ) _ { i } \phi ( z ) _ { i } ^ { T } \right] = \mathbb { E } _ { \theta } [ \phi ( z _ { i } ) \phi ( z _ { i } ) ^ { T } ] = \mathcal { T } ( \mathcal { K } _ { z } ) . } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
Since $\phi$ O ⇣ |X |2 d2 O ⇣ |Xthe Monte Cthe Mdoes not introduce any new variables $\Theta _ { y }$ ⇣ |X |2 + n2 + nd ⌘ , making th⌘ to O ⇣ |X |2 + n2 + nd ⌘, makKe↵1 ⌘ 2! ⇥GP (MC-GP) kernel,Carlo-GP (MC-GP) kernel,can be computed as,
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r } { \Theta _ { y } = \mathbb { E } _ { \theta } \left[ \frac { \partial \phi ( z _ { i } ) } { \partial \theta } \left( \frac { \partial \phi ( z _ { i } ) } { \partial \theta } \right) ^ { T } \right] = \mathbb { E } _ { \theta } \left[ \mathrm { d i a g } ( \dot { \phi } ( z _ { i } ) ) \frac { \partial z _ { i } } { \partial \theta } \left( \frac { \partial z _ { i } } { \partial \theta } \right) ^ { T } \mathrm { d i a g } ( \dot { \phi } ( z _ { i } ) ) \right] = \dot { \mathcal { T } } ( K _ { z } ) \odot \Theta _ { z } . } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
LocallyLanalogous to Taken together these equations imply that,
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
( \mathcal { K } _ { y } , \Theta _ { y } ) = \phi ^ { * } \left( \mathcal { K } _ { z } , \Theta _ { z } \right) \equiv \left( \mathcal { T } ( \mathcal { K } _ { z } ) , \dot { \mathcal { T } } ( \mathcal { K } _ { z } ) \odot \Theta _ { z } \right)
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
$^ 5 \mathcal { T } \left( \Sigma \right) \equiv \mathbb { E } \left[ \phi ( u ) \phi ( u ) ^ { T } \right] , \dot { \mathcal { T } } \left( \Sigma \right) \equiv \mathbb { E } \left[ \phi ^ { \prime } ( u ) \phi ^ { \prime } ( u ) ^ { T } \right] , u \sim \mathcal { N } \left( 0 , \Sigma \right) .$ § §xel covariances. LCNs destroy p§ §el-pixel covariances. LCNs deswe do not know the analytic forative to the variance. In particulaall relative to the variance. In par, as in (Lee et al., 2019).
|
| 149 |
+
|
| 150 |
+
will be the translation rule for a pointwise nonlinearity. Note that Equation Equation 4 only has an analytic expression for a small set of activation functions $\phi$ .
|
| 151 |
+
|
| 152 |
+
Next we consider the case of a dense operation. Using the independence between the weights, the biases, and $h$ it follows that,
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\mathcal { K } _ { h } = \mathbb { E } _ { W , \beta , \theta } [ h _ { i } h _ { i } ^ { T } ] = \sigma _ { \omega } ^ { 2 } \mathbb { E } _ { \theta } [ y _ { i } y _ { i } ^ { T } ] + \sigma _ { b } ^ { 2 } = \sigma _ { \omega } ^ { 2 } \mathcal { K } _ { y } + \sigma _ { b } ^ { 2 } .
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
Finally, the NTK of $h$ can be computed as a sum of two terms:
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\Theta _ { h } = \mathbb { E } _ { W , \beta , \theta } \left[ \frac { \partial h _ { i } } { \partial ( W , \beta ) } \left( \frac { \partial h _ { i } } { \partial ( W , \beta ) } \right) ^ { T } \right] + \mathbb { E } _ { W , \beta , \theta } \left[ \frac { \partial h _ { i } } { \partial \theta } \left( \frac { \partial h _ { i } } { \partial \theta } \right) ^ { T } \right] = \sigma _ { \omega } ^ { 2 } K _ { y } + \sigma _ { b } ^ { 2 } + \sigma _ { \omega } ^ { 2 } \Theta _ { y } .
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
This gives the translation rule for the dense layer in terms of $\mathcal { K } _ { y }$ and $\Theta _ { y }$ as,
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\begin{array} { r } { ( K _ { h } , \theta _ { h } ) = \mathrm { D e n s e } ( \sigma _ { \omega } , \sigma _ { b } ) ^ { * } \left( K _ { y } , \theta _ { y } \right) \equiv \left( \sigma _ { \omega } ^ { 2 } K _ { y } + \sigma _ { b } ^ { 2 } , \sigma _ { \omega } ^ { 2 } K _ { y } + \sigma _ { b } ^ { 2 } + \sigma _ { \omega } ^ { 2 } \Theta _ { y } \right) . } \end{array}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
# 3.2 PERFORMANCE
|
| 171 |
+
|
| 172 |
+
Our library performs a number of automatic performance optimizations without sacrificing flexibility.
|
| 173 |
+
|
| 174 |
+
Leveraging block-diagonal covariance structure. A common computational challenge with GPs is inverting the training set covariance matrix. Naively, for a classification task with $C$ classes and training set $\mathcal { X }$ , NNGP and NTK covariances have the shape of $| \mathcal { X } | C \times | \mathcal { X } | C$ . For CIFAR-10, this would be $5 0 0 , 0 0 0 \times 5 0 0 , 0 0 0$ . However, if a fully-connected readout layer is used (which is an extremely common design in classification architectures), the $C$ logits are i.i.d. conditioned on the input $x$ . This results in outputs that are normally distributed with a block-diagonal covariance matrix of the form $\Sigma \otimes I _ { C }$ , where $\Sigma$ has shape $| { \mathcal { X } } | \times | { \mathcal { X } } |$ and $I _ { C }$ is the $C \times C$ identity matrix. This reduces the computational complexity and storage in many common cases by an order of magnitude, which makes closed-form exact inference feasible in these cases.
|
| 175 |
+
|
| 176 |
+
Automatically tracking only the smallest necessary subset of intermediary covariance entries. For most architectures, especially convolutional, the main computational burden lies in constructing the covariance matrix (as opposed to inverting it). Specifically for a convolutional network of depth $l$ , constructing the $| { \mathcal { X } } | \times | { \mathcal { X } } |$ output covariance matrix, $\Sigma$ , involves computing $l$ intermediate layer covariance matrices, $\Sigma ^ { l }$ , of size $| \mathcal { X } | d \times | \mathcal { X } | d$ (see Listing 1 for a model requiring this computation) where $d$ is the total number of pixels in the intermediate layer outputs (e.g. $d = 1 0 2 4$ in the case of CIFAR-10 with SAME padding). However, as Xiao et al. (2018); Novak et al. (2019); GarrigaAlonso et al. (2019) remarked, if no pooling is used in the network the output covariance $\Sigma$ can be computed by only using the stack of $d$ $| { \mathcal { X } } | \times | { \mathcal { X } } |$ -blocks of $\Sigma ^ { l }$ , bringing the time and memory cost from $O ( \left| \mathcal { X } \right| ^ { 2 } d ^ { 2 } )$ down to $\mathcal { O } ( | \mathcal { X } | ^ { 2 } d )$ per layer (see Figure 4 and Listing 2 for models admitting this optimization). Finally, if the network has no convolutional layers, the cost further reduces to $\mathcal { O } ( | \mathcal { X } | ^ { 2 } )$ (see Listing 3 for an example). These choices are performed automatically by NEURAL TANGENTS to achieve efficient computation and minimal memory footprint.
|
| 177 |
+
|
| 178 |
+
Expressing covariance computations as 2D convolutions with optimal layout. A key insight to high performance in convolutional models is that the covariance propagation operator for convolutional layers $\mathcal { A }$ can be expressed in terms of 2D convolutions when it operates on both the full $| \mathcal { X } | d \times | \mathcal { X } | d$ covariance matrix $\Sigma$ , and on the $d$ diagonal $| { \mathcal { X } } | \times | { \mathcal { X } } |$ -blocks. This allows utilization of modern hardware accelerators, many of which target 2D convolutions as their primary machine learning application.
|
| 179 |
+
|
| 180 |
+
Simultaneous NNGP and NT kernel computations. As NTK computation requires the NNGP covariance as an intermediary computation, the NNGP covariance is computed together with the NTK at no extra cost. This is especially convenient for researchers looking to investigate similarities and differences between these two infinite-width NN limits.
|
| 181 |
+
|
| 182 |
+
Automatic batching and parallelism across multiple devices. In most cases as the dataset or model becomes large, it is impossible to perform the entire kernel computation at once. Additionally, in many cases it is desirable to parallelize the kernel computation across devices (CPUs, GPUs, or TPUs). NEURAL TANGENTS provides an easy way to perform both of these common tasks using a single batch decorator shown below:
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 5: Performance scaling with batch size (left) and number of GPUs (right). Shows time per entry needed to compute the analytic NNGP and NTK covariance matrices (using kernel_fn ) in a 21-layer ReLU network with global average pooling. Left: Increasing the batch size when computing the covariance matrix in blocks allows for a significant performance increase until a certain threshold when all cores in a single GPU are saturated. Simpler models are expected to have better scaling with batch size. Right: Time-per-sample scales linearly with the number of GPUs, demonstrating near-perfect hardware utilization.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>batched_kernel_fn = nt.batch(kernel_fn,batch_size) batched_kernel_fn(x,x) == kernel_fn(x,x) # True!</td></tr></table>
|
| 188 |
+
|
| 189 |
+
This code works with either analytic kernels or empirical kernels. By default, it automatically shares the computation over all available devices. We plot the performance as a function of batch size and number of accelerators when computing the theoretical NTK of a 21-layer convolutional network in Figure 5, observing near-perfect scaling with the number of accelerators.
|
| 190 |
+
|
| 191 |
+
Op fusion. JAX and XLA allow end-to-end compilation of the whole kernel computation and/or inference. This enables the XLA compiler to fuse low-level ops into custom model-specific accelerator kernels, as well as eliminating overhead from op-by-op dispatch to an accelerator. In similar vein, we allow the covariance tensor to change its order of dimensions from layer to layer, with the order tracked and parsed as additional metadata under the hood. This eliminates redundant transpositions6 by adjusting the computation performed by each layer based on the input metadata.
|
| 192 |
+
|
| 193 |
+
# 4 CONCLUSION
|
| 194 |
+
|
| 195 |
+
We believe NEURAL TANGENTS will enable researchers to quickly and easily explore infinite-width networks. By democratizing this previously challenging model family, we hope that researchers will begin to use infinite neural networks, in addition to their finite counterparts, when faced with a new problem domain (especially in cases that are data-limited). In addition, we are excited to see novel uses of infinite networks as theoretical tools to gain insight and clarity into many of the hard theoretical problems in deep learning. Going forward, there are significant additions to NEURAL TANGENTS that we are exploring. There are more layers we would like to add in the future $( \ S _ { \mathrm { { D } } } )$ that will enable an even larger range of infinite network topologies. Additionally, there are further performance improvements we would like to implement, to allow experimenting with larger models and datasets. We invite the community to join our efforts by contributing new layers to the library (§B.7), or by using it for research and providing feedback!
|
| 196 |
+
|
| 197 |
+
# ACKNOWLEDGMENTS
|
| 198 |
+
|
| 199 |
+
We thank Yasaman Bahri for frequent discussion and useful feedback on the manuscript. We additionally appreciate both Yasaman Bahri and Greg Yang for the ongoing contributions to improve the library. We thank Sergey Ioffe for feedback on the text, as well as Ravid Ziv, and Jeffrey Pennington for discussion and feedback on early versions of the library.
|
| 200 |
+
|
| 201 |
+
# REFERENCES
|
| 202 |
+
|
| 203 |
+
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
|
| 204 |
+
|
| 205 |
+
Takuya Akiba, Keisuke Fukuda, and Shuji Suzuki. ChainerMN: Scalable Distributed Deep Learning Framework. In Proceedings of Workshop on ML Systems in The Thirty-first Annual Conference on Neural Information Processing Systems (NIPS), 2017. URL http://learningsys.org/nips17/ assets/papers/paper_25.pdf.
|
| 206 |
+
|
| 207 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, 2018.
|
| 208 |
+
|
| 209 |
+
Anonymous. Infinite attention: Nngp and ntk for deep attention networks. In International Conference on Machine Learning (ICML), 2020. submission under review.
|
| 210 |
+
|
| 211 |
+
Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Ruslan Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances In Neural Information Processing Systems, 2019a.
|
| 212 |
+
|
| 213 |
+
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, 2019b.
|
| 214 |
+
|
| 215 |
+
Yaniv Blumenfeld, Dar Gilboa, and Daniel Soudry. A mean field theory of quantized deep networks: The quantization-depth trade-off. arXiv preprint arXiv:1906.00771, 2019.
|
| 216 |
+
|
| 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, 2018a. URL http://github.com/google/jax.
|
| 218 |
+
|
| 219 |
+
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, and Skye Wanderman-Milne. Stax, a flexible neural net specification library in jax, 2018b. URL https://github.com/google/jax/blob/master/jax/experimental/stax.py.
|
| 220 |
+
|
| 221 |
+
Lenaic Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. arXiv preprint arXiv:1812.07956, 2019.
|
| 222 |
+
|
| 223 |
+
Youngmin Cho and Lawrence K Saul. Kernel methods for deep learning. In Advances In Neural Information Processing Systems, 2009.
|
| 224 |
+
|
| 225 |
+
François Chollet et al. Keras. https://keras.io, 2015.
|
| 226 |
+
|
| 227 |
+
Amit Daniely, Roy Frostig, and Yoram Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. In Advances In Neural Information Processing Systems, pp. 2253–2261, 2016.
|
| 228 |
+
|
| 229 |
+
Simon S Du, Jason D Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. arXiv preprint arXiv:1811.03804, 2018a.
|
| 230 |
+
|
| 231 |
+
Simon S Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. arXiv preprint arXiv:1810.02054, 2018b.
|
| 232 |
+
|
| 233 |
+
Simon S Du, Kangcheng Hou, Russ R Salakhutdinov, Barnabas Poczos, Ruosong Wang, and Keyulu Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp.
|
| 234 |
+
|
| 235 |
+
5724–5734. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/ 8809-graph-neural-tangent-kernel-fusing-graph-neural-networks-with-graph-kernels. pdf.
|
| 236 |
+
|
| 237 |
+
Jacob R Gardner, Geoff Pleiss, David Bindel, Kilian Q Weinberger, and Andrew Gordon Wilson. Gpytorch: Blackbox matrix-matrix gaussian process inference with gpu acceleration. In Advances in Neural Information Processing Systems, 2018.
|
| 238 |
+
|
| 239 |
+
Adrià Garriga-Alonso, Carl Edward Rasmussen, and Laurence Aitchison. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2019.
|
| 240 |
+
|
| 241 |
+
GPy. GPy: A gaussian process framework in python. http://github.com/SheffieldML/GPy, 2012.
|
| 242 |
+
|
| 243 |
+
Soufiane Hayou, Arnaud Doucet, and Judith Rousseau. On the selection of initialization and activation function for deep neural networks. arXiv preprint arXiv:1805.08266, 2018.
|
| 244 |
+
|
| 245 |
+
Soufiane Hayou, Arnaud Doucet, and Judith Rousseau. Mean-field behaviour of neural tangent kernel for deep neural networks, 2019.
|
| 246 |
+
|
| 247 |
+
Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, 2018.
|
| 248 |
+
|
| 249 |
+
Ryo Karakida, Shotaro Akaho, and Shun-ichi Amari. Universal statistics of fisher information in deep neural networks: mean field approach. 2018.
|
| 250 |
+
|
| 251 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 252 |
+
|
| 253 |
+
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.
|
| 254 |
+
|
| 255 |
+
Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha SohlDickstein, and Jeffrey Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. In Advances in neural information processing systems, 2019.
|
| 256 |
+
|
| 257 |
+
Ping Li and Phan-Minh Nguyen. On random deep weight-tied autoencoders: Exact asymptotic analysis, phase transitions, and implications to training. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=HJx54i05tX.
|
| 258 |
+
|
| 259 |
+
Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. In Advances in Neural Information Processing Systems, pp. 8157–8166, 2018.
|
| 260 |
+
|
| 261 |
+
Alexander G. de G. Matthews, Mark van der Wilk, Tom Nickson, Keisuke. Fujii, Alexis Boukouvalas, Pablo Le‘on-Villagr‘a, Zoubin Ghahramani, and James Hensman. GPflow: A Gaussian process library using TensorFlow. Journal of Machine Learning Research, 18(40):1–6, apr 2017. URL http://jmlr.org/papers/v18/16-537.html.
|
| 262 |
+
|
| 263 |
+
Alexander G de G Matthews, Mark Rowland, Jiri Hron, Richard E Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. arXiv preprint arXiv:1804.11271, 2018a.
|
| 264 |
+
|
| 265 |
+
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, 2018b.
|
| 266 |
+
|
| 267 |
+
Radford M. Neal. Priors for infinite networks (tech. rep. no. crg-tr-94-1). University of Toronto, 1994.
|
| 268 |
+
|
| 269 |
+
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.
|
| 270 |
+
|
| 271 |
+
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. In NIPS-W, 2017.
|
| 272 |
+
|
| 273 |
+
Ben Poole, Subhaneil Lahiri, Maithra Raghu, Jascha Sohl-Dickstein, and Surya Ganguli. Exponential expressivity in deep neural networks through transient chaos. In Advances In Neural Information Processing Systems, 2016.
|
| 274 |
+
|
| 275 |
+
Arnu Pretorius, Elan van Biljon, Steve Kroon, and Herman Kamper. Critical initialisation for deep signal propagation in noisy rectifier neural networks. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 5717–5726. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/ 7814-critical-initialisation-for-deep-signal-propagation-in-noisy-rectifier-neural-networks. pdf.
|
| 276 |
+
|
| 277 |
+
Samuel S Schoenholz, Justin Gilmer, Surya Ganguli, and Jascha Sohl-Dickstein. Deep information propagation. arXiv preprint arXiv:1611.01232, 2016.
|
| 278 |
+
|
| 279 |
+
Seiya Tokui, Kenta Oono, Shohei Hido, and Justin Clayton. Chainer: a next-generation 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.
|
| 280 |
+
|
| 281 |
+
Lechao Xiao, Yasaman Bahri, Jascha Sohl-Dickstein, Samuel Schoenholz, and Jeffrey Pennington. Dynamical isometry and a mean field theory of CNNs: How to train 10,000-layer vanilla convolutional neural networks. In International Conference on Machine Learning, 2018.
|
| 282 |
+
|
| 283 |
+
Lechao Xiao, Jeffrey Pennington, and Samuel S Schoenholz. Disentangling trainability and generalization in deep learning. arXiv preprint arXiv:1912.13053, 2019.
|
| 284 |
+
|
| 285 |
+
Ge Yang and Samuel Schoenholz. Mean field residual networks: On the edge of chaos. In Advances In Neural Information Processing Systems, 2017.
|
| 286 |
+
|
| 287 |
+
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, 2019.
|
| 288 |
+
|
| 289 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Proceedings of the British Machine Vision Conference (BMVC), 2016.
|
| 290 |
+
|
| 291 |
+
Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Gradient descent optimizes overparameterized deep relu networks. Machine Learning, Oct 2019. ISSN 1573-0565. doi: 10.1007/s10994-019-05839-6. URL https://doi.org/10.1007/s10994-019-05839-6.
|
| 292 |
+
|
| 293 |
+
# APPENDIX
|
| 294 |
+
|
| 295 |
+
A NEURAL TANGENTS AND PRIOR WORK
|
| 296 |
+
|
| 297 |
+
Here we briefly discuss the differences between NEURAL TANGENTS and the relevant prior work.
|
| 298 |
+
|
| 299 |
+
1. Prior benchmarks in the domain of infinitely wide neural networks. Various prior works have evaluated convolutional and fully-connected models on certain datasets (Lee et al., 2018; Matthews et al., 2018b;a; Novak et al., 2019; Garriga-Alonso et al., 2019; Arora et al., 2019a). While these efforts must have required implementing certain parts of our library, to our knowledge such prior efforts were either not open-sourced or not comprehensive / user-friendly / scalable enough to be used as a user-facing library. In addition, all of the works above used their own separate implementation, which further highlights a need for a more general approach.
|
| 300 |
+
|
| 301 |
+
2. Code released by Lee et al. (2019). Lee et al. (2019) have released code along with their paper submission, which is a strict and minor subset of our library. More specifically, at the time of the submission, Lee et al. (2019) have released code equivalent to nt.linearize , nt.empirical_ntk_fn , nt.predict.gradient_descent_mse , nt.predict.gradient_descent , and nt.predict.momentum . Every other part of the library (most notably, nt.stax ) is new in this submission and was not used by Lee et al. (2019) or any other prior work. At the time of writing, NEURAL TANGENTS differs from the code released by Lee et al. (2019) by about $+ 9 , 5 0 0 / - 2 , 5 0 0$ lines of code.
|
| 302 |
+
|
| 303 |
+
3. GPy (2012), GPFlow (Matthews et al., 2017), GPyTorch (Gardner et al., 2018), and other GP packages. While various packages allowing for kernel construction, optimization, and inference with Gaussian Processes exist, none of them allow easy construction of the very specific kernels corresponding to infinite neural networks (NNGP/NTK; nt.stax ), nor do they provide the tools and convenience for studying wide but finite networks and their training dynamics ( nt.taylor_expand , nt.predict , nt.monte_carlo_kernel_fn ). On the other hand, NEURAL TANGENTS does not provide any tools for approximate inference with these kernels.
|
| 304 |
+
|
| 305 |
+
# B LIBRARY DESCRIPTION
|
| 306 |
+
|
| 307 |
+
NEURAL TANGENTS provides a high-level interface for specifying analytic, infinite-width, Bayesian and gradient descent trained neural networks as Gaussian Processes. This interface closely follows the stax API (Bradbury et al., 2018b) in JAX.
|
| 308 |
+
|
| 309 |
+
# B.1 NEURAL NETWORKS WITH JAX
|
| 310 |
+
|
| 311 |
+
stax represents each component of a network as two functions: init_fn and apply_fn . These components can be composed in serial or in parallel to produce new network components with their own init_fn and apply_fn . In this way, complicated neural network architectures can be specified hierarchically.
|
| 312 |
+
|
| 313 |
+
Calling init_fn on a random seed and an input shape generates a random draw of trainable parameters for a neural network. Calling apply_fn on these parameters and a batch of inputs returns the outputs of the given finite neural network.
|
| 314 |
+
|
| 315 |
+
from jax.experimental import stax
|
| 316 |
+
init_fn, apply_fn $=$ stax.serial(stax.Dense(512), stax.Relu, stax.Dense(10)) _, params $=$ init_fn(key, (-1, $3 2 \ \times \ 3 2 \ \times \ 3 )$ )
|
| 317 |
+
fx_train, fx_test $=$ apply_fn(params, x_train), apply_fn(params, x_test)
|
| 318 |
+
|
| 319 |
+
# B.2 INFINITE NEURAL NETWORKS WITH NEURAL TANGENTS
|
| 320 |
+
|
| 321 |
+
We extend stax layers to return a third function kernel_fn , which represents the covariance functions of the infinite NNGP and NTK networks of the given architecture (recall that since infinite networks are GPs, they are fully defined by their covariance functions, assuming 0 mean as is common in the literature).
|
| 322 |
+
|
| 323 |
+
from neural_tangents import stax init_fn, apply_fn, kernel_fn $=$ stax.serial(stax.Dense(512), stax.Relu(), stax.Dense(10))
|
| 324 |
+
|
| 325 |
+
We demonstrate a specification of a more complicated architecture (WideResNet) in Listing 1.
|
| 326 |
+
|
| 327 |
+
kernel_fn accepts two batches of inputs $\mathsf { x } \mathsf { 1 }$ and $\times 2$ and returns their NNGP covariance and NTK matrices as kernel_fn(x1, x2).nngp and kernel_fn(x1, x2).ntk respectively, which can then be used to make posterior test set predictions as the mean of a conditional multivariate normal $\mathcal { V } _ { \mathrm { t e s t } } = K \left( \mathcal { X } _ { \mathrm { t e s t } } , \mathcal { X } _ { \mathrm { t r a i n } } \right) \mathcal { K } \left( \mathcal { X } _ { \mathrm { t r a i n } } , \mathcal { X } _ { \mathrm { t r a i n } } \right) ^ { - 1 } \mathcal { Y } _ { \mathrm { t r a i n } }$ :
|
| 328 |
+
|
| 329 |
+
from jax.numpy.linalg import inv y_test $=$ kernel_fn(x_test, x_train).ntk @ inv(kernel_fn(x_train, x_train).ntk) @ y_train
|
| 330 |
+
|
| 331 |
+
Note that the above code does not do Cholesky decomposition and is presented merely to show the mathematical expression. We provide efficient GP inference method in the predict submodule:
|
| 332 |
+
|
| 333 |
+
import neural_tangents as nt y_test $=$ nt.predict.gp_inference(kernel_fn, x_train, y_train, x_test, get='ntk', diag_reg=1e-4, compute_cov=False)
|
| 334 |
+
|
| 335 |
+
# B.3 COMPUTING INFINITE NETWORK KERNELS IN BATCHES AND IN PARALLEL
|
| 336 |
+
|
| 337 |
+
Naively, the kernel_fn will compute the whole kernel in a single call on one device. However, for large datasets or complicated architectures, it is often necessary to distribute the calculation in some way. To do this, we introduce a batch decorator that takes a kernel_fn and returns a new kernel_fn with the exact same signature. The new function computes the kernel in batches and automatically parallelizes the calculation over however many devices are available, with near-perfect speedup scaling with the number of devices (Figure 5, right).
|
| 338 |
+
|
| 339 |
+
import neural_tangents as nt kernel_fn $=$ nt.batch(kernel_fn, batch_siz $: = 3 2$ )
|
| 340 |
+
|
| 341 |
+
Note that batching is often used to compute large covariance matrices that may not even fit on a GPU/TPU device, and require to be stored and used for inference using CPU RAM. This is easy to achieve by simply specifying nt.batch(..., store_on_device $=$ False) . Once the matrix is stored in RAM, inference will be performed with a CPU when nt.predict methods are called. As mentioned in $\ S \_$ , for many (notably, convolutional, and especially pooling) architectures, inference cost can be small relative to kernel construction, even when running on CPU (for example, it takes less than 3 minutes to execute jax.scipy.linalg.solve(..., sym_pos $=$ True) on a $4 5 , 0 0 0 \times 4 5 , 0 0 0$ training covariance matrix and a $1 5 , 0 0 0 \times 1 0$ training target matrix).
|
| 342 |
+
|
| 343 |
+
# B.4 TRAINING DYNAMICS OF INFINITE NETWORKS
|
| 344 |
+
|
| 345 |
+
In addition to closed form multivariate Gaussian posterior prediction, it is also interesting to consider network predictions following continuous gradient descent. To facilitate this we provide several functions to compute predictions following gradient descent with an MSE loss, for gradient descent with arbitrary loss, or for momentum with arbitrary loss. The first case is handled analytically, while the latter two are computed by numerically integrating the differential equation. For example, the following code will compute the function evaluation on train and test points following gradient descent for some time training_time .
|
| 346 |
+
|
| 347 |
+
import neural_tangents as nt predictor $=$ nt.predict.gradient_descent_mse(kernel_fn(x_train, x_train), y_train, fx_train, fx_test $=$ predictor(training_time, fx_train, fx_test)
|
| 348 |
+
|
| 349 |
+
# B.5 INFINITE NETWORKS OF ANY ARCHITECTURE THROUGH SAMPLING
|
| 350 |
+
|
| 351 |
+
Of course, there are cases where the analytic kernel cannot be computed. To support these situations, we provide utility functions to efficiently compute Monte Carlo estimates of the NNGP covariance and NTK. These functions work with neural networks constructed using any neural network library.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 6: Training a neural network and its various approximations using nt.taylor_expand . Presented is a 5-layer Erf-neural network of width 512 trained on MNIST using SGD with momentum, along with its constant $\mathbf { 0 } ^ { \mathrm { t h } }$ order), linear $1 ^ { \mathrm { s t } }$ order), and quadratic ( $2 ^ { \mathrm { { \bar { n } d } } }$ order) Taylor expansions about the initial parameters. As training progresses (left to right), lower-order expansions deviate from the original function faster than higher-order ones.
|
| 355 |
+
|
| 356 |
+
from jax import random
|
| 357 |
+
from jax.experimental import stax
|
| 358 |
+
import neural_tangents as nt
|
| 359 |
+
init_fn, apply_fn $=$ stax.serial(stax.Dense(64), stax.BatchNorm(), stax.Sigmoid, stax.Dense(1))
|
| 360 |
+
kernel_fn $=$ nt.monte_carlo_kernel_fn(init_fn, apply_fn, key=random.PRNGKey(1), n_samples=128)
|
| 361 |
+
kernel $=$ kernel_fn(x_train, x_train)
|
| 362 |
+
|
| 363 |
+
We demonstrate convergence of the Monte Carlo kernel estimates to the closed-form analytic kernels in the case of a WideResNet in Figure 2.
|
| 364 |
+
|
| 365 |
+
# B.6 WEIGHTS OF WIDE BUT FINITE NETWORKS
|
| 366 |
+
|
| 367 |
+
While most of NEURAL TANGENTS is devoted to a function-space perspective—describing the distribution of function values on finite collections of training and testing points—we also provide tools to investigate a dual weight space perspective described in Lee et al. (2019). Convergence of dynamics to NTK dynamics coincide with networks being described by a linear approximation about their initial set of parameters. We provide decorators linearize and taylor_expand to approximate functions to linear order and to arbitrary order respectively. Both functions take an apply_fn and returns a new apply_fn that computes the series approximation.
|
| 368 |
+
|
| 369 |
+
<table><tr><td>import neural_tangents as nt</td></tr><tr><td>taylor_apply_fn = nt.taylor_expand(apply_fn,params,order)</td></tr><tr><td></td></tr><tr><td>fx_train_approx = taylor_apply_fn(new_params,x_train)</td></tr></table>
|
| 370 |
+
|
| 371 |
+
These act exactly like normal JAX functions and, in particular, can be plugged into gradient descent, which we demonstrate in Figure 6.
|
| 372 |
+
|
| 373 |
+
# B.7 EXTENDING NEURAL TANGENTS
|
| 374 |
+
|
| 375 |
+
Many neural network layers admit a sensible infinite-width limit behavior in the Bayesian and continuous gradient descent regimes as long as the multivariate central limit theorem applies to their outputs conditioned on their inputs. To add such layer to NEURAL TANGENTS, one only has to implement it as a method in nt.stax with the following signature:
|
| 376 |
+
|
| 377 |
+
@_layer # an internal decorator taking care of certain boilerplate. NewLayer(layer_params: Any) $- >$ (init_fn: function, apply_fn: function, kernel_fn: function)
|
| 378 |
+
|
| 379 |
+
Here init_fn and apply_fn are initialization and the forward pass methods of the finite width layer implementation (see $\ S \_$ ). If the layer of interest already exists in JAX, there is no need to implement these methods and the user can simply return the respective methods from jax.experimental.stax (see nt.stax.Flatten for an example; in fact the majority of nt.stax layers call the original jax.experimental.stax layers for finite width layer methods).
|
| 380 |
+
|
| 381 |
+
In this case what remains is to implement the kernel_fn method with signature kernel_fn(input_kernel: nt.utils.Kernel) $- >$ output_kernel: nt.utils.Kernel
|
| 382 |
+
|
| 383 |
+
Here both input_kernel and output_kernel are namedtuple s containing the NNGP and NTK covariance matrices, as well as additional metadata useful for computing the kernel propagation operation. The specific operation to be performed should be derived by the user in the context of the particular operation that the finite width layer performs. This transformation could be as simple as an affine map on the kernel matrices, but could also be analytically intractable.
|
| 384 |
+
|
| 385 |
+
Once implemented, the correctness of the implementation can be very easily tested by extending the nt.tests.stax_test with the new layer, to test the agreement with large-widths empirical NNGP and NTK kernels.
|
| 386 |
+
|
| 387 |
+
# C ARCHITECTURE SPECIFICATIONS
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
|
| 391 |
+
# Listing 2: All-convolutional model (ConvOnly) definition used in Figure 3.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Listing 3: Fully-connected (FC) model definition used in Figure 3.
|
| 395 |
+
|
| 396 |
+
D IMPLEMENTED AND COMING SOON FUNCTIONALITY
|
| 397 |
+
|
| 398 |
+
The following layers7 are currently implemented, with translation rules given in Table 1:
|
| 399 |
+
|
| 400 |
+
serial
|
| 401 |
+
parallel
|
| 402 |
+
FanOut
|
| 403 |
+
FanInSum
|
| 404 |
+
FanInConcat
|
| 405 |
+
Dense
|
| 406 |
+
Conv with arbitrary filter shapes, strides, dimension numbers, and padding8
|
| 407 |
+
Relu
|
| 408 |
+
LeakyRelu
|
| 409 |
+
Abs
|
| 410 |
+
ABRelu
|
| 411 |
+
Erf
|
| 412 |
+
Identity
|
| 413 |
+
Flatten
|
| 414 |
+
AvgPool
|
| 415 |
+
GlobalAvgPool
|
| 416 |
+
SumPool
|
| 417 |
+
GlobalSumPool
|
| 418 |
+
Dropout
|
| 419 |
+
LayerNorm
|
| 420 |
+
GlobalSelfAttention (Anonymous, 2020)
|
| 421 |
+
|
| 422 |
+
The following is in our near-term plans:
|
| 423 |
+
|
| 424 |
+
Exp , Elu , Selu , Gelu • Apache Beam support.
|
| 425 |
+
|
| 426 |
+
The following layers do not have known closed-form expressions for infinite network covariances, and respective infinite networks have to be estimated empirically (via nt.monte_carlo_kernel_fn ) or using other approximations (not currently implemented):
|
| 427 |
+
|
| 428 |
+
<table><tr><td>Tensor Op</td><td>NNGP Op</td><td>NTK Op</td></tr><tr><td>x</td><td>K</td><td>Θ</td></tr><tr><td>Dense(σw, b)</td><td>²K+²</td><td>(²K+²)+²Θ</td></tr><tr><td>?</td><td>T(K)</td><td>T(K)0Θ</td></tr><tr><td>Dropout(p)</td><td></td><td>K +(¹-1)Diag()Θ+(¹-1) Diag(θ)</td></tr><tr><td>Conv(σw, Ob)</td><td>²A(K)+²</td><td>²A(K)+σ²+σ²A(0)</td></tr><tr><td>Flatten</td><td>Tr(K)</td><td>Tr(K + Θ)</td></tr><tr><td>AvgPool(s, q, p)</td><td>AvgPool(s, q, p)(KC)</td><td>AvgPool(s, q, p)(K + Θ)</td></tr><tr><td>GlobalAvgPool</td><td>GlobalAvgPool(KC)</td><td>GlobalAvgPool(K + Θ)</td></tr><tr><td>SumPool(s, q,p)</td><td>SumPool(s,q, p)(K)</td><td>SumPool(s,q, p)(K + Θ)</td></tr><tr><td>GlobalSumPool</td><td>GlobalSumPool(KC)</td><td>GlobalSumPool(K + Θ)</td></tr><tr><td>Attn(σQk, σov)</td><td>Attn(σQk, σov)(K)</td><td>2Attn(σQk, σov)(K)+</td></tr><tr><td>(Anonymous, 2020)</td><td></td><td>Attn(σqk, σov)(0)</td></tr><tr><td>FanInSum(X1,..., Xn)</td><td>银份 Σj=1Kj</td><td>Σ-10j</td></tr><tr><td>FanOut(n)</td><td>[K] * n</td><td>[0] * n</td></tr></table>
|
| 429 |
+
|
| 430 |
+
Table 1: Translation rules (§3) converting tensor operations into operations on NNGP and NTK kernels. Here the input tensor $\mathcal { X }$ is assumed to have shape $| { \mathcal { X } } | \times { \bf { \bar { H } } } \times W \times C$ (dataset size, height, width, number of channels), and the full NNGP and NT kernels $\kappa$ and $\tau$ are considered to be of shape $( | \mathcal { X } | \times H \times W ) ^ { \times 2 }$ (in practice shapes of $| \mathcal { X } | ^ { \times 2 } \times H \times W$ and $| \mathcal { X } | ^ { \times 2 }$ are also possible, depending on which optimizations in $\ S \_$ are applicable). Notation details. The $\mathrm { T r }$ , GlobalAvgPool, and GlobalSumPool ops are assumed to act on all spatial axes (with sizes $H$ and $W$ in this example), producing a $| \mathcal { X } | ^ { \times 2 }$ -kernel. Similarly, the AvgPool and SumPool ops is assumed to act on all spatial axes as well, applying the specified strides $s$ , pooling window sizes $p$ and padding strategy $p$ to the respective axes pairs in $\kappa$ and $\tau$ (acting as 4D pooling with replicated parameters of the 2D version). $\tau$ and $\dot { \tau }$ are defined identically to Lee et al. (2019) as $\mathcal { T } ( \bar { \Sigma ) } = \mathbb { E } \left[ \bar { \phi ( u ) } \phi ( u ) ^ { T } \right] , \bar { \mathcal { T } } ( \Sigma ) =$ $\mathbb { E } \left[ \phi ^ { \prime } ( u ) \phi ^ { \prime } ( u ) ^ { T } \right] , u \sim \mathcal { N } ( 0 , \Sigma )$ . These expressions can be evaluated in closed form for many nonlinearities, and preserve the shape of the kernel. The $\mathcal { A }$ op is defined similarly to Novak et al. (2019); Xiao et al. (2018) as $\begin{array} { r } { \big [ \boldsymbol { A } \left( \boldsymbol { \Sigma } \right) \big ] _ { h , h ^ { \prime } } ^ { w , w ^ { \prime } } \left( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } \right) = \sum _ { d h , d w } \left[ \boldsymbol { \Sigma } \right] _ { h + d h , h ^ { \prime } + d h } ^ { w + d w , w ^ { \prime } + d w } \left( \boldsymbol { x } , \boldsymbol { x } ^ { \prime } \right) / q ^ { 2 } } \end{array}$ , where the summation is performed over the convolutional filter receptive field with $q$ pixels (we assume unit strides and circular padding in this expression, but generalization to other settings is trivial and supported by the library). $[ \bar { \Sigma } ] \ast n = [ \Sigma , \dots , \Sigma ]$ ( $\stackrel { \cdot } { n }$ -fold replication). For LayerNorm, FanInConcat, and Attn (Anonymous, 2020) translation rules we refer the reader to our code at https://github. com/google/neural-tangents, as these ops are challenging to express concisely using current notation. See Figure 4 for an example of applying the translation rules to a specific model, and $\ S 3 . 1$ for deriving a sample translation rule. See $\ S _ { \mathrm { D } }$ for the full list of currently implemented translations.
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 7: Predictive negative log-likelihoods and condition numbers. Top. Test negative loglikelihoods for NNGP posterior and Gaussian predictive distribution for NTK at infinite training time for CIFAR-10 (test set of 2000 points). Fully Connected (FC, Listing 3) and Convolutional network without pooling (CONV, Listing 2) models are selected based on train marginal negative log-likelihoods in Figure 3. Bottom. Condition numbers for covariance matrices corresponding to NTK/NNGP as well as respective predictive covaraince on the test set. Ill-conditioning of Wide Residual Network kernels due to pooling layers (Xiao et al., 2019) could be the cause of numerical issues when evaluating predictive NLL for this kernels.
|
md/train/SyProzZAW/SyProzZAW.md
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THE POWER OF DEEPER NETWORKS FOR EXPRESSING NATURAL FUNCTIONS
|
| 2 |
+
|
| 3 |
+
David Rolnick, Max Tegmark Massachusetts Institute of Technology {drolnick, tegmark}@mit.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
It is well-known that neural networks are universal approximators, but that deeper networks tend in practice to be more powerful than shallower ones. We shed light on this by proving that the total number of neurons $m$ required to approximate natural classes of multivariate polynomials of $n$ variables grows only linearly with $n$ for deep neural networks, but grows exponentially when merely a single hidden layer is allowed. We also provide evidence that when the number of hidden layers is increased from 1 to $k$ , the neuron requirement grows exponentially not with $n$ but with $n ^ { 1 / k }$ , suggesting that the minimum number of layers required for practical expressibility grows only logarithmically with $n$ .
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has lately been shown to be a very powerful tool for a wide range of problems, from image segmentation to machine translation. Despite its success, many of the techniques developed by practitioners of artificial neural networks (ANNs) are heuristics without theoretical guarantees. Perhaps most notably, the power of feedforward networks with many layers (deep networks) has not been fully explained. The goal of this paper is to shed more light on this question and to suggest heuristics for how deep is deep enough.
|
| 12 |
+
|
| 13 |
+
It is well-known (Cybenko, 1989; Funahashi, 1989; Hornik et al., 1989; Barron, 1994; Pinkus, 1999) that neural networks with a single hidden layer can approximate any function under reasonable assumptions, but it is possible that the networks required will be extremely large. Recent authors have shown that some functions can be approximated by deeper networks much more efficiently (i.e. with fewer neurons) than by shallower ones. Often, these results admit one or more of the following limitations: “existence proofs” without explicit constructions of the functions in question; explicit constructions, but relatively complicated functions; or applicability only to types of network rarely used in practice.
|
| 14 |
+
|
| 15 |
+
It is important and timely to extend this work to make it more concrete and actionable, by deriving resource requirements for approximating natural classes of functions using today’s most common neural network architectures. Lin et al. (2017) recently proved that it is exponentially more efficient to use a deep network than a shallow network when Taylor-approximating the product of input variables. In the present paper, we move far beyond this result in the following ways: (i) we use standard uniform approximation instead of Taylor approximation, (ii) we show that the exponential advantage of depth extends to all general sparse multivariate polynomials, and (iii) we address the question of how the number of neurons scales with the number of layers. Our results apply to standard feedforward neural networks and are borne out by empirical tests.
|
| 16 |
+
|
| 17 |
+
Our primary contributions are as follows:
|
| 18 |
+
|
| 19 |
+
• It is possible to achieve arbitrarily close approximations of simple multivariate and univariate polynomials with neural networks having a bounded number of neurons (see $\ S 3$ ). • Such polynomials are exponentially easier to approximate with deep networks than with shallow networks (see $\ S 4$ ).
|
| 20 |
+
|
| 21 |
+
• The power of networks improves rapidly with depth; for natural polynomials, the number of layers required is at most logarithmic in the number of input variables, where the base of the logarithm depends upon the layer width (see §5).
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Deeper networks have been shown to have greater representational power with respect to various notions of complexity, including piecewise linear decision boundaries (Montufar et al., 2014) and topological invariants (Bianchini & Scarselli, 2014). Recently, Poole et al. (2016) and Raghu et al. (2016) showed that the trajectories of input variables attain exponentially greater length and curvature with greater network depth.
|
| 26 |
+
|
| 27 |
+
Work including Daniely (2017); Eldan & Shamir (2016); Pinkus (1999); Poggio et al. (2017); Telgarsky (2016) shows that there exist functions that require exponential width to be approximated by a shallow network. Barron (1994) provides bounds on the error in approximating general functions by shallow networks. Mhaskar et al. (2016) and Poggio et al. (2017) show that for compositional functions (those that can be expressed by recursive function composition), the number of neurons required for approximation by a deep network is exponentially smaller than the best known upper bounds for a shallow network. Mhaskar et al. (2016) ask whether functions with tight lower bounds must be pathologically complicated, a question which we answer here in the negative.
|
| 28 |
+
|
| 29 |
+
Various authors have also considered the power of deeper networks of types other than the standard feedforward model. The problem has also been posed for sum-product networks (Delalleau & Bengio, 2011) and restricted Boltzmann machines (Martens et al., 2013). Cohen et al. (2016) showed, using tools from tensor decomposition, that shallow arithmetic circuits can express only a measure-zero set of the functions expressible by deep circuits. A weak generalization of this result to convolutional neural networks was shown in Cohen & Shashua (2016).
|
| 30 |
+
|
| 31 |
+
# 3 THE POWER OF APPROXIMATION
|
| 32 |
+
|
| 33 |
+
In this paper, we will consider the standard model of feedforward neural networks (also called multilayer perceptrons). Formally, the network may be considered as a multivariate function $N ( \mathbf { x } ) =$ $\mathbf { A } _ { k } \sigma ( \cdot \cdot \cdot \sigma ( \mathbf { A } _ { 1 } \sigma ( \mathbf { A } _ { 0 } \mathbf { x } ) ) \cdot \cdot \cdot )$ , where $\mathbf { A } _ { 0 } , \mathbf { A } _ { 1 } , \ldots , \mathbf { A } _ { k }$ are constant matrices and $\sigma$ denotes a scalar nonlinear function applied element-wise to vectors. The constant $k$ is referred to as the depth of the network. The neurons of the network are the entries of the vectors $\sigma ( \mathbf { A } _ { \ell } \cdot \cdot \cdot \sigma ( \mathbf { A } _ { 1 } \sigma ( \mathbf { A } _ { 0 } \mathbf { x } ) ) \cdot \cdot \cdot )$ , for $\ell = 1 , \dots , k - 1$ . These vectors are referred to as the hidden layers of the network.
|
| 34 |
+
|
| 35 |
+
Two notions of approximation will be relevant in our results: $\epsilon$ -approximation, also known as uniform approximation, and Taylor approximation.
|
| 36 |
+
|
| 37 |
+
Definition 3.1. For constant $\epsilon > 0$ , we say that a network $N ( \mathbf { x } )$ $\epsilon$ -approximates a multivariate function $f ( \mathbf { x } )$ (for $\mathbf { x }$ in a specified domain $( - R , R ) ^ { n } ) i f \operatorname* { s u p } _ { \mathbf { x } } | N ( \mathbf { x } ) - f ( \mathbf { x } ) | < \epsilon .$ .
|
| 38 |
+
|
| 39 |
+
Definition 3.2. We say that a network $N ( \mathbf { x } )$ Taylor-approximates $a$ multivariate polynomial $p ( \mathbf { x } )$ of degree d if $p ( \mathbf { x } )$ is the dth order Taylor polynomial (about the origin) of $N ( \mathbf { x } )$ .
|
| 40 |
+
|
| 41 |
+
The following proposition shows that Taylor approximation implies $\epsilon$ -approximation for homogeneous polynomials. The reverse implication does not hold.
|
| 42 |
+
|
| 43 |
+
Proposition 3.3. Suppose that the network $N ( \mathbf { x } )$ Taylor-approximates the homogeneous multivariate polynomial $p ( \mathbf { x } )$ . Then, for every , there exists a network $N _ { \epsilon } ( \mathbf { x } )$ that $\epsilon$ -approximates $p ( \mathbf { x } )$ , such that $N ( \mathbf { x } )$ and $N _ { \epsilon } ( \mathbf { x } )$ have the same number of neurons in each layer. (This statement holds for $\mathbf { x } \in ( - R , R ) ^ { n }$ for any specified $R .$ .)
|
| 44 |
+
|
| 45 |
+
Proof. Suppose that ${ \cal N } ( { \bf x } ) = { \bf A } _ { k } \sigma ( \cdot \cdot \cdot \sigma ( { \bf A } _ { 1 } \sigma ( { \bf A } _ { 0 } { \bf x } ) ) \cdot \cdot \cdot )$ and that $p ( \mathbf { x } )$ has degree $d$ . Since $p ( \mathbf { x } )$ is a Taylor approximation of $N ( \mathbf { x } )$ , we can write $N ( \mathbf { x } )$ as $p ( \mathbf { x } ) + E ( \mathbf { x } )$ , where $\begin{array} { r } { E ( \bar { \mathbf { x } } ) = \sum _ { i = d + 1 } ^ { \infty } \bar { E } _ { i } ( \mathbf { x } ) } \end{array}$ is a Taylor series with each $E _ { i } ( \mathbf { x } )$ homogeneous of degree $i$ . Since $N ( \mathbf { x } )$ is the function defined by a neural network, it converges for every $\mathbf { x } \in \mathbb { R } ^ { n }$ . Thus, $E ( \mathbf { x } )$ converges, as does $E ( \delta \mathbf { x } ) / \delta ^ { d } =$ $\bar { \sum _ { i = d + 1 } ^ { \infty } \delta ^ { i - d } E _ { i } ( \mathbf { x } ) }$ . By picking $\delta$ sufficiently small, we can make each term $\delta ^ { i - d } E _ { i } ( \mathbf { x } )$ arbitrarily small. Let $\delta$ be small enough that $| E ( \delta \mathbf { x } ) / \delta ^ { d } | < \epsilon$ holds for all $\mathbf { x }$ in $( - R , R ) ^ { n }$ .
|
| 46 |
+
|
| 47 |
+
Let $\mathbf { A } _ { 0 } ^ { \prime } = \delta \mathbf { A } _ { 0 }$ , ${ \bf A } _ { k } ^ { \prime } = { \bf A } _ { k } / \delta ^ { d }$ , and ${ \bf A } _ { \ell } ^ { \prime } = { \bf A } _ { \ell }$ for $\ell = 1 , 2 , \dots , k - 1$ . Then, for $N _ { \epsilon } ( \mathbf { x } ) \ =$ $\mathbf { A } _ { k } ^ { \prime } \sigma ( \cdot \cdot \cdot \sigma ( \mathbf { A } _ { 1 } ^ { \prime } \sigma ( \mathbf { A } _ { 0 } ^ { \prime } \mathbf { x } ) ) \cdot \cdot \cdot )$ , we observe that $N _ { \epsilon } ( { \bf x } ) = N ( \delta { \bf x } ) / \delta ^ { d }$ , and therefore:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r l } & { | N _ { \epsilon } ( \mathbf { x } ) - p ( \mathbf { x } ) | = | N ( \delta \mathbf { x } ) / \delta ^ { d } - p ( \mathbf { x } ) | } \\ & { \qquad = | p ( \delta \mathbf { x } ) / \delta ^ { d } + E ( \delta \mathbf { x } ) / \delta ^ { d } - p ( \mathbf { x } ) | } \\ & { \qquad = | E ( \delta \mathbf { x } ) / \delta ^ { d } | } \\ & { \qquad < \epsilon . } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
We conclude that $N _ { \epsilon } ( \mathbf { x } )$ is an $\epsilon$ -approximation of $p ( \mathbf { x } )$ , as desired.
|
| 54 |
+
|
| 55 |
+
For a fixed nonlinear function $\sigma$ , we consider the total number of neurons (excluding input and output neurons) needed for a network to approximate a given function. Remarkably, it is possible to attain arbitrarily good approximations of a (not necessarily homogeneous) multivariate polynomial by a feedforward neural network, even with a single hidden layer, without increasing the number of neurons past a certain bound. (See also Corollary 1 in Poggio et al. (2017).)
|
| 56 |
+
|
| 57 |
+
Theorem 3.4. Suppose that $p ( \mathbf { x } )$ is a degree- $d$ multivariate polynomial and that the nonlinearity $\sigma$ has nonzero Taylor coefficients up to degree $d .$ . Let $m _ { k } ^ { \epsilon } ( p )$ be the minimum number of neurons in $a$ depth- $k$ network that -approximates $p$ . Then, the limit $\begin{array} { r } { \operatorname* { l i m } _ { \epsilon \to 0 } m _ { k } ^ { \epsilon } ( p ) } \end{array}$ exists (and is finite). (Once again, this statement holds for $\mathbf { x } \in ( - R , R ) ^ { n }$ for any specified $R .$ )
|
| 58 |
+
|
| 59 |
+
Proof. We show that $\scriptstyle \operatorname* { l i m } _ { \epsilon \to 0 } m _ { 1 } ^ { \epsilon } ( p )$ exists; it follows immediately that $\scriptstyle \operatorname* { l i m } _ { \epsilon \to 0 } m _ { k } ^ { \epsilon } ( p )$ exists for every $k$ , since an $\epsilon$ -approximation to $p$ with depth $k$ can be constructed from one with depth 1.
|
| 60 |
+
|
| 61 |
+
Let $p _ { 1 } ( \mathbf { x } ) , p _ { 2 } ( \mathbf { x } ) , \ldots , p _ { s } ( \mathbf { x } )$ be the monomials of $p ( \mathbf { x } )$ , so that $\begin{array} { r } { p ( \mathbf { x } ) = \sum _ { i } p _ { i } ( \mathbf { x } ) } \end{array}$ . We claim that each $p _ { i } ( { \bf x } )$ can be Taylor-approximated by a network $N ^ { i } ( { \mathbf x } )$ with one hidden layer. This follows, for example, from the proof in Lin et al. (2017) that products can be Taylor-approximated by networks with one hidden layer, since each monomial is the product of several inputs (with multiplicity); we prove a far stronger result about $N ^ { i } ( { \mathbf x } )$ later in this paper (see Theorem 4.1).
|
| 62 |
+
|
| 63 |
+
Suppose now that $N ^ { i } ( { \mathbf x } )$ has $m _ { i }$ hidden neurons. By Proposition 3.3, we conclude that since $p _ { i } ( \mathbf { x } )$ is homogeneous, it may be $\delta$ -approximated by a network $N _ { \delta } ^ { i } ( { \bf x } )$ with $m _ { i }$ hidden neurons, where $\delta = \epsilon / s$ . By combining the networks $N _ { \delta } ^ { i } ( { \bf x } )$ for each $i$ , we can define a network $\begin{array} { r } { N _ { \epsilon } ( { \bf x } ) = \sum _ { i } N _ { \delta } ^ { i } ( { \bf x } ) } \end{array}$ with $\textstyle \sum _ { i } m _ { i }$ neurons. Then, we have:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { l } { { \displaystyle | N _ { \epsilon } ( { \bf x } ) - p ( { \bf x } ) | \le \sum _ { i } | N _ { \delta } ^ { i } ( { \bf x } ) - p _ { i } ( { \bf x } ) | } } \\ { { \displaystyle \le \sum _ { i } \delta = s \delta = \epsilon } . } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Hence, $N _ { \epsilon } ( \mathbf { x } )$ is an $\epsilon$ -approximation of $p ( \mathbf { x } )$ , implying that $\begin{array} { r } { m _ { 1 } ^ { \epsilon } ( p ) \leq \sum _ { i } m _ { i } } \end{array}$ for every $\epsilon$ . Thus, $\scriptstyle \operatorname* { l i m } _ { \epsilon \to 0 } m _ { 1 } ^ { \epsilon } ( p )$ exists, as desired.
|
| 70 |
+
|
| 71 |
+
This theorem is perhaps surprising, since it is common for $\epsilon$ -approximations to functions to require ever-greater complexity, approaching infinity as $\epsilon 0$ . For example, the function $\exp ( | - x | )$ may be approximated on the domain $( - \pi , \pi )$ by Fourier sums of the form √ $\scriptstyle \sum _ { k = 0 } ^ { m } a _ { m } \cos ( { \bar { k } } x )$ . However, in order to achieve $\epsilon$ -approximation, we need to take $m \sim 1 / \sqrt { \epsilon }$ terms. By contrast, we have shown that a finite neural network architecture can achieve arbitrarily good approximations merely by altering its weights.
|
| 72 |
+
|
| 73 |
+
Note also that the assumption of nonzero Taylor coefficients cannot be dropped from Theorem 3.4. For example, the theorem is false for rectified linear units (ReLUs), which are piecewise linear and do not admit a Taylor series. This is because $\epsilon$ -approximating a non-linear polynomial with a piecewise linear function requires an ever-increasing number of pieces as $\epsilon 0$ .
|
| 74 |
+
|
| 75 |
+
Theorem 3.4 allows us to make the following definition:
|
| 76 |
+
|
| 77 |
+
Definition 3.5. Suppose that a nonlinear function $\sigma$ is given. For $p$ a multivariate polynomial, let munk $m _ { k } ^ { u n i f o r m } ( p )$ be the minimum number of neurons in a depth- $k$ network that $\epsilon$ -approximates $p$ for all $\epsilon$ arbitrarily small. Set $m ^ { u n i f o r m } ( p ) = \mathrm { m i n } _ { k } m _ { k } ^ { u n i f o r m } ( p )$ . Likewise, let mTaylork (p) be the minimum number of neurons in a depth- $k$ network that Taylor-approximates $p _ { ; }$ , and set $m ^ { T a y l o r } ( p ) =$ $\mathrm { m i n } _ { k } m _ { k } ^ { T a y l o r } ( p )$
|
| 78 |
+
|
| 79 |
+
In the next section, we will show that there is an exponential gap between $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p )$ and $m ^ { \mathrm { u n i f o r m } } ( p )$ and between $m _ { 1 } ^ { \mathrm { T a y l o r } } ( p )$ and $m ^ { \mathrm { T a y l o r } } ( p )$ for various classes of polynomials $p$ .
|
| 80 |
+
|
| 81 |
+
# 4 THE INEFFICIENCY OF SHALLOW NETWORKS
|
| 82 |
+
|
| 83 |
+
In this section, we compare the efficiency of shallow networks (those with a single hidden layer) and deep networks at approximating multivariate polynomials. Proofs of our main results are included in the Appendix.
|
| 84 |
+
|
| 85 |
+
# 4.1 MULTIVARIATE POLYNOMIALS
|
| 86 |
+
|
| 87 |
+
Our first result shows that uniform approximation of monomials requires exponentially more neurons in a shallow than a deep network.
|
| 88 |
+
|
| 89 |
+
Theorem 4.1. Let $p ( \mathbf { x } )$ denote the monomial $x _ { 1 } ^ { r _ { 1 } } x _ { 2 } ^ { r _ { 2 } } \cdot \cdot \cdot x _ { n } ^ { r _ { n } }$ , with $\begin{array} { r } { d = \sum _ { i = 1 } ^ { n } r _ { i } } \end{array}$ . Suppose that the nonlinearity $\sigma$ has nonzero Taylor coefficients up to degree $2 d$ . Then, we have:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\begin{array} { r l } & { ( i ) ~ m _ { 1 } ^ { u n i f o r m } ( p ) = \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) , } \\ & { ( i i ) ~ m ^ { u n i f o r m } ( p ) \leq \sum _ { i = 1 } ^ { n } ( 7 \lceil \log _ { 2 } ( r _ { i } ) \rceil + 4 ) , } \end{array}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $\lceil x \rceil$ denotes the smallest integer that is at least $x$ .
|
| 96 |
+
|
| 97 |
+
We can prove a comparable result for $m ^ { \mathrm { T a y l o r } }$ under slightly weaker assumptions on $\sigma$ . Note that by setting $r _ { 1 } = r _ { 2 } = . . . = r _ { n } = 1$ , we recover the result of Lin et al. (2017) that the product of $n$ numbers requires $2 ^ { n }$ neurons in a shallow network but can be Taylor-approximated with linearly many neurons in a deep network.
|
| 98 |
+
|
| 99 |
+
Theorem 4.2. Let $p ( \mathbf { x } )$ denote the monomial $x _ { 1 } ^ { r _ { 1 } } x _ { 2 } ^ { r _ { 2 } } \cdot \cdot \cdot x _ { n } ^ { r _ { n } }$ , with $\begin{array} { r } { d = \sum _ { i = 1 } ^ { n } r _ { i } } \end{array}$ . Suppose that $\sigma$ has nonzero Taylor coefficients up to degree . Then, we have:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r l } & { ( i ) ~ m _ { 1 } ^ { T a y l o r } ( p ) = \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) , } \\ & { ( i i ) ~ m ^ { T a y l o r } ( p ) \leq \sum _ { i = 1 } ^ { n } ( 7 \lceil \log _ { 2 } ( r _ { i } ) \rceil + 4 ) . } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
It is worth noting that neither of Theorems 4.1 and 4.2 implies the other. This is because it is possible for a polynomial to admit a compact uniform approximation without admitting a compact Taylor approximation.
|
| 106 |
+
|
| 107 |
+
It is natural now to consider the cost of approximating general polynomials. However, without further constraint, this is relatively uninstructive because polynomials of degree $d$ in $n$ variables live within a space of dimension $( \overset { - } { \underset { d } { \cdot } } ^ { + d } )$ , and therefore most require exponentially many neurons for any depth of network. We therefore consider polynomials of sparsity $c$ : that is, those that can be represented as the sum of $c$ monomials. This includes many natural functions.
|
| 108 |
+
|
| 109 |
+
The following theorem, when combined with Theorems 4.1 and 4.2, shows that general polynomials $p$ with subexponential sparsity have exponentially large $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p )$ and $m _ { 1 } ^ { \mathrm { T a y l o r } } ( p )$ , but subexponential $m ^ { \mathrm { u n i f o r m } } ( p )$ and $m ^ { \mathrm { T a y l o r } } ( p )$ .
|
| 110 |
+
|
| 111 |
+
Theorem 4.3. Let $p ( \mathbf { x } )$ be a multivariate polynomial of degree d and sparsity c, having monomials $q _ { 1 } ( \mathbf { x } ) , q _ { 2 } ( \mathbf { x } ) , \ldots , q _ { c } ( \mathbf { x } )$ . Suppose that the nonlinearity $\sigma$ has nonzero Taylor coefficients up to degree $2 d$ . Then, we have:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { r l } & { ) \ m _ { 1 } ^ { u n i f o r m } ( p ) \geq \frac { 1 } { c } \operatorname* { m a x } _ { j } \ m _ { 1 } ^ { u n i f o r m } ( q _ { j } ) . } \\ & { ) \ m ^ { u n i f o r m } ( p ) \leq \sum _ { j } \ m ^ { u n i f o r m } ( q _ { j } ) . } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
These statements also hold if $m ^ { u n i f o r m }$ is replaced with $m ^ { T a y l o r }$
|
| 118 |
+
|
| 119 |
+
As mentioned above with respect to ReLUs, some assumptions on the Taylor coefficients of the activation function are necessary for the results we present. However, it is possible to loosen the assumptions of Theorem 4.1 and 4.2 while still obtaining exponential lower bounds on $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p )$ and Taylor1 (p):
|
| 120 |
+
|
| 121 |
+
Theorem 4.4. Let $p ( \mathbf { x } )$ denote the monomial $x _ { 1 } ^ { r _ { 1 } } x _ { 2 } ^ { r _ { 2 } } \cdot \cdot \cdot x _ { n } ^ { r _ { n } }$ , with $\begin{array} { r } { d = \sum _ { i = 1 } ^ { n } r _ { i } } \end{array}$ . Suppose that the nonlinearity $\sigma$ has nonzero dth Taylor coefficient (other Taylor coefficients are allowed to be zero). Then, $m _ { 1 } ^ { u n i f o r m } ( p )$ and $m _ { 1 } ^ { T a y l o r } ( p )$ are at least $\begin{array} { r } { \frac { 1 } { d } \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) } \end{array}$ . (An even better lower bound is the maximum coefficient in the polynomial $\textstyle \prod _ { i } ( 1 + y + \dotsc + y ^ { r _ { i } } )$ .)
|
| 122 |
+
|
| 123 |
+
# 4.2 UNIVARIATE POLYNOMIALS
|
| 124 |
+
|
| 125 |
+
As with multivariate polynomials, depth can offer an exponential savings when approximating univariate polynomials. We show below (Proposition 4.5) that a shallow network can approximate any degree- $d$ univariate polynomial with a number of neurons at most linear in $d$ . The monomial $x ^ { \dot { d } }$ requires $d + 1$ neurons in a shallow network (Proposition 4.6), but can be approximated with only logarithmically many neurons in a deep network. Thus, depth allows us to reduce networks from linear to logarithmic size, while for multivariate polynomials the gap was between exponential and linear. The difference here arises because the dimensionality of the space of univariate degree- $d$ polynomials is linear in $d$ , which the dimensionality of the space of multivariate degree- $d$ polynomials is exponential in $d$ .
|
| 126 |
+
|
| 127 |
+
Proposition 4.5. Suppose that the nonlinearity Then, $m _ { 1 } ^ { T a y l o r } ( p ) \leq \bar { d } + 1$ for every univariate polynomial $\sigma$ has nonzero Taylor coefficients up to degree $p$ of degree $d .$ . $d$ .
|
| 128 |
+
|
| 129 |
+
Proof. Pick $a _ { 0 } , a _ { 1 } , \ldots , a _ { d }$ to be arbitrary, distinct real numbers. Consider the Vandermonde matrix A with entries $A _ { i j } = a _ { i } ^ { j }$ . It is well-known that $\begin{array} { r } { \operatorname* { d e t } ( \mathbf { A } ) = \prod _ { i < i ^ { \prime } } ( a _ { i ^ { \prime } } - a _ { i } ) \neq 0 } \end{array}$ . Hence, A is invertible, which means that multiplying its columns by nonzero values gives another invertible matrix. Suppose that we multiply the $j$ th column of $\mathbf { A }$ by $\sigma _ { j }$ to get $\mathbf { A } ^ { \prime }$ , where $\begin{array} { r } { \sigma ( x ) = \sum _ { j } \sigma _ { j } x ^ { j } } \end{array}$ is the Taylor expansion of $\sigma ( x )$ .
|
| 130 |
+
|
| 131 |
+
Now, observe that the $i$ th row of $\mathbf { A } ^ { \prime }$ is exactly the coefficients of $\sigma ( a _ { i } x )$ , up to the degree- $d$ term. Since $\mathbf { A } ^ { \prime }$ is invertible, the rows must be linearly independent, so the polynomials $\sigma ( a _ { i } x )$ , restricted to terms of degree at most $d$ , must themselves be linearly independent. Since the space of degree- $d$ univariate polynomials is $( d + 1 )$ -dimensional, these $d + 1$ linearly independent polynomials must span the space. Hence, $m _ { 1 } ^ { \mathrm { T a y l o r } } ( p ) \leq d + 1$ for any univariate degree- $d$ polynomial $p$ . In fact, we can fix the weights from the input neuron to the hidden layer (to be $a _ { 0 } , a _ { 1 } , \ldots , a _ { d }$ , respectively) and still represent any polynomial $p$ with $d + 1$ hidden neurons. □
|
| 132 |
+
|
| 133 |
+
Proposition 4.6. Let $p ( x ) = x ^ { d }$ , and suppose that the nonlinearity $\sigma ( x )$ has nonzero Taylor coefficients up to degree $2 d$ . Then, we have:
|
| 134 |
+
|
| 135 |
+
(i) $m _ { 1 } ^ { u n i f o r m } ( p ) = d + 1 .$ (ii) $m ^ { u n i f o r m } ( p ) \leq 7 \lceil \log _ { 2 } ( d ) \rceil .$
|
| 136 |
+
|
| 137 |
+
These statements also hold if $m ^ { u n i f o r m }$ is replaced with $m ^ { T a y l o r }$ .
|
| 138 |
+
|
| 139 |
+
Proof. Part (i) follows from part (i) of Theorems 4.1 and 4.2 by setting $n = 1$ and $r _ { 1 } = d$ .
|
| 140 |
+
|
| 141 |
+
For part (ii), observe that we can Taylor-approximate the square $x ^ { 2 }$ of an input $x$ with three neurons in a single layer:
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
{ \frac { 1 } { 2 \sigma ^ { \prime \prime } ( 0 ) } } \left( \sigma ( x ) + \sigma ( - x ) - 2 \sigma ( 0 ) \right) = x ^ { 2 } + { \mathcal { O } } ( x ^ { 4 } + x ^ { 5 } + . . . ) .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
We refer to this construction as a square gate, and the construction of Lin et al. (2017) as a product gate. We also use identity gate to refer to a neuron that simply preserves the input of a neuron from the preceding layer (this is equivalent to the skip connections in residual nets (He et al., 2016)).
|
| 148 |
+
|
| 149 |
+
Consider a network in which each layer contains a square gate (3 neurons) and either a product gate or an identity gate (4 or 1 neurons, respectively), according to the following construction: The square gate squares the output of the preceding square gate, yielding inductively a result of the form $x ^ { \hat { 2 } ^ { k } }$ , where $k$ is the depth of the layer. Writing $d$ in binary, we use a product gate if there is a 1 in the $2 ^ { k - 1 }$ -place; if so, the product gate multiplies the output of the preceding product gate by the output of the preceding square gate. If there is a 0 in the $2 ^ { { \dot { k } } - 1 }$ -place, we use an identity gate instead of a product gate. Thus, each layer computes $x ^ { 2 ^ { k } }$ and multiplies $x ^ { 2 ^ { k - 1 } }$ to the computation if the $2 ^ { k - 1 }$ -place in $d$ is 1. The process stops when the product gate outputs $x ^ { d }$ .
|
| 150 |
+
|
| 151 |
+
This network clearly uses at most $7 \lceil \log _ { 2 } ( d ) \rceil$ neurons, with a worst case scenario where $d + 1$ is a power of 2. Hence $m ^ { \mathrm { T a y l o r } } ( p ) \leq 7 \lceil \log _ { 2 } ( \bar { d } ) \rceil$ , with $m ^ { \mathrm { u n i f o r m } } ( p ) \leq m ^ { \mathrm { T a y l o r } } ( p )$ by Proposition 3.3 since $p$ is homogeneous. □
|
| 152 |
+
|
| 153 |
+
# 5 HOW EFFICIENCY IMPROVES WITH DEPTH
|
| 154 |
+
|
| 155 |
+
We now consider how $m _ { k } ^ { \mathrm { u n i f o r m } } ( p )$ scales with $k$ , interpolating between exponential in $n$ (for $k = 1$ and linear in $n$ (for $k = \log n$ ). In practice, networks with modest $k > 1$ are effective at representing natural functions. We explain this theoretically by showing that the cost of approximating the product polynomial drops off rapidly as $k$ increases.
|
| 156 |
+
|
| 157 |
+
By repeated application of the shallow network construction in Lin et al. (2017), we obtain the following upper bound on $m _ { k } ^ { \mathrm { u n i f o r m } } ( p )$ , which we conjecture to be essentially tight. Our approach leverages the compositionality of polynomials, as discussed e.g. in Mhaskar et al. (2016) and Poggio et al. (2017), using a tree-like neural network architecture.
|
| 158 |
+
|
| 159 |
+
Theorem 5.1. Let $p ( \mathbf { x } )$ equal the product $x _ { 1 } x _ { 2 } \cdots x _ { n }$ , and suppose $\sigma$ has nonzero Taylor coefficients up to degree $n$ . Then, we have:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
m _ { k } ^ { u n i f o r m } ( p ) = \mathcal { O } \left( n ^ { ( k - 1 ) / k } \cdot 2 ^ { n ^ { 1 / k } } \right) .
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
Proof. We construct a network in which groups of the $n$ inputs are recursively multiplied up to Taylor approximation. The $n$ inputs are first divided into groups of size $b _ { 1 }$ , and each group is multiplied in the first hidden layer using $2 ^ { b _ { 1 } }$ neurons (as described in Lin et al. (2017)). Thus, the first hidden layer includes a total of $2 ^ { b _ { 1 } } \bar { n } / b _ { 1 }$ neurons. This gives us $n / b _ { 1 }$ values to multiply, which are in turn divided into groups of size $b _ { 2 }$ . Each group is multiplied in the second hidden layer using $2 ^ { b _ { 2 } }$ neurons. Thus, the second hidden layer includes a total of $2 ^ { b _ { 2 } } n / ( b _ { 1 } b _ { 2 } )$ neurons.
|
| 166 |
+
|
| 167 |
+
We continue in this fashion for $b _ { 1 } , b _ { 2 } , \dots , b _ { k }$ such that $b _ { 1 } b _ { 2 } \cdot \cdot \cdot b _ { k } = n$ , giving us one neuron which is the product of all of our inputs. By considering the total number of neurons used, we conclude
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
m _ { k } ^ { \mathrm { { T a y l o r } } } ( p ) \leq \sum _ { i = 1 } ^ { k } { \frac { n } { \prod _ { j = 1 } ^ { i } b _ { j } } } 2 ^ { b _ { i } } = \sum _ { i = 1 } ^ { k } \left( \prod _ { j = i + 1 } ^ { k } b _ { j } \right) 2 ^ { b _ { i } } .
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
By Proposition 3.3, $m _ { k } ^ { \mathrm { u n i f o r m } } ( p ) \leq m _ { k } ^ { \mathrm { T a y l o r } } ( p )$ since $p$ is homogeneous. Setting $b _ { i } = n ^ { 1 / k }$ , for each $i$ gives us the desired bound (1). □
|
| 174 |
+
|
| 175 |
+
In fact, we can solve for the choice of $b _ { i }$ such that the upper bound in (2) is minimized, under the condition $b _ { 1 } b _ { 2 } \cdot \cdot \cdot b _ { k } = n$ . Using the technique of Lagrange multipliers, we know that the optimum occurs at a minimum of the function
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
{ \mathcal { L } } ( b _ { i } , \lambda ) : = \left( n - \prod _ { i = 1 } ^ { k } b _ { i } \right) \lambda + \sum _ { i = 1 } ^ { k } \left( \prod _ { j = i + 1 } ^ { k } b _ { j } \right) 2 ^ { { b } _ { i } } .
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 1: The optimal settings for $\{ b _ { i } \} _ { i = 1 } ^ { k }$ as $n$ varies are shown for $k = 1 , 2 , 3$ . Observe that the $b _ { i }$ converge to $n ^ { 1 / k }$ for large $n$ , as witnessed by a linear fit in the log-log plot. The exact values are given by equations (4) and (5).
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 2: Performance of trained networks in approximating the product of 20 input variables, ranging from red (high error) to blue (low error). The error shown here is the expected absolute difference between the predicted and actual product. The curve w = n(k−1)/k · 2n1/k for $n = 2 0$ is shown in black. In the region above and to the right of the curve, it is possible to effectively approximate the product function (Theorem 5.1).
|
| 186 |
+
|
| 187 |
+
Differentiating $\mathcal { L }$ with respect to $b _ { i }$ , we obtain the conditions
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\begin{array} { l } { { \displaystyle 0 = - \lambda \prod _ { j \neq i } b _ { j } + \sum _ { h = 1 } ^ { i - 1 } \left( \frac { \prod _ { j = h + 1 } ^ { k } b _ { j } } { b _ { i } } \right) 2 ^ { b _ { h } } + ( \log 2 ) \left( \prod _ { j = i + 1 } ^ { k } b _ { j } \right) 2 ^ { b _ { i } } , \mathrm { f o r } 1 \leq i \leq k } } \\ { { \displaystyle 0 = n - \prod _ { j = 1 } ^ { k } b _ { j } } . } \end{array}
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
Dividing (3) by $\textstyle \prod _ { j = i + 1 } ^ { k } b _ { j }$ and rearranging gives us the recursion
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
b _ { i } = b _ { i - 1 } + \log _ { 2 } ( b _ { i - 1 } - 1 / \log 2 ) .
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
Thus, the optimal $b _ { i }$ are not exactly equal but very slowly increasing with $i$ (see Figure 1).
|
| 200 |
+
|
| 201 |
+
The following conjecture states that the bound given in Theorem 5.1 is (approximately) optimal.
|
| 202 |
+
|
| 203 |
+
Conjecture 5.2. Let $p ( \mathbf { x } )$ equal to the product $x _ { 1 } x _ { 2 } \cdots x _ { n }$ , and suppose that $\sigma$ has all nonzero Taylor coefficients. Then, we have:
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
m _ { k } ^ { u n i f o r m } ( p ) = 2 ^ { \Theta ( n ^ { 1 / k } ) } ,
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
i.e., the exponent grows as $n ^ { 1 / k }$ for $n \to \infty$
|
| 210 |
+
|
| 211 |
+
We empirically tested Conjecture 5.2 by training ANNs to predict the product of input values $x _ { 1 } , \ldots , x _ { n }$ with $n = 2 0$ (see Figure 2). The rapid interpolation from exponential to linear width aligns with our predictions.
|
| 212 |
+
|
| 213 |
+
In our experiments, we used feedforward networks with dense connections between successive layers. In the figure, we show results for $\sigma ( x ) = \operatorname { t a n h } ( x )$ (note that this behavior is even better than expected, since this function actually has numerous zero Taylor coefficients). Similar results were also obtained for rectified linear units (ReLUs) as the nonlinearity, despite the fact that this function does not even admit a Taylor series. The number of layers was varied, as was the number of neurons within a single layer. The networks were trained using the AdaDelta optimizer (Zeiler, 2012) to minimize the absolute value of the difference between the predicted and actual values. Input variables $x _ { i }$ were drawn uniformly at random from the interval $[ 0 , 2 ]$ , so that the expected value of the output would be of manageable size.
|
| 214 |
+
|
| 215 |
+
Eq. (6) provides a helpful rule of thumb for how deep is deep enough. Suppose, for instance, that we wish to keep typical layers no wider than about a thousand $( \sim 2 ^ { 1 0 } )$ neurons. Eq. (6) then implies $n ^ { 1 / k } \lesssim 1 0$ , i.e., that the number of layers should be at least
|
| 216 |
+
|
| 217 |
+
$$
|
| 218 |
+
k \gtrsim \log _ { 1 0 } n .
|
| 219 |
+
$$
|
| 220 |
+
|
| 221 |
+
It would be very interesting if one could show that general polynomials $p$ in $n$ variables require a superpolynomial number of neurons to approximate for any constant number of hidden layers. The analogous statement for Boolean circuits - whether the complexity classes $T C ^ { 0 }$ and $T C ^ { \bar { 1 } }$ are equal - remains unresolved and is assumed to be quite hard. Note that the formulations for Boolean circuits and deep neural networks are independent statements (neither would imply the other) due to the differences between computation on binary and real values. Indeed, gaps in expressivity have already been proven to exist for real-valued neural networks of different depths, for which the analogous results remain unknown in Boolean circuits (see e.g. Mhaskar (1993); Chui et al. (1994; 1996); Montufar et al. (2014); Cohen et al. (2016); Telgarsky (2016)).
|
| 222 |
+
|
| 223 |
+
# 6 CONCLUSION
|
| 224 |
+
|
| 225 |
+
We have shown how the power of deeper ANNs can be quantified even for simple polynomials. We have proved that arbitrarily good approximations of polynomials are possible even with a fixed number of neurons and that there is an exponential gap between the width of shallow and deep networks required for approximating a given sparse polynomial. For $n$ variables, a shallow network requires size exponential in $n$ , while a deep network requires at most linearly many neurons. Networks with a constant number $k > 1$ of hidden layers appear to interpolate between these extremes, following a curve exponential in $n ^ { 1 / k }$ . This suggests a rough heuristic for the number of layers required for approximating simple functions with neural networks. For example, if we want no layers to have more than $2 ^ { 1 0 }$ neurons, say, then the minimum number of layers required grows only as $\log _ { 1 0 } n$ . To further improve efficiency using the ${ \mathcal { O } } ( n )$ constructions we have presented, it suffices to increase the number of layers by a factor of $\log _ { 2 } { 1 0 } \approx 3$ , to $\log _ { 2 } n$ .
|
| 226 |
+
|
| 227 |
+
The key property we use in our constructions is compositionality, as detailed in Poggio et al. (2017). It is worth noting that as a consequence our networks enjoy the property of locality mentioned in Cohen et al. (2016), which is also a feature of convolutional neural nets. That is, each neuron in a layer is assumed to be connected only to a small subset of neurons from the previous layer, rather than the entirety (or some large fraction). In fact, we showed (e.g. Prop. 4.6) that there exist natural functions computable with linearly many neurons, with each neuron is connected to at most two neurons in the preceding layer, which nonetheless cannot be computed with fewer than exponentially many neurons in a single layer, no matter how may connections are used. Our construction can also be framed with reference to the other properties mentioned in Cohen et al. (2016): those of sharing (in which weights are shared between neural connections) and pooling (in which layers are gradually collapsed, as our construction essentially does with recursive combination of inputs).
|
| 228 |
+
|
| 229 |
+
This paper has focused exclusively on the resources (neurons and synapses) required to compute a given function for fixed network depth. (Note also results of Lu et al. (2017); Hanin & Sellke (2017); Hanin (2017) for networks of fixed width.) An important complementary challenge is to quantify the resources (e.g. training steps) required to learn the computation, i.e., to converge to appropriate weights using training data — possibly a fixed amount thereof, as suggested in Zhang et al. (2017). There are simple functions that can be computed with polynomial resources but require exponential resources to learn (Shalev-Shwartz et al., 2017). It is quite possible that architectures we have not considered increase the feasibility of learning. For example, residual networks (ResNets) (He et al., 2016) and unitary nets (see e.g. Arjovsky et al. (2016); Jing et al. (2017)) are no more powerful in representational ability than conventional networks of the same size, but by being less susceptible to the “vanishing/exploding gradient” problem, it is far easier to optimize them in practice. We look forward to future work that will help us understand the power of neural networks to learn.
|
| 230 |
+
|
| 231 |
+
# 7 ACKNOWLEDGMENTS
|
| 232 |
+
|
| 233 |
+
This work was supported by the Foundational Questions Institute http://fqxi.org/, the Rothberg Family Fund for Cognitive Science and NSF grant 1122374. We would like to thank Tomaso Poggio, Scott Aaronson, Surya Ganguli, David Budden, Henry Lin, and the anonymous referees for helpful suggestions and discussions, and the Center for Brains, Minds, & Machines for an excellent working environment.
|
| 234 |
+
|
| 235 |
+
# REFERENCES
|
| 236 |
+
|
| 237 |
+
Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In International Conference on Machine Learning (ICML), pp. 1120–1128, 2016.
|
| 238 |
+
|
| 239 |
+
Andrew R Barron. Approximation and estimation bounds for artificial neural networks. Machine Learning, 14(1):115–133, 1994.
|
| 240 |
+
|
| 241 |
+
Monica Bianchini and Franco Scarselli. On the complexity of neural network classifiers: A comparison between shallow and deep architectures. IEEE transactions on neural networks and learning systems, 25(8):1553–1565, 2014.
|
| 242 |
+
|
| 243 |
+
Charles K Chui, Xin Li, and Hrushikesh Narhar Mhaskar. Limitations of the approximation capabilities of neural networks with one hidden layer. Advances in Computational Mathematics, 5(1): 233–243, 1996.
|
| 244 |
+
|
| 245 |
+
CK Chui, Xin Li, and HN Mhaskar. Neural networks for localized approximation. Mathematics of Computation, 63(208):607–623, 1994.
|
| 246 |
+
|
| 247 |
+
Nadav Cohen and Amnon Shashua. Convolutional rectifier networks as generalized tensor decompositions. In International Conference on Machine Learning (ICML), 2016.
|
| 248 |
+
|
| 249 |
+
Nadav Cohen, Or Sharir, and Amnon Shashua. On the expressive power of deep learning: A tensor analysis. Journal of Machine Learning Research (JMLR), 49, 2016.
|
| 250 |
+
|
| 251 |
+
George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals, and Systems (MCSS), 2(4):303–314, 1989.
|
| 252 |
+
|
| 253 |
+
Amit Daniely. Depth separation for neural networks. In Conference On Learning Theory (COLT), 2017.
|
| 254 |
+
|
| 255 |
+
Olivier Delalleau and Yoshua Bengio. Shallow vs. deep sum-product networks. In Advances in Neural Information Processing Systems (NIPS), pp. 666–674, 2011.
|
| 256 |
+
|
| 257 |
+
Ronen Eldan and Ohad Shamir. The power of depth for feedforward neural networks. In Annual Conference on Learning Theory (COLT), pp. 907–940, 2016.
|
| 258 |
+
|
| 259 |
+
Ken-Ichi Funahashi. On the approximate realization of continuous mappings by neural networks. Neural networks, 2(3):183–192, 1989.
|
| 260 |
+
|
| 261 |
+
Boris Hanin. Universal function approximation by deep neural nets with bounded width and ReLU activations. arXiv preprint arXiv:1708.02691, 2017.
|
| 262 |
+
|
| 263 |
+
Boris Hanin and Mark Sellke. Approximating continuous functions by ReLU nets of minimal width. arXiv preprint arXiv:1710.11278, 2017.
|
| 264 |
+
|
| 265 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
|
| 266 |
+
|
| 267 |
+
Kurt Hornik, Maxwell Stinchcombe, and Halbert White. Multilayer feedforward networks are universal approximators. Neural networks, 2(5):359–366, 1989.
|
| 268 |
+
|
| 269 |
+
Li Jing, Yichen Shen, Tena Dubcek, John Peurifoy, Scott Skirlo, Yann LeCun, Max Tegmark, and Marin Soljaciˇ c. Tunable efficient unitary neural networks (EUNN) and their application to RNNs. ´ In International Conference on Machine Learning (ICML), pp. 1733–1741, 2017.
|
| 270 |
+
|
| 271 |
+
Henry W Lin, Max Tegmark, and David Rolnick. Why does deep and cheap learning work so well? Journal of Statistical Physics, 168(6):1223–1247, 2017.
|
| 272 |
+
|
| 273 |
+
Zhou Lu, Hongming Pu, Feicheng Wang, Zhiqiang Hu, and Liwei Wang. The expressive power of neural networks: A view from the width. In Advances in Neural Information Processing Systems (NIPS), pp. 6232–6240, 2017.
|
| 274 |
+
|
| 275 |
+
James Martens, Arkadev Chattopadhya, Toni Pitassi, and Richard Zemel. On the representational efficiency of restricted Boltzmann machines. In Advances in Neural Information Processing Systems (NIPS), pp. 2877–2885, 2013.
|
| 276 |
+
|
| 277 |
+
Hrushikesh Mhaskar, Qianli Liao, and Tomaso Poggio. Learning functions: When is deep better than shallow. arXiv:1603.00988v4, 2016.
|
| 278 |
+
|
| 279 |
+
Hrushikesh Narhar Mhaskar. Approximation properties of a multilayered feedforward artificial neural network. Advances in Computational Mathematics, 1(1):61–80, 1993.
|
| 280 |
+
|
| 281 |
+
Guido F Montufar, Razvan Pascanu, Kyunghyun Cho, and Yoshua Bengio. On the number of linear regions of deep neural networks. In Advances in Neural Information Processing Systems (NIPS), pp. 2924–2932, 2014.
|
| 282 |
+
|
| 283 |
+
Allan Pinkus. Approximation theory of the mlp model in neural networks. Acta Numerica, 8: 143–195, 1999.
|
| 284 |
+
|
| 285 |
+
Tomaso Poggio, Hrushikesh Mhaskar, Lorenzo Rosasco, Brando Miranda, and Qianli Liao. Why and when can deep-but not shallow-networks avoid the curse of dimensionality: A review. International Journal of Automation and Computing, 15(5):503–519, 2017.
|
| 286 |
+
|
| 287 |
+
Ben Poole, Subhaneil Lahiri, Maithra Raghu, Jascha Sohl-Dickstein, and Surya Ganguli. Exponential expressivity in deep neural networks through transient chaos. In Advances In Neural Information Processing Systems (NIPS), pp. 3360–3368, 2016.
|
| 288 |
+
|
| 289 |
+
Maithra Raghu, Ben Poole, Jon Kleinberg, Surya Ganguli, and Jascha Sohl-Dickstein. Survey of expressivity in deep neural networks. arXiv:1611.08083, 2016.
|
| 290 |
+
|
| 291 |
+
Shai Shalev-Shwartz, Ohad Shamir, and Shaked Shammah. Failures of gradient-based deep learning. In International Conference on Machine Learning (ICML), pp. 3067–3075, 2017.
|
| 292 |
+
|
| 293 |
+
Matus Telgarsky. Benefits of depth in neural networks. Journal of Machine Learning Research (JMLR), 49, 2016.
|
| 294 |
+
|
| 295 |
+
Matthew D Zeiler. ADADELTA: an adaptive learning rate method. arXiv:1212.5701, 2012.
|
| 296 |
+
|
| 297 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In International Conference on Learning Representations (ICLR), 2017.
|
| 298 |
+
|
| 299 |
+
# APPENDIX
|
| 300 |
+
|
| 301 |
+
# 7.1 PROOF OF THEOREM 4.1.
|
| 302 |
+
|
| 303 |
+
Without loss of generality, suppose that $r _ { i } > 0$ for $i = 1 , \ldots , n$ . Let $X$ be the multiset in which $x _ { i }$ occurs with multiplicity $r _ { i }$ .
|
| 304 |
+
|
| 305 |
+
We first show that $\textstyle \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 )$ neurons are sufficient to approximate $p ( \mathbf { x } )$ . Appendix A in Lin et al. (2017) demonstrates that for variables $y _ { 1 } , \ldots , y _ { N }$ , the product $y _ { 1 } \cdots y _ { N }$ can be Taylorapproximated as a linear combination of the $2 ^ { N }$ functions $\sigma ( \pm y _ { 1 } \pm \cdot \cdot \cdot \pm y _ { d } )$ .
|
| 306 |
+
|
| 307 |
+
Consider setting $y _ { 1 } , \ldots , y _ { d }$ equal to the elements of multiset $X$ . Then, we conclude that we can approximate $p ( \mathbf { x } )$ as a linear combination of the functions $\sigma ( \pm y _ { 1 } \pm \cdot \cdot \pm y _ { d } )$ . However, these functions are not all distinct: there are $r _ { i } + 1$ distinct ways to assign $\pm$ signs to $r _ { i }$ copies of $x _ { i }$ (ignoring permutations of the signs). Therefore, there are $\textstyle \prod _ { i = 1 } ^ { n } ( r _ { i } + { \bar { 1 } } )$ distinct functions $\sigma ( \pm y _ { 1 } \pm$ $\cdots \pm y _ { N } )$ , proving that $\begin{array} { r } { m ^ { \mathrm { { I a y l o r } } } ( p ) \leq \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) } \end{array}$ . Proposition 3.3 implies that for homogeneous polynomials $p$ , we have $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p ) \leq m _ { 1 } ^ { \mathrm { T a y l o r } } ( p )$ .
|
| 308 |
+
|
| 309 |
+
We now show that this number of neurons is also necessary for approximating $p ( \mathbf { x } )$ . Suppose that $N _ { \epsilon } ( \mathbf { x } )$ is an $\epsilon$ -approximation to $p ( \mathbf { x } )$ with depth 1, and let the Taylor series of $N _ { \epsilon } ( \mathbf { x } )$ be $p ( \mathbf { x } ) + E ( \mathbf { x } )$ . Let $\dot { E } _ { k } ( { \bf x } )$ be the degree- $k$ homogeneous component of $E ( \mathbf { x } )$ , for $0 \leq k \leq 2 d$ . By the definition of $\epsilon$ -approximation, $\operatorname* { s u p } _ { \mathbf { x } } E ( \mathbf { x } )$ goes to 0 as $\epsilon$ does, so by picking $\epsilon$ small enough, we can ensure that the coefficients of each $E _ { k } ( { \bf x } )$ go to 0.
|
| 310 |
+
|
| 311 |
+
Let ing $m = m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p )$ and suppose that der, we conclude t $\sigma ( x )$ has the Taylor expere exist constants ion an $\scriptstyle \sum _ { k = 0 } ^ { \infty } \sigma _ { k } x ^ { k }$ . Then, by group-at $a _ { i j }$ $w _ { j }$
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { l } { { \displaystyle \sigma _ { d } \sum _ { j = 1 } ^ { m } w _ { j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d } = p ( { \bf x } ) + { \cal E } _ { d } ( { \bf x } ) } } \\ { { \displaystyle \sigma _ { k } \sum _ { j = 1 } ^ { m } w _ { j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { k } = { \cal E } _ { k } ( { \bf x } ) \quad \mathrm { f o r ~ } k \ne d . } } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
For each $S \subseteq X$ , let us take the derivative of this equation by every variable that occurs in $S$ , where we take multiple derivatives of variables that occur multiple times. This gives
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { l } { { \displaystyle \frac { \sigma _ { d } \cdot d ! } { | S | ! } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { h \in S } a _ { h j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - | S | } = \frac { \partial } { \partial S } p ( { \bf x } ) + \frac { \partial } { \partial S } E _ { d } ( { \bf x } ) } , } \\ { { \displaystyle \frac { \sigma _ { k } \cdot k ! } { | S | ! } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { h \in S } a _ { h j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { k - | S | } = \frac { \partial } { \partial S } E _ { k } ( { \bf x } ) } . } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Observe that there are $\begin{array} { r } { r \equiv \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) } \end{array}$ choices for $S$ , since each variable $x _ { i }$ can be included anywhere from 0 to $r _ { i }$ times. Define A to be the $r \times m$ matrix with entries $\begin{array} { r } { A _ { S , j } = \prod _ { h \in S } a _ { h j } } \end{array}$ . We claim that A has full row rank. This would show that the number of columns $m$ is at least the number of rows $\begin{array} { r } { r = \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) } \end{array}$ , proving the desired lower bound on $m$ .
|
| 324 |
+
|
| 325 |
+
Suppose towards contradiction that the rows $A _ { S _ { \ell } }$ ,• admit a linear dependence:
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\sum _ { \ell = 1 } ^ { r } c _ { \ell } A _ { S _ { \ell } , \bullet } = \mathbf { 0 } ,
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
where the coefficients $c _ { \ell }$ are all nonzero and the $S _ { \ell }$ denote distinct subsets of $X$ . Let $S _ { * }$ be such that $\left| c _ { * } \right|$ is maximized. Then, take the dot product of each side of the above equation by the vector with entries (indexed by $j$ ) equal to $\scriptstyle w _ { j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - | S _ { * } | }$ :
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { l } { \displaystyle 0 = \sum _ { \ell = 1 } ^ { r } c _ { \ell } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { h \in S _ { \ell } } a _ { h j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - | S _ { * } | } } \\ { = \sum _ { \ell | ( | S _ { \ell } | = | S _ { * } | ) } c _ { \ell } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { h \in S _ { \ell } } a _ { h j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - | S _ { \ell } | } } \\ { + \displaystyle \sum _ { \ell | ( | S _ { \ell } | \neq | S _ { * } | ) } c _ { \ell } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { h \in S _ { \ell } } a _ { h j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { ( d + | S _ { \ell } | - | S _ { * } | ) - | S _ { \ell } | } . } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
We can use (7) to simplify the first term and (8) (with $k = d + | S _ { \ell } | - | S _ { * } | )$ to simplify the second term, giving us:
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\begin{array} { l } { { \displaystyle 0 = \sum _ { \ell | ( | S _ { \ell } | = | S _ { * } | ) } c _ { \ell } \cdot \frac { | S _ { \ell } | ! } { \sigma _ { d } \cdot d ! } \cdot \left( \frac { \partial } { \partial S _ { \ell } } p ( { \bf x } ) + \frac { \partial } { \partial S _ { \ell } } E _ { d } ( { \bf x } ) \right) } } \\ { { \displaystyle + \sum _ { \ell | ( | S _ { \ell } | \neq | S _ { * } | ) } c _ { \ell } \cdot \frac { | S _ { \ell } | ! } { \sigma _ { d + | S _ { \ell } | - | S _ { * } | } \cdot ( d + | S _ { \ell } | - | S _ { * } | ) ! } \cdot \frac { \partial } { \partial S _ { \ell } } E _ { d + | S _ { \ell } | - | S _ { * } | } ( { \bf x } ) } } \end{array}
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
Consider the coefficient of the monomia l ∂∂S p(x), which appears in the first summand with coefficient $c _ { * } \cdot \frac { | S _ { * } | ! } { \sigma _ { d } \cdot d ! }$ . Since the $S _ { \ell }$ are distinct, this monomial does not appear in any other term $\begin{array} { r } { \frac { \partial } { \partial S _ { \ell } } p ( \mathbf { x } ) } \end{array}$ , but it could appear in some of the terms $\frac { \partial } { \partial S _ { \ell } } E _ { k } ( { \bf x } )$ .
|
| 344 |
+
|
| 345 |
+
By definition, $\left| c _ { * } \right|$ is the largest of the values $\left| c _ { \ell } \right|$ , and by setting $\epsilon$ small enough, all coefficients of $\frac { \partial } { \partial S _ { \ell } } E _ { k } ( { \bf x } )$ can be made negligibly small for every $k$ . This implies that the coefficient of the monomial $\begin{array} { r } { \frac { \partial } { \partial S _ { * } } p ( \mathbf { x } ) } \end{array}$ can be made arbitrarily close to $c _ { * } \cdot \frac { | S _ { * } | ! } { \sigma _ { d } \cdot d ! }$ , which is nonzero since $c _ { * }$ is nonzero.
|
| 346 |
+
|
| 347 |
+
However, the left-hand side of equation (9) tells us that this coefficient should be zero - a contradiction. We conclude that A has full row rank, and therefore that $\begin{array} { r } { m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p ) = m \geq \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) } \end{array}$ . This completes the proof of part (i).
|
| 348 |
+
|
| 349 |
+
We now consider part (ii) of the theorem. It follows from Proposition 4.6, part (ii) that, for each $i$ , we can Taylor-approximate $\boldsymbol { x } _ { i } ^ { r _ { i } }$ using $7 \lceil \log _ { 2 } ( r _ { i } ) \rceil$ neurons arranged in a deep network. Therefore, we can Taylor-approximate all of the $\boldsymbol { x } _ { i } ^ { r _ { i } }$ using a total of $\textstyle \sum _ { i } 7 \lceil { \bar { \log _ { 2 } } } ( r _ { i } ) \rceil$ neurons. From Lin et al. (2017), we know that these $n$ terms can be multiplied using $4 n$ additional neurons, giving us a total of $\begin{array} { r } { \sum _ { i } ( 7 \lceil \log _ { 2 } ( r _ { i } ) \rceil + 4 ) } \end{array}$ . Proposition 3.3 implies again that $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p ) \leq m _ { 1 } ^ { \mathrm { T a y l o r } } ( p )$ . This completes the proof.
|
| 350 |
+
|
| 351 |
+
# 7.2 PROOF OF THEOREM 4.2.
|
| 352 |
+
|
| 353 |
+
As above, suppose that $r _ { i } > 0$ for $i = 1 , \ldots , n$ , and let $X$ be the multiset in which $x _ { i }$ occurs with multiplicity $r _ { i }$ .
|
| 354 |
+
|
| 355 |
+
It is shown in the proof of Theorem 4.1 that $\textstyle \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 )$ neurons are sufficient to Taylorapproximate $p ( x )$ . We now show that this number of neurons is also necessary for approximating $p ( \mathbf { x } )$ . Let $m = m _ { 1 } ^ { \mathrm { T a y l o r } } ( p )$ and suppose that $\sigma ( x )$ has the Taylor expansion $\scriptstyle \sum _ { k = 0 } ^ { \infty } \sigma _ { k } x ^ { k }$ . Then, by grouping terms of each order, we conclude that there exist constants $a _ { i j }$ and $w _ { j }$ such that
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\begin{array} { l } { { \displaystyle \sigma _ { d } \sum _ { j = 1 } ^ { m } w _ { j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d } = p ( { \bf x } ) } } \\ { { \displaystyle \sigma _ { k } \sum _ { j = 1 } ^ { m } w _ { j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { k } = 0 \quad \mathrm { f o r } 0 \le k \le N - 1 . } } \end{array}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
For each $S \subseteq X$ , let us take the derivative of equations (10) and (11) by every variable that occurs in $S$ , where we take multiple derivatives of variables that occur multiple times. This gives
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\begin{array} { l } { \displaystyle \frac { \sigma _ { d } \cdot d ! } { | S | ! } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { h \in S } a _ { h j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - | S | } = \frac { \partial } { \partial S } p ( { \bf x } ) , } \\ { \displaystyle \frac { \sigma _ { k } \cdot k ! } { | S | ! } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { h \in S } a _ { h j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { k - | S | } = 0 } \end{array}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
for $| S | \le k \le d - 1$ . Observe that there are $\begin{array} { r } { r = \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) } \end{array}$ choices for $S$ , since each variable $x _ { i }$ can be included anywhere from 0 to $r _ { i }$ times. Define A to be the $r \times m$ matrix with entries $\begin{array} { r } { A _ { S , j } \ = \ \prod _ { h \in S } a _ { h j } } \end{array}$ . We claim that A has full row rank. This would show that the number of columns $m$ is at least the number of rows $\begin{array} { r } { r = \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 ) } \end{array}$ , proving the desired lower bound on $m$ .
|
| 368 |
+
|
| 369 |
+
Suppose towards contradiction that the rows $A _ { S _ { \ell } }$ ,• admit a linear dependence:
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\sum _ { \ell = 1 } ^ { r } c _ { \ell } A _ { S _ { \ell } , \bullet } = \mathbf { 0 } ,
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
where the coefficients $c _ { \ell }$ are nonzero and the $S _ { \ell }$ denote distinct subsets of $X$ . Set $s = \operatorname* { m a x } _ { \ell } | S _ { \ell } |$ . Then, take the dot product of each side of the above equation by the vector with entries (indexed by
|
| 376 |
+
|
| 377 |
+
$j$ ) equal to $\scriptstyle w _ { j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - s }$
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\begin{array} { l } { \displaystyle 0 = \sum _ { \ell = 1 } ^ { r } c _ { \ell } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { \hbar \in S _ { \ell } } a _ { \hbar j } \left( \displaystyle \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - s } } \\ { = \displaystyle \sum _ { \ell | ( | S _ { \ell } | = s ) } c _ { \ell } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { \hbar \in S _ { \ell } } a _ { \hbar j } \left( \displaystyle \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - | S _ { \ell } | } } \\ { + \displaystyle \sum _ { \ell | ( | S _ { \ell } | < s ) } c _ { \ell } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { \hbar \in S _ { \ell } } a _ { \hbar j } \left( \displaystyle \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { ( d + | S _ { \ell } | - s ) - | S _ { \ell } | } . } \end{array}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
We can use (12) to simplify the first term and (13) (with $k = d + | S _ { \ell } | - s )$ to simplify the second term, giving us:
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { l } { { \displaystyle 0 = \sum _ { \ell | ( | S _ { \ell } | = s ) } c _ { \ell } \cdot \frac { | S _ { \ell } | ! } { \sigma _ { d } \cdot d ! } \cdot \frac { \partial } { \partial S _ { \ell } } p ( { \bf x } ) + \sum _ { \ell | ( | S _ { \ell } | < s ) } c _ { \ell } \cdot \frac { | S _ { \ell } | ! } { \sigma _ { d + | S _ { \ell } | - s } \cdot ( d + | S _ { \ell } | - s ) ! } \cdot 0 } } \\ { { \displaystyle = \sum _ { \ell | ( | S _ { \ell } | = s ) } c _ { \ell } \cdot \frac { | S _ { \ell } | ! } { \sigma _ { d } \cdot d ! } \cdot \frac { \partial } { \partial S _ { \ell } } p ( { \bf x } ) } . } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
Since the distinct monomials $\begin{array} { r } { \frac { \partial } { \partial S _ { \ell } } p ( \mathbf { x } ) } \end{array}$ are linearly independent, this contradicts our assumption that the $c _ { \ell }$ are nonzero. We conclude that A has full row rank, and therefore that $m _ { 1 } ^ { \mathrm { T a y l o r } } ( p ) = m \geq$ $\textstyle \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 )$ . This completes the proof of part (i).
|
| 390 |
+
|
| 391 |
+
Part (ii) of the theorem was demonstrated in the proof of Theorem 4.1. This completes the proof.
|
| 392 |
+
|
| 393 |
+
# 7.3 PROOF OF THEOREM 4.3.
|
| 394 |
+
|
| 395 |
+
Our proof in Theorem 4.1 relied upon the fact that all nonzero partial derivatives of a monomial are linearly independent. This fact is not true for general polynomials $p$ ; however, an exactly similar argument shows that $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p )$ is at least the number of linearly independent partial derivatives of $p$ , taken with respect to multisets of the input variables.
|
| 396 |
+
|
| 397 |
+
Consider the monomial of such that $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( q )$ is maximized, and suppose that $q ( \mathbf { x } ) \mathbf { \Psi } = \mathbf { \tilde { \Gamma } }$ $x _ { 1 } ^ { r _ { 1 } } x _ { 2 } ^ { r _ { 2 } } \cdot \cdot \cdot x _ { n } ^ { r _ { n } }$ . By Theorem 4.1, $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( q )$ 1is equal to the number $\textstyle \prod _ { i = 1 } ^ { n } ( r _ { i } + { \bar { 1 } } )$ of distinct monomials that can be obtained by taking partial derivatives of $q$ . Let $Q$ be the set of such monomials, and let $D$ be the set of (iterated) partial derivatives corresponding to them, so that for $d \in D$ , we have $d ( q ) \in Q$ .
|
| 398 |
+
|
| 399 |
+
Consider the set of polynomials $P = \{ d ( p ) \mid d \in D \}$ . We claim that there exists a linearly independent subset of $P$ with size at least $| D | / c$ . Suppose to the contrary that $P ^ { \prime }$ is a maximal linearly independent subset of $P$ with $| P ^ { \prime } | < | D | / c$ .
|
| 400 |
+
|
| 401 |
+
Since $p$ has $c$ monomials, every element of $P$ has at most $c$ monomials. Therefore, the total number of distinct monomials in elements of $P ^ { \prime }$ is less than $| D |$ . However, there are at least $| D |$ distinct monomials contained in elements of $P$ , since for $d \in D$ , the polynomial $d ( p )$ contains the monomial $d ( q )$ , and by definition all $d ( q )$ are distinct as $d$ varies. We conclude that there is some polynomial $p ^ { \prime } \in P \backslash P ^ { \prime }$ containing a monomial that does not appear in any element of $P ^ { \prime }$ . But then $p ^ { \prime }$ is linearly independent of $P ^ { \prime }$ , a contradiction since we assumed that $P ^ { \prime }$ was maximal.
|
| 402 |
+
|
| 403 |
+
We conclude that some linearly independent subset of $P$ has size at least $| D | / c ,$ and therefore that the space of partial derivatives of $p$ has rank at least $| D | / c = m _ { 1 } ^ { \mathrm { u n i f o r m } } ( q ) / c$ . This proves part (i) of the theorem. Part (ii) follows immediately from the definition of $m ^ { \mathrm { u n i f o r m } } ( p )$ .
|
| 404 |
+
|
| 405 |
+
Similar logic holds for $m ^ { \mathrm { T a y l o r } }$ .
|
| 406 |
+
|
| 407 |
+
# 7.4 PROOF OF THEOREM 4.4.
|
| 408 |
+
|
| 409 |
+
We will prove the desired lower bounds for $m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p )$ ; a very similar argument holds for Taylor1 (p). As above, suppose that $r _ { i } > 0$ for $i = 1 , \ldots , n$ . Let $X$ be the multiset in which $x _ { i }$ occurs with multiplicity $r _ { i }$ .
|
| 410 |
+
|
| 411 |
+
Suppose that $N _ { \epsilon } ( \mathbf { x } )$ is an $\epsilon$ -approximation to $p ( \mathbf { x } )$ with depth 1, and let the degree- $d$ Taylor polynomial of $N _ { \epsilon } ( \mathbf { x } )$ be $p ( \mathbf { x } ) + E ( \mathbf { x } )$ . Let $E _ { d } ( \mathbf { x } )$ be the degree- $d$ homogeneous component of $E ( \mathbf { x } )$ . Observe that the coefficients of the error polynomial $E _ { d } ( \mathbf { x } )$ can be made arbitrarily small by setting $\epsilon$ sufficiently small.
|
| 412 |
+
|
| 413 |
+
Let ing $m = m _ { 1 } ^ { \mathrm { u n i f o r m } } ( p )$ and suppose that der, we conclude t $\sigma ( x )$ has the Taylor expere exist constants ion an $\scriptstyle \sum _ { k = 0 } ^ { \infty } \sigma _ { k } x ^ { k }$ . Then, by group-at $a _ { i j }$ $w _ { j }$
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\sigma _ { d } \sum _ { j = 1 } ^ { m } w _ { j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d } = p ( \mathbf { x } ) + E _ { d } ( \mathbf { x } )
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
For each $S \subseteq X$ , let us take the derivative of this equation by every variable that occurs in $S$ , where we take multiple derivatives of variables that occur multiple times. This gives
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\frac { \sigma _ { d } \cdot d ! } { | S | ! } \sum _ { j = 1 } ^ { m } w _ { j } \prod _ { h \in S } a _ { h j } \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - | S | } = \frac { \partial } { \partial S } p ( { \bf x } ) + \frac { \partial } { \partial S } E _ { d } ( { \bf x } ) .
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
Consider this equation as $S \subseteq X$ varies over all $C _ { s }$ multisets of fixed size $s$ . The left-hand side represents a linear combination of the $m$ terms $\scriptstyle \left( \sum _ { i = 1 } ^ { n } a _ { i j } x _ { i } \right) ^ { d - s }$ . The polynomials $\begin{array} { r } { \frac { \partial } { \partial S } p ( { \bf x } ) + \frac { \partial } { \partial S } E _ { d } ( { \bf x } ) } \end{array}$ on the right-hand side must be linearly independent as $S$ varies, since the distinct monomials $\begin{array} { r } { \frac { \partial } { \partial S } p ( { \bf x } ) } \end{array}$ are linearly independent and the coefficients of $\frac { \partial } { \partial S } E _ { d } ( { \bf x } )$ can be made arbitrarily small.
|
| 426 |
+
|
| 427 |
+
This means that the number $m$ of linearly combined terms on the left-hand side must be at least the number $C _ { s }$ of choices for $S$ . Observe that $C _ { s }$ is the coefficient of the term $y ^ { s }$ in the polynomial $\begin{array} { r } { g ( y ) = \prod _ { i } ( 1 + y + . . . + y ^ { r _ { i } } ) } \end{array}$ . A simple (and not very good) lower bound for $C _ { s }$ is $\textstyle { \frac { 1 } { d } } \prod _ { i = 1 } ^ { \dot { n } } { \big ( } r _ { i } + 1 { \big ) }$ , since there are $\textstyle \prod _ { i = 1 } ^ { n } ( r _ { i } + 1 )$ distinct sub-multisets of $X$ , and their cardinalities range from 0 to $d$ .
|
md/train/SyevYxHtDB/SyevYxHtDB.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PREDICTION POISONING: TOWARDS DEFENSES AGAINST DNN MODEL STEALING ATTACKS
|
| 2 |
+
|
| 3 |
+
Tribhuvanesh Orekondy1, Bernt Schiele1, Mario Fritz2
|
| 4 |
+
|
| 5 |
+
1 Max Planck Institute for Informatics
|
| 6 |
+
2 CISPA Helmholtz Center for Information Security
|
| 7 |
+
Saarland Informatics Campus, Germany
|
| 8 |
+
{orekondy, schiele}@mpi-inf.mpg.de, fritz@cispa.saarland
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
High-performance Deep Neural Networks (DNNs) are increasingly deployed in many real-world applications e.g., cloud prediction APIs. Recent advances in model functionality stealing attacks via black-box access (i.e., inputs in, predictions out) threaten the business model of such applications, which require a lot of time, money, and effort to develop. Existing defenses take a passive role against stealing attacks, such as by truncating predicted information. We find such passive defenses ineffective against DNN stealing attacks. In this paper, we propose the first defense which actively perturbs predictions targeted at poisoning the training objective of the attacker. We find our defense effective across a wide range of challenging datasets and DNN model stealing attacks, and additionally outperforms existing defenses. Our defense is the first that can withstand highly accurate model stealing attacks for tens of thousands of queries, amplifying the attacker’s error rate up to a factor of $8 5 \times$ with minimal impact on the utility for benign users.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Effectiveness of state-of-the-art DNN models at a variety of predictive tasks has encouraged their usage in a variety of real-world applications e.g., home assistants, autonomous vehicles, commercial cloud APIs. Models in such applications are valuable intellectual property of their creators, as developing them for commercial use is a product of intense labour and monetary effort. Hence, it is vital to preemptively identify and control threats from an adversarial lens focused at such models. In this work we address model stealing, which involves an adversary attempting to counterfeit the functionality of a target victim ML model by exploiting black-box access (query inputs in, posterior predictions out).
|
| 17 |
+
|
| 18 |
+
Stealing attacks dates back to Lowd & Meek (2005), who addressed reverse-engineering linear spam classification models. Recent literature predominantly focus on DNNs (specifically CNN image classifiers), and are shown to be highly effective (Tramer et al., 2016) on complex models (Orekondy \` et al., 2019), even without knowledge of the victim’s architecture (Papernot et al., 2017b) nor the training data distribution. The attacks have also been shown to be highly effective at replicating pay-per-query image prediction APIs, for as little as $\$ 30$ (Orekondy et al., 2019).
|
| 19 |
+
|
| 20 |
+
Defending against stealing attacks however has received little attention and is lacking. Existing defense strategies aim to either detect stealing query patterns (Juuti et al., 2019), or degrade quality of predicted posterior via perturbation. Since detection makes strong assumptions on the attacker’s query distribution (e.g., small $L _ { 2 }$ distances between successive queries), our focus is on the more popular perturbation-based defenses. A common theme among such defenses is accuracypreserving posterior perturbation: the posterior distribution is manipulated while retaining the top-1 label. For instance, rounding decimals (Tramer et al., 2016), revealing only high-confidence predic- \` tions (Orekondy et al., 2019), and introducing ambiguity at the tail end of the posterior distribution (Lee et al., 2018). Such strategies benefit from preserving the accuracy metric of the defender. However, in line with previous works (Tramer et al., 2016; Orekondy et al., 2019; Lee et al., 2018), we \` find models can be effectively stolen using just the top-1 predicted label returned by the black-box. Specifically, in many cases we observe ${ < } 1 \%$ difference between attacks that use the full range of posteriors (blue line in Fig. 1) to train stolen models and the top-1 label (orange line) alone. In this paper, we work towards effective defenses (red line in Fig. 1) against DNN stealing attacks with minimal impact to defender’s accuracy.
|
| 21 |
+
|
| 22 |
+
The main insight to our approach is that unlike a benign user, a model stealing attacker additionally uses the predictions to train a replica model. By introducing controlled perturbations to predictions, our approach targets poisoning the training objective (see Fig. 2). Our approach allows for a utility-preserving defense, as well as trading-off a marginal utility cost to significantly degrade attacker’s performance. As a practical benefit, the defense involves a single hyperparameter (perturbation utility budget) and can be used with minimal overhead to any classification model without retraining or modifications.
|
| 23 |
+
|
| 24 |
+
We rigorously evaluate our approach by defending six victim models, against four recent and effective DNN stealing attack strategies (Papernot et al., 2017b; Juuti et al., 2019; Orekondy et al., 2019). Our defense consistently mitigates all stealing attacks and further shows improvements over multiple baselines. In particular, we find our defenses degrades the attacker’s query sample efficiency by 1-2 orders of magnitude. Our approach significantly reduces the attacker’s performance (e.g., $30 \%$ reduction on MNIST and 13- $28 \%$ on CUB200) at a marginal cost $( 1 - 2 \% )$ to defender’s test accuracy. Furthermore, our approach can achieve the same level of mitigation as baseline defenses, but by introducing significantly lesser perturbation.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 1: We find existing defenses (orange line) ineffective against recent attacks. Our defense (red line) in contrast significantly mitigates the attacks.
|
| 28 |
+
|
| 29 |
+
Contributions. (i) We propose the first utility-constrained defense against DNN model stealing attacks; (ii) We present the first active defense which poisons the attacker’s training objective by introducing bounded perturbations; and (iii) Through extensive experiments, we find our approach consistently mitigate various attacks and additionally outperform baselines.
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
Figure 2: We perturb posterior predictions $\tilde { \pmb { y } } = \pmb { y } + \pmb { \delta }$ , with an objective of poisoning the adversary’s gradient signal.
|
| 33 |
+
|
| 34 |
+
# 2 RELATED LITERATURE
|
| 35 |
+
|
| 36 |
+
Model stealing attacks (also referred to as ‘extraction’ or ‘reverse-engineering’) in literature aim to infer hyperparameters (Oh et al., 2018; Wang & Gong, 2018), recover exact parameters (Lowd & Meek, 2005; Tramer et al., 2016; Milli et al., 2018), or extract the functionality (Correia-Silva et al., \` 2018; Orekondy et al., 2019) of a target black-box ML model. In some cases, the extracted model information is optionally used to perform evasion attacks (Lowd & Meek, 2005; Nelson et al., 2010; Papernot et al., 2017b). The focus of our work is model functionality stealing, where the attacker’s yardstick is test-set accuracy of the stolen model. Initial works on stealing simple linear models (Lowd & Meek, 2005) have been recently succeeded by attacks shown to be effective on complex CNNs (Papernot et al., 2017b; Correia-Silva et al., 2018; Orekondy et al., 2019) (see Appendix B for an exhaustive list). In this work, we works towards defenses targeting the latter line of DNN model stealing attacks.
|
| 37 |
+
|
| 38 |
+
Since ML models are often deployed in untrusted environments, a long line of work exists on guaranteeing certain (often orthogonal) properties to safeguard against malicious users. The properties include security (e.g., robustness towards adversarial evasion attacks (Biggio et al., 2013; Goodfellow et al., 2014; Madry et al., 2018)) and integrity (e.g., running in untrusted environments (Tramer & Boneh, 2019)). To prevent leakage of private attributes (e.g., identities) specific to training data in the resulting ML model, differential privacy (DP) methods (Dwork et al., 2014) introduce randomization during training (Abadi et al., 2016; Papernot et al., 2017a). In contrast, our defense objective is to provide confidentiality and protect the functionality (intellectual property) of the ML model against illicit duplication.
|
| 39 |
+
|
| 40 |
+
Model stealing defenses are limited. Existing works (which is primarily in multiclass classification settings) aim to either detect stealing attacks (Juuti et al., 2019; Kesarwani et al., 2018; Nelson et al., 2009; Zheng et al., 2019) or perturb the posterior prediction. We focus on the latter since detection involves making strong assumptions on adversarial query patterns. Perturbation-based defenses are predominantly non-randomized and accuracy-preserving (i.e., top-1 label is unchanged). Approaches include revealing probabilities only of confident classes (Orekondy et al., 2019), rounding probabilities (Tramer et al., 2016), or introducing ambiguity in posteriors (Lee et al., 2018). None \` of the existing defenses claim to mitigate model stealing, but rather they only marginally delay the attack by increasing the number of queries. Our work focuses on presenting an effective defense, significantly decreasing the attacker’s query sample efficiency within a principled utility-constrained framework.
|
| 41 |
+
|
| 42 |
+
# 3 PRELIMINARIES
|
| 43 |
+
|
| 44 |
+
Model Functionality Stealing. Model stealing attacks are cast as an interaction between two parties: a victim/defender $V$ (‘teacher’ model) and an attacker $A$ (‘student’ model). The only means of communication between the parties are via black-box queries: attacker queries inputs $\textbf { \em x } \in ~ \mathcal { X }$ and defender returns a posterior probability distribution $\dot { \pmb { y } } \in \Delta ^ { K } = P ( \pmb { y } | \pmb { x } ) = \dot { F _ { V } } ( \pmb { x } )$ , where $\Delta ^ { K } = \{ \pmb { y } \subseteq 0 , \mathbf { 1 } ^ { T } \pmb { y } = \overset { \cdot } { 1 } \}$ is the probability simplex over $K$ classes (we use $K$ instead of $K - 1$ for notational convenience). The attack occurs in two (sometimes overlapping) phases: (i) querying: the attacker uses the black-box as an oracle labeler on a set of inputs to construct a ‘transfer set’ of input-prediction pairs $\mathcal { D } ^ { \mathrm { t r a n s f e r } } = \{ ( \pmb { x } _ { i } , \pmb { y } _ { i } ) \} _ { i = 1 } ^ { B }$ ; and (ii) training: the attacker trains a model $F _ { A }$ to minimize the empirical risk on $\mathcal { D } ^ { \mathrm { t r a n s f e r } }$ . The end-goal of the attacker is to maximize accuracy on a held-out test-set (considered the same as that of the victim for evaluation purposes).
|
| 45 |
+
|
| 46 |
+
Knowledge-limited Attacker. In model stealing, attackers justifiably lack complete knowledge of the victim model $F _ { V }$ . Of specific interest are the model architecture and the input data distribution to train the victim model $P _ { V } ( X )$ that are not known to the attacker. Since prior work (Hinton et al., 2015; Papernot et al., 2016; Orekondy et al., 2019) indicates functionality largely transfers across architecture choices, we now focus on the query data used by the attacker. Existing attacks can be broadly categorized based on inputs $\{ x \sim P _ { A } ( X ) \}$ used to query the black-box: (a) independent distribution: (Tramer et al., 2016; Correia-Silva et al., 2018; Orekondy et al., 2019) samples inputs \` from some distribution (e.g., ImageNet for images, uniform noise) independent to input data used to train the victim model; and (b) synthetic set: (Papernot et al., 2017b; Juuti et al., 2019) augment a limited set of seed data by adaptively querying perturbations (e.g., using FGSM) of existing inputs. We address both attack categories in our paper.
|
| 47 |
+
|
| 48 |
+
Defense Objectives. We perturb predictions in a controlled setting: $\tilde { \pmb { y } } = F _ { V } ^ { \delta } ( \pmb { x } ) = \pmb { y } + \delta$ s.t. $\tilde { y } , y \in \Delta ^ { K }$ . The defender has two (seemingly conflicting) objectives: (i) utility: such that perturbed predictions remain useful to a benign user. We consider two utility measures: (a) $\mathsf { A c c } ( \dot { F } _ { V } ^ { \delta } , \mathcal { D } ^ { \mathrm { t e s t } } )$ : accuracy of defended model on test examples; and (b) $\mathrm { d i s t } ( { \pmb y } , \tilde { \pmb y } ) = | | { \pmb y } - \tilde { \pmb y } | | _ { p } = \epsilon$ to measure perturbation. (ii) non-replicability: to reduce the test accuracy of an attacker (denoted as $\mathsf { A c c } ( F _ { A } , \mathcal { D } ^ { \mathrm { t e s t } } ) )$ who exploits the predictions to train a replica $F _ { A }$ on $\mathcal { D } ^ { \mathrm { t r a n s f e r } }$ . For consistency, we evaluate both the defender’s and attacker’s stolen model accuracies on the same set of test examples $\mathcal { D } ^ { \mathrm { t e s t } }$ .
|
| 49 |
+
|
| 50 |
+
Defender’s Assumptions. We closely mimic an assumption-free scenario similar to existing perturbation-based defenses. The scenario entails the knowledge-limited defender: (a) unaware whether a query is malicious or benign; (b) lacking prior knowledge of the strategy used by an attacker; and (c) perturbing each prediction independently (hence circumventing Sybil attacks). For added rigor, we also study attacker’s countermeasures to our defense in Section 5.
|
| 51 |
+
|
| 52 |
+
# 4 APPROACH: MAXIMIZING ANGULAR DEVIATION BETWEEN GRADIENTS
|
| 53 |
+
|
| 54 |
+
Motivation: Targeting First-order Approximations. We identify that the attacker eventually optimizes parameters of a stolen model $F ( \cdot ; w )$ (we drop the subscript $\cdot _ { A }$ for readability) to minimize the loss on training examples $\{ ( \pmb { x } _ { i } , \tilde { \pmb { y } } _ { i } ) \}$ . Common to a majority of optimization algorithms is estimating the first-order approximation of the empirical loss, by computing the gradient of the loss
|
| 55 |
+
|
| 56 |
+
w.r.t. the model parameters ${ \pmb w } \in \mathbb { R } ^ { D }$ :
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\pmb { u } = - \nabla _ { \pmb { w } } L ( F ( \pmb { x } ; \pmb { w } ) , \pmb { y } )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Maximizing Angular Deviation (MAD). The core idea of our approach is to perturb the posterior probabilities $\textbf { { y } }$ which results in an adversarial gradient signal that maximally deviates (see Fig. 2) from the original gradient (Eq. 1). More formally, we add targeted noise to the posteriors which results in a gradient direction:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\pmb { a } = - \nabla _ { \pmb { w } } L ( F ( \pmb { x } ; \pmb { w } ) , \tilde { \pmb { y } } )
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
to maximize the angular deviation between the original and the poisoned gradient signals:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\operatorname* { m a x } _ { \mathbf { a } } \ 2 ( 1 - \cos \angle ( \mathbf { a } , \boldsymbol { u } ) ) = \operatorname* { m a x } _ { \hat { \mathbf { a } } } \ | | \hat { \boldsymbol { a } } - \hat { \boldsymbol { u } } | | _ { 2 } ^ { 2 } \qquad \quad ( \hat { \boldsymbol { a } } = \boldsymbol { a } / | | \boldsymbol { a } | | _ { 2 } , \hat { \boldsymbol { u } } = \boldsymbol { u } / | | \boldsymbol { u } | | _ { 2 } )
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Given that the attacker model is trained to match the posterior predictions, such as by minimizing the cross-entropy loss $\begin{array} { r } { L ( \pmb { y } , \tilde { \pmb { y } } ) = - \sum _ { k } \tilde { y } _ { k } \log y _ { k } } \end{array}$ we rewrite Equation (2) as:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
a = - \nabla _ { w } L ( F ( x ; w ) , \tilde { y } ) = \nabla _ { w } \sum _ { k } \tilde { y } _ { k } \log F ( x ; w ) _ { k } = \sum _ { k } \tilde { y } _ { k } \nabla _ { w } \log F ( x ; w ) _ { k } = G ^ { T } \tilde { y } _ { k } \log F ( x ; w ) _ { k } .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $G \in \mathbb { R } ^ { K \times D }$ represents the Jacobian over log-likelihood predictions $F ( \pmb { x } ; \pmb { w } )$ over $K$ classes w.r.t. parameters ${ \pmb w } \in \mathbb { R } ^ { D }$ . By similarly rewriting Equation (1), substituting them in Equation (3) and including the constraints, we arrive at our poisoning objective (Eq. 4-7) of our approach which we refer to as MAD. We can optionally enforce preserving accuracy of poisoned prediction via constraint (8), which will be discussed shortly.
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r l r } { \underset { \tilde { y } } { \operatorname* { m a x } } } & { \left\| \frac { \boldsymbol { G } ^ { T } \tilde { \boldsymbol { y } } } { | | \boldsymbol { G } ^ { T } \tilde { \boldsymbol { y } } | | _ { 2 } } - \frac { \boldsymbol { G } ^ { T } \boldsymbol { y } } { | | \boldsymbol { G } ^ { T } \boldsymbol { y } | | _ { 2 } } \right\| _ { 2 } ^ { 2 } } \\ { \mathrm { w h e r e } } & { \boldsymbol { G } = \nabla _ { w } \log \boldsymbol { F } ( \boldsymbol { x } ; \boldsymbol { w } ) } & { ( \boldsymbol { G } \in \mathbb { R } ^ { K \times D } ) } \\ { \mathrm { s . t } } & { \boldsymbol { \tilde { y } } \in \Delta ^ { K } } & { ( \mathrm { S i m p l e x ~ c o n s t r a i n t } ) } \\ & { \mathrm { d i s t } ( \boldsymbol { y } , \boldsymbol { \tilde { y } } ) \le \epsilon } & { ( \mathrm { U i l i t y ~ c o n s t r a i n t } ) } \\ & { \mathrm { ~ a r g ~ } _ { k } } & { \mathrm { ~ ( F o r ~ v a r i a n t ~ } \mathsf { M A D - a r g m a x } ) } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
The above presents a challenge of black-box optimization problem for the defense since the defender justifiably lacks access to the attacker model $F$ (Eq. 5). Apart from addressing this challenge in the next few paragraphs, we also discuss (a) solving a non-standard and non-convex constrained maximization objective; and (b) preserving accuracy of predictions via constraint (8).
|
| 87 |
+
|
| 88 |
+
Estimating $G$ . Since we lack access to adversary’s model $F$ , we estimate the jacobian ${ \pmb G } =$ $\nabla _ { \boldsymbol { w } } \log F _ { \mathrm { s u r } } ( \boldsymbol { x } ; \boldsymbol { w } )$ (Eq. 5) per input query $_ { \textbf { \em x } }$ using a surrogate model $F _ { \mathrm { s u r } }$ . We empirically determined (details in Appendix E.1) choice of architecture of $F _ { \mathrm { s u r } }$ robust to choices of adversary’s architecture $F$ . However, the initialization of $F _ { \mathrm { s u r } }$ plays a crucial role, with best results on a fixed randomly initialized model. We conjecture this occurs due to surrogate models with a high loss provide better gradient signals to guide the defender.
|
| 89 |
+
|
| 90 |
+
Heuristic Solver. Gradient-based strategies to optimize objective (Eq. 4) often leads to poor local maxima. This is in part due to the objective increasing in all directions around point $\textbf { { y } }$ (assuming $G$ is full-rank), making optimization sensitive to initialization. Consequently, we resort to a heuristic to solve for $\tilde { y }$ . Our approach is motivated by Hoffman (1981), who show that the maximum of a convex function over a compact convex set occurs at the extreme points of the set. Hence, our two-step solver: (i) searches for a maximizer $\boldsymbol { y } ^ { * }$ for (4) by iterating over the $K$ extremes ${ \bf { \nabla } } _ { \bf { { y } } _ { k } }$ (where $y _ { k } { = } 1 \rangle$ ) of the probability simplex $\Delta ^ { K }$ ; and (ii) then computes a perturbed posterior $\tilde { y }$ as a linear interpolation of the original posteriors $\textbf { { y } }$ and the maximizer $\pmb { y } ^ { * } \colon \bar { \pmb { y } } = ( 1 - \bar { \alpha } ) \pmb { y } + \alpha \pmb { y } ^ { * }$ , where $\alpha$ is selected such that the utility constraint (Eq. 7) is satisfied. We further elaborate on the solver and present a pseudocode in Appendix C.
|
| 91 |
+
|
| 92 |
+
Variant: MAD-argmax. Within our defense formulation, we encode an additional constraint (Eq. 8) to preserve the accuracy of perturbed predictions. MAD-argmax variant helps us perform accuracy-preserving perturbations similar to prior work. But in contrast, the perturbations are constrained (Eq. 7) and are specifically introduced to maximize the MAD objective. We enforce the accuracy-preserving constraint in our solver by iterating over extremes of intersection of sets Eq.(6) and (8): $\begin{array} { r } { \dot { \Delta { \phi } } _ { k } ^ { K } = \{ { \pmb y } ^ { \top } { } \subseteq 0 , { \bf 1 } ^ { T } { \pmb y } = 1 , y _ { k } \geq y _ { j } , k \} \not = j \} \subseteq \breve { \Delta } ^ { K } . } \end{array}$ .
|
| 93 |
+
|
| 94 |
+
# 5 EXPERIMENTAL RESULTS
|
| 95 |
+
|
| 96 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 97 |
+
|
| 98 |
+
Victim Models and Datasets. We set up six victim models (see column ${ } ^ { \bullet } F _ { V }$ ’ in Table 1), each model trained on a popular image classification dataset. All models are trained using SGD $\mathrm { L R } =$ 0.1) with momentum (0.5) for 30 (LeNet) or 100 epochs (VGG16), with a LR decay of 0.1 performed every 50 epochs. We train and evaluate each victim model on their respective train and test sets.
|
| 99 |
+
|
| 100 |
+
Attack Strategies. We hope to broadly address all DNN model stealing strategies during our defense evaluation. To achieve this, we consider attacks that vary in query data distributions (independent and synthetic; see Section 3) and strategies (random and adaptive). Specifically, in our experiments we use the following attack models: (i) Jacobian-based Data Augmentation ‘JBDA’ (Papernot et al., 2017b);
|
| 101 |
+
|
| 102 |
+
Table 1: Victim models and Accuracies. All accuracies are w.r.t undefended victim model.
|
| 103 |
+
|
| 104 |
+
<table><tr><td>Fv</td><td>Acc(Fv)</td><td colspan="4">Acc(FA)</td></tr><tr><td></td><td></td><td>jbda</td><td>jbself</td><td>jbtop3</td><td>k.off</td></tr><tr><td>MNIST (LeNet)</td><td>99.4</td><td>89.2</td><td>89.4</td><td>87.3</td><td>99.1</td></tr><tr><td>FashionMNIST(LeNet)</td><td>92.0</td><td>38.7</td><td>45.8</td><td>68.7</td><td>69.2</td></tr><tr><td>CIFAR10 (VGG16)</td><td>92.0</td><td>28.6</td><td>20.7</td><td>73.8</td><td>78.7</td></tr><tr><td>CIFAR100 (VGG16)</td><td>72.2</td><td>5.3</td><td>2.9</td><td>39.2</td><td>51.9</td></tr><tr><td>CUB200 (VGG16)</td><td>80.4</td><td>6.8</td><td>3.9</td><td>21.5</td><td>65.1</td></tr><tr><td>Caltech256 (VGG16)</td><td>80.0</td><td>12.5</td><td>16.0</td><td>29.5</td><td>74.6</td></tr></table>
|
| 105 |
+
|
| 106 |
+
(ii,iii) ‘JB-self’ and ‘JB-top3’ (Juuti et al., 2019); and (iv) Knockoff Nets ‘knockoff’ (Orekondy et al., 2019); We follow the default configurations of the attacks where possible. A recap and implementation details of the attack models are available in Appendix D.
|
| 107 |
+
|
| 108 |
+
In all attack strategies, the adversary trains a model $F _ { A }$ to minimize the cross-entropy loss on a transfer set $( \mathcal { D } ^ { \mathrm { t r a n s f e r } } = \{ ( \pmb { x } _ { i } , \tilde { \pmb { y } } _ { i } ) \} _ { i = 1 } ^ { B } )$ obtained by using the victim model $F _ { V }$ to pseudo-label inputs $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ (sampled or adaptively synthesized). By default, we use $B { = } 5 0 \mathrm { K }$ queries, which achieves reasonable performance for all attacks and additionally makes defense evaluation tractable. The size of the resulting transfer set $\scriptstyle B = 5 0 \mathrm { K }$ examples) is comparable (e.g., $1 \times$ for CIFAR10/100, $2 . 1 \times$ for Caltech256) to size of victim’s training set. In line with prior work (Papernot et al., 2016; Orekondy et al., 2019), we too find (Section 5.2.3) attack and defense performances are unaffected by choice of architectures, and hence use the victim architecture for the stolen model $F _ { A }$ . Due to the complex parameterization of VGG-16 $( 1 0 0 \mathbf { M } + )$ , we initialize the weights from a pretrained TinyImageNet or ImageNet model (except for the last FC layer, which is trained from scratch). All stolen models are trained using SGD $\scriptstyle \mathrm { ( L R = 0 . 1 }$ ) with momentum (0.5) for 30 epochs (LeNet) and 100 epochs (VGG16). We find choices of attacker’s architecture and optimization does not undermine the defense (discussed in Section 5.2.3).
|
| 109 |
+
|
| 110 |
+
Effectiveness of Attacks. We evaluate accuracy of resulting stolen models from the attack strategies as-is on the victim’s test set, thereby allowing for a fair head-to-head comparison with the victim model (additional details in Appendix A and D). The stolen model test accuracies, along with undefended victim model $F _ { V }$ accuracies are reported in Table 1. We observe for all six victim models, using just 50K black-box queries, attacks are able to significantly extract victim’s functionality e.g., ${ > } 8 7 \%$ on MNIST. We find the knockoff attack to be the strongest, exhibiting reasonable performance even on complex victim models e.g., $7 4 . 6 \%$ ${ \mathsf { 0 . 9 3 } } { \times } \mathsf { A c c } ( F _ { V } ) )$ on Caltech256.
|
| 111 |
+
|
| 112 |
+
How Good are Existing Defenses? Most existing defenses in literature (Tramer et al., 2016; \` Orekondy et al., 2019; Lee et al., 2018) perform some form of information truncation on the posterior probabilities e.g., rounding, returning top- $k$ labels; all strategies preserve the rank of the most confident label. We now evaluate model stealing attacks on the extreme end of information truncation, wherein the defender returns just the top-1 ‘argmax’ label. This strategy illustrates a rough lower bound on the strength of the attacker when using existing defenses. Specific to knockoff, we observe the attacker is minimally impacted on simpler datasets (e.g., $0 . 2 \%$ accuracy drop on CIFAR10; see Fig. A5 in Appendix). While this has a larger impact on more complex datasets involving numerous classes (e.g., a maximum of $2 3 . 4 \%$ drop observed on CUB200), the strategy also introduces a significant perturbation $( L _ { 1 } { = } 1 { \pm } 0 . 5 )$ to the posteriors. The results suggest existing defenses, which largely the top-1 label, are largely ineffective at mitigating model stealing attacks.
|
| 113 |
+
|
| 114 |
+
Defenses: Evaluation. We evaluate all defenses on a non-replicability vs. utility curve at various operating points $\epsilon$ of the defense. We furthermore evaluate the defenses for a large query budget (50K). We use as non-replicability the accuracy of the stolen model on held-out test data $\mathcal { D } ^ { \mathrm { t e s t } }$ .
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 3: Attackers vs. Our Defense. Curves are obtained by varying degree of perturbation $\epsilon$ (Eq. 7) in our defense. $\uparrow$ denotes higher numbers are better and $\downarrow$ , lower numbers are better. Non-replicability objective is presented on the $x -$ -axis and utility on the $y$ -axis.
|
| 118 |
+
|
| 119 |
+
We use two utility metrics: (a) accuracy: test-accuracy of the defended model producing perturbed predictions on $\mathcal { D } ^ { \mathrm { t e s t } }$ ; and (b) perturbation magnitude $\epsilon$ : measured as $L _ { 1 }$ distance $| | \pmb { y } - \tilde { \pmb { y } } | | _ { 1 }$ .
|
| 120 |
+
|
| 121 |
+
Defense: Baselines. We compare our approaches against three methods: (i) reverse-sigmoid (Lee et al., 2018): which softens the posterior distribution and introduces ambiguity among nonargmax probabilities. For this method, we evaluate non-replicability and utility metrics for the defense operating at various choices of their hyperparameter $\bar { \boldsymbol { \beta } } \in [ 0 , 1 ]$ , while keeping their datasetspecific hyperparameter $\gamma$ fixed (MNIST: 0.2, FashionMNIST: 0.4, CIFAR10: 0.1, rest: 0.2). (ii) random noise: For controlled random-noise, we add uniform random noise $\delta _ { z }$ on the logit prediction scores $\tilde { z } = z + \delta _ { z }$ , where $\begin{array} { r } { z = \log ( \frac { y } { 1 - y } ) } \end{array}$ ), enforce utility by projecting $\delta _ { z }$ to an $\epsilon _ { z }$ -ball (Duchi et al., 2008), and renormalize probabilities $\begin{array} { r } { \tilde { y } = \frac { 1 } { 1 + e ^ { - \tilde { z } } } } \end{array}$ 11+e−z˜ . (iii) dp-sgd: while our method and previous two baselines perturbs predictions, we also compare against introducing randomization to victim model parameters by training with the DP-SGD algorithm (Abadi et al., 2016). DP is a popular technique to protect the model against training data inference attacks. This baseline allows us to verify whether the same protection extends to model functionality.
|
| 122 |
+
|
| 123 |
+
# 5.2 RESULTS
|
| 124 |
+
|
| 125 |
+
In the follow sections, we demonstrate the effectiveness of our defense rigorously evaluated across a wide range of complex datasets, attack models, defense baselines, query, and utility budgets. For readability, we first evaluate the defense against attack models, proceed to comparing the defense against strong baselines and then provide an analysis of the defense.
|
| 126 |
+
|
| 127 |
+
# 5.2.1 MAD DEFENSE VS. ATTACKS
|
| 128 |
+
|
| 129 |
+
Figure 3 presents evaluation of our defenses MAD (Eq. 4-7) and MAD-argmax (Eq. 4-8) against the four attack models. To successfully mitigate attacks as a defender, we want the defense curves (colored solid lines with operating points denoted by thin crosses) to move away from undefended accuracies (denoted by circular discs, where $\scriptstyle \epsilon = 0 . 0$ ) to ideal defense performances (cyan cross, where $\mathsf { A c c } ( \mathsf { D e f } . )$ is unchanged and $\mathsf { A c c } ( \mathsf { A t t } . )$ is chance-level).
|
| 130 |
+
|
| 131 |
+
We observe from Figure 3 that by employing an identical defense across all datasets and attacks, the effectiveness of the attacker can be greatly reduced. Across all models, we find MAD provides reasonable operating points (above the diagonal), where defender achieves significantly higher test accuracies compared to the attacker. For instance, on MNIST, for ${ < } 1 \%$ drop in defender’s accuracy, our defense simultaneously reduces accuracy of the jbtop3 attacker by $52 \%$ $8 7 . 3 \% \to 3 5 . 7 \% )$ and knockoff by $29 \%$ $9 9 . 1 \% 6 9 . 8 \%$ ). We find similar promising results even on high-dimensional complex datasets e.g., on CUB200, a $23 \%$ $6 5 . 1 \% 4 1 . 9 \%$ ) performance drop of knockoff for $2 \%$ drop in defender’s test performance. Our results indicate effective defenses are achievable, where the defender can trade-off a marginal utility cost to drastically impede the attacker.
|
| 132 |
+
|
| 133 |
+
# 5.2.2 MAD DEFENSE VS. BASELINE DEFENSES
|
| 134 |
+
|
| 135 |
+
We now study how our approach compares to baseline defenses, by evaluating the defenses against the knockoff attack (which resulted in the strongest attack in our experiments). From Figure 4, we observe:
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 4: Knockoff attack vs. Ours $^ +$ Baseline Defenses (best seen magnified). Non-replicability is presented on the $x$ -axis. On $_ y$ -axis, we present two utility measures: (a) top: Utility $= L _ { 1 }$ distance (b) bottom: Utility $=$ Defender’s accuracy. Region above the diagonal indicates instances where defender outperforms the attacker.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 5: Attacker argmax. Follow-up to Figure 4b (CIFAR10), but with attacker using only the argmax label.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 6: Histogram of Angular Deviations. Presented for MAD attack on CIFAR10 with various choices of $\epsilon$ .
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 7: Test loss. Visualized during training. Colours and lines correspond to $\epsilon$ values in Fig. 6.
|
| 148 |
+
|
| 149 |
+
(i) Utility objective $\mathbf { \Phi } = L _ { 1 }$ distance (Fig. 4a): Although random-noise and reverse-sigmoid reduce attacker’s accuracy, the strategies in most cases involves larger perturbations. In contrast, MAD and MAD-argmax provides similar non-replicability (i.e., $\mathsf { A c c } ( \mathsf { A t t . } ) )$ with significantly lesser perturbation, especially at lower magnitudes. For instance, on MNIST (first column), MAD $( L _ { 1 } = 0 . 9 5 )$ ) reduces the accuracy of the attacker to under $80 \%$ with $0 . 6 3 \times$ the perturbation as that of reversesigmoid and random-noise $( L _ { 1 } \approx 1 . 5 )$ .
|
| 150 |
+
|
| 151 |
+
(ii) Utility objective $=$ argmax-preserving (Fig. 4b): By setting a hard constraint on retaining the label of the predictions, we find the accuracy-preserving defenses MAD-argmax and reverse-sigmoid successfully reduce the performance of the attacker by at least $20 \%$ across all datasets. In most cases, we find MAD-argmax in addition achieves this objective by introducing lesser distortion to the predictions compared to reverse-sigmoid. For instance, in Fig. 4a, we find MAD-argmax consistently reduce the attacker accuracy to the same amount at lesser $L _ { 1 }$ distances. In reversesigmoid, we attribute the large $L _ { 1 }$ perturbations to a shift in posteriors towards a uniform distribution e.g., mean entropy of perturbed predictions is $3 . 0 2 \pm 0 . 1 6$ (max-entropy $= 3 . 3 2 )$ at $L _ { 1 } { = } 1 . 0$ for MNIST; in contrast, MAD-argmax displays a mean entropy of $1 . 7 9 \pm 0 . 1 1$ . However, common to accuracy-preserving strategies is a pitfall that the top-1 label is retained. In Figure 5 (see overlapping red and yellow cross-marks), we present the results of training the attacker using only the top-1 label. In line with previous discussions, we find that the attacker is able to significantly recover the original performance of the stolen model for accuracy-preserving defenses MAD-argmax and reverse-sigmoid.
|
| 152 |
+
|
| 153 |
+
(iii) Non-replicability vs. utility trade-off (Fig. 4b): We now compare our defense MAD (blue lines) with baselines (rand-noise and $\mathtt { d p \mathrm { - s g d ) } }$ which trade-off utility to mitigate model stealing. Our results indicate MAD offers a better defense (lower attacker accuracies for similar defender accuracies). For instance, to reduce the attacker’s accuracy to ${ < } 7 0 \%$ , while the defender’s accuracy significantly degrades using dp-sgd $( 3 9 \% )$ and rand-noise $( 5 6 . 4 \% )$ , MAD involves a marginal decrease of $1 \%$ .
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 8: MAD Ablation experiments. Utility $=$ (left) $L _ { 1 }$ distance (right) defender test accuracy.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 9: Subverting the Defense.
|
| 160 |
+
|
| 161 |
+
# 5.2.3 ANALYSIS
|
| 162 |
+
|
| 163 |
+
How much angular deviation does MAD introduce? To obtain insights on the angular deviation induced between the true and the perturbed gradient, we conduct an experiment by tracking the true gradient direction (which was unknown so far) at each training step. We simulate this by training an attacker model using online SGD $\mathrm { { L R } } { = } 0 . 0 0 1$ ) over $N$ iterations using $B$ distinct images to query and a batch size of 1. At each step $t$ of training, the attacker queries a randomly sampled input $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ to the defender model and backpropogates the loss resulting from $\tilde { \mathbf { y } } _ { t }$ . In this particular experiment, the perturbation $\tilde { \mathbf { y } } _ { t }$ is crafted having exact knowledge of the attacker’s parameters. We evaluate the angular deviation between gradients with $\mathbf { \Pi } ( a )$ and without $( \pmb { u } )$ the perturbation.
|
| 164 |
+
|
| 165 |
+
In Figure 6, we visualize a histogram of deviations: $\begin{array} { r } { \theta = \operatorname { a r c c o s } { \frac { { \mathbf { \em u } } \cdot { \mathbf { \boldsymbol { a } } } } { | | { \mathbf { \em u } } | | | | | { \mathbf { \boldsymbol { a } } } | | } } } \end{array}$ , where $\pmb { u } = \nabla _ { \pmb { w } } L ( \pmb { w } _ { t } , \pmb { y } , \cdot )$ and $\pmb { a } = \nabla _ { \pmb { w } } L ( \pmb { w } _ { t } , \tilde { \pmb { y } } , \cdot )$ . We observe: (i) although our perturbation space is severely restricted (a low-dimensional probability simplex), we can introduce surprisingly high deviations $( 0 - 1 1 5 ^ { \circ } )$ in the high-dimensional parameter space of the VGG16; (ii) for $\epsilon$ values at reasonable operating points which preserves the defender’s accuracy within $10 \%$ of the undefended accuracy (e.g., $\epsilon \in [ 0 . 9 5$ , 0.99] for CIFAR10), we see deviations with mean $2 4 . 9 ^ { \circ }$ (yellow bars in Fig. 6). This indicates that the perturbed gradient on an average leads to a slower decrease in loss function; (iii) on the extreme end, with $\epsilon = \epsilon _ { \mathrm { m a x } } = 2$ , on an average, we find the perturbations successfully flips $( > 9 0 ^ { \circ } )$ the gradient direction leading to an increase on the test loss, as seen in Figure 7 (blue line). We also find the above observations reasonably transfers to a black-box attacker setting (see Appendix F.4), where the perturbations are crafted without knowledge of the attacker’s parameters. Overall, we find our approach considerably corrupts the attacker’s gradient direction.
|
| 166 |
+
|
| 167 |
+
Ablative Analysis. We present an ablation analysis of our approach in Figure 8. In this experiment, we compare our approach MAD and MAD-argmax to: (a) $G = I$ : We substitute the jacobian $G$ (Eq. 5) with a $K \times K$ identity matrix; and (b) $\mathbf { \boldsymbol { y } } ^ { * } =$ rand: Inner maximization term (Eq. 4) returns a random extreme of the simplex. Note that both (a) and (b) do not use the gradient information to perturb the posteriors.
|
| 168 |
+
|
| 169 |
+
From Figure 8, we observe: (i) poor performance of $\mathbf { \boldsymbol { y } } ^ { * } =$ rand, indicating random untargeted perturbations of the posterior probability is a poor strategy; (ii) $G = I$ , where the angular deviation is maximized between the posterior probability vectors is a slightly better strategy; (ii) MAD outperforms the above approaches. Consequently, we find using the gradient information (although a proxy to the attacker’s gradient signal) within our formulation (Equation 4) is crucial to providing better model stealing defenses.
|
| 170 |
+
|
| 171 |
+
Subverting the Defense. We now explore various strategies an attacker can use to circumvent the defense. To this end, we evaluate the following strategies: (a) argmax: attacker uses only the most-confident label during training; (b) arch- $^ *$ : attacker trains other choices of architectures; (c) nquery: attacker queries each image multiple times; (d) nquery+aug: same as (c), but with random cropping and horizontal flipping; and (e) opt- $^ *$ : attacker uses an adaptive LR optimizer e.g., ADAM (Kingma & Ba, 2014).
|
| 172 |
+
|
| 173 |
+
We present results over the subversion strategies in Figure 9. We find our defense robust to above strategies. Our results indicate that the best strategy for the attacker to circumvent our defense is to discard the probabilities and rely only on the most confident label to train the stolen model. In accuracy-preserving defenses (see Fig. 5), this previously resulted in an adversary entirely circumventing the defense (recovering up to $1 . 0 \times$ original performance). In contrast, we find MAD is nonetheless effective in spite of the strategy, maintaining a $9 \%$ absolute accuracy reduction in attacker’s stolen performance.
|
| 174 |
+
|
| 175 |
+
# 6 CONCLUSION
|
| 176 |
+
|
| 177 |
+
In this work, we were motivated by limited success of existing defenses against DNN model stealing attacks. While prior work is largely based on passive defenses focusing on information truncation, we proposed the first active defense strategy that attacks the adversary’s training objective. We found our approach effective in defending a variety of victim models and against various attack strategies. In particular, we find our attack can reduce the accuracy of the adversary by up to $65 \%$ , without significantly affecting defender’s accuracy.
|
| 178 |
+
|
| 179 |
+
Acknowledgement. This research was partially supported by the German Research Foundation (DFG CRC 1223). We thank Paul Swoboda and David Stutz for helpful discussions.
|
| 180 |
+
|
| 181 |
+
# REFERENCES
|
| 182 |
+
|
| 183 |
+
Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In CCS, 2016.
|
| 184 |
+
|
| 185 |
+
Ibrahim M Alabdulmohsin, Xin Gao, and Xiangliang Zhang. Adding robustness to support vector machines against adversarial reverse engineering. In CIKM, 2014.
|
| 186 |
+
|
| 187 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndi ˇ c, Pavel Laskov, Gior- ´ gio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In ECML PKDD, 2013.
|
| 188 |
+
|
| 189 |
+
Varun Chandrasekaran, K Chaudhari, Irene Giacomelli, Somesh Jha, and Songbai Yan. Exploring connections between active learning and model extraction. arXiv preprint arXiv:1905.09165, 2019.
|
| 190 |
+
|
| 191 |
+
Jacson Rodrigues Correia-Silva, Rodrigo F Berriel, Claudine Badue, Alberto F de Souza, and Thiago Oliveira-Santos. Copycat cnn: Stealing knowledge by persuading confession with random nonlabeled data. In IJCNN, 2018.
|
| 192 |
+
|
| 193 |
+
John Duchi, Shai Shalev-Shwartz, Yoram Singer, and Tushar Chandra. Efficient projections onto the l 1-ball for learning in high dimensions. In ICML, 2008.
|
| 194 |
+
|
| 195 |
+
Cynthia Dwork, Aaron Roth, et al. The algorithmic foundations of differential privacy. Foundations and Trends $\textsuperscript { \textregistered }$ in Theoretical Computer Science, 2014.
|
| 196 |
+
|
| 197 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 198 |
+
|
| 199 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv:1503.02531, 2015.
|
| 200 |
+
|
| 201 |
+
Karla Leigh Hoffman. A method for globally minimizing concave functions over convex sets. Mathematical Programming, 20(1):22–32, 1981.
|
| 202 |
+
|
| 203 |
+
Matthew Jagielski, Nicholas Carlini, David Berthelot, Alex Kurakin, and Nicolas Papernot. Highfidelity extraction of neural network models. arXiv preprint arXiv:1909.01838, 2019.
|
| 204 |
+
|
| 205 |
+
Mika Juuti, Sebastian Szyller, Alexey Dmitrenko, Samuel Marchal, and N Asokan. Prada: Protecting against dnn model stealing attacks. In Euro S&P, 2019.
|
| 206 |
+
|
| 207 |
+
Manish Kesarwani, Bhaskar Mukhoty, Vijay Arya, and Sameep Mehta. Model extraction warning in mlaas paradigm. In ACSAC, 2018.
|
| 208 |
+
|
| 209 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2014.
|
| 210 |
+
|
| 211 |
+
Taesung Lee, Benjamin Edwards, Ian Molloy, and Dong Su. Defending against model stealing attacks using deceptive perturbations. S&P Deep Learning and Security (DLS) Workshop, 2018.
|
| 212 |
+
|
| 213 |
+
Daniel Lowd and Christopher Meek. Adversarial learning. In KDD, 2005.
|
| 214 |
+
|
| 215 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
|
| 216 |
+
|
| 217 |
+
Smitha Milli, Ludwig Schmidt, Anca D Dragan, and Moritz Hardt. Model reconstruction from model explanations. arXiv preprint arXiv:1807.05185, 2018.
|
| 218 |
+
|
| 219 |
+
Blaine Nelson, Marco Barreno, Fuching Jack Chi, Anthony D Joseph, Benjamin IP Rubinstein, Udam Saini, Charles Sutton, JD Tygar, and Kai Xia. Misleading learners: Co-opting your spam filter. In Machine learning in cyber trust. 2009.
|
| 220 |
+
|
| 221 |
+
Blaine Nelson, Benjamin Rubinstein, Ling Huang, Anthony Joseph, Shing-hon Lau, Steven Lee, Satish Rao, Anthony Tran, and Doug Tygar. Near-optimal evasion of convex-inducing classifiers. In AISTATS, 2010.
|
| 222 |
+
|
| 223 |
+
Seong Joon Oh, Max Augustin, Bernt Schiele, and Mario Fritz. Towards reverse-engineering blackbox neural networks. In ICLR, 2018.
|
| 224 |
+
|
| 225 |
+
Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. Knockoff nets: Stealing functionality of black-box models. In CVPR, 2019.
|
| 226 |
+
|
| 227 |
+
Soham Pal, Yash Gupta, Aditya Shukla, Aditya Kanade, Shirish Shevade, and Vinod Ganapathy. A framework for the extraction of deep neural networks by leveraging public data. arXiv preprint arXiv:1905.09165, 2019.
|
| 228 |
+
|
| 229 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016.
|
| 230 |
+
|
| 231 |
+
Nicolas Papernot, Mart´ın Abadi, Ulfar Erlingsson, Ian Goodfellow, and Kunal Talwar. Semisupervised knowledge transfer for deep learning from private training data. In ICLR, 2017a.
|
| 232 |
+
|
| 233 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Asia CCS, 2017b.
|
| 234 |
+
|
| 235 |
+
Florian Tramer and Dan Boneh. Slalom: Fast, verifiable and private execution of neural networks in trusted hardware. In ICLR, 2019.
|
| 236 |
+
|
| 237 |
+
Florian Tramer, Fan Zhang, Ari Juels, Michael K Reiter, and Thomas Ristenpart. Stealing machine \` learning models via prediction apis. In USENIX Security, 2016.
|
| 238 |
+
|
| 239 |
+
Binghui Wang and Neil Zhenqiang Gong. Stealing hyperparameters in machine learning. In S&P, 2018.
|
| 240 |
+
|
| 241 |
+
Huadi Zheng, Qingqing Ye, Haibo Hu, Chengfang Fang, and Jie Shi. Bdpl: A boundary differentially private layer against machine learning model extraction attacks. In ESORICS, 2019.
|
| 242 |
+
|
| 243 |
+
# Appendix
|
| 244 |
+
|
| 245 |
+
A OVERVIEW AND NOTATION
|
| 246 |
+
|
| 247 |
+

|
| 248 |
+
Figure A1: Overview of Attack, Defense, and Evaluation Metrics. We consider an attacker $A$ who exploits black-box access to defended model $F _ { V } ^ { \delta }$ to train a stolen model $F _ { A }$ . In this paper, we take the role of the defender who intends to minimize replicability (i.e., $\mathsf { A c c } ( F _ { A } , { \mathcal { D } } ^ { \mathrm { t e s t } } ) )$ , while maintaining utility of the predictions. We consider two notions of utility: (1) minimizing perturbations in predictions, measured here using $L _ { 1 }$ distance; and (2) maintaining accuracy of the defended model on test set $\mathrm { A c c } ( F _ { V } ^ { \delta } , { \mathcal { D } } ^ { \mathrm { t e s t } } )$ . Note that for a fair head-to-head comparison, we use the same held-out test set $\mathcal { D } ^ { \mathrm { t e s t } }$ to evaluate accuracies of both the defended model $F _ { V } ^ { \delta }$ and stolen model $F _ { A }$ . Similar to all prior work, we assume $\mathcal { D } ^ { \mathrm { t r a i n } }$ , $\mathcal { D } ^ { \mathrm { t e s t } }$ are drawn i.i.d from the same (victim) distribution $\mathcal { D } _ { V }$ . Notation used in the above figure is further elaborated in Table A1.
|
| 249 |
+
|
| 250 |
+
Table A1: Notation
|
| 251 |
+
|
| 252 |
+
<table><tr><td></td><td>x</td><td>Inputs (images ∈ RC×H×W)</td></tr><tr><td></td><td>y,y</td><td>Original, perturbed posterior predictions</td></tr><tr><td></td><td>AR</td><td>Probability simplex overK vertices</td></tr><tr><td>Attacker A</td><td>PA(X)</td><td>Attacker's input data distribution</td></tr><tr><td></td><td>Dtransfer</td><td>Transfer set (= {(xi,yi)},where xi ~ PA(X),yi = Fv(xi))</td></tr><tr><td></td><td>FA</td><td>Attacker's (stolen) model trained on Dtransfer</td></tr><tr><td>Victim/DefenderV</td><td>Pv(X)</td><td>Victim's input data distribution</td></tr><tr><td></td><td>Dtrain</td><td>Training data (= {(xi,yi)},where xi ~ Pv(X))</td></tr><tr><td></td><td>Fv</td><td>Undefended model trained on Dtrain</td></tr><tr><td></td><td>F</td><td>Defended model</td></tr><tr><td></td><td>Dtest</td><td>Test set(= {(xi, yi)},where xi~Pv(X))</td></tr></table>
|
| 253 |
+
|
| 254 |
+
B RELATED WORK: EXTENSION
|
| 255 |
+
|
| 256 |
+
A summary of existing model stealing attacks and defenses is presented in Table A2.
|
| 257 |
+
|
| 258 |
+
# C DETAILED ALGORITHM
|
| 259 |
+
|
| 260 |
+
We present a detailed algorithm (see Algorithm 1) for our approach described in Section 4.
|
| 261 |
+
|
| 262 |
+
The algorithm roughly follows four steps:
|
| 263 |
+
|
| 264 |
+
(i) Predict $\mathbf { ( L } 2 )$ : Obtains posterior probability predictions $\textbf { { y } }$ for input $_ { \textbf { \em x } }$ using a victim model $F _ { V } ( { \pmb x } ; { \pmb w } _ { V } )$ .
|
| 265 |
+
|
| 266 |
+
Table A2: Existing DNN Attacks and Defenses. Complements the discussion in Section 2. $\mathbf { \Gamma } _ { \mathbf { C N N } } { } ^ { * }$ ’: Complex ImageNet-like CNN. $\cdot \cdot \cdot$ : Both. ‘P/D’: Perturbation/Detection. ‘AP’: Accuracy preserving (i.e., maintains top-1 labels of predictions). ‘AC’: Attacks considered.
|
| 267 |
+
|
| 268 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Black-box type</td><td colspan="2">Proposed Attack</td><td colspan="4">Proposed Defense</td></tr><tr><td>Input Query Data</td><td>Adapt.?</td><td>Strategy</td><td>P/D?</td><td>AP?</td><td>AC</td></tr><tr><td>1.Lowd & Meek (2005)</td><td>Linear</td><td>Random Noise</td><td>√</td><td></td><td>-</td><td>-</td><td>-</td></tr><tr><td>2.Nelson et al. (2009)</td><td>Linear</td><td>Labeled Data</td><td>X</td><td>Rejection</td><td>D</td><td>X</td><td>1</td></tr><tr><td>3.Nelson et al. (2010)</td><td>Linear</td><td>Random Noise</td><td></td><td></td><td>-</td><td></td><td></td></tr><tr><td>4. Alabdulmohsin et al. (2014)</td><td>Linear</td><td>Random Noise</td><td>√</td><td>Ensembling</td><td>P</td><td>X</td><td>4</td></tr><tr><td>5.Tramer et al.(2016)</td><td>Linear, NN</td><td>Random Noise</td><td>+</td><td>Rounding</td><td>P</td><td>√</td><td>5</td></tr><tr><td>6.Milli et al. (2018)</td><td>Linear, NN</td><td>Random Noise</td><td></td><td>=</td><td>-</td><td></td><td>-</td></tr><tr><td>7.Kesarwani et al. (2018)</td><td>Decision Tree</td><td></td><td></td><td>Detection</td><td>D</td><td>√</td><td>5</td></tr><tr><td>8.Chandrasekaran et al. (2019)</td><td>Linear</td><td>Random Noise</td><td>√</td><td>Random Pert.</td><td>P</td><td>X</td><td>-</td></tr><tr><td>9.Papernot et al.(2017b)</td><td>CNN</td><td>Synth. Data</td><td>√</td><td></td><td>-</td><td></td><td>-</td></tr><tr><td>10. Correia-Silva et al. (2018)</td><td>CNN</td><td>Unlabeled Data</td><td>X</td><td></td><td></td><td>=</td><td></td></tr><tr><td>11.Pal et al. (2019)</td><td>CNN</td><td>Unlabeled Data</td><td>+</td><td></td><td>-</td><td>=</td><td>1</td></tr><tr><td>12. Orekondy et al. (2019)</td><td>CNN*</td><td>Unlabeled Data</td><td></td><td>Rounding, Top-k</td><td>P</td><td>√</td><td>12</td></tr><tr><td>13.Jagielski et al. (2019)</td><td>CNN*</td><td>Unlabeled Data</td><td>√</td><td></td><td>1</td><td>-</td><td>-</td></tr><tr><td>14. Juuti et al. (2019)</td><td>CNN</td><td>Synth. Data</td><td>√</td><td>Detection</td><td>D</td><td>√</td><td>9,14</td></tr><tr><td>15.Lee et al. (2018)</td><td>CNN</td><td></td><td></td><td>Reverse sigmoid</td><td>P</td><td>√</td><td>9</td></tr><tr><td>16. Ours</td><td>CNN*</td><td>=</td><td></td><td>Targeted Pert.</td><td>P</td><td>+</td><td>9,12,14</td></tr></table>
|
| 269 |
+
|
| 270 |
+
Algorithm 1: MAD Defense. To supplement approach in Section 4
|
| 271 |
+
|
| 272 |
+
(ii) Estimate Jacobian $G$ (L3): We estimate a $\mathbb { R } ^ { K \times D }$ jacobian matrix on a surrogate model $F$ . By default, we use as $F$ a randomly initialized model (more details in Appendix E.1). Each row of $G$ represents the gradient direction (in parameter space $\mathbb { R } ^ { D }$ ) over log likelihood of class $k$ .
|
| 273 |
+
|
| 274 |
+
(iii) Maximize MAD Objective (L4): We find the optimal direction $\boldsymbol { y } ^ { * }$ which maximizes the MAD objective (Eq. 3). To compute the arg max, we iterative over the $K$ extremes of the probability simplex $\Delta ^ { K }$ to find ${ \pmb y } ^ { * }$ which maximizes the objective. The extreme ${ \pmb y } _ { k }$ denotes a probability vector with $y _ { k } = 1$ .
|
| 275 |
+
|
| 276 |
+
(iv) Enforce Utility Constraint (L5-7): We enforce the perturbation utility constraint (Eq. 7) by considering a linear interpolation of ${ \pmb y } ^ { * }$ and $\textbf { { y } }$ . The resulting interpolation probability vector $\tilde { \pmb y } : = h ( \alpha ^ { * } )$ represents the utility-constrained perturbed prediction that is returned instead of $\textbf { { y } }$ .
|
| 277 |
+
|
| 278 |
+
1 Function PerturbedPredict-MAD $( { \pmb x } )$ : Input: Input data $_ { \textbf { \em x } }$ , model to defend $F _ { V } ( \bf { \cdot } ; \mu \ v { v } _ { V } )$ , proxy attacker model $F ( \cdot ; w )$ Output: Perturbed posterior probability $\tilde { \pmb { y } } \in \Delta ^ { K }$ s.t. $\mathrm { d i s t } ( \tilde { \pmb { y } } , \pmb { y } ) \le \epsilon$
|
| 279 |
+
2 ${ \pmb y } : = F _ { V } ( { \pmb x } ; { \pmb w } _ { V } )$ // Obtain $K$ -dim posteriors
|
| 280 |
+
3 $\pmb { G } : = \nabla _ { \pmb { w } } \log F ( \pmb { x } ; \pmb { w } )$ // Pre-compute $\left( \mathbb { K } \texttt { x D } \right)$ ) Jacobian GT yk GT y 2
|
| 281 |
+
4 y∗ := arg maxyk∈ext(∆K) ||GT yk||2 ||GT y||2
|
| 282 |
+
5 Define $h ( \alpha ) = ( 1 - \alpha ) \pmb { y } + \alpha \pmb { y } ^ { \ast }$
|
| 283 |
+
6 $\begin{array} { r } { \alpha ^ { * } : = \arg \operatorname* { m a x } _ { \alpha \in [ 0 , 1 ] , \mathrm { d i s t } ( \cdot ) \leq \epsilon } \ \mathrm { d i s t } ( h ( \alpha ) , \ y ^ { * } ) } \end{array}$ // Find optimal step-size via bisection, or OptStep(.) for $L _ { p }$ norms
|
| 284 |
+
7 $\tilde { y } : = h ( \alpha ^ { * } )$ // Perturbed probabilities
|
| 285 |
+
8 return $\tilde { y }$
|
| 286 |
+
9
|
| 287 |
+
10 Function OptStep(y, y∗, , p):
|
| 288 |
+
11 α∗ := max n ||y−y∗||p , 1o
|
| 289 |
+
12 return $\ b { \alpha } ^ { * }$
|
| 290 |
+
|
| 291 |
+
# D ATTACK MODELS: RECAP AND IMPLEMENTATION DETAILS
|
| 292 |
+
|
| 293 |
+
Jacobian Based Data Augmentation (jbda) (Papernot et al., 2017b). The motivation of the approach is to obtain a surrogate of the victim black-box classifier, with an end-goal of performing evasion attacks (Biggio et al., 2013; Goodfellow et al., 2014). We restrict discussions primarily to the first part of constructing the surrogate. To obtain the surrogate (the stolen model), the authors depend on an unlabeled ‘seed’ set, typically from the same distribution as that used to train the victim model. As a result, the attacker assumes (mild) knowledge of the input data distribution and the class-label of the victim.
|
| 294 |
+
|
| 295 |
+
The key idea behind the approach is to query perturbations of inputs, to obtain a reasonable approximation of the decision boundary of the victim model. The attack strategy involves performing the following steps in a repeated manner: (i) images from the substitute set (initially the seed) $\mathcal { D }$ is labeled by querying the victim model $F _ { V }$ as an oracle labeler; (ii) the surrogate model $F _ { A }$ is trained on the substitute dataset; (iii) the substitute set is augmented using perturbations of existing images: $\mathscr { D } _ { \rho + 1 } = \mathscr { D } _ { \rho } \cup \{ \pmb { x } + \lambda _ { \rho + 1 } \cdot \mathrm { s g n } ( J _ { F } [ F _ { A } ( \pmb { x } ) ] ) : \pmb { x } \in \mathscr { D } _ { \rho } \}$ , where $J$ is the jacobian function.
|
| 296 |
+
|
| 297 |
+
We use a seed set of: 100 (MNIST and FashionMNIST), 500 (CIFAR10, CUB200, Caltech256) and 1000 (CIFAR100). We use the default set of hyperparameters of Papernot et al. (2017b) in other respects.
|
| 298 |
+
|
| 299 |
+
Jacobian Based $\{ \mathbf { s e l f } , \mathbf { t o p } { \mathbf { - } } \mathbf { k } \}$ (jbself, jbtop3) (Juuti et al., 2019) . The authors generalize the above approach, by extending the manner in which the synthetic samples are produced. In jbself, the jacobian is calculated w.r.t to $k$ nearest classes and in jb-self, w.r.t the maximum a posterior class predicted by $F _ { A }$ .
|
| 300 |
+
|
| 301 |
+
Knockoff Nets (knockoff) (Orekondy et al., 2019) . Knockoff is a recent attack model, which demonstrated model stealing can be performed without access to seed samples. Rather, the queries to the black-box involve natural images (which can be unrelated to the training data of the victim model) sampled from a large independent data source e.g., ImageNet1K. Consequently, no knowledge of the input data distribution nor the class-label space of the victim model is required to perform model stealing. The paper proposes two strategies on how to sample images to query: random and adaptive. We use the random strategy in the paper, since adaptive resulted in marginal increases in an open-world setup (which we have).
|
| 302 |
+
|
| 303 |
+
As the independent data sources in our knockoff attacks, we use: EMNIST-Letters (when stealing MNIST victim model), EMNIST (FashionMNIST), CIFAR100 (CIFAR10), CIFAR10 (CIFAR100), ImageNet1k (CUB200, Caltech256). Overlap between query images and the training data of the victim models are purely co-incidental.
|
| 304 |
+
|
| 305 |
+
We use the code from the project’s public github repository.
|
| 306 |
+
|
| 307 |
+
Evaluating Attacks. The resulting replica model $F _ { A }$ from all the above attack strategies are evaluated on a held-out test set. We remark that the replica model is evaluated as-is, without additional finetuning or modifications. Similar to prior work, we evaluate the accuracies of $F _ { A }$ on the victim’s held-out test set. Evaluating both stolen and the victim model on the same test set allows for fair head-to-head comparison.
|
| 308 |
+
|
| 309 |
+
# E SUPPLEMENTARY ANALYSIS
|
| 310 |
+
|
| 311 |
+
In this section, we present additional analysis to supplement Section 5.2.3.
|
| 312 |
+
|
| 313 |
+
# E.1 ESTIMATING $G$
|
| 314 |
+
|
| 315 |
+
Central to our defense is estimating the jacobian matrix $\boldsymbol { G } = \nabla _ { w } \log \boldsymbol { F } ( \boldsymbol { x } ; \boldsymbol { w } )$ (Eq. 5), where $F ( \cdot ; w )$ is the attacker’s model. However, a defender with black-box attacker knowledge (where $F$ is unknown) requires determining $G$ by instead using a surrogate model $F _ { \mathrm { s u r } }$ . We determine choice of $F _ { \mathrm { s u r } }$ empirically by studying two factors: (a) architecture of $F _ { s u r }$ : choice of defender’s surrogate architecture robust to varying attacker architectures (see Fig. A2); and (b) initialization of $F _ { s u r }$ : initialization of the surrogate model parameters plays a crucial role in providing a better defense. We consider four choices of initialization: $\{$ ‘rand’, ‘early’, ‘mid’, ‘late $\}$ which exhibits approximately {chance-level $2 5 \%$ , $50 \%$ , $7 5 \% \}$ test accuracies respectively. We observe (see Fig. A3) that a randomly initialized model, which is far from convergence, provides better gradient signals in crafting perturbations.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure A2: Influence of attacker architecture choices on a fixed surrogate.
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure A3: Influence of Initialization of a VGG16 Surrogate Model. ‘rand’ $=$ random initialization, (‘early’, ’mid’, ’late’) $= \sim ( 2 5 , 5 0 , 7 5 ) \%$ test accuracy of surrogate on test set.
|
| 322 |
+
|
| 323 |
+
<table><tr><td></td><td>Undefended</td><td>MAD</td></tr><tr><td>MNIST</td><td>0.88 ± 14.41</td><td>6.47 ±12.25</td></tr><tr><td>FashionMNIST</td><td>0.89 ±15.76</td><td>6.65 ± 14.16</td></tr><tr><td>CIFAR10</td><td>1.93 ±13.02</td><td>8.58 ±15.02</td></tr><tr><td>CIFAR100</td><td>2.15 ± 18.82</td><td>69.26 ± 21.4</td></tr><tr><td>CUBS200</td><td>4.45 ± 9.66</td><td>446.93 ± 23.87</td></tr><tr><td>Caltech256</td><td>4.93 ± 21.25</td><td>815.97 ± 30.3</td></tr></table>
|
| 324 |
+
|
| 325 |
+
Table A3: Run times (in ms). We report the mean and standard deviation of predictions of undefended and defended models, computed over 10K predictions.
|
| 326 |
+
|
| 327 |
+
# E.2 RUN-TIME ANALYSIS
|
| 328 |
+
|
| 329 |
+
We present the run-times of our defended and undefended models in Table A3. The reported numbers were summarized over 10K unique predictions performed on an Nvidia Tesla V100. We find our optimization procedure Eq. (4-7) for all models take under a second, with at most 0.8s in the case of Caltech256. The primary computational bottleneck of our defense implementation is estimating matrix $G \in \mathbb { R } ^ { K \times D }$ in Eq. 5, which currently requires performing $K$ (i.e., number of output classes) backward passes through the surrogate model. Consequently, we find that our inference times on Caltech256 can be further reduced to $0 . 3 \mathrm { s } \pm 0 . 0 4$ by using a more efficient surrogate architecture (e.g., ResNet-34).
|
| 330 |
+
|
| 331 |
+
# F ADDITIONAL PLOTS
|
| 332 |
+
|
| 333 |
+
# F.1 ATTACKER EVALUATION
|
| 334 |
+
|
| 335 |
+
We present evaluation of all attacks considered in the paper on an undefended model in Figure A4. Furthermore, specific to the knockoff attack, we analyze how training using only the top-1 label (instead of complete posterior information) affects the attacker in Figure A5.
|
| 336 |
+
|
| 337 |
+
# F.2 BUDGET VS. ACCURACY
|
| 338 |
+
|
| 339 |
+
We plot the budget (i.e., number of distinct black-box attack queries to the defender) vs. the test accuracy of the defender/attacker in Figure A6. The figure supplements Figure 1 and the discussion found in Section 5.2.1 of the main paper.
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure A4: Evaluation of all attacks on undefended victim models.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure A5: Stolen model trained using knockoff strategy on complete posterior information $( y )$ and only the top-1 label of the posteriors (arg $\operatorname* { m a x } _ { k } y _ { k } ,$ ).
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure A6: Budget vs. Test Accuracy. Supplements Fig. 3c in the main paper.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure A7: Attacker argmax. Supplements Fig. 4 in the main paper.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure A8: Histogram of Angular Deviations (Black-box setting). Supplements Fig. 6 in the main paper. The test-loss during of the attacker model for each of the histograms (over multiple $\epsilon$ values) are provided in the bottom row.
|
| 355 |
+
|
| 356 |
+
# F.3 ATTACKER ARGMAX
|
| 357 |
+
|
| 358 |
+
In Figure A7, we perform the non-replicability vs. utility evaluation (complementing Fig. 5 in the main paper) under a special situation: the attacker discards the probabilities and only uses the top-1 Black-box s‘argmax’ label to train the stolen model. Relevant discussion can be found in Section 5.2.2.
|
| 359 |
+
|
| 360 |
+
# F.4 BLACK-BOX ANGULAR DEVIATIONS
|
| 361 |
+
|
| 362 |
+
In Figure A8, we provide the angular deviations obtained in a black-box setting over the course of training the attack model. We train the attacker model using the transfer set obtained by the knockoff approach (the strongest attacker in our experiments) for 50 epochs using a SGD $( \mathrm { l r } = 0 . 0 1 $ , momentum $= 0 . 5$ ) and a batch size of 64. The experiment compliments our previous discussion in Section 5.2.3 of the main paper under “How much angular deviation does MAD introduce?”. As before, we estimate the angular deviations as: $\begin{array} { r } { \theta = \operatorname { a r c c o s } { \frac { { \mathbf { \em u } } \cdot { \mathbf { \boldsymbol { a } } } } { | | { \mathbf { \boldsymbol { u } } } | | | | | { \mathbf { \boldsymbol { a } } } | | } } } \end{array}$ , where $\pmb { u } = \nabla _ { \pmb { w } } L ( \pmb { w } _ { t } , \pmb { y } , \cdot )$ and $\pmb { a } = \nabla _ { \pmb { w } } L ( \pmb { w } _ { t } , \tilde { \pmb { y } } , \cdot )$ . We observe from Figure A8: (i) the defensive angular deviations introduced by MAD to posterior predictions transfer to a black-box attacker setting, when crafting perturbations without access to the adversary’s model parameters; and (ii) although the setting introduces lower angular deviations at the extreme case of $\epsilon { = } 2 . 0$ (e.g., $1 1 4 . 7 ^ { \circ } 7 6 . 5 ^ { \circ }$ in CIFAR10), we observe the perturbation sufficient to maximize the attacker’s test loss. We find significant angular deviations introduced by our approach in a black-box setting as well.
|
| 363 |
+
|
| 364 |
+
# F.5 MAD ABLATION EXPERIMENTS
|
| 365 |
+
|
| 366 |
+
We present the ablation experiments covering all defender models in Figure A9. Relevant discussion is available in Section 5.2.3 of the main paper under “Ablative Analysis”.
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure A9: MAD ablation experiments. Supplements Fig. 8 in the main paper.
|
md/train/T6AxtOaWydQ/T6AxtOaWydQ.md
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# $i$ -MIX: A DOMAIN-AGNOSTIC STRATEGYFOR CONTRASTIVE REPRESENTATION LEARNING
|
| 2 |
+
|
| 3 |
+
Kibok Lee1,2 Yian Zhu1 Kihyuk Sohn3 Chun-Liang $\mathbf { L i ^ { 3 } }$ Jinwoo $\mathbf { S h i n ^ { 4 } }$ Honglak Lee1,5 1University of Michigan 2Amazon Web Services 3Google Cloud AI 4KAIST $^ { 5 } \mathrm { L } \bar { \mathrm { G } }$ AI Research 1 {kibok,yianz,honglak}@umich.edu 3 {kihyuks,chunliang}@google.com 2kibok@amazon.com 4jinwoos@kaist.ac.kr 5honglak@lgresearch.ai
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Contrastive representation learning has shown to be effective to learn representations from unlabeled data. However, much progress has been made in vision domains relying on data augmentations carefully designed using domain knowledge. In this work, we propose $i$ -Mix, a simple yet effective domain-agnostic regularization strategy for improving contrastive representation learning. We cast contrastive learning as training a non-parametric classifier by assigning a unique virtual class to each data in a batch. Then, data instances are mixed in both the input and virtual label spaces, providing more augmented data during training. In experiments, we demonstrate that $i$ -Mix consistently improves the quality of learned representations across domains, including image, speech, and tabular data. Furthermore, we confirm its regularization effect via extensive ablation studies across model and dataset sizes. The code is available at https://github.com/kibok90/imix.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Representation learning (Bengio et al., 2013) is a fundamental task in machine learning since the success of machine learning relies on the quality of representation. Self-supervised representation learning (SSL) has been successfully applied in several domains, including image recognition (He et al., 2020; Chen et al., 2020a), natural language processing (Mikolov et al., 2013; Devlin et al., 2018), robotics (Sermanet et al., 2018; Lee et al., 2019), speech recognition (Ravanelli et al., 2020), and video understanding (Korbar et al., 2018; Owens & Efros, 2018). Since no label is available in the unsupervised setting, pretext tasks are proposed to provide self-supervision: for example, context prediction (Doersch et al., 2015), inpainting (Pathak et al., 2016), and contrastive learning (Wu et al., 2018b; Hjelm et al., 2019; He et al., 2020; Chen et al., 2020a). SSL has also been used as an auxiliary task to improve the performance on the main task, such as generative model learning (Chen et al., 2019), semi-supervised learning (Zhai et al., 2019), and improving robustness and uncertainty (Hendrycks et al., 2019).
|
| 12 |
+
|
| 13 |
+
Recently, contrastive representation learning has gained increasing attention by showing state-ofthe-art performance in SSL for large-scale image recognition (He et al., 2020; Chen et al., 2020a), which outperforms its supervised pre-training counterpart (He et al., 2016) on downstream tasks. However, while the concept of contrastive learning is applicable to any domains, the quality of learned representations rely on the domain-specific inductive bias: as anchors and positive samples are obtained from the same data instance, data augmentation introduces semantically meaningful variance for better generalization. To achieve a strong, yet semantically meaningful data augmentation, domain knowledge is required, e.g., color jittering in 2D images or structural information in video understanding. Hence, contrastive representation learning in different domains requires an effort to develop effective data augmentations. Furthermore, while recent works have focused on largescale settings where millions of unlabeled data is available, it would not be practical in real-world applications. For example, in lithography, acquiring data is very expensive in terms of both time and cost due to the complexity of manufacturing process (Lin et al., 2018; Sim et al., 2019).
|
| 14 |
+
|
| 15 |
+
Meanwhile, MixUp (Zhang et al., 2018) has shown to be a successful data augmentation for supervised learning in various domains and tasks, including image classification (Zhang et al., 2018), generative model learning (Lucas et al., 2018), and natural language processing (Guo et al., 2019; Guo, 2020).
|
| 16 |
+
|
| 17 |
+
In this paper, we explore the following natural, yet important question: is the idea of MixUp useful for unsupervised, self-supervised, or contrastive representation learning across different domains?
|
| 18 |
+
|
| 19 |
+
To this end, we propose instance $M i x \left( i – M i x \right)$ , a domain-agnostic regularization strategy for contrastive representation learning. The key idea of $i$ -Mix is to introduce virtual labels in a batch and mix data instances and their corresponding virtual labels in the input and label spaces, respectively. We first introduce the general formulation of $i$ -Mix, and then we show the applicability of $i$ -Mix to state-ofthe-art contrastive representation learning methods, SimCLR (Chen et al., 2020a) and MoCo (He et al., 2020), and a self-supervised learning method without negative pairs, BYOL (Grill et al., 2020).
|
| 20 |
+
|
| 21 |
+
Through the experiments, we demonstrate the efficacy of $i$ -Mix in a variety of settings. First, we show the effectiveness of $i$ -Mix by evaluating the discriminative performance of learned representations in multiple domains. Specifically, we adapt $i$ -Mix to the contrastive representation learning methods, advancing state-of-the-art performance across different domains, including image (Krizhevsky & Hinton, 2009; Deng et al., 2009), speech (Warden, 2018), and tabular (Asuncion & Newman, 2007) datasets. Then, we study $i$ -Mix in various conditions, including when 1) the model and training dataset is small or large, 2) domain knowledge is limited, and 3) transfer learning.
|
| 22 |
+
|
| 23 |
+
Contribution. In summary, our contribution is three-fold:
|
| 24 |
+
|
| 25 |
+
• We propose $i$ -Mix, a method for regularizing contrastive representation learning, motivated by MixUp (Zhang et al., 2018). We show how to apply $i$ -Mix to state-of-the-art contrastive representation learning methods (Chen et al., 2020a; He et al., 2020; Grill et al., 2020). • We show that $i$ -Mix consistently improves contrastive representation learning in both vision and non-vision domains. In particular, the discriminative performance of representations learned with $i$ -Mix is on par with fully supervised learning on CIFAR-10/100 (Krizhevsky & Hinton, 2009) and Speech Commands (Warden, 2018). • We verify the regularization effect of $i$ -Mix in a variety of settings. We empirically observed that $i$ -Mix significantly improves contrastive representation learning when 1) the training dataset size is small, or 2) the domain knowledge for data augmentations is not enough.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Self-supervised representation learning (SSL) aims at learning representations from unlabeled data by solving a pretext task that is derived from self-supervision. Early works on SSL proposed pretext tasks based on data reconstruction by autoencoding (Bengio et al., 2007), such as context prediction (Doersch et al., 2015) and inpainting (Pathak et al., 2016). Decoder-free SSL has made a huge progress in recent years. Exemplar CNN (Dosovitskiy et al., 2014) learns by classifying individual instances with data augmentations. SSL of visual representation, including colorization (Zhang et al., 2016), solving jigsaw puzzles (Noroozi & Favaro, 2016), counting the number of objects (Noroozi et al., 2017), rotation prediction (Gidaris et al., 2018), next pixel prediction (Oord et al., 2018; Henaff´ et al., 2019), and combinations of them (Doersch & Zisserman, 2017; Kim et al., 2018; Noroozi et al., 2018) often leverages image-specific properties to design pretext tasks. Meanwhile, alhough deep clustering (Caron et al., 2018; 2019; Asano et al., 2020) is often distinguished from SSL, it also leverages unsupervised clustering assignments as self-supervision for representation learning.
|
| 30 |
+
|
| 31 |
+
Contrastive representation learning has gained lots of attention for SSL (He et al., 2020; Chen et al., 2020a). As opposed to early works on exemplar CNN (Dosovitskiy et al., 2014; 2015), contrastive learning maximizes similarities of positive pairs while minimizes similarities of negative pairs instead of training an instance classifier. As the choice of negative pairs is crucial for the quality of learned representations, recent works have carefully designed them. Memory-based approaches (Wu et al., 2018b; Hjelm et al., 2019; Bachman et al., 2019; Misra & van der Maaten, 2020; Tian et al., 2020a) maintain a memory bank of embedding vectors of instances to keep negative samples, where the memory is updated with embedding vectors extracted from previous batches. In addition, MoCo (He et al., 2020) showed that differentiating the model for anchors and positive/negative samples is effective, where the model for positive/negative samples is updated by the exponential moving average of the model for anchors. On the other hand, recent works (Ye et al., 2019; Misra & van der Maaten, 2020; Chen et al., 2020a; Tian et al., 2020a) showed that learning invariance to different views is important in contrastive representation learning. The views can be generated through data augmentations carefully designed using domain knowledge (Chen et al., 2020a), splitting input channels (Tian et al., 2020a), or borrowing the idea of other pretext tasks, such as creating jigsaw puzzles or rotating inputs (Misra & van der Maaten, 2020). In particular, SimCLR (Chen et al., 2020a) showed that a simple memory-free approach with a large batch size and strong data augmentations has a comparable performance to memory-based approaches. InfoMin (Tian et al., 2020b) further studied a way to generate good views for contrastive representation learning and achieved state-of-the-art performance by combining prior works. Different from other contrastive representation learning methods, BYOL (Grill et al., 2020) does not require negative pairs, where the proposed pretext task aims at predicting latent representations of one view from another. While prior works have focused on SSL on large-scale visual recognition tasks, our work focuses on contrastive representation learning in both small- and large-scale settings in different domains.
|
| 32 |
+
|
| 33 |
+
Data augmentation is a technique to increase the diversity of data, especially when training data are not enough for generalization. Since the augmented data must be understood as the original data, data augmentations are carefully designed using the domain knowledge about images (DeVries & Taylor, 2017b; Cubuk et al., 2019a;b; Zhong et al., 2020), speech (Amodei et al., 2016; Park et al., 2019), or natural languages (Zhang et al., 2015; Wei & Zou, 2019).
|
| 34 |
+
|
| 35 |
+
Some works have studied data augmentation with less domain knowledge: DeVries & Taylor (2017a) proposed a domain-agnostic augmentation strategy by first encoding the dataset and then applying augmentations in the feature space. MixUp (Zhang et al., 2018) is an effective data augmentation strategy in supervised learning, which performs vicinal risk minimization instead of empirical risk minimization, by linearly interpolating input data and their labels on the data and label spaces, respectively. On the other hand, MixUp has also shown its effectiveness in other tasks and non-vision domains, including generative adversarial networks (Lucas et al., 2018), improved robustness and uncertainty (Hendrycks et al., 2020), and sentence classification in natural language processing (Guo, 2020; Guo et al., 2019). Other variations have also been investigated by interpolating in the feature space (Verma et al., 2019) or leveraging domain knowledge (Yun et al., 2019). MixUp would not be directly applicable to some domains, such as point clouds, but its adaptation can be effective (Harris et al., 2020). $i$ -Mix is a kind of data augmentation for better generalization in contrastive representation learning, resulting in better performances on downstream tasks.
|
| 36 |
+
|
| 37 |
+
Concurrent works have leveraged the idea of MixUp for contrastive representation learning. As discussed in Section 3.3, only input data can be mixed for improving contrastive representation learning (Shen et al., 2020; Verma et al., 2020; Zhou et al., 2020), which can be considered as injecting data-driven noises. Kalantidis et al. (2020) mixed hard negative samples on the embedding space. Kim et al. (2020) reported similar observations to ours but focused on small image datasets.
|
| 38 |
+
|
| 39 |
+
# 3 APPROACH
|
| 40 |
+
|
| 41 |
+
In this section, we review MixUp (Zhang et al., 2018) in supervised learning and present $i$ -Mix in contrastive learning (He et al., 2020; Chen et al., 2020a; Grill et al., 2020). Throughout this section, let $\mathcal { X }$ be a data space, $\mathbb { R } ^ { D }$ be a $D$ -dimensional embedding space, and a model $f : \mathcal { X } \to \mathbb { R } ^ { D }$ be a mapping between them. For conciseness, $f _ { i } = f ( x _ { i } )$ and $\tilde { f _ { i } } = f ( \tilde { x } _ { i } )$ for $x _ { i } , { \tilde { x } } _ { i } \in { \mathcal { X } }$ , and model parameters are omitted in loss functions.
|
| 42 |
+
|
| 43 |
+
# 3.1 MIXUP IN SUPERVISED LEARNING
|
| 44 |
+
|
| 45 |
+
Suppose an one-hot label $y _ { i } \in \{ 0 , 1 \} ^ { C }$ is assigned to a data $x _ { i }$ , where $C$ is the number of classes. Let a linear classifier predicting the labels consists of weight vectors $\{ w _ { 1 } , \ldots , w _ { C } \}$ , where $w _ { c } \in \mathbb { R } ^ { D }$ . 1 Then, the cross-entropy loss for supervised learning is defined as:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\ell _ { \mathrm { S u p } } ( x _ { i } , y _ { i } ) = - \sum _ { c = 1 } ^ { C } y _ { i , c } \log \frac { \exp ( w _ { c } ^ { \top } f _ { i } ) } { \sum _ { k = 1 } ^ { C } \exp ( w _ { k } ^ { \top } f _ { i } ) } .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
While the cross-entropy loss is widely used for supervised training of deep neural networks, there are several challenges of training with the cross-entropy loss, such as preventing overfitting or networks being overconfident. Several regularization techniques have been proposed to alleviate these issues, including label smoothing (Szegedy et al., 2016), adversarial training (Miyato et al., 2018), and confidence calibration (Lee et al., 2018).
|
| 52 |
+
|
| 53 |
+
MixUp (Zhang et al., 2018) is an effective regularization with negligible computational overhead. It conducts a linear interpolation of two data instances in both input and label spaces and trains a model by minimizing the cross-entropy loss defined on the interpolated data and labels. Specifically, for two labeled data $( x _ { i } , y _ { i } )$ , $( x _ { j } , y _ { j } )$ , the MixUp loss is defined as follows:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\ell _ { \mathrm { S u p } } ^ { \mathrm { M i x U p } } \big ( ( x _ { i } , y _ { i } ) , ( x _ { j } , y _ { j } ) ; \lambda \big ) = \ell _ { \mathrm { S u p } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda y _ { i } + ( 1 - \lambda ) y _ { j } ) ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $\lambda \sim \operatorname { B e t a } ( \alpha , \alpha )$ is a mixing coefficient sampled from the beta distribution. MixUp is a vicinal risk minimization method (Chapelle et al., 2001) that augments data and their labels in a data-driven manner. Not only improving the generalization on the supervised task, it also improves adversarial robustness (Pang et al., 2019) and confidence calibration (Thulasidasan et al., 2019).
|
| 60 |
+
|
| 61 |
+
# 3.2 $i$ -MIX IN CONTRASTIVE LEARNING
|
| 62 |
+
|
| 63 |
+
We introduce instance mix $\mathit { i }$ -Mix), a data-driven augmentation strategy for contrastive representation learning to improve the generalization of learned representations. Intuitively, instead of mixing class labels, $i$ -Mix interpolates their virtual labels, which indicates their identity in a batch.
|
| 64 |
+
|
| 65 |
+
Let $\boldsymbol { B } = \{ ( x _ { i } , \tilde { x } _ { i } ) \} _ { i = 1 } ^ { N }$ be a batch of data pairs, where $N$ is the batch size, $x _ { i } , { \tilde { x } } _ { i } \in { \mathcal { X } }$ are two views of the same data, which are usually generated by different augmentations. For each anchor $x _ { i }$ , we call ${ \tilde { x } } _ { i }$ and $\tilde { x } _ { j \neq i }$ positive and negative samples, respectively.2 Then, the model $f$ learns to maximize similarities of positive pairs (instances from the same data) while minimize similarities of negative pairs (instances from different data) in the embedding space. The output of $f$ is L2-normalized, which has shown to be effective (Wu et al., 2018a; He et al., 2020; Chen et al., 2020a). Let $v _ { i } \in \{ 0 , 1 \} ^ { N }$ be the virtual label of $x _ { i }$ and $\tilde { x } _ { i }$ in a batch $\boldsymbol { B }$ , where $v _ { i , i } = 1$ and $v _ { i , j \neq i } = 0$ . For a general sample-wise contrastive loss with virtual labels $\ell ( x _ { i } , v _ { i } )$ , the $i$ -Mix loss is defined as follows:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\ell ^ { i \cdot \mathrm { M i x } } \big ( ( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } ) ; \mathcal { B } , \lambda \big ) = \ell ( \mathrm { M i x } ( x _ { i } , x _ { j } ; \lambda ) , \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ; \mathcal { B } ) ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\lambda \sim \operatorname { B e t a } ( \alpha , \alpha )$ is a mixing coefficient and Mix is a mixing operator, which can be adapted depending on target domains: for example, $\operatorname { M i x U p } ( x _ { i } , x _ { j } ; \lambda ) = \lambda x _ { i } + ( 1 - \lambda ) x _ { j }$ (Zhang et al., 2018) when data values are continuous, and $\mathbf { C u t M i x } ( x _ { i } , x _ { j } ; \lambda ) = M _ { \lambda } \odot x _ { i } + ( 1 - M _ { \lambda } ) \odot x _ { j }$ (Yun et al., 2019) when data values have a spatial correlation with neighbors, where $M _ { \lambda }$ is a binary mask filtering out a region whose relative area is $( 1 - \lambda )$ , and $\odot$ is an element-wise multiplication. Note that some mixing operators might not work well for some domains: for example, CutMix would not be valid when data values and their spatial neighbors have no correlation. However, the MixUp operator generally works well across domains including image, speech, and tabular; we use it for $i$ -Mix formulations and experiments, unless otherwise specified. In the following, we show how to apply $i$ -Mix to contrastive representation learning methods.
|
| 72 |
+
|
| 73 |
+
SimCLR (Chen et al., 2020a) is a simple contrastive representation learning method without a memory bank, where each anchor has one positive sample and $( 2 N - 2 )$ negative samples. Let $x _ { N + i } = \tilde { x } _ { i }$ for conciseness. Then, the $( 2 N { - } 1 )$ -way discrimination loss is written as follows:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\ell _ { \mathrm { S i m C L R } } ( x _ { i } ; \mathcal { B } ) = - \log \frac { \exp { \left( s ( f _ { i } , f _ { ( N + i ) \bmod { 2 N } } ) / \tau \right) } } { \sum _ { k = 1 , k \ne i } ^ { 2 N } \exp { \left( s ( f _ { i } , f _ { k } ) / \tau \right) } } ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\tau$ is a temperature scaling parameter and $s ( f , { \tilde { f } } ) = ( f ^ { \top } { \tilde { f } } ) / \| f \| \| { \tilde { f } } \|$ is the inner product of two L2-normalized vectors. In this formulation, $i$ -Mix is not directly applicable because virtual labels are defined differently for each anchor.3 To resolve this issue, we simplify the formulation of SimCLR by excluding anchors from negative samples. Then, with virtual labels, the $N$ -way discrimination loss is written as follows:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\ell _ { \mathrm { N - p a i r } } ( x _ { i } , v _ { i } ; \mathcal { B } ) = - \sum _ { n = 1 } ^ { N } v _ { i , n } \log \frac { \exp { \left( s ( f _ { i } , \tilde { f } _ { n } ) / \tau \right) } } { \sum _ { k = 1 } ^ { N } \exp { \left( s ( f _ { i } , \tilde { f } _ { k } ) / \tau \right) } } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where we call it the N-pair contrastive loss, as the formulation is similar to the $\mathbf { N } .$ -pair loss in the context of metric learning (Sohn, 2016).4 For two data instances $( x _ { i } , v _ { i } )$ , $( x _ { j } , v _ { j } )$ and a batch of data
|
| 86 |
+
|
| 87 |
+
Algorithm 1 Loss computation for $i$ -Mix on N-pair contrastive learning in PyTorch-like style.
|
| 88 |
+
|
| 89 |
+
a, b $=$ aug(x), aug(x) # two different views of input x
|
| 90 |
+
lam $=$ Beta(alpha, alpha).sample() # mixing coefficient
|
| 91 |
+
randidx $=$ randperm(len(x))
|
| 92 |
+
$\ a = \ 1 a _ { } \ m$ $^ { \star }$ a + (1-lam) $\star$ a[randidx]
|
| 93 |
+
logits $=$ matmul(normalize(model(a)), normalize(model(b)).T) / t
|
| 94 |
+
$1 0 s s = 1 a m$ $\star$ CrossEntropyLoss(logits, arange(len(x))) + \ (1-lam) $\star$ CrossEntropyLoss(logits, randidx)
|
| 95 |
+
|
| 96 |
+
pairs $\boldsymbol { B } = \{ ( x _ { i } , \tilde { x } _ { i } ) \} _ { i = 1 } ^ { N }$ , the $i$ -Mix loss is defined as follows:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\ell _ { \mathrm { N - p a i r } } ^ { i \mathrm { - } \mathrm { M i x } } \big ( ( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } ) ; \mathcal { B } , \lambda \big ) = \ell _ { \mathrm { N - p a i r } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ; \mathcal { B } ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Algorithm 1 provides the pseudocode of $i$ -Mix on $\mathbf { N } .$ -pair contrastive learning for one iteration.5
|
| 103 |
+
|
| 104 |
+
Pair relations in contrastive loss. To use contrastive loss for representation learning, one needs to properly define a pair relation $\{ ( x _ { i } , \tilde { x } _ { i } ) \} _ { i = 1 } ^ { N }$ . For contrastive representation learning, where semantic class labels are not provided, the pair relation would be defined in that 1) a positive pair, $x _ { i }$ and ${ \tilde { x } } _ { i }$ , are different views of the same data and 2) a negative pair, $x _ { i }$ and $\tilde { x } _ { j \neq i }$ , are different data instances. For supervised representation learning, $x _ { i }$ and $\tilde { x } _ { i }$ are two data instances from the same class, while $x _ { i }$ and $\tilde { x } _ { j \neq i }$ are from different classes. Note that two augmented versions of the same data also belong to the same class, so they can also be considered as a positive pair. $i$ -Mix is not limited to self-supervised contrastive representation learning, but it can also be used as a regularization method for supervised contrastive representation learning (Khosla et al., 2020) or deep metric learning (Sohn, 2016; Movshovitz-Attias et al., 2017).
|
| 105 |
+
|
| 106 |
+
MoCo (He et al., 2020). In contrastive representation learning, the number of negative samples affects the quality of learned representations (Arora et al., 2019). Because SimCLR mines negative samples in the current batch, having a large batch size is crucial, which often requires a lot of computational resources (Chen et al., 2020a). For efficient training, recent works have maintained a memory bank $\mathcal { M } = \{ \mu _ { k } \} _ { k = 1 } ^ { K }$ , which is a queue of previously extracted embedding vectors, where $K$ is the size of the memory bank (Wu et al., 2018b; He et al., 2020; Tian et al., 2020a;b). In addition, MoCo introduces an exponential moving average (EMA) model to extract positive and negative embedding vectors, whose parameters are updated as $\theta _ { f ^ { \tt E M A } } m \theta _ { f ^ { \tt E M A } } + ( 1 - m ) \theta _ { f }$ , where $m \in [ 0 , 1 )$ is a momentum coefficient and $\theta$ is model parameters. The loss is written as follows:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\ell _ { \operatorname { M o C o } } ( x _ { i } ; \mathcal { B } , \mathcal { M } ) = - \log \frac { \exp \big ( s ( f _ { i } , \tilde { f } _ { i } ^ { \mathrm { E M A } } ) / \tau \big ) } { \exp \big ( s ( f _ { i } , \tilde { f } _ { i } ^ { \mathrm { E M A } } ) / \tau \big ) + \sum _ { k = 1 } ^ { K } \exp \big ( s ( f _ { i } , \mu _ { k } ) / \tau \big ) } .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
The memory bank $\mathcal { M }$ is then updated with $\{ \tilde { f } _ { i } ^ { \mathrm { E M A } } \}$ in the first-in first-out order. In this $( K { + } 1 )$ -way discrimination loss, data pairs are independent to each other, such that $i$ -Mix is not directly applicable because virtual labels are defined differently for each anchor. To overcome this issue, we include the positive samples of other anchors as negative samples, similar to the N-pair contrastive loss in Eq. (5). Let $\tilde { v } _ { i } \in \dot { \{ 0 , 1 \} } ^ { N + K }$ be a virtual label indicating the positive sample of each anchor, where $\tilde { v } _ { i , i } = 1$ and $\tilde { v } _ { i , j \neq i } = 0$ . Then, the $( N { + } K )$ -way discrimination loss is written as follows:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\ell _ { \mathrm { M o C o } } ( x _ { i } , \tilde { v } _ { i } ; \mathcal { B } , \mathcal { M } ) = - \sum _ { n = 1 } ^ { N } \tilde { v } _ { i , n } \log \frac { \exp \big ( s ( f _ { i } , \tilde { f } _ { n } ^ { \mathrm { E M A } } ) / \tau \big ) } { \sum _ { k = 1 } ^ { N } \exp \big ( s ( f _ { i } , \tilde { f } _ { k } ^ { \mathrm { E M A } } ) / \tau \big ) + \sum _ { k = 1 } ^ { K } \exp \big ( s ( f _ { i } , \mu _ { k } ) / \tau \big ) } .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
As virtual labels are bounded in the same set in this formulation, $i$ -Mix is directly applicable: for two data instances $( x _ { i } , \tilde { v } _ { i } )$ , $( x _ { j } , \tilde { v } _ { j } )$ , a batch of data pairs $\boldsymbol { B } = \{ ( x _ { i } , \tilde { x } _ { i } ) \} _ { i = 1 } ^ { N }$ , and the memory bank $\mathcal { M }$ the $i$ -Mix loss is defined as follows:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\ell _ { \mathrm { M o C o } } ^ { i \cdot \mathrm { M i x } } \big ( ( x _ { i } , \tilde { v } _ { i } ) , ( x _ { j } , \tilde { v } _ { j } ) ; \mathcal { B } , \mathcal { M } , \lambda \big ) = \ell _ { \mathrm { M o C o } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda \tilde { v } _ { i } + ( 1 - \lambda ) \tilde { v } _ { j } ; \mathcal { B } , \mathcal { M } ) .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
BYOL (Grill et al., 2020). Different from other contrastive representation learning methods, BYOL is a self-supervised representation learning method without contrasting negative pairs. For two views of the same data $x _ { i } , { \tilde { x } } _ { i } \in { \mathcal { X } }$ , the model $f$ learns to predict a view embedded with the EMA model $\tilde { f } _ { i } ^ { \mathtt { E M A } }$ from its embedding $f _ { i }$ . Specifically, an additional prediction layer $g$ is introduced, such that the difference between $g ( f _ { i } )$ and $\tilde { f } _ { i } ^ { \mathtt { E M A } }$ is learned to be minimized. The BYOL loss is written as follows:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\ell _ { \mathrm { B Y O L } } ( x _ { i } , \tilde { x } _ { i } ) = \Big \| g ( f _ { i } ) / \| g ( f _ { i } ) \| - \tilde { f } _ { i } / \| \tilde { f } _ { i } \| \Big \| ^ { 2 } = 2 - 2 \cdot s ( g ( f _ { i } ) , \tilde { f } _ { i } ) .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
This formulation can be represented in the form of the general contrastive loss in Eq. (3), as the second view $\tilde { x } _ { i }$ can be accessed from the batch $\boldsymbol { B }$ with its virtual label $v _ { i }$ . To derive $i$ -Mix in BYOL, let $\tilde { F } = [ \tilde { f } _ { 1 } / \| \tilde { f } _ { 1 } \| , . . . , \tilde { f } _ { N } / \| \tilde { f } _ { N } \| ] \in \mathbb { R } ^ { D \times N }$ be the collection of L2-normalized embedding vectors of the second views, such that $\tilde { f } _ { i } / { \| \tilde { f } _ { i } \| } = \tilde { F } v _ { i }$ . Then, the BYOL loss is written as follows:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\ell _ { \mathrm { B Y O L } } ( x _ { i } , v _ { i } ; \mathcal { B } ) = \Big | \Big | g ( f _ { i } ) / \| g ( f _ { i } ) \| - \tilde { F } v _ { i } \Big | \Big | ^ { 2 } = 2 - 2 \cdot s ( g ( f _ { i } ) , \tilde { F } v _ { i } ) .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
For two data instances $( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } )$ and a batch of data pairs $\boldsymbol { B } = \{ ( x _ { i } , \tilde { x } _ { i } ) \} _ { i = 1 } ^ { N }$ , the $i$ -Mix loss is defined as follows:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\ell _ { \mathrm { B Y O L } } ^ { i \mathrm { - } \mathrm { M i x } } \big ( ( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } ) ; \mathcal { B } , \lambda \big ) = \ell _ { \mathrm { B Y O L } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ; \mathcal { B } ) .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
# 3.3 INPUTMIX
|
| 143 |
+
|
| 144 |
+
The contribution of data augmentations to the quality of learned representations is crucial in contrastive representation learning. For the case when the domain knowledge about efficient data augmentations is limited, we propose to apply InputMix together with $i$ -Mix, which mixes input data but not their labels. This method can be viewed as introducing structured noises driven by auxiliary data to the principal data with the largest mixing coefficient $\lambda$ , and the label of the principal data is assigned to the mixed data (Shen et al., 2020; Verma et al., 2020; Zhou et al., 2020). We applied InputMix and $i$ -Mix together on image datasets in Table 3.
|
| 145 |
+
|
| 146 |
+
# 4 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
In this section, we demonstrate the effectiveness of $i$ -Mix. In all experiments, we conduct contrastive representation learning on a pretext dataset and evaluate the quality of representations via supervised classification on a downstream dataset. We report the accuracy averaged over up to five runs. In the first stage, a convolutional neural network (CNN) or multilayer perceptron (MLP) followed by the two-layer MLP projection head is trained on an unlabeled dataset. Then, we replace the projection head with a linear classifier and train only the linear classifier on a labeled dataset for downstream task. Except for transfer learning, datasets for the pretext and downstream tasks are the same. For $i$ -Mix, we sample a mixing coefficient $\lambda \sim \operatorname { B e t a } ( \alpha , \alpha )$ for each data, where $\alpha = 1$ unless otherwise stated.6 Additional details for the experimental settings and more experiments can be found in Appendix C.
|
| 149 |
+
|
| 150 |
+
# 4.1 EXPERIMENTAL SETUP
|
| 151 |
+
|
| 152 |
+
Baselines and datasets. We consider 1) N-pair contrastive learning as a memory-free contrastive learning method,7 2) MoCo v2 (He et al., 2020; Chen et al., 2020b) 8 as a memory-based contrastive learning method, and 3) BYOL (Grill et al., 2020), which is a self-supervised learning method without negative pairs. We apply $i$ -Mix to these methods and compare their performances. To show the effectiveness of $i$ -Mix across domains, we evaluate the methods on datasets from multiple domains, including image, speech, and tabular datasets.
|
| 153 |
+
|
| 154 |
+
CIFAR-10/100 (Krizhevsky & Hinton, 2009) consist of 50k training and 10k test images, and ImageNet (Deng et al., 2009) has 1.3M training and $5 0 \mathrm { k }$ validation images, where we use them for evaluation. For ImageNet, we also use a subset of randomly chosen 100 classes out of 1k classes to experiment at a different scale. We apply a set of data augmentations randomly in sequence including random resized cropping, horizontal flipping, color jittering, gray scaling, and Gaussian blurring for ImageNet, which has shown to be effective (Chen et al., 2020a;b). We use ResNet-50 (He et al., 2016) as a backbone network. Models are trained with a batch size of 256 (i.e., 512 including augmented data) for up to 4000 epochs on CIFAR-10 and 100, and with a batch size of 512 for 800 epochs on ImageNet. For ImageNet experiments, we use the CutMix (Yun et al., 2019) version of $i$ -Mix.
|
| 155 |
+
|
| 156 |
+
Table 1: Comparison of contrastive representation learning methods and $i$ -Mix in different domains.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Domain</td><td>Dataset</td><td>N-pair</td><td>+ i-Mix</td><td>MoCo v2</td><td>+i-Mix</td><td>BYOL</td><td>+ i-Mix</td></tr><tr><td rowspan="2">Image</td><td>CIFAR-10</td><td>93.3 ± 0.1</td><td>95.6 ± 0.2</td><td>93.5 ± 0.2</td><td>96.1 ± 0.1</td><td>94.2 ± 0.2</td><td>96.3 ± 0.2</td></tr><tr><td>CIFAR-100</td><td>70.8 ± 0.4</td><td>75.8 ± 0.3</td><td>71.6 ± 0.1</td><td>78.1 ± 0.3</td><td>72.7 ± 0.4</td><td>78.6 ± 0.2</td></tr><tr><td>Speech</td><td>Commands</td><td>94.9 ± 0.1</td><td>98.3 ± 0.1</td><td>96.3 ± 0.1</td><td>98.4 ± 0.0</td><td>94.8 ± 0.2</td><td>98.3 ± 0.0</td></tr><tr><td>Tabular</td><td>CovType</td><td>68.5 ± 0.3</td><td>72.1 ± 0.2</td><td>70.5 ± 0.2</td><td>73.1 ± 0.1</td><td>72.1 ± 0.2</td><td>74.1 ± 0.2</td></tr></table>
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 1: Comparison of performance gains by applying $i$ -Mix to MoCo v2 with different model sizes and number of epochs on CIFAR-10 and 100.
|
| 162 |
+
|
| 163 |
+
The Speech Commands dataset (Warden, 2018) contains 51k training, 7k validation, and $\mathrm { 7 k }$ test data in 12 classes. We apply a set of data augmentations randomly in sequence: changing amplitude, speed, and pitch in time domain, stretching, time shifting, and adding background noise in frequency domain. Augmented data are then transformed to a $3 2 \times 3 2$ mel spectogram. We use the same architecture with image experiments. Models are trained with a batch size of 256 for 500 epochs.
|
| 164 |
+
|
| 165 |
+
For tabular dataset experiments, we consider Forest Cover Type (CovType) and Higgs Boson (Higgs) from UCI repository (Asuncion & Newman, 2007). CovType contains 15k training and 566k test data in 7 classes, and Higgs contains $1 0 . 5 \mathbf { M }$ training and $0 . 5 \mathbf { M }$ test data for binary classification. For Higgs, we use a subset of $1 0 0 \mathrm { k }$ and 1M training data to experiment at a different scale. Since the domain knowledge for data augmentations on tabular data is limited, only a masking noise with the probability 0.2 is considered as a data augmentation. We use a 5-layer MLP with batch normalization (Ioffe & Szegedy, 2015) as a backbone network. Models are trained with a batch size of 512 for 500 epochs. We use $\alpha = 2$ for CovType and Higgs100k, as it is slightly better than $\alpha = 1$ .
|
| 166 |
+
|
| 167 |
+
# 4.2 MAIN RESULTS
|
| 168 |
+
|
| 169 |
+
Table 1 shows the wide applicability of $i$ -Mix to state-of-the-art contrastive representation learning methods in multiple domains. $i$ -Mix results in consistent improvements on the classification accuracy, e.g., up to $6 . 5 \%$ when $i$ -Mix is applied to MoCo v2 on CIFAR-100. Interestingly, we observe that linear classifiers on top of representations learned with $i$ -Mix without fine-tuning the pre-trained part often yield a classification accuracy on par with simple end-to-end supervised learning from random initialization, e.g., $i$ -Mix vs. end-to-end supervised learning performance is $9 6 . 3 \%$ vs. $9 5 . 5 \%$ on CIFAR-10, $7 8 . 6 \%$ vs. $7 8 . 9 \%$ on CIFAR-100, and $9 8 . 2 \%$ vs. $9 8 . 0 \%$ on Speech Commands.
|
| 170 |
+
|
| 171 |
+
# 4.3 REGULARIZATION EFFECT OF $i$ -MIX
|
| 172 |
+
|
| 173 |
+
A better regularization method often benefits from longer training of deeper models, which is more critical when training on a small dataset. To investigate the regularization effect of $i$ -Mix, we first \*InputMix is applied when no other data augmentations are used.
|
| 174 |
+
|
| 175 |
+
Table 2: Comparison of MoCo v2 and $i$ -Mix on large-scale datasets.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Domain</td><td>Dataset</td><td>MoCo v2</td><td>+i-Mix</td></tr><tr><td>Image</td><td>ImageNet-100 ImageNet-1k</td><td>84.1 70.9</td><td>87.0 71.3</td></tr><tr><td>Domain</td><td>Dataset</td><td>MoCo v2</td><td></td></tr><tr><td></td><td>Higgs100k</td><td></td><td>+ i-Mix</td></tr><tr><td>Tabular</td><td>Higgs1M</td><td>72.1 74.9</td><td>72.9 74.5</td></tr></table>
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 2: Comparison of MoCo v2 and $i$ -Mix trained on the different size of ImageNet.
|
| 181 |
+
|
| 182 |
+
Table 3: Comparison of MoCo v2 and $i$ -Mix with and without data augmentations.
|
| 183 |
+
|
| 184 |
+
<table><tr><td rowspan="2">Aug</td><td colspan="2">CIFAR-10</td><td colspan="2">CIFAR-100</td><td colspan="2">Speech Commands</td><td colspan="2">CovType</td><td colspan="2">Higgs100k</td><td colspan="2">Higgs1M</td></tr><tr><td>MoCo v2</td><td>+i-Mix*</td><td>MoCo v2</td><td>+i-Mix*</td><td>MoCo v2</td><td>+i-Mix</td><td>MoCo v2</td><td>+ i-Mix</td><td>MoCo v2</td><td>+i-Mix</td><td>MoCo v2</td><td>+i-Mix</td></tr><tr><td>=</td><td>47.7 ± 1.3</td><td>83.4 ±0.4</td><td>24.7 ±0.7</td><td>54.0 ± 0.5</td><td>76.9 ± 1.7</td><td>92.8 ± 0.5</td><td>69.6 ±0.3</td><td>73.1 ± 0.1</td><td>64.2</td><td>71.8</td><td>65.5</td><td>72.9</td></tr><tr><td>√</td><td>93.5 ± 0.2</td><td>96.1 ± 0.1</td><td>71.6 ± 0.1</td><td>78.1 ±0.3</td><td>96.3 ± 0.1</td><td>98.4 ± 0.0</td><td>70.5 ± 0.2</td><td>73.1 ± 0.1</td><td>72.1</td><td>72.9</td><td>74.9</td><td>74.5</td></tr></table>
|
| 185 |
+
|
| 186 |
+
make a comparison between MoCo v2 and $i$ -Mix by training with different model sizes and number of training epochs on the pretext task. We train ResNet-18, 50, 101, and 152 models with varying number of training epochs from 200 to 2000. Figure 1 shows the performance of MoCo v2 (solid box) and $i$ -Mix (dashed box). The improvement by applying $i$ -Mix to MoCo v2 is consistent over the different architecture size and the number of training epochs. Deeper models benefit from $i$ -Mix, achieving $9 6 . 7 \%$ on CIFAR-10 and $7 9 . 1 \%$ on CIFAR-100 when the backbone network is ResNet-152. On the other hand, models trained without $i$ -Mix start to show decrease in performance, possibly due to overfitting to the pretext task when trained longer. The trend clearly shows that $i$ -Mix results in better representations via improved regularization.
|
| 187 |
+
|
| 188 |
+
Next, we study the effect of $i$ -Mix with varying dataset sizes for the pretext tasks. Table 2 shows the effect of $i$ -Mix on large-scale datasets10 from image and tabular domains. We observe that $i$ -Mix is particularly effective when the amount of training data is reduced, e.g., ImageNet-100 consists of images from 100 classes, thus has only $10 \%$ of training data compared to ImageNet-1k. However, the performance gain is reduced when the amount of training data is large. we further study representations learned with different pretext dataset sizes from $1 \%$ to $100 \%$ of the ImageNet training data in Figure 2. Here, different from ImageNet-100, we reduce the amount of data for each class, but maintain the number of classes the same. We observe that the performance gain by $i$ -Mix is more significant when the size of the pretext dataset is small. Our study suggests that $i$ -Mix is effective for regularizing self-supervised representation learning when training from a limited amount of data. We believe that this is aligned with findings in Zhang et al. (2018) for MixUp in supervised learning. Finally, when a large-scale unlabeled dataset is available, we expect $i$ -Mix would still be useful in obtaining better representations when trained longer with deeper and larger models.
|
| 189 |
+
|
| 190 |
+
# 4.4 CONTRASTIVE LEARNING WITHOUT DOMAIN-SPECIFIC DATA AUGMENTATION
|
| 191 |
+
|
| 192 |
+
Data augmentations play a key role in contrastive representation learning, and therefore it raises a question when applying them to domains with a limited or no knowledge of such augmentations. In this section, we study the effectiveness of $i$ -Mix as a domain-agnostic strategy for contrastive representation learning, which can be adapted to different domains. Table 3 shows the performance of MoCo v2 and $i$ -Mix with and without data augmentations. We observe significant performance gains with $i$ -Mix when other data augmentations are not applied. For example, compared to the accuracy of $9 3 . 5 \%$ on CIFAR-10 when other data augmentations are applied, contrastive learning achieves $4 7 . 7 \%$ when trained without any data augmentations. This suggests that data augmentation is an essential part for the success of contrastive representation learning (Chen et al., 2020a). However, $i$ -Mix is able to learn meaningful representations without other data augmentations and achieves the accuracy of $8 3 . 4 \%$ on CIFAR-10.
|
| 193 |
+
|
| 194 |
+
<table><tr><td rowspan="2">VOC Object Detection</td><td colspan="2">ImageNet</td></tr><tr><td>MoCo v2</td><td>+ i-Mix</td></tr><tr><td>AP</td><td>57.3 ± 0.1</td><td>57.5± 0.4</td></tr><tr><td>AP50</td><td>82.5 ± 0.2</td><td>82.7 ± 0.2</td></tr><tr><td>AP75</td><td>63.8 ±0.3</td><td>64.2 ± 0.7</td></tr></table>
|
| 195 |
+
|
| 196 |
+
(b) ImageNet as the pretext dataset
|
| 197 |
+
|
| 198 |
+
Table 4: Comparison of MoCo v2 and $i$ -Mix in transfer learning.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>Pretext</td><td colspan="2">CIFAR-10</td><td colspan="2">CIFAR-100</td></tr><tr><td>Downstream</td><td>MoCo v2</td><td>+i-Mix</td><td>MoCo v2</td><td>+i-Mix</td></tr><tr><td>CIFAR-10</td><td>93.5 ± 0.2</td><td>96.1 ± 0.1</td><td>85.9 ±0.3</td><td>90.0 ± 0.4</td></tr><tr><td>CIFAR-100</td><td>64.1 ± 0.4</td><td>70.8 ± 0.4</td><td>71.6 ± 0.1</td><td>78.1 ± 0.3</td></tr></table>
|
| 201 |
+
|
| 202 |
+
(a) CIFAR-10 and 100 as the pretext dataset
|
| 203 |
+
|
| 204 |
+
In Table 3, InputMix is applied together with $i$ -Mix to further improve the performance on image datasets. For each principal data, we mix two auxiliary data, with mixing coefficients $( 0 . 5 \lambda _ { 1 } + 0 . 5$ , $0 . 5 \lambda _ { 2 }$ , $0 . 5 \lambda _ { 3 }$ ), where $\lambda _ { 1 } , \lambda _ { 2 } , \lambda _ { 3 } \sim \mathrm { D i r i c h l e t } ( 1 , 1 , 1 )$ .11 In the above example, while $i$ -Mix is better than baselines, adding InputMix further improves the performance of $i$ -Mix, i.e., from $7 5 . 1 \%$ to $8 3 . 4 \%$ on CIFAR-10, and from $5 0 . 7 \%$ to $5 4 . 0 \%$ on CIFAR-100. This confirms that InputMix can further improve the performance when domain-specific data augmentations are not available, as discussed in Section 3.3.
|
| 205 |
+
|
| 206 |
+
Moreover, we verify its effectiveness on other domains beyond the image domain. For example, the performance improves from $7 6 . 9 \%$ to $9 2 . 8 \%$ on the Speech Commands dataset when we assume no other data augmentations are available. We also observe consistent improvements in accuracy for tabular datasets, even when the training dataset size is large. Although the domain knowledge for data augmentations is important to achieve state-of-the-art results, our demonstration shows the potential of $i$ -Mix to be used for a wide range of application domains where domain knowledge is particularly limited.
|
| 207 |
+
|
| 208 |
+
# 4.5 TRANSFERABILITY OF $i$ -MIX
|
| 209 |
+
|
| 210 |
+
In this section, we show the improved transferability of the representations learned with $i$ -Mix. The results are provided in Table 4. First, we train linear classifiers with downstream datasets different from the pretext dataset used to train backbone networks and evaluate their performance, e.g., CIFAR-10 as pretext and CIFAR-100 as downstream datasets or vice versa. We observe consistent performance gains when learned representations from one dataset are evaluated on classification tasks of another dataset. Next, we transfer representations trained on ImageNet to the PASCAL VOC object detection task (Everingham et al., 2010). We follow the settings in prior works (He et al., 2020; Chen et al., 2020b): the parameters of the pre-trained ResNet-50 are transferred to a Faster R-CNN detector with the ResNet50-C4 backbone (Ren et al., 2015), and fine-tuned end-to-end on the VOC $_ { 0 7 + 1 2 }$ trainval dataset and evaluated on the VOC 07 test dataset. We report the average precision (AP) averaged over IoU thresholds between $50 \%$ to $9 5 \%$ at a step of $5 \%$ , and $\mathrm { { A P } _ { 5 0 } }$ and $\mathsf { A P } _ { 7 5 }$ , which are AP values when IoU threshold is $50 \%$ and $7 5 \%$ , respectively. Similar to Table 2, we observe small but consistent performance gains in all metrics. Those results confirm that $i$ -Mix improves the quality of learned representations, such that performances on downstream tasks are improved.
|
| 211 |
+
|
| 212 |
+
# 5 CONCLUSION
|
| 213 |
+
|
| 214 |
+
We propose $i$ -Mix, a domain-agnostic regularization strategy applicable to a class of self-supervised learning. The key idea of $i$ -Mix is to introduce a virtual label to each data instance, and mix both inputs and the corresponding virtual labels. We show that $i$ -Mix is applicable to state-of-the-art self-supervised representation learning methods including SimCLR, MoCo, and BYOL, which consistently improves the performance in a variety of settings and domains. Our experimental results indicate that $i$ -Mix is particularly effective when the training dataset size is small or data augmentation is not available, each of which are prevalent in practice.
|
| 215 |
+
|
| 216 |
+
# REFERENCES
|
| 217 |
+
|
| 218 |
+
Dario Amodei, Sundaram Ananthanarayanan, Rishita Anubhai, Jingliang Bai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, Qiang Cheng, Guoliang Chen, et al. Deep speech 2: End-to-end speech recognition in english and mandarin. In ICML, 2016.
|
| 219 |
+
|
| 220 |
+
Sanjeev Arora, Hrishikesh Khandeparkar, Mikhail Khodak, Orestis Plevrakis, and Nikunj Saunshi. A theoretical analysis of contrastive unsupervised representation learning. In ICML, 2019.
|
| 221 |
+
|
| 222 |
+
Yuki Markus Asano, Christian Rupprecht, and Andrea Vedaldi. Self-labelling via simultaneous clustering and representation learning. In ICLR, 2020.
|
| 223 |
+
|
| 224 |
+
Arthur Asuncion and David Newman. Uci machine learning repository, 2007.
|
| 225 |
+
|
| 226 |
+
Philip Bachman, R Devon Hjelm, and William Buchwalter. Learning representations by maximizing mutual information across views. In NeurIPS, 2019.
|
| 227 |
+
|
| 228 |
+
Christopher Beckham, Sina Honari, Vikas Verma, Alex M Lamb, Farnoosh Ghadiri, R Devon Hjelm, Yoshua Bengio, and Chris Pal. On adversarial mixup resynthesis. In NeurIPS, 2019.
|
| 229 |
+
|
| 230 |
+
Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In NIPS, 2007.
|
| 231 |
+
|
| 232 |
+
Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. PAMI, 35(8):1798–1828, 2013.
|
| 233 |
+
|
| 234 |
+
Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In ECCV, 2018.
|
| 235 |
+
|
| 236 |
+
Mathilde Caron, Piotr Bojanowski, Julien Mairal, and Armand Joulin. Unsupervised pre-training of image features on non-curated data. In ICCV, 2019.
|
| 237 |
+
|
| 238 |
+
Olivier Chapelle, Jason Weston, Leon Bottou, and Vladimir Vapnik. Vicinal risk minimization. In ´ NIPS, 2001.
|
| 239 |
+
|
| 240 |
+
Ting Chen, Xiaohua Zhai, Marvin Ritter, Mario Lucic, and Neil Houlsby. Self-supervised gans via auxiliary rotation loss. In CVPR, 2019.
|
| 241 |
+
|
| 242 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020a.
|
| 243 |
+
|
| 244 |
+
Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020b.
|
| 245 |
+
|
| 246 |
+
Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. In CVPR, 2019a.
|
| 247 |
+
|
| 248 |
+
Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical data augmentation with no separate search. arXiv preprint arXiv:1909.13719, 2019b.
|
| 249 |
+
|
| 250 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 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 |
+
Terrance DeVries and Graham W Taylor. Dataset augmentation in feature space. arXiv preprint arXiv:1702.05538, 2017a.
|
| 255 |
+
|
| 256 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017b.
|
| 257 |
+
|
| 258 |
+
Carl Doersch and Andrew Zisserman. Multi-task self-supervised visual learning. In ICCV, 2017.
|
| 259 |
+
|
| 260 |
+
Carl Doersch, Abhinav Gupta, and Alexei A Efros. Unsupervised visual representation learning by context prediction. In ICCV, 2015.
|
| 261 |
+
|
| 262 |
+
Alexey Dosovitskiy, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with convolutional neural networks. In NeurIPS, 2014.
|
| 263 |
+
|
| 264 |
+
Alexey Dosovitskiy, Philipp Fischer, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with exemplar convolutional neural networks. PAMI, 38(9):1734–1747, 2015.
|
| 265 |
+
|
| 266 |
+
Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. IJCV, 88(2):303–338, 2010.
|
| 267 |
+
|
| 268 |
+
Maurice Frechet. Sur la distance de deux lois de probabilit ´ e.´ COMPTES RENDUS HEBDOMADAIRES DES SEANCES DE L ACADEMIE DES SCIENCES, 244(6):689–692, 1957.
|
| 269 |
+
|
| 270 |
+
Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In ICLR, 2018.
|
| 271 |
+
|
| 272 |
+
Ian J Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. In ICML, 2013.
|
| 273 |
+
|
| 274 |
+
Priya Goyal, Piotr Dollar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, ´ Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 275 |
+
|
| 276 |
+
Jean-Bastien Grill, Florian Strub, Florent Altche, Corentin Tallec, Pierre H Richemond, Elena ´ Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020.
|
| 277 |
+
|
| 278 |
+
Hongyu Guo. Nonlinear mixup: Out-of-manifold data augmentation for text classification. In AAAI, 2020.
|
| 279 |
+
|
| 280 |
+
Hongyu Guo, Yongyi Mao, and Richong Zhang. Augmenting data with mixup for sentence classification: An empirical study. arXiv preprint arXiv:1905.08941, 2019.
|
| 281 |
+
|
| 282 |
+
Michael Gutmann and Aapo Hyvarinen. Noise-contrastive estimation: A new estimation principle ¨ for unnormalized statistical models. In AISTATS, 2010.
|
| 283 |
+
|
| 284 |
+
Ethan Harris, Antonia Marcu, Matthew Painter, Mahesan Niranjan, and Adam Prugel- ¨ Bennett Jonathon Hare. Fmix: Enhancing mixed sample data augmentation. arXiv preprint arXiv:2002.12047, 2020.
|
| 285 |
+
|
| 286 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 287 |
+
|
| 288 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
|
| 289 |
+
|
| 290 |
+
Olivier J Henaff, Ali Razavi, Carl Doersch, SM Eslami, and Aaron van den Oord. Data-efficient ´ image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019.
|
| 291 |
+
|
| 292 |
+
Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. In NeurIPS, 2019.
|
| 293 |
+
|
| 294 |
+
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 ICLR, 2020.
|
| 295 |
+
|
| 296 |
+
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 NeurIPS, 2017.
|
| 297 |
+
|
| 298 |
+
R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In ICLR, 2019.
|
| 299 |
+
|
| 300 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
|
| 301 |
+
|
| 302 |
+
Yannis Kalantidis, Mert Bulent Sariyildiz, Noe Pion, Philippe Weinzaepfel, and Diane Larlus. Hard negative mixing for contrastive learning. In NeurIPS, 2020.
|
| 303 |
+
|
| 304 |
+
Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. arXiv preprint arXiv:2004.11362, 2020.
|
| 305 |
+
|
| 306 |
+
Dahun Kim, Donghyeon Cho, Donggeun Yoo, and In So Kweon. Learning image representations by completing damaged jigsaw puzzles. In WACV, 2018.
|
| 307 |
+
|
| 308 |
+
Sungnyun Kim, Gihun Lee, Sangmin Bae, and Se-Young Yun. Mixco: Mix-up contrastive learning for visual representation. arXiv preprint arXiv:2010.06300, 2020.
|
| 309 |
+
|
| 310 |
+
Bruno Korbar, Du Tran, and Lorenzo Torresani. Cooperative learning of audio and video models from self-supervised synchronization. In NeurIPS, 2018.
|
| 311 |
+
|
| 312 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
|
| 313 |
+
|
| 314 |
+
Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. In ICLR, 2018.
|
| 315 |
+
|
| 316 |
+
Michelle A Lee, Yuke Zhu, Krishnan Srinivasan, Parth Shah, Silvio Savarese, Li Fei-Fei, Animesh Garg, and Jeannette Bohg. Making sense of vision and touch: Self-supervised learning of multimodal representations for contact-rich tasks. In ICRA, 2019.
|
| 317 |
+
|
| 318 |
+
Yibo Lin, Yuki Watanabe, Taiki Kimura, Tetsuaki Matsunawa, Shigeki Nojima, Meng Li, and David Z Pan. Data efficient lithography modeling with residual neural networks and transfer learning. In Proceedings of the 2018 International Symposium on Physical Design, pp. 82–89, 2018.
|
| 319 |
+
|
| 320 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. In ICLR, 2017.
|
| 321 |
+
|
| 322 |
+
Thomas Lucas, Corentin Tallec, Jakob Verbeek, and Yann Ollivier. Mixed batches and symmetric discriminators for gan training. In ICML, 2018.
|
| 323 |
+
|
| 324 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NeurIPS, 2013.
|
| 325 |
+
|
| 326 |
+
Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In CVPR, 2020.
|
| 327 |
+
|
| 328 |
+
Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. PAMI, 41(8):1979–1993, 2018.
|
| 329 |
+
|
| 330 |
+
Yair Movshovitz-Attias, Alexander Toshev, Thomas K Leung, Sergey Ioffe, and Saurabh Singh. No fuss distance metric learning using proxies. In ICCV, 2017.
|
| 331 |
+
|
| 332 |
+
Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In ECCV, 2016.
|
| 333 |
+
|
| 334 |
+
Mehdi Noroozi, Hamed Pirsiavash, and Paolo Favaro. Representation learning by learning to count. In ICCV, 2017.
|
| 335 |
+
|
| 336 |
+
Mehdi Noroozi, Ananth Vinjimoor, Paolo Favaro, and Hamed Pirsiavash. Boosting self-supervised learning via knowledge transfer. In CVPR, 2018.
|
| 337 |
+
|
| 338 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 339 |
+
|
| 340 |
+
Andrew Owens and Alexei A Efros. Audio-visual scene analysis with self-supervised multisensory features. In ECCV, 2018.
|
| 341 |
+
|
| 342 |
+
Tianyu Pang, Kun Xu, and Jun Zhu. Mixup inference: Better exploiting mixup to defend adversarial attacks. arXiv preprint arXiv:1909.11515, 2019.
|
| 343 |
+
|
| 344 |
+
Daniel S Park, William Chan, Yu Zhang, Chung-Cheng Chiu, Barret Zoph, Ekin D Cubuk, and Quoc V Le. Specaugment: A simple data augmentation method for automatic speech recognition. arXiv preprint arXiv:1904.08779, 2019.
|
| 345 |
+
|
| 346 |
+
Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, and Alexei A Efros. Context encoders: Feature learning by inpainting. In CVPR, 2016.
|
| 347 |
+
|
| 348 |
+
Mirco Ravanelli, Jianyuan Zhong, Santiago Pascual, Pawel Swietojanski, Joao Monteiro, Jan Trmal, and Yoshua Bengio. Multi-task self-supervised learning for robust speech recognition. In ICASSP, 2020.
|
| 349 |
+
|
| 350 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015.
|
| 351 |
+
|
| 352 |
+
Pierre Sermanet, Corey Lynch, Yevgen Chebotar, Jasmine Hsu, Eric Jang, Stefan Schaal, Sergey Levine, and Google Brain. Time-contrastive networks: Self-supervised learning from video. In ICRA, 2018.
|
| 353 |
+
|
| 354 |
+
Zhiqiang Shen, Zechun Liu, Zhuang Liu, Marios Savvides, and Trevor Darrell. Rethinking image mixture for unsupervised visual representation learning. arXiv preprint arXiv:2003.05438, 2020.
|
| 355 |
+
|
| 356 |
+
Woojoo Sim, Kibok Lee, Dingdong Yang, Jaeseung Jeong, Ji-Suk Hong, Sooryong Lee, and Honglak Lee. Automatic correction of lithography hotspots with a deep generative model. In Optical Microlithography XXXII, volume 10961, pp. 1096105. International Society for Optics and Photonics, 2019.
|
| 357 |
+
|
| 358 |
+
Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. In NeurIPS, 2016.
|
| 359 |
+
|
| 360 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, 2015.
|
| 361 |
+
|
| 362 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
|
| 363 |
+
|
| 364 |
+
Sunil Thulasidasan, Gopinath Chennupati, Jeff A Bilmes, Tanmoy Bhattacharya, and Sarah Michalak. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. In NeurIPS, 2019.
|
| 365 |
+
|
| 366 |
+
Yonglong Tian, Dilip Krishnan, and Phillip Isola. Contrastive multiview coding. In ECCV, 2020a.
|
| 367 |
+
|
| 368 |
+
Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. arXiv preprint arXiv:2005.10243, 2020b.
|
| 369 |
+
|
| 370 |
+
Leonid Nisonovich Vaserstein. Markov processes over denumerable products of spaces, describing large systems of automata. Problemy Peredachi Informatsii, 5(3):64–72, 1969.
|
| 371 |
+
|
| 372 |
+
Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, Aaron Courville, David Lopez-Paz, and Yoshua Bengio. Manifold mixup: Better representations by interpolating hidden states. In ICML, 2019.
|
| 373 |
+
|
| 374 |
+
Vikas Verma, Minh-Thang Luong, Kenji Kawaguchi, Hieu Pham, and Quoc V Le. Towards domainagnostic contrastive learning. arXiv preprint arXiv:2011.04419, 2020.
|
| 375 |
+
|
| 376 |
+
Pete Warden. Speech commands: A dataset for limited-vocabulary speech recognition. arXiv preprint arXiv:1804.03209, 2018.
|
| 377 |
+
|
| 378 |
+
Jason W Wei and Kai Zou. Eda: Easy data augmentation techniques for boosting performance on text classification tasks. arXiv preprint arXiv:1901.11196, 2019.
|
| 379 |
+
|
| 380 |
+
Yue Wu, Yinpeng Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, Zhengyou Zhang, and Yun Fu. Incremental classifier learning with generative adversarial networks. arXiv preprint arXiv:1802.00853, 2018a.
|
| 381 |
+
|
| 382 |
+
Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, 2018b.
|
| 383 |
+
|
| 384 |
+
Mang Ye, Xu Zhang, Pong C Yuen, and Shih-Fu Chang. Unsupervised embedding learning via invariant and spreading instance feature. In CVPR, 2019.
|
| 385 |
+
|
| 386 |
+
Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In ICCV, 2019.
|
| 387 |
+
|
| 388 |
+
Xiaohua Zhai, Avital Oliver, Alexander Kolesnikov, and Lucas Beyer. S4l: Self-supervised semisupervised learning. In ICCV, 2019.
|
| 389 |
+
|
| 390 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018.
|
| 391 |
+
|
| 392 |
+
Richard Zhang, Phillip Isola, and Alexei A Efros. Colorful image colorization. In ECCV, 2016.
|
| 393 |
+
|
| 394 |
+
Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In NeurIPS, 2015.
|
| 395 |
+
|
| 396 |
+
Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In AAAI, 2020.
|
| 397 |
+
|
| 398 |
+
Hong-Yu Zhou, Shuang Yu, Cheng Bian, Yifan Hu, Kai Ma, and Yefeng Zheng. Comparing to learn: Surpassing imagenet pretraining on radiographs by comparing image representations. In MICCAI, 2020.
|
| 399 |
+
|
| 400 |
+
# A MORE APPLICATIONS OF $i$ -MIX
|
| 401 |
+
|
| 402 |
+
In this section, we introduce more variations of $i$ -Mix. For conciseness, we use $v _ { i }$ to denote virtual labels for different methods. We make the definition of $v _ { i }$ for each application clear.
|
| 403 |
+
|
| 404 |
+
# A.1 $i$ -MIX FOR SIMCLR
|
| 405 |
+
|
| 406 |
+
For each anchor, SimCLR takes other anchors as negative samples such that the virtual labels must be extended. Let $x _ { N + i } = \tilde { x } _ { i }$ for conciseness, and $\bar { v _ { i } } \in \{ 0 , 1 \} ^ { 2 \bar { N } }$ be the virtual label indicating the positive sample of each anchor, where $v _ { i , N + i } = 1$ and $v _ { i , j \neq N + i } = 0$ . Note that $v _ { i , i } = 0$ because the anchor itself is not counted as a positive sample. Then, Eq. (4) can be represented in the form of the cross-entropy loss:
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\ell _ { \mathrm { S i m C L R } } ( x _ { i } , v _ { i } ; \mathcal { B } ) = - \sum _ { n = 1 } ^ { 2 N } v _ { i , n } \log \frac { \exp { \left( s ( f _ { i } , f _ { n } ) / \tau \right) } } { \sum _ { k = 1 , k \neq i } ^ { 2 N } \exp { \left( s ( f _ { i } , f _ { k } ) / \tau \right) } } .
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
The application of $i$ -Mix to SimCLR is straightforward: for two data instances $( x _ { i } , v _ { i } )$ , $( x _ { j } , v _ { j } )$ and a batch of data $\boldsymbol { B } = \{ x _ { i } \} _ { i = 1 } ^ { 2 N }$ , the $i$ -Mix loss is defined as follows:12
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\ell _ { \mathrm { S i m C L R } } ^ { i \mathrm { - M i x } } \big ( ( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } ) ; \mathcal { B } , \lambda \big ) = \ell _ { \mathrm { S i m C L R } } \big ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ; \mathcal { B } \big ) .
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
Note that only the input data of Eq. (A.2) is mixed, such that $f _ { i }$ in Eq. (A.1) is an embedding vector of the mixed data while the other $f _ { n }$ ’s are the ones of clean data. Because both clean and mixed data need to be fed to the network $f$ , $i$ -Mix for SimCLR requires twice more memory and training time compared to SimCLR when the same batch size is used.
|
| 419 |
+
|
| 420 |
+
# A.2 $i$ -MIX FOR SUPERVISED CONTRASTIVE LEARNING
|
| 421 |
+
|
| 422 |
+
Supervised contrastive learning has recently shown to be effective for supervised representation learning and it often outperforms the standard end-to-end supervised classifier learning (Khosla et al., 2020). Suppose an one-hot label $y _ { i } \in \{ 0 , 1 \} ^ { C }$ is assigned to a data $x _ { i }$ , where $C$ is the number of classes. Let $ { \boldsymbol { B } } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { 2 N }$ $x _ { N + i } = \tilde { x } _ { i }$ , let $v _ { i } \in \{ 0 , 1 \} ^ { 2 N }$ and $y _ { N + i } = y _ { i }$ be the virtual label indicating the positive samples of each anchor, for conciseness. For a batch of data pairs and their labels where $v _ { i , j } = 1$ if $y _ { i } = y _ { j \neq i }$ , and otherwise $v _ { i , j } = 0$ . Intuitively, $\begin{array} { r } { \sum _ { j = 1 } ^ { 2 N } v _ { i , j } = 2 N _ { y _ { i } } - 1 } \end{array}$ where $N _ { y _ { i } }$ is the number of data with the label $y _ { i }$ . Then, the supervised learning version of the SimCLR (SupCLR) loss function is written as follows:
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\ell _ { \mathrm { S u p C L R } } ( x _ { i } , v _ { i } ; \mathcal { B } ) = - \frac { 1 } { 2 N _ { y _ { i } } - 1 } \sum _ { n = 1 } ^ { 2 N } v _ { i , n } \log \frac { \exp { \left( s ( f _ { i } , f _ { n } ) / \tau \right) } } { \sum _ { k = 1 , k \neq i } ^ { 2 N } \exp { \left( s ( f _ { i } , f _ { k } ) / \tau \right) } } .
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
The application of $i$ -Mix to SupCLR is straightforward: for two data instances $( x _ { i } , v _ { i } )$ , $( x _ { j } , v _ { j } )$ and a batch of data $\boldsymbol { B } = \{ x _ { i } \} _ { i = 1 } ^ { 2 N }$ , the $i$ -Mix loss is defined as follows:
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\ell _ { \mathrm { S u p C L R } } ^ { i \mathrm { - } \mathrm { M i x } } \big ( ( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } ) ; \mathcal { B } , \lambda \big ) = \ell _ { \mathrm { S u p C L R } } \big ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ; \mathcal { B } \big ) .
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
# A.3 $i$ -MIX FOR N-PAIR SUPERVISED CONTRASTIVE LEARNING
|
| 435 |
+
|
| 436 |
+
Note that $i$ -Mix in Eq. (A.4) is not as efficient as SupCLR in Eq. (A.3) due to the same reason in the case of SimCLR. To overcome this, we reformulate SupCLR in the form of the N-pair loss (Sohn, 2016). Suppose an one-hot label $y _ { i } \in \{ 0 , 1 \} ^ { C }$ is assigned to a data $x _ { i }$ , where $C$ is the number of classes. For a batch of data pairs and their labels $\boldsymbol { B } = \{ ( x _ { i } , \tilde { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ , let $v _ { i } \in \{ 0 , 1 \} ^ { N }$ be the virtual label indicating the positive samples of each anchor, where $v _ { i , j } = 1$ if $y _ { i } = y _ { j \neq i }$ , and otherwise $v _ { i , j } = 0$ . Then, the supervised version of the $\mathbf { N } .$ -pair (Sup-N-pair) contrastive loss function is written as follows:
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
\ell _ { \mathrm { S u p - N - p a i r } } ( x _ { i } , v _ { i } ; \mathcal { B } ) = - \frac { 1 } { N _ { y _ { i } } } \sum _ { n = 1 } ^ { N } v _ { i , n } \log \frac { \exp { \left( s ( f _ { i } , \tilde { f } _ { n } ) / \tau \right) } } { \sum _ { k = 1 } ^ { N } \exp { \left( s ( f _ { i } , \tilde { f } _ { k } ) / \tau \right) } } .
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
Then, the $i$ -Mix loss for Sup-N-pair is defined as follows:
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
\ell _ { \mathrm { S u p - N - p a i r } } ^ { i \mathrm { - M i x } } \big ( ( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } ) ; \mathcal { B } , \lambda \big ) = \ell _ { \mathrm { S u p - N - p a i r } } \big ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ; \mathcal { B } \big ) .
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
12The $j$ -th data can be excluded from the negative samples, but it does not result in a significant difference.
|
| 449 |
+
|
| 450 |
+
# B PROOF OF THE LINEARITY OF LOSSES WITH RESPECT TO VIRTUAL LABELS
|
| 451 |
+
|
| 452 |
+
Cross-entropy loss. The loss used in contrastive representation learning works, which is often referred to as InfoNCE (Oord et al., 2018), can be represented in the form of the cross-entropy loss as we showed for N-pair contrastive learning, SimCLR (Chen et al., 2020a), and MoCo (He et al., 2020). Here we provide an example in the case of N-pair contrastive learning. Let $f _ { i j } ^ { \lambda } = f ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } )$ for conciseness.
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\begin{array} { l } { \ell _ { \mathrm { N - p a r } } ^ { \mathrm { - d M x } } \big ( ( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } ) ; \mathcal { B } , \lambda \big ) = \ell _ { \mathrm { N - p a r } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ; \mathcal { B } ) } \\ { = - { \displaystyle \sum _ { n = 1 } ^ { N } } ( \lambda v _ { i , n } + ( 1 - \lambda ) v _ { j , n } ) \log { \frac { \exp { \big ( s ( f _ { i j } ^ { \lambda } , \tilde { f _ { n } } ) / \tau \big ) } } { \sum _ { k = 1 } ^ { N } \exp { \big ( s ( f _ { i j } ^ { \lambda } , \tilde { f _ { k } } ) / \tau \big ) } } } } \\ { = - { \displaystyle \lambda \sum _ { n = 1 } ^ { N } } v _ { i , n } \log { \frac { \exp { \big ( s ( f _ { i j } ^ { \lambda } , \tilde { f _ { n } } ) / \tau \big ) } } { \sum _ { k = 1 } ^ { N } \exp { \big ( s ( f _ { i j } ^ { \lambda } , \tilde { f _ { k } } ) / \tau \big ) } } } - ( 1 - \lambda ) { \displaystyle \sum _ { n = 1 } ^ { N } } v _ { j , n } \log { \frac { \exp { \big ( s ( f _ { i j } ^ { \lambda } , \tilde { f _ { n } } ) / \tau \big ) } } { \sum _ { k = 1 } ^ { N } \exp { \big ( s ( f _ { i j } ^ { \lambda } , \tilde { f _ { k } } ) / \tau \big ) } } } } \\ { = { \lambda \ell _ { \mathrm { N - p a r } } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , v _ { i } ; \mathcal { B } ) + ( 1 - \lambda ) \ell _ { \mathrm { N - p a r } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , v _ { j } ; \mathcal { B } ) . } \end{array}
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
L2 loss between L2-normalized feature vectors. The BYOL (Grill et al., 2020) loss is in this type. Let $\tilde { F } = [ \tilde { f } _ { 1 } / \| \tilde { f } _ { 1 } \| , . . . , \tilde { f } _ { N } / \| \tilde { f } _ { N } \| ] \in \mathbb { R } ^ { D \times N }$ such that $\tilde { f } _ { i } / \| \tilde { f } _ { i } \| = \tilde { F } v _ { i }$ , and $\bar { g } = g ( f ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } ) ) / \| g ( f ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } ) ) \|$ for conciseness.
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\begin{array} { r l } & { \ell _ { \mathtt { B Y O L } } ^ { \mathrm { i - A l i x } } \big ( ( x _ { i } , v _ { i } ) , ( x _ { j } , v _ { j } ) ; \mathcal { B } , \lambda \big ) = \ell _ { \mathtt { B Y O L } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ) } \\ & { \ = \left\| \bar { g } - \tilde { F } ( \lambda v _ { i } + ( 1 - \lambda ) v _ { j } ) \right\| ^ { 2 } = \left\| \bar { g } - \Big ( \lambda \tilde { F } v _ { i } + ( 1 - \lambda ) \tilde { F } v _ { j } \Big ) \right\| ^ { 2 } } \\ & { = 1 - 2 \cdot \bar { g } ^ { \top } \left( \lambda \tilde { F } v _ { i } + ( 1 - \lambda ) \tilde { F } v _ { j } \right) + \left\| \lambda \tilde { F } v _ { i } + ( 1 - \lambda ) \tilde { F } v _ { j } \right\| ^ { 2 } } \\ & { = 2 - 2 \cdot \bar { g } ^ { \top } \left( \lambda \tilde { F } v _ { i } + ( 1 - \lambda ) \tilde { F } v _ { j } \right) + \mathrm { c o n s t } } \\ & { = \lambda \| \bar { g } - \tilde { F } v _ { i } \| ^ { 2 } + ( 1 - \lambda ) \| \bar { g } - \tilde { F } v _ { j } \| ^ { 2 } + \mathrm { c o n s t } } \\ & { = \lambda \ell _ { \mathtt { B Y O L } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , v _ { i } ; \mathcal { B } ) + ( 1 - \lambda ) \ell _ { \mathtt { B Y O L } } ( \lambda x _ { i } + ( 1 - \lambda ) x _ { j } , v _ { j } ; \mathcal { B } ) + \mathrm { c o n s t . } } \end{array}
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
Because $\tilde { F }$ is not backpropagated, it can be considered as a constant.
|
| 465 |
+
|
| 466 |
+
# C MORE ON EXPERIMENTS
|
| 467 |
+
|
| 468 |
+
We describe details of the experimental settings and more experimental results. For additional experiments below, we adapted the code for supervised contrastive learning (Khosla et al., 2020).13
|
| 469 |
+
|
| 470 |
+
# C.1 SETUP
|
| 471 |
+
|
| 472 |
+
In this section, we describe details of the experimental settings. Note that the learning rate is scaled by the batch size (Goyal et al., 2017): ScaledLearningRate $=$ LearningRate $\times$ BatchSize/256.
|
| 473 |
+
|
| 474 |
+
Image. The experiments on CIFAR-10 and 100 (Krizhevsky & Hinton, 2009) and ImageNet (Deng et al., 2009) are conducted in two stages: following Chen et al. (2020a), the convolutional neural network (CNN) part of ResNet-50 (He et al., 2016)14 followed by the two-layer multilayer perceptron (MLP) projection head (output dimensions are 2048 and 128, respectively) is trained on the unlabeled pretext dataset with a batch size of 256 (i.e., 512 augmented data) with the stochastic gradient descent (SGD) optimizer with a momentum of 0.9 over up to 4000 epochs. BYOL has an additional prediction head (output dimensions are the same with the projection head), which follows the projection head, only for the model updated by gradient. 10 epochs of warmup with a linear schedule to an initial learning rate of 0.125, followed by the cosine learning rate schedule (Loshchilov & Hutter, 2017) is used. We use the weight decay of 0.0001 for the first stage. For ImageNet, we use the same hyperparameters except that the batch size is 512 and the initial learning rate is 0.03.
|
| 475 |
+
|
| 476 |
+
Then, the head of the CNN is replaced with a linear classifier, and only the linear classifier is trained with the labeled downstream dataset. For the second stage, we use a batch size of 256 with the SGD optimizer with a momentum of 0.9 and an initial learning rate chosen among $\{ 1 , 3 , 5 , 1 0 , 3 0 , 5 0 , 7 0 \}$ over 100 epochs, where the learning rate is decayed by 0.2 after 80, 90, 95 epochs. No weight decay is used at the second stage. The quality of representation is evaluated by the top-1 accuracy on the downstream task. We sample a single mixing coefficient $\lambda \sim \mathrm { B e t a } ( 1 , 1 )$ for each training batch. The temperature is set to $\tau = 0 . 2$ . Note that the optimal distribution of $\lambda$ and the optimal value of $\tau$ varies over different architectures, methods, and datasets, but the choices above result in a reasonably good performance. The memory bank size of MoCo is 65536 for ImageNet and 4096 for other datasets, and the momentum for the exponential moving average (EMA) update is 0.999 for MoCo and BYOL. We do not symmetrize the BYOL loss, as it does not significantly improve the performance while increasing computational complexity.
|
| 477 |
+
|
| 478 |
+
For data augmentation, we follow Chen et al. (2020a): We apply a set of data augmentations randomly in sequence including resized cropping (Szegedy et al., 2015), horizontal flipping with a probability of 0.5, color jittering,15 and gray scaling with a probability of 0.2. A Gaussian blurring with $\sigma \in [ 0 . { \dot { 1 } } , 2 ]$ and kernel size of $10 \%$ of the image height/width is applied for ImageNet. For evaluation on downstream tasks, we apply padded cropping with the pad size of 4 and horizontal flipping for CIFAR-10 and 100, and resized cropping and horizontal flipping for ImageNet.
|
| 479 |
+
|
| 480 |
+
Speech. In the experiments on Speech Commands (Warden, 2018), the network is the same with the image domain experiments, except that the number of input channels is one instead of three. The temperature is set to $\tau = 0 . 5$ for the standard setting and $\tau = 0 . 2$ for the no augmentation setting. $10 \%$ of silence data (all zero) are added when training. At the first stage, the model is trained with the SGD optimizer with a momentum of 0.9 and an initial learning rate of 0.125 over 500 epochs, where the learning rate decays by 0.1 after 300 and 400 epochs and the weight decay is 0.0001. The other settings are the same with the experiments on CIFAR.
|
| 481 |
+
|
| 482 |
+
For data augmentation,16 we apply a set of data augmentations randomly in sequence including changing amplitude, speed, and pitch in time domain, stretching, time shifting, and adding background noise in frequency domain. Each data augmentation is applied with a probability of 0.5. Augmented data are then transformed to the mel spectogram in the size of $3 2 \times 3 2$ .
|
| 483 |
+
|
| 484 |
+
Tabular. In the experiments on CovType and Higgs (Asuncion & Newman, 2007), we take a fivelayer MLP with batch normalization as a backbone network. The output dimensions of layers are (2048-2048-4096-4096-8192), where all layers have batch normalization followed by ReLU except for the last layer. The last layer activation is maxout (Goodfellow et al., 2013) with 4 sets, such that the output dimension is 2048. On top of this five-layer MLP, we attach two-layer MLP (2048-128) as a projection head. We sample a single mixing coefficient $\lambda \sim \operatorname { B e t a } ( \alpha , \alpha )$ for each training batch, where $\alpha = 2$ for CovType and Higgs100k, and $\alpha = 1$ for Higgs1M. The temperature is set to $\tau = 0 . 1$ . The other settings are the same with the experiments on CIFAR, except that the batch size is 512 and the number of training epochs is 500. At the second stage, the MLP head is replaced with a linear classifier. For Higgs, the classifier is computed by linear regression from the feature matrix obtained without data augmentation to the label matrix using the pseudoinverse. Since the prior knowledge on tabular data is very limited, only the masking noise with a probability of 0.2 is considered as a data augmentation.
|
| 485 |
+
|
| 486 |
+
# C.2 VARIATIONS OF $i$ -MIX
|
| 487 |
+
|
| 488 |
+
We compare the MixUp (Zhang et al., 2018) and CutMix (Yun et al., 2019) variation of $i$ -Mix on N-pair contrastive learning and SimCLR. To distinguish them, we call them $i$ -MixUp and $i$ -CutMix, respectively. To be fair with the memory usage in the pretext task stage, we reduce the batch size of $i$ -MixUp and $i$ -CutMix by half (256 to 128) for SimCLR. Following the learning rate adjustment strategy in Goyal et al. (2017), we also decrease the learning rate by half (0.125 to 0.0625) when the batch size is reduced. We note that $i$ -MixUp and $i$ -CutMix on SimCLR take approximately 2.5 times more training time to achieve the same number of training epochs. The results are provided in Table C.1. We first verify that the N-pair formulation results in no worse performance than that of SimCLR. This justifies to conduct experiments using the N-pair formulation instead of that of
|
| 489 |
+
|
| 490 |
+
Table C.1: Comparison of N-pair contrastive learning and SimCLR with $i$ -MixUp and $i$ -CutMix on them with ResNet-50 on CIFAR-10 and 100. We run all experiments for 1000 epochs. $i$ -MixUp improves the accuracy on the downstream task regardless of the data distribution shift between the pretext and downstream tasks. $i$ -CutMix shows a comparable performance with $i$ -MixUp when the pretext and downstream datasets are the same, but it does not when the data distribution shift occurs.
|
| 491 |
+
|
| 492 |
+
<table><tr><td rowspan="2">Pretext</td><td rowspan="2">Downstream</td><td colspan="3">N-pair</td><td colspan="3">SimCLR</td></tr><tr><td>Vanilla</td><td>i-MixUp</td><td>i-CutMix</td><td>Vanilla</td><td>i-MixUp</td><td>i-CutMix</td></tr><tr><td rowspan="2">CIFAR-10</td><td>CIFAR-10</td><td>92.4 ± 0.1</td><td>94.8 ± 0.2</td><td>94.7 ± 0.1</td><td>92.5 ± 0.1</td><td>94.8 ± 0.2</td><td>94.8 ± 0.2</td></tr><tr><td>CIFAR-100</td><td>60.2 ± 0.3</td><td>63.3 ± 0.2</td><td>61.5 ± 0.2</td><td>60.0 ± 0.2</td><td>61.4 ± 1.0</td><td>57.1 ± 0.4</td></tr><tr><td rowspan="2">CIFAR-100</td><td>CIFAR-10</td><td>84.4 ± 0.2</td><td>86.2 ± 0.2</td><td>85.1 ± 0.2</td><td>84.4 ± 0.2</td><td>85.2 ± 0.3</td><td>83.7 ± 0.6</td></tr><tr><td>CIFAR-100</td><td>68.7 ±0.2</td><td>72.3 ± 0.2</td><td>72.3 ± 0.4</td><td>68.7 ± 0.2</td><td>72.3 ± 0.2</td><td>71.7 ± 0.2</td></tr></table>
|
| 493 |
+
|
| 494 |
+
<table><tr><td rowspan="2">Pretext</td><td rowspan="2">Downstream</td><td colspan="3">Self-Supervised Pretext</td><td colspan="3">Supervised Pretext</td></tr><tr><td>SimCLR</td><td>N-pair</td><td>+i-Mix</td><td>SimCLR</td><td>N-pair</td><td>+ i-Mix</td></tr><tr><td rowspan="2">CIFAR-10</td><td>CIFAR-10</td><td>92.5 ± 0.1</td><td>92.4 ± 0.1</td><td>94.8 ± 0.2</td><td>95.6 ± 0.3</td><td>95.7 ± 0.1</td><td>97.0 ± 0.1</td></tr><tr><td>CIFAR-100</td><td>60.0 ± 0.2</td><td>60.2 ± 0.3</td><td>63.3 ± 0.2</td><td>58.6 ± 0.2</td><td>58.9 ± 0.5</td><td>57.8 ± 0.6</td></tr><tr><td rowspan="2">CIFAR-100</td><td>CIFAR-10</td><td>84.4 ± 0.2</td><td>84.4 ±0.2</td><td>86.2 ± 0.2</td><td>86.5 ± 0.4</td><td>86.7 ±0.2</td><td>88.7 ± 0.2</td></tr><tr><td>CIFAR-100</td><td>68.7 ± 0.2</td><td>68.7 ±0.2</td><td>72.3 ± 0.2</td><td>74.3 ± 0.2</td><td>74.6 ± 0.3</td><td>78.4 ± 0.2</td></tr></table>
|
| 495 |
+
|
| 496 |
+
Table C.2: Comparison of the N-pair self-supervised and supervised contrastive learning methods and $i$ -Mix on them with ResNet-50 on CIFAR-10 and 100. We also provide the performance of formulations proposed in prior works: SimCLR (Chen et al., 2020a) and its supervised version (Khosla et al., 2020). We run all experiments for 1000 epochs. $i$ -Mix improves the accuracy on the downstream task regardless of the data distribution shift between the pretext and downstream tasks, except the case that the pretest task has smaller number of classes than that of the downstream task. The quality of representation depends on the pretext task in terms of the performance of transfer learning: self-supervised learning is better on CIFAR-10, while supervised learning is better on CIFAR-100.
|
| 497 |
+
|
| 498 |
+
SimCLR, which is simpler and more efficient, especially when applying $i$ -Mix, while not losing the performance. When pretext and downstream tasks share the training dataset, $i$ -CutMix often outperforms $i$ -MixUp, though the margin is small. However, $i$ -CutMix shows a worse performance in transfer learning.
|
| 499 |
+
|
| 500 |
+
Table C.2 compares the performance of SimCLR, N-pair contrastive learning, and $i$ -Mix on N-pair contrastive learning when the pretext task is self-supervised and supervised contrastive learning. We confirm that the N-pair formulation results in no worse performance than that of SimCLR in supervised contrastive learning as well. $i$ -Mix improves the performance of supervised contrastive learning from $9 5 . 7 \%$ to $9 7 . 0 \%$ on CIFAR-10, similarly to improvement achieved by MixUp for supervised learning where it improves the performance of supervised classifier learning from $9 5 . 5 \%$ to $9 6 . 6 \%$ . On the other hand, when the pretext dataset is CIFAR-100, the performance of supervised contrastive learning is not better than that of supervised learning: MixUp improves the performance of supervised classifier learning from $7 8 . 9 \%$ to $8 2 . 2 \%$ , and $i$ -Mix improves the performance of supervised contrastive learning from $7 4 . 6 \%$ to $7 8 . 4 \%$ .
|
| 501 |
+
|
| 502 |
+
While supervised $i$ -Mix improves the classification accuracy on CIFAR-10 when trained on CIFAR10, the representation does not transfer well to CIFAR-100, possibly due to overfitting to 10 class classification. When pretext dataset is CIFAR-100, supervised contrastive learning shows a better performance than self-supervised contrastive learning regardless of the distribution shift, as it learns sufficiently general representation for linear classifier to work well on CIFAR-10 as well.
|
| 503 |
+
|
| 504 |
+
# C.3 QUALITATIVE EMBEDDING ANALYSIS
|
| 505 |
+
|
| 506 |
+
Figure C.1 visualizes embedding spaces learned by N-pair contrastive learning and $i$ -Mix on CIFAR10 and 100. When the downstream dataset is the same with the pretext task, both contrastive learning and $i$ -Mix cluster classes well, as shown in Figure C.1(a) and C.1(b). However, when the downstream task is transferred to CIFAR-100, $i$ -Mix in Figure C.1(d) clusters classes better than contrastive
|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
Figure C.1: t-SNE visualization of embeddings trained by contrastive learning and $i$ -Mix with ResNet50 on CIFAR-10. (a,b): Classes are well-clustered in both cases when applied to CIFAR-10. (c,d): When models are transferred to CIFAR-100, classes are more clustered for $i$ -Mix than contrastive learning, as highlighted in dashed boxes. We show 10 classes for a better visualization.
|
| 510 |
+
|
| 511 |
+
<table><tr><td rowspan="2">Pretext</td><td rowspan="2">Downstream</td><td colspan="2">FED(×10-4)(↓)</td><td colspan="2">Training Acc (%) (↑)</td><td colspan="2">Test Acc (%) (↑)</td></tr><tr><td>N-pair</td><td>+ i-Mix</td><td>N-pair</td><td>+ i-Mix</td><td>N-pair</td><td>+i-Mix</td></tr><tr><td rowspan="2">CIFAR-10</td><td>CIFAR-10</td><td>30.0</td><td>16.7</td><td>96.1</td><td>96.1</td><td>92.4</td><td>94.8</td></tr><tr><td>CIFAR-100</td><td>13.8</td><td>7.9</td><td>70.7</td><td>69.5</td><td>60.2</td><td>63.3</td></tr><tr><td rowspan="2">CIFAR-100</td><td>CIFAR-10</td><td>15.2</td><td>9.7</td><td>88.1</td><td>88.8</td><td>84.4</td><td>86.2</td></tr><tr><td>CIFAR-100</td><td>30.4</td><td>13.3</td><td>85.6</td><td>79.0</td><td>68.7</td><td>72.3</td></tr></table>
|
| 512 |
+
|
| 513 |
+
Table C.3: Comparison of N-pair contrastive learning and $i$ -Mix with ResNet-50 on CIFAR-10 and 100 in terms of the Frechet embedding distance (FED) between training and test data distribution on ´ the embedding space, and training and test accuracy. $\uparrow ( \downarrow )$ indicates that the higher (lower) number is the better. $i$ -Mix improves contrastive learning in all metrics, which shows that $i$ -Mix is an effective regularization method for the pretext task, such that the learned representation is more generalized.
|
| 514 |
+
|
| 515 |
+
learning in Figure C.1(c). Specifically, clusters of “apple,” “chair,” and “dolphin,” can be found in Figure C.1(d) while they spread out in Figure C.1(c). Also, “rose” and “squirrel” are more separated in Figure C.1(d) than C.1(c). This shows that the representation learned with $i$ -Mix is more generalizable than vanilla contrastive learning.
|
| 516 |
+
|
| 517 |
+
# C.4 QUANTITATIVE EMBEDDING ANALYSIS
|
| 518 |
+
|
| 519 |
+
To estimate the quality of representation by the similarity between training and test data distribution, we measure the Frechet embedding distance (FED): similarly to the Fr ´ echet inception distance (FID) ´ introduced in Heusel et al. (2017), FED is the Frechet distance (´ Frechet´ , 1957; Vaserstein, 1969) between the set of training and test embedding vectors under the Gaussian distribution assumption. For conciseness, let ${ \bar { f } } _ { i } = { f } ( x _ { i } ) / \| f ( x _ { i } ) \|$ be an $\ell _ { 2 }$ normalized embedding vector; we normalize embedding vectors as we do when we measure the cosine similarity. Then, with the estimated mean $\begin{array} { r } { m = \frac { 1 } { N } \bar { \sum _ { i = 1 } ^ { N } { \bar { f } _ { i } } } } \end{array}$ and the estimated covariance $\begin{array} { r } { S = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } ( { \bar { f } } _ { i } - m ) ( { \bar { f } } _ { i } - m ) ^ { \top } } \end{array}$ , the FED can be defined as
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
\begin{array} { r } { d ^ { 2 } \big ( ( m ^ { \mathrm { t r } } , S ^ { \mathrm { t r } } ) , ( m ^ { \mathrm { t e } } , S ^ { \mathrm { t e } } ) \big ) = \| m ^ { \mathrm { t r } } - m ^ { \mathrm { t e } } \| ^ { 2 } + \operatorname { T r } \big ( S ^ { \mathrm { t r } } + S ^ { \mathrm { t e } } - 2 ( S ^ { \mathrm { t r } } S ^ { \mathrm { t e } } ) ^ { \frac { 1 } { 2 } } \big ) . } \end{array}
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
As shown in Table C.3, $i$ -Mix improves FED over contrastive learning, regardless of the distribution shift. Note that the distance is large when the training dataset of the downstream task is the same with that of the pretext task. This is because the model is overfit to the training dataset, such that the distance from the test dataset, which is unseen during training, has to be large.
|
| 526 |
+
|
| 527 |
+
On the other hand, Table C.3 shows that $i$ -Mix reduces the gap between the training and test accuracy. This implies that $i$ -Mix is an effective regularization method for pretext tasks, such that the learned representation is more generalizable on downstream tasks.
|
md/train/Xb8xvrtB8Ce/Xb8xvrtB8Ce.md
ADDED
|
@@ -0,0 +1,472 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BAG OF TRICKS FOR ADVERSARIAL TRAINING
|
| 2 |
+
|
| 3 |
+
Tianyu Pang, Xiao Yang, Yinpeng Dong, Hang Su, Jun Zhu∗ Department of Computer Science & Technology, Institute for AI, BNRist Center Tsinghua-Bosch Joint ML Center, THBI Lab, Tsinghua University, Beijing, 100084 China {pty17,yangxiao19,dyp17}@mails.tsinghua.edu.cn, {suhangss,dcszj}@tsinghua.edu.cn
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Adversarial training (AT) is one of the most effective strategies for promoting model robustness. However, recent benchmarks show that most of the proposed improvements on AT are less effective than simply early stopping the training procedure. This counter-intuitive fact motivates us to investigate the implementation details of tens of AT methods. Surprisingly, we find that the basic settings (e.g., weight decay, training schedule, etc.) used in these methods are highly inconsistent. In this work, we provide comprehensive evaluations on CIFAR-10, focusing on the effects of mostly overlooked training tricks and hyperparameters for adversarially trained models. Our empirical observations suggest that adversarial robustness is much more sensitive to some basic training settings than we thought. For example, a slightly different value of weight decay can reduce the model robust accuracy by more than $7 \%$ , which is probable to override the potential promotion induced by the proposed methods. We conclude a baseline training setting and re-implement previous defenses to achieve new state-of-the-art results1. These facts also appeal to more concerns on the overlooked confounders when benchmarking defenses.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Adversarial training (AT) has been one of the most effective defense strategies against adversarial attacks (Biggio et al., 2013; Szegedy et al., 2014; Goodfellow et al., 2015). Based on the primary AT frameworks like PGD-AT (Madry et al., 2018), many improvements have been proposed from different perspectives, and demonstrate promising results (detailed in Sec. 2). However, the recent benchmarks (Croce & Hein, 2020b; Chen & Gu, 2020) find that simply early stopping the training procedure of PGD-AT (Rice et al., 2020) can attain the gains from almost all the previously proposed improvements, including the state-of-the-art TRADES (Zhang et al., 2019b).
|
| 12 |
+
|
| 13 |
+
This fact is somewhat striking since TRADES also executes early stopping (one epoch after decaying the learning rate) in their code implementation. Besides, the reported robustness of PGD-AT in Rice et al. (2020) is much higher than in Madry et al. (2018), even without early-stopping. This paradox motivates us to check the implementation details of these seminal works. We find that TRADES uses weight decay of $2 \times 1 0 ^ { - 4 }$ , Gaussian PGD initialization as $\delta _ { 0 } \sim \mathcal { N } ( 0 , \alpha I )$ , and eval mode of batch normalization (BN) when crafting adversarial examples, while Rice et al. (2020) use weight decay of $5 \times 1 0 ^ { - 4 }$ , uniform PGD initialization as $\delta _ { 0 } \sim \mathcal { U } ( - \epsilon , \epsilon )$ , and train mode of BN to generate adversarial examples. In our experiments on CIFAR-10 (e.g., Table 8), the two slightly different settings can differ the robust accuracy by $\sim 5 \%$ , which is significant according to the reported benchmarks.
|
| 14 |
+
|
| 15 |
+
To have a comprehensive study, we further investigate the implementation details of tens of papers working on the AT methods, some of which are summarized in Table 1. We find that even using the same model architectures, the basic hyperparameter settings (e.g., weight decay, learning rate schedule, etc.) used in these papers are highly inconsistent and customized, which could affect the model performance and may override the gains from the methods themselves. Under this situation, if we directly benchmark these methods using their released code or checkpoints, some actually effective improvements would be under-estimated due to the improper hyperparameter settings.
|
| 16 |
+
|
| 17 |
+
Our contributions. We evaluate the effects of a wide range of basic training tricks (e.g., warmup, early stopping, weight decay, batch size, BN mode, etc.) on the adversarially trained models. Our empirical results suggest that improper training settings can largely degenerate the model performance, while this degeneration may be mistakenly ascribed to the methods themselves. We provide a baseline recipe for PGD-AT on CIFAR-10 as an example, and demonstrate the generality of the recipe on training other frameworks like TRADES. As seen in Table 16, the retrained TRADES achieve new state-of-the-art performance on the AutoAttack benchmark (Croce & Hein, 2020b).
|
| 18 |
+
|
| 19 |
+
Table 1: Hyperparameter settings and tricks used to implement different AT methods on CIFAR-10. We convert the training steps into epochs, and provide code links for reference in Table 11. Compared to the model architectures, the listed settings are easy to be neglected and paid less attention to unify.
|
| 20 |
+
|
| 21 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=2 colspan=1>1.r.</td><td rowspan=2 colspan=1>Total epoch(l.r. decay)</td><td rowspan=2 colspan=1>Batchsize</td><td rowspan=2 colspan=1>Weightdecay</td><td rowspan=1 colspan=1>Early stop</td><td rowspan=1 colspan=1>Warm-up</td></tr><tr><td rowspan=1 colspan=1>(train /attack)</td><td rowspan=1 colspan=1>(l.r. / pertub.)</td></tr><tr><td rowspan=1 colspan=1>Madry et al. (2018)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>200 (100,150)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>2×10-4</td><td rowspan=1 colspan=1>No/No</td><td rowspan=1 colspan=1>No/No</td></tr><tr><td rowspan=1 colspan=1>Cai et al. (2018)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>300 (150,250)</td><td rowspan=1 colspan=1>200</td><td rowspan=1 colspan=1>5×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No / Yes</td></tr><tr><td rowspan=2 colspan=1>Zhang et al. (2019b)Wang et al. (2019)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>76 (75)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>2 ×10-4</td><td rowspan=1 colspan=1>Yes /No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>120 (60,100)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>1×10-4</td><td rowspan=1 colspan=1>No / Yes</td><td rowspan=1 colspan=1>No/No</td></tr><tr><td rowspan=1 colspan=1>Qin et al. (2019)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>110 (100, 105)</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>2×10-4</td><td rowspan=1 colspan=1>No/No</td><td rowspan=1 colspan=1>No / Yes</td></tr><tr><td rowspan=1 colspan=1>Mao et al. (2019)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>80 (50, 60)</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>2 ×10-4</td><td rowspan=1 colspan=1>No/No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=2 colspan=1>Carmon et al. (2019)Alayrac et al. (2019)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>100 (cosine anneal)</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>5×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>64 (38, 46,51)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>5×10-4</td><td rowspan=1 colspan=1>No/No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=1 colspan=1>Shafahi et al. (2019b)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>200 (100,150)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>2×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=1 colspan=1>Zhang et al. (2019a)</td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1>105 (79,90,100)</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>5×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=2 colspan=1>Zhang & Wang (2019)Atzmon et al. (2019)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>200 (60, 90)</td><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>2×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No/No</td></tr><tr><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>100 (50)</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>1×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No/No</td></tr><tr><td rowspan=1 colspan=1>Wong et al. (2020)</td><td rowspan=1 colspan=1>0~0.2</td><td rowspan=1 colspan=1>30 (one cycle)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>5×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>Yes /No</td></tr><tr><td rowspan=1 colspan=1>Rice et al. (2020)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>200 (100,150)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>5×10-4</td><td rowspan=1 colspan=1>Yes /No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=3 colspan=1>Ding et al. (2020)Pang et al. (2020a)Zhang et al. (2020)</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>128 (51, 77, 102)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>2×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>200 (100,150)</td><td rowspan=1 colspan=1>50</td><td rowspan=1 colspan=1>1×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>120 (60,90,110)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>2×10-4</td><td rowspan=1 colspan=1>No / Yes</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=2 colspan=1>Huang et al. (2020)Cheng et al. (2020)</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>200 (cosine anneal)</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>5×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>Yes /No</td></tr><tr><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>200 (80,140,180)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>5×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=1 colspan=1>No /No</td></tr><tr><td rowspan=2 colspan=1>Lee et al. (2020)Xu et al. (2020)</td><td rowspan=2 colspan=1>0.10.1</td><td rowspan=1 colspan=1>200 (100,150)</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>2×10-4</td><td rowspan=1 colspan=1>No /No</td><td rowspan=2 colspan=1>No /NoNo/No</td></tr><tr><td rowspan=1 colspan=1>120 (60,90)</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>1×10-4</td><td rowspan=1 colspan=1>No/No</td></tr></table>
|
| 22 |
+
|
| 23 |
+
Although our empirical conclusions may not generalize to other datasets or tasks, we reveal the facts that adversarially trained models could be sensitive to certain training settings, which are usually neglected in previous work. These results also encourage the community to re-implement the previously proposed defenses with fine-tuned training settings to better explore their potentials.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
In this section, we introduce related work on the adversarial defenses and recent benchmarks. We detail on the adversarial attacks in Appendix A.1.
|
| 28 |
+
|
| 29 |
+
# 2.1 ADVERSARIAL DEFENSES
|
| 30 |
+
|
| 31 |
+
To alleviate the adversarial vulnerability of deep learning models, many defense strategies have been proposed, but most of them can eventually be evaded by adaptive attacks (Carlini & Wagner, 2017b; Athalye et al., 2018). Other more theoretically guaranteed routines include training provably robust networks (Dvijotham et al., 2018a;b; Hein & Andriushchenko, 2017; Wong & Kolter, 2018) and obtaining certified models via randomized smoothing (Cohen et al., 2019). While these methods are promising, they currently do not match the state-of-the-art robustness under empirical evaluations.
|
| 32 |
+
|
| 33 |
+
The idea of adversarial training (AT) stems from the seminal work of Goodfellow et al. (2015), while other AT frameworks like PGD-AT (Madry et al., 2018) and TRADES (Zhang et al., 2019b) occupied the winner solutions in the adversarial competitions (Kurakin et al., 2018; Brendel et al., 2020). Based on these primary AT frameworks, many improvements have been proposed via encoding the mechanisms inspired from other domains, including ensemble learning (Tramèr et al., 2018; Pang et al., 2019), metric learning (Mao et al., 2019; Li et al., 2019; Pang et al., 2020c), generative modeling (Jiang et al., 2018; Pang et al., 2018b; Wang & Yu, 2019; Deng et al., 2020), semisupervised learning (Carmon et al., 2019; Alayrac et al., 2019; Zhai et al., 2019), and self-supervised learning (Hendrycks et al., 2019; Chen et al., 2020a;b; Naseer et al., 2020). On the other hand, due to the high computational cost of AT, many efforts are devoted to accelerating the training procedure via reusing the computations (Shafahi et al., 2019b; Zhang et al., 2019a), adaptive adversarial steps (Wang et al., 2019; Zhang et al., 2020) or one-step training (Wong et al., 2020; Liu et al., 2020; Vivek B & Venkatesh Babu, 2020). The following works try to solve the side effects (e.g., catastrophic overfitting) caused by these fast AT methods (Andriushchenko & Flammarion, 2020; Li et al., 2020).
|
| 34 |
+
|
| 35 |
+
Table 2: Test accuracy $( \% )$ under different early stopping and warmup on CIFAR-10. The model is ResNet-18 (results on WRN-34-10 is in Table 14). For early stopping attack iter., we denote, e.g., 40 / 70 as the epochs to increase the tolerance step by one (Zhang et al., 2020). For warmup, the learning rate and the maximal perturbation linearly increase from zero to preset values in $1 0 / 1 5 / 2 0$ epochs.
|
| 36 |
+
|
| 37 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Base</td><td colspan="3">Early stopping attack iter.</td><td colspan="3">Warmup on l.r.</td><td colspan="3">Warmup on perturb.</td></tr><tr><td>40/70</td><td>40 /100</td><td>60 /100</td><td>10</td><td>15</td><td>20</td><td>10</td><td>15</td><td>20</td></tr><tr><td>Clean</td><td>82.52</td><td>86.52</td><td>86.56</td><td>85.67</td><td>82.45</td><td>82.64</td><td>82.31</td><td>82.64</td><td>82.75</td><td>82.78</td></tr><tr><td>PGD-10 AA</td><td>53.58 48.51</td><td>52.65 46.6</td><td>53.22 46.04</td><td>52.90 45.96</td><td>53.43 48.26</td><td>53.29 48.12</td><td>53.35 48.37</td><td>53.65 48.44</td><td>53.27 48.17</td><td>53.62 48.48</td></tr></table>
|
| 38 |
+
|
| 39 |
+
# 2.2 ADVERSARIAL BENCHMARKS
|
| 40 |
+
|
| 41 |
+
Due to the large number of proposed defenses, several benchmarks have been developed to rank the adversarial robustness of existing methods. Dong et al. (2020) perform large-scale experiments to generate robustness curves, which are used for evaluating typical defenses. Croce & Hein (2020b) propose AutoAttack, which is an ensemble of four selected attacks. They apply AutoAttack on tens of previous defenses and provide a comprehensive leader board. Chen & Gu (2020) propose the black-box RayS attack, and establish a similar leader board for defenses. In this paper, we mainly apply PGD attack and AutoAttack as two common ways to evaluate the models.
|
| 42 |
+
|
| 43 |
+
Except for the adversarial robustness, there are other efforts that introduce augmented datasets for accessing the robustness against general corruptions or perturbations. Mu & Gilmer (2019) introduce MNIST-C with a suite of 15 corruptions applied to the MNIST test set, while Hendrycks & Dietterich (2019) introduce ImageNet-C and ImageNet-P with common corruptions and perturbations on natural images. Evaluating robustness on these datasets can reflect the generality of the proposed defenses, and avoid overfitting to certain attacking patterns (Engstrom et al., 2019; Tramèr & Boneh, 2019).
|
| 44 |
+
|
| 45 |
+
# 3 BAG OF TRICKS
|
| 46 |
+
|
| 47 |
+
Our overarching goal is to investigate how the usually overlooked implementation details affect the performance of the adversarially trained models. Our experiments are done on CIFAR-10 (Krizhevsky & Hinton, 2009) under the $\ell _ { \infty }$ threat model of maximal perturbation $\epsilon = 8 / 2 5 5$ , without accessibility to additional data. We evaluate the models under 10-steps PGD attack (PGD-10) (Madry et al., 2018) and AutoAttack (AA) (Croce & Hein, 2020b). For the PGD attack, we apply untargeted mode using ground truth labels, step size of 2/255, and 5 restarts for evaluation / no restart for training. For the AutoAttack2, we apply the standard version, with no restart for AutoPGD and FAB, compared to 5 restarts for plus version. We consider some basic training tricks and perform ablation studies on each of them, based on the default training setting as described below:
|
| 48 |
+
|
| 49 |
+
Default setting. Following Rice et al. (2020), in the default setting, we apply the primary PGD-AT framework and the hyperparameters including batch size 128; SGD momentum optimizer with the initial learning rate of 0.1; weight decay $5 \times 1 \bar { 0 } ^ { - 4 }$ ; ReLU activation function and no label smoothing; train mode for batch normalization when crafting adversarial examples. All the models are trained for 110 epochs with the learning rate decaying by a factor of 0.1 at 100 and 105 epochs, respectively. We report the results on the checkpoint with the best PGD-10 accuracy.
|
| 50 |
+
|
| 51 |
+
Note that our empirical observations and conclusions may not always generalize to other datasets or AT frameworks, but we emphasize the importance of using consistent implementation details (not only the same model architectures) to enable fair comparisons among different AT methods.
|
| 52 |
+
|
| 53 |
+
Table 3: Test accuracy $( \% )$ under different batch size and learning rate (l.r.) on CIFAR-10. The basic l.r. is 0.1, while the scaled l.r. is, e.g., 0.2 for batch size 256, and 0.05 for batch size 64.
|
| 54 |
+
|
| 55 |
+
<table><tr><td rowspan=1 colspan=5>ResNet-18</td></tr><tr><td rowspan=1 colspan=1>Batch</td><td rowspan=1 colspan=2>Basic 1.r.</td><td rowspan=1 colspan=1>Sca</td><td rowspan=1 colspan=1>Scaled l.r.</td></tr><tr><td rowspan=1 colspan=1>size</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>PGD-10</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>PGD-10</td></tr><tr><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>80.08</td><td rowspan=1 colspan=1>51.31</td><td rowspan=1 colspan=1>82.44</td><td rowspan=4 colspan=1>52.48152.5253.36</td></tr><tr><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>82.52</td><td rowspan=1 colspan=1>53.58</td><td rowspan=2 colspan=1>182.24</td></tr><tr><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>83.33</td><td rowspan=1 colspan=1>52.20</td></tr><tr><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>83.40</td><td rowspan=1 colspan=1>50.69</td><td rowspan=1 colspan=1>82.16</td></tr><tr><td rowspan=1 colspan=5>WRN-34-10</td></tr><tr><td rowspan=1 colspan=1>Batchsize</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>Basic 1.r.PGD-10</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>Scaled 1.r.PGD-10</td></tr><tr><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>84.20</td><td rowspan=1 colspan=1>54.69</td><td rowspan=1 colspan=1>85.40</td><td rowspan=3 colspan=1>54.86156.09</td></tr><tr><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>86.07</td><td rowspan=1 colspan=1>56.60</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>86.21</td><td rowspan=1 colspan=1>52.90</td><td rowspan=1 colspan=1>85.89</td></tr><tr><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>86.29</td><td rowspan=1 colspan=1>50.17</td><td rowspan=1 colspan=1>86.47</td><td rowspan=1 colspan=1>55.49</td></tr></table>
|
| 56 |
+
|
| 57 |
+
Table 4: Test accuracy $( \% )$ under different degrees of label smoothing (LS) on CIFAR-10. More evaluation results under, e.g., PGD-1000 can be found in Table 17.
|
| 58 |
+
|
| 59 |
+
<table><tr><td rowspan=1 colspan=5>ResNet-18</td></tr><tr><td rowspan=1 colspan=1>LS</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>PGD-10</td><td rowspan=1 colspan=1>AA</td><td rowspan=1 colspan=1>RayS</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>82.52</td><td rowspan=1 colspan=1>53.58</td><td rowspan=1 colspan=1>48.51</td><td rowspan=1 colspan=1>53.34</td></tr><tr><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>82.69</td><td rowspan=1 colspan=1>54.04</td><td rowspan=1 colspan=1>48.76</td><td rowspan=1 colspan=1>53.71</td></tr><tr><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>82.73</td><td rowspan=1 colspan=1>54.22</td><td rowspan=1 colspan=1>49.20</td><td rowspan=1 colspan=1>53.66</td></tr><tr><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>82.51</td><td rowspan=1 colspan=1>54.34</td><td rowspan=1 colspan=1>49.24</td><td rowspan=1 colspan=1>53.59</td></tr><tr><td rowspan=1 colspan=1>0.4</td><td rowspan=1 colspan=1>82.39</td><td rowspan=1 colspan=1>54.13</td><td rowspan=1 colspan=1>48.83</td><td rowspan=1 colspan=1>53.40</td></tr><tr><td rowspan=1 colspan=5>WRN-34-10</td></tr><tr><td rowspan=1 colspan=1>LS</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>PGD-10</td><td rowspan=1 colspan=1>AA</td><td rowspan=1 colspan=1>RayS</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>86.07</td><td rowspan=1 colspan=1>56.60</td><td rowspan=1 colspan=1>52.19</td><td rowspan=1 colspan=1>60.07</td></tr><tr><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>85.96</td><td rowspan=1 colspan=1>56.88</td><td rowspan=1 colspan=1>52.74</td><td rowspan=1 colspan=1>59.99</td></tr><tr><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>86.09</td><td rowspan=1 colspan=1>57.31</td><td rowspan=1 colspan=1>53.00</td><td rowspan=1 colspan=1>60.28</td></tr><tr><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>85.99</td><td rowspan=1 colspan=1>57.55</td><td rowspan=1 colspan=1>52.70</td><td rowspan=1 colspan=1>61.00</td></tr><tr><td rowspan=1 colspan=1>0.4</td><td rowspan=1 colspan=1>86.19</td><td rowspan=1 colspan=1>57.63</td><td rowspan=1 colspan=1>52.71</td><td rowspan=1 colspan=1>60.64</td></tr></table>
|
| 60 |
+
|
| 61 |
+
Table 5: Test accuracy $( \% )$ using different optimizers on CIFAR-10. The model is ResNet-18 (results on WRN-34-10 is in Table 15). The initial learning rate for Adam and AdamW is 0.0001.
|
| 62 |
+
|
| 63 |
+
<table><tr><td></td><td>Mom</td><td>Nesterov</td><td>Adam</td><td>AdamW</td><td>SGD-GC</td><td>SGD-GCC</td></tr><tr><td>Clean</td><td>82.52</td><td>82.83</td><td>83.20</td><td>81.68</td><td>82.77</td><td>82.93</td></tr><tr><td>PGD-10</td><td>53.58</td><td>53.78</td><td>48.87</td><td>46.58</td><td>53.62</td><td>53.40</td></tr><tr><td>AA</td><td>48.51</td><td>48.22</td><td>44.04</td><td>42.39</td><td>48.33</td><td>48.51</td></tr></table>
|
| 64 |
+
|
| 65 |
+
# 3.1 EARLY STOPPING AND WARMUP
|
| 66 |
+
|
| 67 |
+
Early stopping training epoch. The trick of early stopping w.r.t. the training epoch was first applied in the implementation of TRADES (Zhang et al., 2019b), where the learning rate decays at the 75th epoch and the training is stopped at the 76th epoch. Later Rice et al. (2020) provide a comprehensive study on the overfitting phenomenon in AT, and advocate early stopping the training epoch as a general strategy for preventing adversarial overfitting, which could be triggered according to the PGD accuracy on a split validation set. Due to its effectiveness, we regard this trick as a default choice.
|
| 68 |
+
|
| 69 |
+
Early stopping adversarial intensity. Another level of early stopping happens on the adversarial intensity, e.g., early stopping PGD steps when crafting adversarial examples for training. This trick was first applied by the runner-up of the defense track in NeurIPS 2018 adversarial vision challenge (Brendel et al., 2020). Later efforts are devoted to formalizing this early stopping mechanism with different trigger rules (Wang et al., 2019; Zhang et al., 2020). Balaji et al. (2019) early stop the adversarial perturbation, which has a similar effect on the adversarial intensity. In the left part of Table 2, we evaluate the method proposed by Zhang et al. (2020) due to its simplicity. As seen, this kind of early stopping can improve the performance on clean data while keeping comparable accuracy under PGD-10. However, the performance under the stronger AutoAttack is degraded.
|
| 70 |
+
|
| 71 |
+
Warmup w.r.t. learning rate. Warmup w.r.t. learning rate is a general trick for training deep learning models (Goodfellow et al., 2016). In the adversarial setting, Wong et al. (2020) show that the one cycle learning rate schedule is one of the critical ingredients for the success of FastAT. Thus, we evaluate the effect of this trick for the piecewise learning rate schedule and PGD-AT framework. We linearly increase the learning rate from zero to the preset value in the first $1 0 / 1 5 / 2 0$ epochs. As shown in the middle part of Table 2, the effect of warming up learning rate is marginal.
|
| 72 |
+
|
| 73 |
+
Warmup w.r.t. adversarial intensity. In the AT procedure, warmup can also be executed w.r.t. the adversarial intensity. Cai et al. (2018) propose the curriculum AT process to gradually increase the adversarial intensity and monitor the overfitting trend. Qin et al. (2019) increase the maximal perturbation $\epsilon$ from zero to $8 / 2 5 5$ in the first 15 epochs. In the right part of Table 2, we linearly increase the maximal perturbation in the first $1 0 / 1 5 / 2 0$ epochs, while the effect is still limited.
|
| 74 |
+
|
| 75 |
+
Table 6: Test accuracy $( \% )$ under different non-linear activation function on CIFAR-10. The model is ResNet-18. We apply the hyperparameters recommended by Xie et al. (2020) on ImageNet for the activation function. Here the notation ‡ indicates using weight decay of $5 \times 1 0 ^ { - 5 }$ , where applying weight decay of $5 \times 1 0 ^ { - 4 }$ with these activations will lead to much worse model performance.
|
| 76 |
+
|
| 77 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>ReLU</td><td rowspan=1 colspan=1>Leaky.</td><td rowspan=1 colspan=1>ELU t</td><td rowspan=1 colspan=1>CELU t</td><td rowspan=1 colspan=1>SELU $</td><td rowspan=1 colspan=1>GELU</td><td rowspan=1 colspan=1>Softplus</td><td rowspan=1 colspan=1>Tanh </td></tr><tr><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>82.52</td><td rowspan=1 colspan=1>82.11</td><td rowspan=1 colspan=1>82.17</td><td rowspan=1 colspan=1>81.37</td><td rowspan=1 colspan=1>78.88</td><td rowspan=1 colspan=1>80.42</td><td rowspan=1 colspan=1>82.80</td><td rowspan=1 colspan=1>80.13</td></tr><tr><td rowspan=1 colspan=1>PGD-10</td><td rowspan=1 colspan=1>53.58</td><td rowspan=1 colspan=1>53.25</td><td rowspan=1 colspan=1>52.08</td><td rowspan=1 colspan=1>51.37</td><td rowspan=1 colspan=1>49.53</td><td rowspan=1 colspan=1>52.21</td><td rowspan=1 colspan=1>54.30</td><td rowspan=1 colspan=1>49.12</td></tr></table>
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 1: (a) Test accuracy w.r.t. different values of weight decay. The reported checkpoints correspond to the best PGD-10 accuracy (Rice et al., 2020). We test on two model architectures, and highlight (with red circles) three most commonly used weight decays in previous work; (b) Curves of test accuracy w.r.t. training epochs, where the model is WRN-34-10. We set weight decay be $1 \times 1 0 ^ { - 4 }$ , $2 \times \mathrm { { i } 0 ^ { - 4 } }$ , and $5 \times \bar { 1 0 } ^ { - 4 }$ , respectively. We can observe that smaller weight decay can learn faster but also more tend to overfit w.r.t. the robust accuracy. In Fig. 4, we early decay the learning rate before the models overfitting, but weight decay of $5 \times \mathrm { { \dot { 1 } } 0 ^ { - 4 } }$ still achieve better robustness.
|
| 81 |
+
|
| 82 |
+
# 3.2 TRAINING HYPERPARAMETERS
|
| 83 |
+
|
| 84 |
+
Batch size. On the large-scale datasets like ImageNet (Deng et al., 2009), it has been recognized that the mini-batch size is an important factor influencing the model performance (Goyal et al., 2017), where larger batch size traverses the dataset faster but requires more memory usage. In the adversarial setting, Xie et al. (2019) use a batch size of 4096 to train a robust model on ImageNet, which achieves state-of-the-art performance under adversarial attacks. As to the defenses reported on the CIFAR-10 dataset, the mini-batch sizes are usually chosen between 128 and 256, as shown in Table 1. To evaluate the effect, we test on two model architectures and four values of batch size in Table 3. Since the number of training epochs is fixed to 110, we also consider applying the linear scaling rule introduced in Goyal et al. (2017), i.e., when the mini-batch size is multiplied by $k$ , multiply the learning rate by $k$ . We treat the batch size of 128 and the learning rate of 0.1 as a basic setting to obtain the factor $k$ . We can observe that the batch size of 128 works well on CIFAR-10, while the linear scaling rule can benefit the cases with other batch sizes.
|
| 85 |
+
|
| 86 |
+
Table 7: Test accuracy $( \% )$ under different BN modes on CIFAR-10. We evaluate across several model architectures, since the BN layers have different positions in different models.
|
| 87 |
+
|
| 88 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">BN mode</td><td colspan="6">Model architecture</td></tr><tr><td>ResNet-18</td><td>SENet-18</td><td>DenseNet-121</td><td>GoogleNet</td><td>DPN26</td><td>WRN-34-10</td></tr><tr><td rowspan="3">Clean</td><td>train</td><td>82.52</td><td>82.20</td><td>85.38</td><td>83.97</td><td>83.67</td><td>86.07</td></tr><tr><td>eval</td><td>83.48</td><td>84.11</td><td>86.33</td><td>85.26</td><td>84.56</td><td>87.38</td></tr><tr><td>-</td><td>+0.96</td><td>+1.91</td><td>+0.95</td><td>+1.29</td><td>+0.89</td><td>+1.31</td></tr><tr><td rowspan="3">PGD-10</td><td>train</td><td>53.58</td><td>54.01</td><td>56.22</td><td>53.76</td><td>53.88</td><td>56.60</td></tr><tr><td>eval</td><td>53.64</td><td>53.90</td><td>56.11</td><td>53.77</td><td>53.41</td><td>56.04</td></tr><tr><td>-</td><td>+0.06</td><td>-0.11</td><td>-0.11</td><td>+0.01</td><td>-0.47</td><td>-0.56</td></tr><tr><td rowspan="3">AA</td><td>train</td><td>48.51</td><td>48.72</td><td>51.58</td><td>48.73</td><td>48.50</td><td>52.19</td></tr><tr><td>eval</td><td>48.75</td><td>48.95</td><td>51.24</td><td>48.83</td><td>48.30</td><td>51.93</td></tr><tr><td>1</td><td>+0.24</td><td>+0.23</td><td>-0.34</td><td>+0.10</td><td>-0.20</td><td>-0.26</td></tr></table>
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 2: Clean accuracy vs. PGD-10 accuracy for different model architectures. The circle sizes are proportional to the number of parameters that specified in Table 12.
|
| 92 |
+
|
| 93 |
+
Label smoothing (LS). Shafahi et al. (2019a) propose to utilize LS to mimic adversarial training. Pang et al. (2019) also find that imposing LS on the ensemble prediction can alleviate the adversarial transferability among individual members. Unfortunately, combing LS with standard training cannot prevent the models from evaded by adaptive attacks (Tramer et al., 2020) or larger iteration steps (Summers & Dinneen, 2018). Beyond previous observations, we further evaluate the effect of LS on adversarial training. As shown in Table 4 and Table 17, mild LS can improve $0 . 5 \sim 1 \%$ robust accuracy under the strong attacks we evaluated, including AutoAttack and PGD-1000, without affecting the clean performance. This can be regarded as the effect induced by calibrating the confidence (Stutz et al., 2020) of adversarially trained models $( 8 0 \% \sim 8 5 \%$ accuracy on clean data). In contrast, excessive LS could degrade the robustness (e.g., $\mathrm { L S } = 0 . 3$ vs. $\mathrm { L S } = 0 . 4$ on ResNet-18), which is consistent with the recent observations in Jiang et al. (2020) (they use $\mathrm { L S } = 0 . 5$ ). However, since LS is known for its potential gradient masking effect, we advocate careful evaluations when applying this trick on the proposed defenses, following the suggestions in Carlini et al. (2019).
|
| 94 |
+
|
| 95 |
+
Optimizer. Most of the AT methods apply SGD with momentum as the optimizer. The momentum factor is usually set to be 0.9 with zero dampening. In other cases, Carmon et al. (2019) apply SGD with Nesterov, and Rice et al. (2020) apply Adam for cyclic learning rate schedule. We test some commonly used optimizers in Table 5, as well as the decoupled AdamW (Loshchilov & Hutter, 2019) and the recently proposed gradient centralization trick SGD-GC / SGD-GCC (Yong et al., 2020). We can find that SGD-based optimizers (e.g., Mom, Nesterov, SGD-GC / SGD-GCC) have similar performance, while Adam / AdamW performs worse for piecewise learning rate schedule.
|
| 96 |
+
|
| 97 |
+
Weight decay. As observed in Table 1, three different values of weight decay are used in previous defenses, including $1 \times 1 0 ^ { - 4 }$ , $2 \times 1 0 ^ { - 4 }$ , and $5 \times 1 0 ^ { - 4 }$ . While $5 \times 1 0 ^ { - 4 }$ is a fairly widely used value for weight decay in deep learning, the prevalence of the value $2 \times 1 0 ^ { - 4 }$ should stem from Madry et al. (2018) in the adversarial setting. In Fig. 1(a), we report the best test accuracy under different values of weight decay3. We can see that the gap of robust accuracy can be significant due to slightly different values of weight decay (e.g., up to $\sim 7 \%$ for $1 \times 1 0 ^ { - 4 }$ vs. $5 \times 1 0 ^ { - 4 }$ ). Besides, in Fig. 1(b) we plot the learning curves of test accuracy w.r.t. training epochs. Note that smaller values of weight decay make the model learn faster in the initial phase, but the overfitting phenomenon also appears earlier. In Fig. 3, we visualize the cross sections of the decision boundary. We can see that proper values of weight decay (e.g., $5 \times 1 0 ^ { - 4 }$ ) can enlarge margins from decision boundary and improve robustness. Nevertheless, as shown in the left two columns, this effect is less significant on promoting clean accuracy. As a result, weight decay is a critical and usually neglected ingredient that largely influences the robust accuracy of adversarially trained models. In contrast, the clean accuracy is much less sensitive to weight decay, for both adversarially and standardly (shown in Fig. 5) trained models.
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 3: Random normal cross-sections of the decision boundary for PGD-AT with different weight decay. The model architecture is WRN-34-10. Following the examples in Moosavi-Dezfooli et al. (2019), we craft PGD-10 perturbation as the normal direction $v$ , and $r$ be a random direction, under the $\ell _ { \infty }$ constraint of $8 / 2 5 5$ . The values of $\mathbf { X }$ -axis and y-axis represent the multiplied scale factors.
|
| 101 |
+
|
| 102 |
+
Activation function. Most of the previous AT methods apply ReLU as the non-linear activation function in their models, while Xie et al. (2020) empirically demonstrate that smooth activation functions can better improve model robustness on ImageNet. Following their settings, we test if a similar conclusion holds on CIFAR-10. By comparing the results on ReLU and Softplus in Table 6 (for PGD-AT) and Table 13 (for TRADES), we confirm that smooth activation indeed benefits model robustness for ResNet-18. However, as shown in Table 8 (for PGD-AT) and Table 9 (for TRADES), this benefit is less significant on larger models like WRN. Thus we deduce that smaller model capacity can benefit more from the smoothness of activation function. Besides, as shown in Table 6, models trained on CIFAR-10 seem to prefer activation function $\sigma ( x )$ with zero truncation, i.e., $\sigma ( { \boldsymbol { x } } ) \geq 0$ . Those with negative return values like ELU, LeakyReLU, Tanh have worse performance than ReLU.
|
| 103 |
+
|
| 104 |
+
Table 9: Test accuracy $( \% )$ . The AT framework is TRADES. We highlight the setting used by the original implementation in Zhang et al. (2019b). As listed in Table 16, our retrained TRADES models can achieve state-of-the-art performance in the AutoAttack benchmark.
|
| 105 |
+
|
| 106 |
+
<table><tr><td colspan="6">Threat model: loo constraint, e = 0.031</td></tr><tr><td>Architecture</td><td>Weight decay</td><td>BN mode</td><td>Activation</td><td>Clean PGD-10</td><td>AA</td></tr><tr><td rowspan="5">WRN-34-10</td><td>2 ×10-4</td><td>train</td><td>ReLU</td><td>83.86 54.96</td><td>51.52</td></tr><tr><td>2 × 10-4</td><td> eval</td><td>ReLU 85.17</td><td>55.10</td><td>51.85</td></tr><tr><td>5 ×10-4</td><td>train ReLU</td><td>84.17</td><td>57.34</td><td>53.51</td></tr><tr><td>5×10-4</td><td>eval</td><td>ReLU 85.34</td><td>58.54</td><td>54.64</td></tr><tr><td>5×10-4</td><td>eval Softplus</td><td>84.66</td><td>58.05</td><td>54.20</td></tr><tr><td rowspan="2">WRN-34-20</td><td>5×10-4</td><td>eval</td><td>ReLU</td><td>86.93 57.93</td><td>54.42</td></tr><tr><td>5×10-4</td><td>eval Softplus</td><td>85.43 8/255</td><td>57.94</td><td>54.32</td></tr><tr><td colspan="6">Threat model: l constraint,∈=</td></tr><tr><td>Architecture</td><td>Weight decay</td><td>BN mode Activation</td><td>Clean</td><td>PGD-10</td><td>AA</td></tr><tr><td rowspan="5">WRN-34-10</td><td>2×10-4</td><td>train</td><td>ReLU 84.50</td><td>54.60</td><td>50.94</td></tr><tr><td>2 × 10-4</td><td> eval</td><td>ReLU</td><td>85.17</td><td>54.58 51.54</td></tr><tr><td>5 ×10-4</td><td>train</td><td>ReLU 84.04</td><td>57.41</td><td>53.83</td></tr><tr><td>5×10-4</td><td>eval</td><td>ReLU</td><td>85.48 57.45</td><td>53.80</td></tr><tr><td>5×10-4</td><td>eval</td><td>Softplus 84.24</td><td>57.59</td><td>53.88</td></tr><tr><td rowspan="5">WRN-34-20</td><td>2 ×10-4</td><td>train</td><td>ReLU</td><td>84.50 53.86</td><td>51.18</td></tr><tr><td>2 × 10-4</td><td>eval</td><td>ReLU</td><td>85.48 53.21</td><td>50.59</td></tr><tr><td>5 ×10-4</td><td>train</td><td>ReLU</td><td>85.87 57.40</td><td>54.22</td></tr><tr><td>5×10-4</td><td>eval</td><td>ReLU</td><td>86.43</td><td>57.91 54.39</td></tr><tr><td>5×10-4</td><td>eval</td><td>Softplus</td><td>85.51</td><td>57.50 54.21</td></tr></table>
|
| 107 |
+
|
| 108 |
+
Model architecture. Su et al. (2018) provide a comprehensive study on the robustness of standardly trained models, using different model architectures. For the adversarially trained models, it has been generally recognized that larger model capacity can usually lead to better robustness (Madry et al., 2018). Recently, Guo et al. (2020) blend in the technique of AutoML to explore robust architectures. In Fig. 2, we perform similar experiments on more hand-crafted model architectures. The selected models have comparable numbers of parameters. We can observe that DenseNet can achieve both the best clean and robust accuracy, while being memory-efficient (but may require longer inference time). This is consistent with the observation in Guo et al. (2020) that residual connections can benefit the AT procedure. Interestingly, Wu et al. (2020) demonstrate that residual connections allow easier generation of highly transferable adversarial examples, while in our case this weakness for the standardly trained models may turn out to strengthen the adversarially trained models.
|
| 109 |
+
|
| 110 |
+
Batch normalization (BN) mode. When crafting adversarial examples in the training procedure, Zhang et al. (2019b) use eval mode for BN, while Rice et al. (2020) and Madry et al. (2018) use train mode for BN. Since the parameters in the BN layers are not updated in this progress, the difference between these two modes is mainly on the recorded moving average BN mean and variance used in the test phase. As pointed out in Xie & Yuille (2020), properly dealing with BN layers is critical to obtain a well-performed adversarially trained model. Thus in Table 7, we employ the train or eval mode of BN for crafting adversarial examples during training, and report the results on different model architectures to dig out general rules. As seen, using eval mode for BN can increase clean accuracy, while keeping comparable robustness. We also advocate for the eval mode, because if we apply train mode for multi-step PGD attack, the BN mean and variance will be recorded for every intermediate step, which could blur the adversarial distribution used by BN layers during inference.
|
| 111 |
+
|
| 112 |
+
# Takeaways:
|
| 113 |
+
|
| 114 |
+
(i) Slightly different values of weight decay could largely affect the robustness of trained models;
|
| 115 |
+
(ii) Moderate label smoothing and linear scaling rule on l.r. for different batch sizes are beneficial;
|
| 116 |
+
(iii) Applying eval BN mode to craft training adversarial examples can avoid blurring the distribution;
|
| 117 |
+
(iv) Early stopping the adversarial steps or perturbation may degenerate worst-case robustness;
|
| 118 |
+
(v) Smooth activation benefits more when the model capacity is not enough for adversarial training.
|
| 119 |
+
|
| 120 |
+
Table 10: Test accuracy $( \% )$ . The considered AT frameworks are FastAT and FreeAT. The model architecture is WRN-34-10. Detailed settings used for these defenses are described in Sec. 3.5.
|
| 121 |
+
|
| 122 |
+
<table><tr><td>Defense</td><td>Label smooth</td><td>Weight decay</td><td>BN mode</td><td>Clean</td><td>Accuracy PGD-10</td><td>AA</td></tr><tr><td rowspan="4">FastAT (Wong et al., 2020)</td><td>0</td><td>2×10-4</td><td>train</td><td>82.19</td><td>47.47</td><td>42.99</td></tr><tr><td>0</td><td>5× 10-4</td><td>train</td><td>82.93</td><td>48.48</td><td>44.06</td></tr><tr><td>0</td><td>5× 10-4</td><td>eval</td><td>84.00</td><td>48.16</td><td>43.66</td></tr><tr><td>0.1</td><td>5× 10-4</td><td>train</td><td>82.83</td><td>48.76</td><td>44.50</td></tr><tr><td rowspan="4">FreeAT (Shafahi et al.,2019b)</td><td>0</td><td>2× 10-4</td><td>train</td><td>87.42</td><td>47.66</td><td>44.24</td></tr><tr><td>0</td><td>5× 10-4</td><td>train</td><td>88.17</td><td>48.90</td><td>45.66</td></tr><tr><td>0</td><td>5× 10-4</td><td>eval</td><td>88.26</td><td>48.50</td><td>45.49</td></tr><tr><td>0.1</td><td>5×10-4</td><td>train</td><td>88.07</td><td>49.26</td><td>45.91</td></tr></table>
|
| 123 |
+
|
| 124 |
+
# 3.3 COMBINATION OF TRICKS
|
| 125 |
+
|
| 126 |
+
In the above, we separately evaluate the effect of each training trick in the AT procedure. Now we investigate combining the selected useful tricks, which involve label smoothing, weight decay, activation function and BN mode. As demonstrated in Table 8, the improvements are not ideally additive by combining different tricks, while label smoothing and smooth activation function are helpful, but not significant, especially when we apply model architectures with a larger capacity.
|
| 127 |
+
|
| 128 |
+
We also find that the high performance of the models trained by Rice et al. (2020) partially comes from its reasonable training settings, compared to previous work. Based on these, we provide a trick list for training robust models on CIFAR-10 for reference.
|
| 129 |
+
|
| 130 |
+
# Baseline setting (CIFAR-10):
|
| 131 |
+
|
| 132 |
+
Batch size 128; SGD momentum optimizer; weight decay $5 \times 1 0 ^ { - 4 }$ ; eval mode BN for generating adversarial examples; warmups are not necessary; moderate label smoothing $( 0 . 1 \sim 0 . 2 )$ and smooth activation function could be beneficial; model architecture with residual connections.
|
| 133 |
+
|
| 134 |
+
# 3.4 RE-IMPLEMENTATION OF TRADES
|
| 135 |
+
|
| 136 |
+
As a sanity check, we re-implement TRADES to see if our conclusions derived from PGD-AT can generalize and provide the results in Table 9. We can observe that after simply changing the weight decay from $2 \times 1 0 ^ { - 4 }$ to $5 \times 1 0 ^ { - 4 }$ , the clean accuracy of TRADES improves by $\sim \bar { 1 } \%$ and the AA accuracy improves by $\sim 4 \%$ , which make the trained model surpass the previously state-of-theart models reported by the AutoAttack benchmark, as listed in Table 16. This fact highlights the importance of employing a standardized training setting for fair comparisons of different AT methods.
|
| 137 |
+
|
| 138 |
+
# 3.5 EVALUATIONS ON OTHER AT FRAMEWORKS
|
| 139 |
+
|
| 140 |
+
To examine the universality of our observations on PGD-AT and TRADES, we further evaluate on other AT frameworks, including FastAT (Wong et al., 2020) and FreeAT (Shafahi et al., 2019b). We base on the FastAT code4 to implement the methods. Specifically, for FastAT, we use cyclic learning rate schedule with $l _ { \mathrm { m i n } } = 0$ and $l _ { \mathrm { m a x } } = 0 . 2$ , training for 15 epochs. For FreeAT, we also use cyclic learning rate schedule with $l _ { \mathrm { m i n } } = 0$ and $l _ { \operatorname* { m a x } } = 0 . 0 4$ , training for 24 epochs with mini-batch replays be 4. The results are provided in Table 10. We can find that our observations generalize well to other AT frameworks, which verifies that the proposed baseline setting could be a decent default choice for adversarial training on CIFAR-10.
|
| 141 |
+
|
| 142 |
+
# 4 CONCLUSION
|
| 143 |
+
|
| 144 |
+
In this work, we take a step in examining how the usually neglected implementation details impact the performance of adversarially trained models. Our empirical results suggest that compared to clean accuracy, robustness is more sensitive to some seemingly unimportant differences in training settings. Thus when building AT methods, we should more carefully fine-tune the training settings (on validation sets), or follow certain long-tested setup in the adversarial setting.
|
| 145 |
+
|
| 146 |
+
# ACKNOWLEDGEMENTS
|
| 147 |
+
|
| 148 |
+
This work was supported by the National Key Research and Development Program of China (Nos. 2020AAA0104304, 2017YFA0700904), NSFC Projects (Nos. 61620106010, 62076147, U19B2034, U19A2081), Beijing Academy of Artificial Intelligence (BAAI), Tsinghua-Huawei Joint Research Program, a grant from Tsinghua Institute for Guo Qiang, Tiangong Institute for Intelligent Computing, and the NVIDIA NVAIL Program with GPU/DGX Acceleration. Tianyu Pang was supported by MSRA Fellowship and Baidu Scholarship.
|
| 149 |
+
|
| 150 |
+
# REFERENCES
|
| 151 |
+
|
| 152 |
+
Jean-Baptiste Alayrac, Jonathan Uesato, Po-Sen Huang, Alhussein Fawzi, Robert Stanforth, and Pushmeet Kohli. Are labels required for improving adversarial robustness? In Advances in Neural Information Processing Systems (NeurIPS), pp. 12192–12202, 2019.
|
| 153 |
+
|
| 154 |
+
Maksym Andriushchenko and Nicolas Flammarion. Understanding and improving fast adversarial training. In Advances in neural information processing systems (NeurIPS), 2020.
|
| 155 |
+
|
| 156 |
+
Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion, and Matthias Hein. Square attack: a query-efficient black-box adversarial attack via random search. In European Conference on Computer Vision (ECCV), 2020.
|
| 157 |
+
|
| 158 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning (ICML), 2018.
|
| 159 |
+
|
| 160 |
+
Matan Atzmon, Niv Haim, Lior Yariv, Ofer Israelov, Haggai Maron, and Yaron Lipman. Controlling neural level sets. In Advances in Neural Information Processing Systems (NeurIPS), pp. 2034–2043, 2019.
|
| 161 |
+
|
| 162 |
+
Yogesh Balaji, Tom Goldstein, and Judy Hoffman. Instance adaptive adversarial training: Improved accuracy tradeoffs in neural nets. arXiv preprint arXiv:1910.08051, 2019.
|
| 163 |
+
|
| 164 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Šrndic, Pavel Laskov, Giorgio ´ Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 387–402. Springer, 2013.
|
| 165 |
+
|
| 166 |
+
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 (ICLR), 2018.
|
| 167 |
+
|
| 168 |
+
Wieland Brendel, Jonas Rauber, Alexey Kurakin, Nicolas Papernot, Behar Veliqi, Sharada P Mohanty, Florian Laurent, Marcel Salathé, Matthias Bethge, Yaodong Yu, et al. Adversarial vision challenge. In The NeurIPS’18 Competition, pp. 129–153. Springer, 2020.
|
| 169 |
+
|
| 170 |
+
Qi-Zhi Cai, Chang Liu, and Dawn Song. Curriculum adversarial training. In International Joint Conference on Artificial Intelligence (IJCAI), pp. 3740–3747, 2018.
|
| 171 |
+
|
| 172 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy (S&P), 2017a.
|
| 173 |
+
|
| 174 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In ACM Workshop on Artificial Intelligence and Security (AISec), 2017b.
|
| 175 |
+
|
| 176 |
+
Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, Ian Goodfellow, Aleksander Madry, and Alexey Kurakin. On evaluating adversarial robustness. arXiv preprint arXiv:1902.06705, 2019.
|
| 177 |
+
|
| 178 |
+
Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, Percy Liang, and John C Duchi. Unlabeled data improves adversarial robustness. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 179 |
+
|
| 180 |
+
Jinghui Chen and Quanquan Gu. Rays: A ray searching method for hard-label adversarial attack. arXiv preprint arXiv:2006.12792, 2020.
|
| 181 |
+
|
| 182 |
+
Kejiang Chen, Yuefeng Chen, Hang Zhou, Xiaofeng Mao, Yuhong Li, Yuan He, Hui Xue, Weiming Zhang, and Nenghai Yu. Self-supervised adversarial training. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 2218–2222. IEEE, 2020a.
|
| 183 |
+
|
| 184 |
+
Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In ACM Workshop on Artificial Intelligence and Security (AISec). ACM, 2017a.
|
| 185 |
+
|
| 186 |
+
Pin-Yu Chen, Yash Sharma, Huan Zhang, Jinfeng Yi, and Cho-Jui Hsieh. Ead: elastic-net attacks to deep neural networks via adversarial examples. In AAAI Conference on Artificial Intelligence (AAAI), 2018.
|
| 187 |
+
|
| 188 |
+
Tianlong Chen, Sijia Liu, Shiyu Chang, Yu Cheng, Lisa Amini, and Zhangyang Wang. Adversarial robustness: From self-supervised pre-training to fine-tuning. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 699–708, 2020b.
|
| 189 |
+
|
| 190 |
+
Yunpeng Chen, Jianan Li, Huaxin Xiao, Xiaojie Jin, Shuicheng Yan, and Jiashi Feng. Dual path networks. In Advances in Neural Information Processing Systems (NeurIPS), pp. 4467–4475, 2017b.
|
| 191 |
+
|
| 192 |
+
Minhao Cheng, Thong Le, Pin-Yu Chen, Jinfeng Yi, Huan Zhang, and Cho-Jui Hsieh. Query-efficient hard-label black-box attack: An optimization-based approach. In International Conference on Learning Representations (ICLR), 2019a.
|
| 193 |
+
|
| 194 |
+
Minhao Cheng, Qi Lei, Pin-Yu Chen, Inderjit Dhillon, and Cho-Jui Hsieh. Cat: Customized adversarial training for improved robustness. arXiv preprint arXiv:2002.06789, 2020.
|
| 195 |
+
|
| 196 |
+
Shuyu Cheng, Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Improving black-box adversarial attacks with a transfer-based prior. In Advances in Neural Information Processing Systems (NeurIPS), 2019b.
|
| 197 |
+
|
| 198 |
+
Jeremy M Cohen, Elan Rosenfeld, and J Zico Kolter. Certified adversarial robustness via randomized smoothing. In International Conference on Machine Learning (ICML), 2019.
|
| 199 |
+
|
| 200 |
+
Francesco Croce and Matthias Hein. Minimally distorted adversarial examples with a fast adaptive boundary attack. In International Conference on Machine Learning (ICML), 2020a.
|
| 201 |
+
|
| 202 |
+
Francesco Croce and Matthias Hein. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks. In International Conference on Machine Learning (ICML), 2020b.
|
| 203 |
+
|
| 204 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009.
|
| 205 |
+
|
| 206 |
+
Zhijie Deng, Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Adversarial distributional training for robust deep learning. arXiv preprint arXiv:2002.05999, 2020.
|
| 207 |
+
|
| 208 |
+
Gavin Weiguang Ding, Yash Sharma, Kry Yik Chau Lui, and Ruitong Huang. Mma training: Direct input space margin maximization through adversarial training. In International Conference on Learning Representations (ICLR), 2020.
|
| 209 |
+
|
| 210 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 211 |
+
|
| 212 |
+
Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Evading defenses to transferable adversarial examples by translation-invariant attacks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 213 |
+
|
| 214 |
+
Yinpeng Dong, Qi-An Fu, Xiao Yang, Tianyu Pang, Hang Su, Zihao Xiao, and Jun Zhu. Benchmarking adversarial robustness on image classification. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 215 |
+
|
| 216 |
+
Krishnamurthy Dvijotham, Sven Gowal, Robert Stanforth, Relja Arandjelovic, Brendan O’Donoghue, Jonathan Uesato, and Pushmeet Kohli. Training verified learners with learned verifiers. arXiv preprint arXiv:1805.10265, 2018a.
|
| 217 |
+
|
| 218 |
+
Krishnamurthy Dvijotham, Robert Stanforth, Sven Gowal, Timothy Mann, and Pushmeet Kohli. A dual approach to scalable verification of deep networks. In Annual Conference on Uncertainty in Artificial Intelligence (UAI), 2018b.
|
| 219 |
+
|
| 220 |
+
Logan Engstrom, Brandon Tran, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry. A rotation and a translation suffice: Fooling cnns with simple transformations. In International Conference on Machine Learning (ICML), 2019.
|
| 221 |
+
|
| 222 |
+
Reuben Feinman, Ryan R Curtin, Saurabh Shintre, and Andrew B Gardner. Detecting adversarial samples from artifacts. arXiv preprint arXiv:1703.00410, 2017.
|
| 223 |
+
|
| 224 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http: //www.deeplearningbook.org.
|
| 225 |
+
|
| 226 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations (ICLR), 2015.
|
| 227 |
+
|
| 228 |
+
Sven Gowal, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. Uncovering the limits of adversarial training against norm-bounded adversarial examples. arXiv preprint arXiv:2010.03593, 2020.
|
| 229 |
+
|
| 230 |
+
Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 231 |
+
|
| 232 |
+
Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens Van Der Maaten. Countering adversarial images using input transformations. In International Conference on Learning Representations (ICLR), 2018.
|
| 233 |
+
|
| 234 |
+
Minghao Guo, Yuzhe Yang, Rui Xu, Ziwei Liu, and Dahua Lin. When nas meets robustness: In search of robust architectures against adversarial attacks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 631–640, 2020.
|
| 235 |
+
|
| 236 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision (ECCV), pp. 630–645. Springer, 2016.
|
| 237 |
+
|
| 238 |
+
Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems (NeurIPS), pp. 2266–2276, 2017.
|
| 239 |
+
|
| 240 |
+
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations (ICLR), 2019.
|
| 241 |
+
|
| 242 |
+
Dan Hendrycks, Kimin Lee, and Mantas Mazeika. Using pre-training can improve model robustness and uncertainty. In International Conference on Machine Learning (ICML), 2019.
|
| 243 |
+
|
| 244 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7132–7141, 2018.
|
| 245 |
+
|
| 246 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4700–4708, 2017.
|
| 247 |
+
|
| 248 |
+
Lang Huang, Chao Zhang, and Hongyang Zhang. Self-adaptive training: beyond empirical risk minimization. arXiv preprint arXiv:2002.10319, 2020.
|
| 249 |
+
|
| 250 |
+
Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. In International Conference on Machine Learning (ICML), 2018.
|
| 251 |
+
|
| 252 |
+
Haoming Jiang, Zhehui Chen, Yuyang Shi, Bo Dai, and Tuo Zhao. Learning to defense by learning to attack. arXiv preprint arXiv:1811.01213, 2018.
|
| 253 |
+
|
| 254 |
+
Linxi Jiang, Xingjun Ma, Zejia Weng, James Bailey, and Yu-Gang Jiang. Imbalanced gradients: A new cause of overestimated adversarial robustness. arXiv preprint arXiv:2006.13726, 2020.
|
| 255 |
+
|
| 256 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 257 |
+
|
| 258 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. In The International Conference on Learning Representations (ICLR) Workshops, 2017.
|
| 259 |
+
|
| 260 |
+
Alexey Kurakin, Ian Goodfellow, Samy Bengio, Yinpeng Dong, Fangzhou Liao, Ming Liang, Tianyu Pang, Jun Zhu, Xiaolin Hu, Cihang Xie, et al. Adversarial attacks and defences competition. arXiv preprint arXiv:1804.00097, 2018.
|
| 261 |
+
|
| 262 |
+
Saehyung Lee, Hyungyu Lee, and Sungroh Yoon. Adversarial vertex mixup: Toward better adversarially robust generalization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 272–281, 2020.
|
| 263 |
+
|
| 264 |
+
Bai Li, Shiqi Wang, Suman Jana, and Lawrence Carin. Towards understanding fast adversarial training. arXiv preprint arXiv:2006.03089, 2020.
|
| 265 |
+
|
| 266 |
+
Pengcheng Li, Jinfeng Yi, Bowen Zhou, and Lijun Zhang. Improving the robustness of deep neural networks via adversarial training with triplet loss. In International Joint Conference on Artificial Intelligence (IJCAI), 2019.
|
| 267 |
+
|
| 268 |
+
Guanxiong Liu, Issa Khalil, and Abdallah Khreishah. Using single-step adversarial training to defend iterative adversarial examples. arXiv preprint arXiv:2002.09632, 2020.
|
| 269 |
+
|
| 270 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations (ICLR), 2019.
|
| 271 |
+
|
| 272 |
+
Xingjun Ma, Bo Li, Yisen Wang, Sarah M Erfani, Sudanthi Wijewickrema, Michael E Houle, Grant Schoenebeck, Dawn Song, and James Bailey. Characterizing adversarial subspaces using local intrinsic dimensionality. arXiv preprint arXiv:1801.02613, 2018.
|
| 273 |
+
|
| 274 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations (ICLR), 2018.
|
| 275 |
+
|
| 276 |
+
Chengzhi Mao, Ziyuan Zhong, Junfeng Yang, Carl Vondrick, and Baishakhi Ray. Metric learning for adversarial robustness. In Advances in Neural Information Processing Systems (NeurIPS), pp. 478–489, 2019.
|
| 277 |
+
|
| 278 |
+
Jan Hendrik Metzen, Tim Genewein, Volker Fischer, and Bastian Bischoff. On detecting adversarial perturbations. In International Conference on Learning Representations (ICLR), 2017.
|
| 279 |
+
|
| 280 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Jonathan Uesato, and Pascal Frossard. Robustness via curvature regularization, and vice versa. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 281 |
+
|
| 282 |
+
Norman Mu and Justin Gilmer. Mnist-c: A robustness benchmark for computer vision. arXiv preprint arXiv:1906.02337, 2019.
|
| 283 |
+
|
| 284 |
+
Muzammal Naseer, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Fatih Porikli. A selfsupervised approach for adversarial robustness. In Conference on Computer Vision and Pattern Recognition (CVPR), pp. 262–271, 2020.
|
| 285 |
+
|
| 286 |
+
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 427–436, 2015.
|
| 287 |
+
|
| 288 |
+
Tianyu Pang, Chao Du, Yinpeng Dong, and Jun Zhu. Towards robust detection of adversarial examples. In Advances in Neural Information Processing Systems (NeurIPS), pp. 4579–4589, 2018a.
|
| 289 |
+
|
| 290 |
+
Tianyu Pang, Chao Du, and Jun Zhu. Max-mahalanobis linear discriminant analysis networks. In International Conference on Machine Learning (ICML), 2018b.
|
| 291 |
+
|
| 292 |
+
Tianyu Pang, Kun Xu, Chao Du, Ning Chen, and Jun Zhu. Improving adversarial robustness via promoting ensemble diversity. In International Conference on Machine Learning (ICML), 2019.
|
| 293 |
+
|
| 294 |
+
Tianyu Pang, Kun Xu, Yinpeng Dong, Chao Du, Ning Chen, and Jun Zhu. Rethinking softmax crossentropy loss for adversarial robustness. In International Conference on Learning Representations (ICLR), 2020a.
|
| 295 |
+
|
| 296 |
+
Tianyu Pang, Kun Xu, and Jun Zhu. Mixup inference: Better exploiting mixup to defend adversarial attacks. In International Conference on Learning Representations (ICLR), 2020b.
|
| 297 |
+
|
| 298 |
+
Tianyu Pang, Xiao Yang, Yinpeng Dong, Kun Xu, Hang Su, and Jun Zhu. Boosting adversarial training with hypersphere embedding. In Advances in Neural Information Processing Systems (NeurIPS), 2020c.
|
| 299 |
+
|
| 300 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In IEEE European Symposium on Security and Privacy (EuroS&P), pp. 372–387. IEEE, 2016.
|
| 301 |
+
|
| 302 |
+
Chongli Qin, James Martens, Sven Gowal, Dilip Krishnan, Krishnamurthy Dvijotham, Alhussein Fawzi, Soham De, Robert Stanforth, and Pushmeet Kohli. Adversarial robustness through local linearization. In Advances in Neural Information Processing Systems (NeurIPS), pp. 13824–13833, 2019.
|
| 303 |
+
|
| 304 |
+
Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollár. Designing network design spaces. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 10428–10436, 2020.
|
| 305 |
+
|
| 306 |
+
Edward Raff, Jared Sylvester, Steven Forsyth, and Mark McLean. Barrage of random transforms for adversarially robust defense. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 6528–6537, 2019.
|
| 307 |
+
|
| 308 |
+
Leslie Rice, Eric Wong, and J Zico Kolter. Overfitting in adversarially robust deep learning. In International Conference on Machine Learning (ICML), 2020.
|
| 309 |
+
|
| 310 |
+
Ali Shafahi, Amin Ghiasi, Furong Huang, and Tom Goldstein. Label smoothing and logit squeezing: A replacement for adversarial training? arXiv preprint arXiv:1910.11585, 2019a.
|
| 311 |
+
|
| 312 |
+
Ali Shafahi, Mahyar Najibi, Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! In Advances in Neural Information Processing Systems (NeurIPS), 2019b.
|
| 313 |
+
|
| 314 |
+
Dawn Song, Kevin Eykholt, Ivan Evtimov, Earlence Fernandes, Bo Li, Amir Rahmati, Florian Tramer, Atul Prakash, and Tadayoshi Kohno. Physical adversarial examples for object detectors. In USENIX Workshop on Offensive Technologies, 2018a.
|
| 315 |
+
|
| 316 |
+
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 (ICLR), 2018b.
|
| 317 |
+
|
| 318 |
+
David Stutz, Matthias Hein, and Bernt Schiele. Confidence-calibrated adversarial training: Generalizing to unseen attacks. In International Conference on Machine Learning (ICML), 2020.
|
| 319 |
+
|
| 320 |
+
Dong Su, Huan Zhang, Hongge Chen, Jinfeng Yi, Pin-Yu Chen, and Yupeng Gao. Is robustness the cost of accuracy? – a comprehensive study on the robustness of 18 deep image classification models. In European Conference on Computer Vision (ECCV), 2018.
|
| 321 |
+
|
| 322 |
+
Cecilia Summers and Michael J Dinneen. Logit regularization methods for adversarial robustness. ICLR submission, 2018. https://openreview.net/forum?id=BJlr0j0ctX.
|
| 323 |
+
|
| 324 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations (ICLR), 2014.
|
| 325 |
+
|
| 326 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1–9, 2015.
|
| 327 |
+
|
| 328 |
+
Pedro Tabacof and Eduardo Valle. Exploring the space of adversarial images. In 2016 International Joint Conference on Neural Networks (IJCNN), pp. 426–433. IEEE, 2016.
|
| 329 |
+
|
| 330 |
+
Florian Tramèr and Dan Boneh. Adversarial training and robustness for multiple perturbations. In Advances in Neural Information Processing Systems (NeurIPS), pp. 5858–5868, 2019.
|
| 331 |
+
|
| 332 |
+
Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. In International Conference on Learning Representations (ICLR), 2018.
|
| 333 |
+
|
| 334 |
+
Florian Tramer, Nicholas Carlini, Wieland Brendel, and Aleksander Madry. On adaptive attacks to adversarial example defenses. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 335 |
+
|
| 336 |
+
Jonathan Uesato, Brendan O’Donoghue, Aaron van den Oord, and Pushmeet Kohli. Adversarial risk and the dangers of evaluating against weak attacks. In International Conference on Machine Learning (ICML), 2018.
|
| 337 |
+
|
| 338 |
+
S Vivek B and R Venkatesh Babu. Single-step adversarial training with dropout scheduling. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2020.
|
| 339 |
+
|
| 340 |
+
Huaxia Wang and Chun-Nam Yu. A direct approach to robust deep learning using adversarial networks. In International Conference on Learning Representations (ICLR), 2019.
|
| 341 |
+
|
| 342 |
+
Yisen Wang, Xingjun Ma, James Bailey, Jinfeng Yi, Bowen Zhou, and Quanquan Gu. On the convergence and robustness of adversarial training. In International Conference on Machine Learning (ICML), pp. 6586–6595, 2019.
|
| 343 |
+
|
| 344 |
+
Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning (ICML), pp. 5283–5292, 2018.
|
| 345 |
+
|
| 346 |
+
Eric Wong, Leslie Rice, and J. Zico Kolter. Fast is better than free: Revisiting adversarial training. In International Conference on Learning Representations (ICLR), 2020.
|
| 347 |
+
|
| 348 |
+
Dongxian Wu, Yisen Wang, Shu-Tao Xia, James Bailey, and Xingjun Ma. Skip connections matter: On the transferability of adversarial examples generated with resnets. In International Conference on Learning Representations (ICLR), 2020.
|
| 349 |
+
|
| 350 |
+
Cihang Xie and Alan Yuille. Intriguing properties of adversarial training at scale. In International Conference on Learning Representations (ICLR), 2020.
|
| 351 |
+
|
| 352 |
+
Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. In International Conference on Learning Representations (ICLR), 2018.
|
| 353 |
+
|
| 354 |
+
Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 355 |
+
|
| 356 |
+
Cihang Xie, Mingxing Tan, Boqing Gong, Alan Yuille, and Quoc V Le. Smooth adversarial training. arXiv preprint arXiv:2006.14536, 2020.
|
| 357 |
+
|
| 358 |
+
Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1492–1500, 2017.
|
| 359 |
+
|
| 360 |
+
Zheng Xu, Ali Shafahi, and Tom Goldstein. Exploring model robustness with adaptive networks and improved adversarial training. arXiv preprint arXiv:2006.00387, 2020.
|
| 361 |
+
|
| 362 |
+
Hongwei Yong, Jianqiang Huang, Xiansheng Hua, and Lei Zhang. Gradient centralization: A new optimization technique for deep neural networks. In European Conference on Computer Vision (ECCV), 2020.
|
| 363 |
+
|
| 364 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In The British Machine Vision Conference (BMVC), 2016.
|
| 365 |
+
|
| 366 |
+
Runtian Zhai, Tianle Cai, Di He, Chen Dan, Kun He, John Hopcroft, and Liwei Wang. Adversarially robust generalization just requires more unlabeled data. arXiv preprint arXiv:1906.00555, 2019.
|
| 367 |
+
|
| 368 |
+
Dinghuai Zhang, Tianyuan Zhang, Yiping Lu, Zhanxing Zhu, and Bin Dong. You only propagate once: Accelerating adversarial training via maximal principle. In Advances in Neural Information Processing Systems (NeurIPS), 2019a.
|
| 369 |
+
|
| 370 |
+
Haichao Zhang and Jianyu Wang. Defense against adversarial attacks using feature scatteringbased adversarial training. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1829–1839, 2019.
|
| 371 |
+
|
| 372 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P Xing, Laurent El Ghaoui, and Michael I Jordan. Theoretically principled trade-off between robustness and accuracy. In International Conference on Machine Learning (ICML), 2019b.
|
| 373 |
+
|
| 374 |
+
Jingfeng Zhang, Xilie Xu, Bo Han, Gang Niu, Lizhen Cui, Masashi Sugiyama, and Mohan Kankanhalli. Attacks which do not kill training make adversarial learning stronger. In International Conference on Machine Learning (ICML), 2020.
|
| 375 |
+
|
| 376 |
+
# A TECHNICAL DETAILS
|
| 377 |
+
|
| 378 |
+
In this section we introduce more related backgrounds and technical details for reference.
|
| 379 |
+
|
| 380 |
+
# A.1 ADVERSARIAL ATTACKS
|
| 381 |
+
|
| 382 |
+
Since the seminal L-BFGS and FGSM attacks (Szegedy et al., 2014; Goodfellow et al., 2015), a large amount of attacking methods on generating adversarial examples have been introduced. In the white-box setting, gradient-based methods are popular and powerful, which span in the $\ell _ { \infty }$ threat model (Nguyen et al., 2015; Madry et al., 2018), $\ell _ { 2 }$ threat model (Carlini & Wagner, 2017a), $\ell _ { 1 }$ threat model (Chen et al., 2018), and $\ell _ { 0 }$ threat model (Papernot et al., 2016). In the black-box setting, the attack strategies are much more diverse. These include transfer-based attacks (Dong et al., 2018; 2019; Cheng et al., 2019b), quasi-gradient attacks (Chen et al., 2017a; Uesato et al., 2018; Ilyas et al., 2018), and decision-based attacks (Brendel et al., 2018; Cheng et al., 2019a). Adversarial attacks can be also realized in the physical world (Kurakin et al., 2017; Song et al., 2018a). Below we formulate the PGD attack and AutoAttack that we used in our evaluations.
|
| 383 |
+
|
| 384 |
+
PGD attack. One of the most commonly studied adversarial attack is the projected gradient descent (PGD) method (Madry et al., 2018). Let $x _ { 0 }$ be a randomly perturbed sample in the neighborhood of the clean input $x$ , then PGD iteratively crafts the adversarial example as
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\begin{array} { r } { x _ { i } = \mathrm { c l i p } _ { x , \epsilon } ( x _ { i - 1 } + \epsilon _ { i } \cdot \mathrm { s i g n } ( \nabla _ { x _ { i - 1 } } \mathcal { L } ( x _ { i - 1 } , y ) ) ) , } \end{array}
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
where $\mathrm { c l i p } _ { x , \epsilon } ( \cdot )$ is the clipping function and $\mathcal { L }$ is the adversarial objective. The accuracy under PGD attack has been a standard metric to evaluate the model robustness.
|
| 391 |
+
|
| 392 |
+
AutoAttack. Croce & Hein (2020b) first propose the Auto-PGD (APGD) algorithm, where the main idea is to automatically tune the adversarial step sizes according to the optimization trend. As to the adversarial objective, except for the traditional cross-entropy (CE) loss, they develop a new difference of logits ratio (DLR) loss as
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\mathrm { D L R } ( x , y ) = - \frac { z _ { y } - \operatorname* { m a x } _ { i \neq y } z _ { i } } { z _ { \pi _ { 1 } } - z _ { \pi _ { 3 } } } ,
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
where $z$ is the logits and $\pi$ is the ordering which sorts the components of $z$ . Finally, the authors propose to group $\mathbf { A P G D } _ { \mathrm { C E } }$ and $\mathrm { A P G D } _ { \mathrm { D L R } }$ with FAB (Croce & Hein, 2020a) and square attack (Andriushchenko et al., 2020) to form the AutoAttack (AA).
|
| 399 |
+
|
| 400 |
+
# A.2 REFERENCE CODES
|
| 401 |
+
|
| 402 |
+
In Table 11, we provide the code links for the referred defenses. The summarized training settings are either described in their papers or manually retrieved by us in their code implementations.
|
| 403 |
+
|
| 404 |
+
Table 11: We summarize the code links for the referred defense methods in Table 1.
|
| 405 |
+
|
| 406 |
+
<table><tr><td>Method</td><td>Code link</td></tr><tr><td>Madry et al. (2018) Cai et al. (2018)</td><td>github.com/MadryLab/cifar10_challenge</td></tr><tr><td>Zhang et al. (2019b)</td><td>github.com/sunblaze-ucb/curriculum-adversarial-training-CAT</td></tr><tr><td></td><td>github.com/yaodongyu/TRADES</td></tr><tr><td>Wang et al. (2019)</td><td> github.com/YisenWang/dynamic_adv_training</td></tr><tr><td>Mao et al. (2019)</td><td>github.com/columbia/Metric_Learning_Adversarial_Robustness</td></tr><tr><td>Carmon et al. (2019)</td><td>github.com/yaircarmon/semisup-adv</td></tr><tr><td>Alayrac et al. (2019)</td><td>github.com/deepmind/deepmind-research/unsupervised_adversarial_training</td></tr><tr><td>Shafahi et al. (2019b)</td><td>github.com/ashafahi/free_adv_train</td></tr><tr><td>Zhang et al. (2019a)</td><td>github.com/a1600012888/YOPO-You-Only-Propagate-Once</td></tr><tr><td>Zhang & Wang (2019)</td><td> github.com/Haichao-Zhang/FeatureScatter</td></tr><tr><td>Atzmon et al. (2019)</td><td>github.com/matanatz/ControllingNeuralLevelsets</td></tr><tr><td>Wong et al. (2020)</td><td>github.com/locuslab/fast_adversarial</td></tr><tr><td>Rice et al. (2020)</td><td></td></tr><tr><td>Ding et al. (2020)</td><td>github.com/locuslab/robust_overfitting</td></tr><tr><td>Pang et al. (2020a)</td><td>github.com/BorealisAI/mma_training github.com/P2333/Max-Mahalanobis-Training</td></tr><tr><td>Zhang et al. (2020)</td><td>github.com/zjfheart/Friendly-Adversarial-Training</td></tr><tr><td>Huang et al. (2020)</td><td> github.com/LayneH/self-adaptive-training</td></tr><tr><td>Lee et al. (2020)</td><td> github.com/Saehyung-Lee/cifar10_challenge</td></tr></table>
|
| 407 |
+
|
| 408 |
+
# A.3 MODEL ARCHITECTURES
|
| 409 |
+
|
| 410 |
+
We select some typical hand-crafted model architectures as the objects of study, involving DenseNet (Huang et al., 2017), GoogleNet (Szegedy et al., 2015), (PreAct) ResNet (He et al., 2016), SENet (Hu et al., 2018), WRN (Zagoruyko & Komodakis, 2016), DPN (Chen et al., 2017b), ResNeXt (Xie et al., 2017), and RegNetX (Radosavovic et al., 2020). The models are implemented by https://github.com/kuangliu/pytorch-cifar.
|
| 411 |
+
|
| 412 |
+
Table 12: Number of parameters for different model architectures.
|
| 413 |
+
|
| 414 |
+
<table><tr><td>Architecture</td><td># of param.</td><td>Architecture</td><td># of param.</td><td>Architecture</td><td># of param.</td></tr><tr><td>DenseNet-121</td><td>28.29 M</td><td>DPN26</td><td>46.47 M</td><td>GoogleNet</td><td>24.81 M</td></tr><tr><td>DenseNet-201</td><td>73.55 M</td><td>DPN92</td><td>137.50 M</td><td>ResNeXt-29</td><td>36.65 M</td></tr><tr><td>RegNetX (200MF)</td><td>9.42 M</td><td>ResNet-18</td><td>44.70 M</td><td>SENet-18</td><td>45.09 M</td></tr><tr><td>RegNetX (400MF)</td><td>19.34 M</td><td>ResNet-50</td><td>94.28 M</td><td>WRN-34-10</td><td>193.20 M</td></tr></table>
|
| 415 |
+
|
| 416 |
+
# A.4 INFERENCE-PHASE ADVERSARIAL DEFENSES
|
| 417 |
+
|
| 418 |
+
Except for enhancing the models in the training phase, there are other methods that intend to improve robustness in the inference phase. These attempts include performing local linear transformation like adding Gaussian noise (Tabacof & Valle, 2016), different operations of image processing (Guo et al., 2018; Xie et al., 2018; Raff et al., 2019) or specified inference principle (Pang et al., 2020b). On the other hand, detection-based methods aim to filter out adversarial examples and resort to higher-level intervention. Although detection is a suboptimal strategy compared to classification, it can avoid over-confident wrong decisions. These efforts include training auxiliary classifiers to detect adversarial inputs (Metzen et al., 2017), designing detection statistics (Feinman et al., 2017; Ma et al., 2018; Pang et al., 2018a), or basing on additional probabilistic models (Song et al., 2018b).
|
| 419 |
+
|
| 420 |
+
# A.5 CONCURRENT WORK
|
| 421 |
+
|
| 422 |
+
Gowal et al. (2020) also provide a comprehensive study on different training tricks of AT, and push forward the state-of-the-art performance of adversarially trained models on MNIST, CIFAR-10 and CIFAR-100. While they analyze some properties that we also analyze in this paper (such as training batch size, label smoothing, weight decay, activation functions), they also complement our analyses with experiments on, e.g., weight moving average and data quality. Both of our works reveal the importance of training details in the process of AT, and contribute to establishing more justified perspectives for evaluating AT methods.
|
| 423 |
+
|
| 424 |
+
# B ADDITIONAL RESULTS
|
| 425 |
+
|
| 426 |
+
In this section, we provide additional results to further support the conclusions in the main text.
|
| 427 |
+
|
| 428 |
+
# B.1 EARLY DECAYS LEARNING RATE
|
| 429 |
+
|
| 430 |
+
As shown in Fig. 1, smaller values of weight decay make the training faster but also more tend to overfit. So in Fig. 4, we early decay the learning rate at 40 and 45 epochs, rather than 100 and 105 epochs. We can see that the models can achieve the same clean accuracy, but the weight decay of $5 \times 1 0 ^ { - 4 }$ can still achieve better robustness. Besides, in Fig. 5, we use different values of weight decay for standard training, where the models can also achieve similar clean accuracy. These results demonstrate that adversarial robustness is a more difficult target than clean performance, and is more sensitive to the training hyperparameters, both for standardly and adversarially trained models.
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 4: Curves of test accuracy w.r.t. training epochs, where the model is WRN-34-10. Here we early decay the learning rate at 40 and 45 epochs for the cases of weight decay $1 \times 1 0 ^ { - 4 }$ and $2 \times 1 0 ^ { - 4 }$ , just before they overfitting. We can see that the models can achieve the same clean accuracy as weight decay $5 \times 1 0 ^ { - 4 }$ , but still worse robustness.
|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
Figure 5: Curves of test accuracy w.r.t. training epochs. The model architecture is WRN-34-10, and is standardly trained on CIFAR-10. We can observe that the final performance of each model is comparable, which means that clean accuracy is less sensitive to different values of weight decay. This observation also holds for the adversarially trained models as shown in Fig. 1.
|
| 437 |
+
|
| 438 |
+
# B.2 THE EFFECT OF SMOOTH ACTIVATION FUNCTION
|
| 439 |
+
|
| 440 |
+
In Table 13 we test the effect of Softplus and BN mode on ResNet-18.
|
| 441 |
+
|
| 442 |
+
Table 13: Test accuracy $( \% )$ of TRADES. We compare with the results in Table 6 to check the effect of smooth activation function on TRADES, as well as the compatibility of it with eval BN mode.
|
| 443 |
+
|
| 444 |
+
<table><tr><td colspan="7">Threat model: lo constraint,e=8/255</td></tr><tr><td>Architecture</td><td>Weight decay</td><td>BN mode</td><td>Activation</td><td>Clean</td><td>PGD-10</td><td>AA</td></tr><tr><td rowspan="4">ResNet-18</td><td>5×10-4</td><td>train</td><td>ReLU</td><td>80.23</td><td>53.60</td><td>48.96</td></tr><tr><td>5×10-4</td><td>train</td><td>Softplus</td><td>81.26</td><td>54.58</td><td>50.35</td></tr><tr><td>5×10-4</td><td>eval</td><td>ReLU</td><td>81.45</td><td>53.51</td><td>49.06</td></tr><tr><td>5×10-4</td><td>eval</td><td>Softplus</td><td>82.37</td><td>54.37</td><td>50.51</td></tr></table>
|
| 445 |
+
|
| 446 |
+
B.3 RESULTS OF EARLY STOPPING, WARMUP, AND OPTIMIZERS ON WRN-34-10
|
| 447 |
+
|
| 448 |
+
In Table 14 and Table 15, we provide the results on WRN-34-10.
|
| 449 |
+
|
| 450 |
+
Table 14: Test accuracy $( \% )$ under different early stopping and warmup on CIFAR-10. The model is WRN-34-10. For early stopping attack iterations, we denote, e.g., $4 0 / 7 0$ as the epochs to increase the tolerance step by one (Zhang et al., 2020). For warmup, the learning rate (l.r.) and the maximal perturbation (perturb.) linearly increase from zero to the preset value in the first $1 0 / 1 5 / 2 0$ epochs.
|
| 451 |
+
|
| 452 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Base</td><td colspan="3">Early stopping attack iter.</td><td colspan="3">Warmup on l.r.</td><td colspan="3">Warmup on perturb.</td></tr><tr><td>40 /70</td><td>40 /100</td><td>60 /100</td><td>10</td><td>15</td><td>20</td><td>10</td><td>15</td><td>20</td></tr><tr><td>Clean</td><td>86.07</td><td>88.29</td><td>88.25</td><td>88.81</td><td>86.35</td><td>86.63</td><td>86.41</td><td>86.66</td><td>86.43</td><td>86.73</td></tr><tr><td>PGD-10</td><td>56.60</td><td>56.06</td><td>55.49</td><td>56.41</td><td>56.31</td><td>56.60</td><td>56.28</td><td>56.25</td><td>56.37</td><td>55.65</td></tr><tr><td>AA</td><td>52.19</td><td>50.19</td><td>49.44</td><td>49.81</td><td>51.96</td><td>52.13</td><td>51.75</td><td>51.88</td><td>52.06</td><td>51.70</td></tr></table>
|
| 453 |
+
|
| 454 |
+
Table 15: Test accuracy $( \% )$ using different optimizers on CIFAR-10. The model is WRN-34-10. The initial learning rate for Adam and AdamW is 0.0001, while for other optimizers is 0.1.
|
| 455 |
+
|
| 456 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Mom</td><td rowspan=1 colspan=1>Nesterov</td><td rowspan=1 colspan=1>Adam</td><td rowspan=1 colspan=1>AdamW</td><td rowspan=1 colspan=1>SGD-GC</td><td rowspan=1 colspan=1>SGD-GCC</td></tr><tr><td rowspan=3 colspan=1>CleanPGD-10AA</td><td rowspan=1 colspan=1>86.07</td><td rowspan=1 colspan=1>86.80</td><td rowspan=1 colspan=1>81.00</td><td rowspan=1 colspan=1>80.72</td><td rowspan=1 colspan=1>86.70</td><td rowspan=2 colspan=1>86.6756.14</td></tr><tr><td rowspan=1 colspan=1>56.60</td><td rowspan=1 colspan=1>56.34</td><td rowspan=1 colspan=1>52.54</td><td rowspan=1 colspan=1>50.32</td><td rowspan=1 colspan=1>56.06</td></tr><tr><td rowspan=1 colspan=1>52.19</td><td rowspan=1 colspan=1>51.93</td><td rowspan=1 colspan=1>46.52</td><td rowspan=1 colspan=1>45.79</td><td rowspan=1 colspan=1>51.75</td><td rowspan=1 colspan=1>51.65</td></tr></table>
|
| 457 |
+
|
| 458 |
+
# B.4 RANK IN THE AUTOATTACK BENCHMARK
|
| 459 |
+
|
| 460 |
+
The models evaluated in this paper are all retrained based on the released codes (Zhang et al., 2019b; Rice et al., 2020). Now we compare our trained models with the AutoAttack public benchmark, where the results of previous work are based on the released pretrained models. In Table 16, we retrieve our results in Table 9 on the TRADES model where we simply change the weight decay from $2 \times 1 0 ^ { - 4 }$ to $5 \times 1 0 ^ { - 4 }$ . We can see that this seemingly unimportant difference sends the TRADES model back to the state-of-the-art position in the benchmark.
|
| 461 |
+
|
| 462 |
+
Table 16: We retrieve the results of top-rank methods from https://github.com/fra31/ auto-attack. All the methods listed below do not require additional training data on CIFAR-10. Here the model of Ours (TRADES) corresponds to lines of weight decay $5 \times \mathrm { \bar { 1 0 ^ { - 4 } } }$ , eval BN mode and ReLU activation in Table 9, which only differs from the original TRADES in weight decay. We run our methods 5 times with different random seeds, and report the mean and standard deviation.
|
| 463 |
+
|
| 464 |
+
<table><tr><td rowspan=1 colspan=6>Threat model: lo constraint, ∈ = 8/255</td></tr><tr><td rowspan=1 colspan=3>Method</td><td rowspan=1 colspan=1>Architecture</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>AA</td></tr><tr><td rowspan=1 colspan=3>Ours (TRADES)</td><td rowspan=1 colspan=1>WRN-34-20</td><td rowspan=1 colspan=1>86.43</td><td rowspan=7 colspan=1>54.3953.94 ± 0.1053.7453.5153.4252.84</td></tr><tr><td rowspan=2 colspan=2>Ours (TRADES)</td><td rowspan=1 colspan=1></td><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1>WRN-34-10</td><td rowspan=2 colspan=1>85.49 ± 0.24</td></tr><tr><td rowspan=1 colspan=1></td><td></td></tr><tr><td rowspan=2 colspan=2>Pang et al. (2020c)</td><td rowspan=1 colspan=1></td><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1>WRN-34-20</td><td rowspan=2 colspan=1>85.14</td></tr><tr><td rowspan=1 colspan=1>)</td><td></td></tr><tr><td rowspan=2 colspan=3>Zhang et al. (2020)Rice et al. (2020)Qin et al. (2019)</td><td rowspan=1 colspan=1>WRN-34-10</td><td rowspan=1 colspan=1>84.52</td><td rowspan=1 colspan=1>84.52</td></tr><tr><td rowspan=1 colspan=1>WRN-34-20WRN-40-8</td><td rowspan=1 colspan=1>85.3486.28</td></tr><tr><td rowspan=1 colspan=5>Threat model: looconstraint, e = 0.031</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=3>Method</td><td rowspan=1 colspan=1>Architecture</td><td rowspan=1 colspan=1>Clean</td><td rowspan=1 colspan=1>AA</td></tr><tr><td rowspan=1 colspan=3>Ours (TRADES)Huang et al. (2020)Zhang et al. (2019b)</td><td rowspan=1 colspan=1>WRN-34-10WRN-34-10WRN-34-10</td><td rowspan=1 colspan=1>85.45 ± 0.0983.4884.92</td><td rowspan=1 colspan=1>54.28 ± 0.2453.3453.08</td></tr></table>
|
| 465 |
+
|
| 466 |
+
# B.5 MORE EVALUATIONS ON LABEL SMOOTHING
|
| 467 |
+
|
| 468 |
+
In Table 17 we further investigate the effect of label smoothing on adversarial training.
|
| 469 |
+
|
| 470 |
+
Table 17: Test accuracy $( \% )$ ) under different label smoothing on CIFAR-10. The model is ResNet18 trained by PGD-AT. We evaluate under PGD-1000 with different number of restarts and step sizes. Here we use the cross-entropy (CE) objective and C&W objective (Carlini & Wagner, 2017a), respectively. We also evaluate under the SPSA attack (Uesato et al., 2018) for 10, 000 iteration steps, with batch size 128, perturbation size 0.001 and learning rate of $1 / 2 5 5$ .
|
| 471 |
+
|
| 472 |
+
<table><tr><td rowspan=1 colspan=4>Evaluation method</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=4>Label smoothing</td></tr><tr><td rowspan=1 colspan=2>Attack</td><td rowspan=1 colspan=1>Restart</td><td rowspan=1 colspan=1>Step size</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.4</td></tr><tr><td rowspan=4 colspan=2>PGD-1000(CE objective)</td><td rowspan=2 colspan=1>15</td><td rowspan=1 colspan=1>2/255</td><td rowspan=1 colspan=1>52.45</td><td rowspan=1 colspan=1>52.95</td><td rowspan=1 colspan=1>53.08</td><td rowspan=1 colspan=1>53.10</td><td rowspan=1 colspan=1>53.14</td></tr><tr><td rowspan=3 colspan=1>51010</td><td rowspan=3 colspan=1>2/2552/2550.5/255</td><td rowspan=1 colspan=1>52.41</td><td rowspan=1 colspan=1>52.89</td><td rowspan=1 colspan=1>53.01</td><td rowspan=1 colspan=1>53.04</td><td rowspan=1 colspan=1>53.03</td></tr><tr><td rowspan=1 colspan=1>52.31</td><td rowspan=1 colspan=1>52.85</td><td rowspan=1 colspan=1>52.92</td><td rowspan=1 colspan=1>53.02</td><td rowspan=1 colspan=1>52.96</td></tr><tr><td rowspan=1 colspan=1>52.63</td><td rowspan=1 colspan=1>52.94</td><td rowspan=1 colspan=1>53.33</td><td rowspan=1 colspan=1>53.30</td><td rowspan=1 colspan=1>53.25</td></tr><tr><td rowspan=4 colspan=2>PGD-1000(C&W objective)</td><td rowspan=3 colspan=1>1510</td><td rowspan=3 colspan=1>2/2552/2552/255</td><td rowspan=1 colspan=1>50.64</td><td rowspan=1 colspan=1>50.76</td><td rowspan=1 colspan=1>51.07</td><td rowspan=1 colspan=1>50.96</td><td rowspan=1 colspan=1>50.54</td></tr><tr><td rowspan=1 colspan=1>50.58</td><td rowspan=1 colspan=1>50.66</td><td rowspan=1 colspan=1>50.93</td><td rowspan=1 colspan=1>50.86</td><td rowspan=1 colspan=1>50.44</td></tr><tr><td rowspan=1 colspan=1>)</td><td rowspan=1 colspan=1>50.55</td><td rowspan=1 colspan=1>50.59</td><td rowspan=1 colspan=1>50.90</td><td rowspan=1 colspan=1>50.85</td><td rowspan=1 colspan=1>50.44</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>0.5/255</td><td rowspan=1 colspan=1>50.63</td><td rowspan=1 colspan=1>50.73</td><td rowspan=1 colspan=1>51.03</td><td rowspan=1 colspan=1>51.04</td><td rowspan=1 colspan=1>50.52</td></tr><tr><td rowspan=1 colspan=2>SPSA-10000</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1/255</td><td rowspan=1 colspan=1>61.69</td><td rowspan=1 colspan=1>61.92</td><td rowspan=1 colspan=1>61.93</td><td rowspan=1 colspan=1>61.79</td><td rowspan=1 colspan=1>61.53</td></tr></table>
|
md/train/dx11_7vm5_r/dx11_7vm5_r.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/fSTD6NFIW_b/fSTD6NFIW_b.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/hl3v8io3ZYt/hl3v8io3ZYt.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Associating Objects with Transformers for Video Object Segmentation
|
| 2 |
+
|
| 3 |
+
Zongxin Yang1,2, Yunchao Wei3,4, Yi Yang1
|
| 4 |
+
|
| 5 |
+
1 CCAI, College of Computer Science and Technology, Zhejiang University 2 Baidu Research 3 Institute of Information Science, Beijing Jiaotong University 4 Beijing Key Laboratory of Advanced Information Science and Network {zongxinyang1996, wychao1987, yee.i.yang}@gmail.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
This paper investigates how to realize better and more efficient embedding learning to tackle the semi-supervised video object segmentation under challenging multi-object scenarios. The state-of-the-art methods learn to decode features with a single positive object and thus have to match and segment each target separately under multi-object scenarios, consuming multiple times computing resources. To solve the problem, we propose an Associating Objects with Transformers (AOT) approach to match and decode multiple objects uniformly. In detail, AOT employs an identification mechanism to associate multiple targets into the same high-dimensional embedding space. Thus, we can simultaneously process multiple objects’ matching and segmentation decoding as efficiently as processing a single object. For sufficiently modeling multi-object association, a Long Short-Term Transformer is designed for constructing hierarchical matching and propagation. We conduct extensive experiments on both multi-object and single-object benchmarks to examine AOT variant networks with different complexities. Particularly, our R50-AOT-L outperforms all the state-of-the-art competitors on three popular benchmarks, i.e., YouTube-VOS $( 8 4 . 1 \% ~ \mathcal { I } \& \mathcal { F } )$ , DAVIS 2017 $( 8 4 . 9 \% )$ , and DAVIS 2016 $( 9 1 . 1 \% )$ , while keeping more than $3 \times$ faster multi-object run-time. Meanwhile, our AOT-T can maintain real-time multi-object speed on the above benchmarks. Based on AOT, we ranked $\mathbf { 1 ^ { s t } }$ in the 3rd Large-scale VOS Challenge.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Video Object Segmentation (VOS) is a fundamental task in video understanding with many potential applications, including augmented reality [25] and self-driving cars [52]. The goal of semi-supervised VOS, the main task in this paper, is to track and segment object(s) across an entire video sequence based on the object mask(s) given at the first frame.
|
| 14 |
+
|
| 15 |
+
Thanks to the recent advance of deep neural networks, many deep learning based VOS algorithms have been proposed recently and achieved promising performance. STM [26] and its following works [34, 23] leverage a memory network to store and read the target features of predicted past frames and apply a non-local attention mechanism to match the target in the current frame. FEELVOS [41] and CFBI [50, 51] utilize global and local matching mechanisms to match target pixels or patches from both the first and the previous frames to the current frame.
|
| 16 |
+
|
| 17 |
+
Even though the above methods have achieved significant progress, the above methods learn to decode scene features that contain a single positive object. Thus under a multi-object scenario, they have to match each object independently and ensemble all the single-object predictions into a multi-object segmentation, as shown in Fig. 1a. Such a post-ensemble manner eases network architectures’ design since the networks are not required to adapt the parameters or structures for different object numbers. However, modeling multiple objects independently, instead of uniformly, is inefficient in exploring multi-object contextual information to learn a more robust feature representation for VOS. In addition, processing multiple objects separately yet in parallel requires multiple times the amount of GPU memory and computation for processing a single object. This problem restricts the training and application of VOS under multi-object scenarios, especially when computing resources are limited.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: VOS methods (e.g., [50, 34]) process multi-object scenarios in a post-ensemble manner (a). In contrast, our AOT associates all the objects uniformly (b), leading to better efficiency (c).
|
| 21 |
+
|
| 22 |
+
To solve the problem, Fig. 1b demonstrates a feasible approach to associate and decode multiple objects uniformly in an end-to-end framework. Hence, we propose an Associating Objects with Transformers (AOT) approach to match and decode multiple targets uniformly. First, an identification mechanism is proposed to assign each target a unique identity and embed multiple targets into the same feature space. Hence, the network can learn the association or correlation among all the targets. Moreover, the multi-object segmentation can be directly decoded by utilizing assigned identity information. Second, a Long Short-Term Transformer (LSTT) is designed for constructing hierarchical object matching and propagation. Each LSTT block utilizes a long-term attention for matching with the first frame’s embedding and a short-term attention for matching with several nearby frames’ embeddings. Compared to the methods [26, 34] utilizing only one attention layer, we found hierarchical attention structures are more effective in associating multiple objects.
|
| 23 |
+
|
| 24 |
+
We conduct extensive experiments on two popular multi-object benchmarks for VOS, i.e., YouTubeVOS [48] and DAVIS 2017 [31], to validate the effectiveness and efficiency of the proposed AOT. Even using the light-weight Mobilenet-V2 [33] as the backbone encoder, the AOT variant networks achieve superior performance on the validation 2018 & 2019 splits of the large-scale YouTube-VOS (ours, $\mathcal { T } \& \mathcal { F } 8 2 . 6 \sim 8 4 . 5 \%$ & $8 2 . 2 \sim 8 4 . 5 \%$ while keeping more than $\mathbf { 2 \times }$ faster multi-object run-time $( \mathbf { 2 7 . 1 } \sim \mathbf { 9 . 3 F P S }$ ) compared to the state-of-the-art competitors (e.g., CFBI [50], $8 1 . 4 \%$ & $8 1 . 0 \%$ , 3.4FPS). We also achieve new state-of-the-art performance on both the DAVIS-2017 validation $( 8 5 . 4 \% )$ and testing $( 8 1 . 2 \% )$ splits. Moreover, AOT is effective under single-object scenarios as well and outperforms previous methods on DAVIS 2016 [30] $( 9 2 . 0 \% )$ , a popular single-object benchmark. Besides, our smallest variant, AOT-T, can maintain real-time multi-object speed on all above benchmarks (51.4FPS on $4 8 0 \mathrm { p }$ videos). Particularly, AOT ranked $\mathbf { 1 ^ { s t } }$ in the Track 1 (Video Object Segmentation) of the 3rd Large-scale Video Object Segmentation Challenge.
|
| 25 |
+
|
| 26 |
+
Overall, our contributions are summarized as follows:
|
| 27 |
+
|
| 28 |
+
• We propose an identification mechanism to associate and decode multiple targets uniformly for VOS. For the first time, multi-object training and inference can be efficient as single-object ones, as demonstrated in Fig. 1c. • Based on the identification mechanism, we design a new efficient VOS framework, i.e., Long ShortTerm Transformer (LSTT), for constructing hierarchical multi-object matching and propagation. LSTT achieves superior performance on VOS benchmarks [48, 31, 30] while maintaining better efficiency than previous state-of-the-art methods. To the best of our knowledge, LSTT is the first hierarchical framework for object matching and propagation by applying transformers [39] to VOS.
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
Semi-supervised Video Object Segmentation. Given one or more annotated frames (the first frame in general), semi-supervised VOS methods propagate the manual labeling to the entire video sequence. Traditional methods often solve an optimization problem with an energy defined over a graph structure [4, 40, 2]. In recent years, VOS methods have been mainly developed based on deep neural networks (DNN), leading to better results.
|
| 33 |
+
|
| 34 |
+
Early DNN methods rely on fine-tuning the networks at test time to make segmentation networks focus on a specific object. Among them, OSVOS [7] and MoNet [47] fine-tune pre-trained networks on the first-frame ground-truth at test time. OnAVOS [42] extends the first-frame fine-tuning by introducing an online adaptation mechanism. Following these approaches, MaskTrack [29] and PReM [24] utilize optical flow to help propagate the segmentation mask from one frame to the next. Despite achieving promising results, the test-time fine-tuning restricts the network efficiency.
|
| 35 |
+
|
| 36 |
+
Recent works aim to achieve a better run-time and avoid using online fine-tuning. OSMN [49] employs one convolutional network to extract object embedding and another one to guide segmentation predictions. PML [9] learns pixel-wise embedding with a nearest neighbor classifier, and VideoMatch [18] uses a soft matching layer that maps the pixels of the current frame to the first frame in a learned embedding space. Following PML and VideoMatch, FEELVOS [41] and CFBI [50, 51] extend the pixel-level matching mechanism by additionally matching between the current frame and the previous frame. RGMP [46] also gathers guidance information from both the first frame and the previous frame but uses a siamese encoder with two shared streams. STM [26] and its following works (e.g., EGMN [23] and KMN [34]) leverage a memory network to embed past-frame predictions into memory and apply a non-local attention mechanism on the memory to decode the segmentation of the current frame. SST [13] utilizes attention mechanisms in a different way, i.e., transformer blocks [39] are used to extract pixel-level affinity maps and spatial-temporal features. The features are target-agnostic, instead of target-aware like our LSTT, since the mask information in past frames is not propagated and aggregated in the blocks. Instead of using matching mechanisms, LWL [6] proposes to use an online few-shot learner to learn to decode object segmentation.
|
| 37 |
+
|
| 38 |
+
The above methods learn to decode features with a single positive object and thus have to match and segment each target separately under multi-object scenarios, consuming multiple times computing resources of single-object cases. The problem restricts the application and development of the VOS with multiple targets. Hence, we propose our AOT to associate and decode multiple targets uniformly and simultaneously, as efficiently as processing a single object.
|
| 39 |
+
|
| 40 |
+
Visual Transformers. Transformers [39] was proposed to build hierarchical attention-based networks for machine translation. Similar to Non-local Neural Networks [43], transformer blocks compute correlation with all the input elements and aggregate their information by using attention mechanisms [5]. Compared to RNNs, transformer networks model global correlation or attention in parallel, leading to better memory efficiency, and thus have been widely used in natural language processing (NLP) tasks [11, 32, 37]. Recently, transformer blocks were introduced to many computer vision tasks, such as image classification [12, 38, 22], object detection [8]/segmentation [44], and image generation [27], and have shown promising performance compared to CNN-based networks.
|
| 41 |
+
|
| 42 |
+
Many VOS methods [19, 26, 23, 34] have utilized attention mechanisms to match the object features and propagate the segmentation mask from past frames to the current frames. Nevertheless, these methods consider only one positive target in the attention processes, and how to build hierarchical attention-based propagation has been rarely studied. In this paper, we carefully design a long shortterm transformer block, which can effectively construct multi-object matching and propagation within hierarchical structures for VOS.
|
| 43 |
+
|
| 44 |
+
# 3 Revisit Previous Solutions for Video Object Segmentation
|
| 45 |
+
|
| 46 |
+
In VOS, many common video scenarios have multiple targets or objects required for tracking and segmenting. Benefit from deep networks, current state-of-the-art VOS methods [26, 50] have achieved promising performance. Nevertheless, these methods focus on matching and decoding a single object. Under a multi-object scenario, they thus have to match each object independently and ensemble all the single-object predictions into a multi-object prediction, as demonstrated in Fig. 1a. Let $F ^ { \mathcal { N } }$ denotes a VOS network for predicting single-object segmentation, and $A$ is an ensemble function such as sof tmax or the soft aggregation [26], the formula of such a post-ensemble manner for processing $N$ objects is like,
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
Y ^ { \prime } = A ( F ^ { \mathcal { N } } ( I ^ { t } , I ^ { \mathbf { m } } , Y _ { 1 } ^ { \mathbf { m } } ) , . . . , F ^ { \mathcal { N } } ( I ^ { t } , I ^ { \mathbf { m } } , Y _ { N } ^ { \mathbf { m } } ) ) ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: (a) The overview of our Associating Objects with Transformers (AOT). The multi-object masks are embedded by using our Identification mechanism. Moreover, a $L$ -layer Long ShortTerm Transformer is responsible for matching multiple objects uniformly and hierarchically. (b) An illustration of the IDentity assignment (ID) designed for transferring a $N .$ -object mask into an identification embedding. (c) The structure of an LSTT block. LN: layer normalization [3].
|
| 54 |
+
|
| 55 |
+
where $I ^ { t }$ and $I ^ { \mathbf { m } }$ denote the image of the current frame and memory frames respectively, and $\{ Y _ { 1 } ^ { \mathbf { m } } , . . . , Y _ { N } ^ { \mathbf { m } } \}$ are the memory masks (containing the given reference mask and past predicted masks) of all the $N$ objects. This manner extends networks designed for single-object VOS into multi-object applications, so there is no need to adapt the network for different object numbers.
|
| 56 |
+
|
| 57 |
+
Although the above post-ensemble manner is prevalent and straightforward in the VOS field, processing multiple objects separately yet in parallel requires multiple times the amount of GPU memory and computation for matching a single object and decoding the segmentation. This problem restricts the training and application of VOS under multi-object scenarios when computing resources are limited. To make the multi-object training and inference as efficient as single-object ones, an expected solution should be capable of associating and decoding multiple objects uniformly instead of individually. To achieve such an objective, we propose an identification mechanism to embed the masks of any number (required to be smaller than a pre-defined large number) of targets into the same high-dimensional space. Based on the identification mechanism, a novel and efficient framework, i.e., Associating Objects with Transformers (AOT), is designed for propagating all the object embeddings uniformly and hierarchically, from memory frames to the current frame.
|
| 58 |
+
|
| 59 |
+
As shown in Fig. 1b, our AOT associates and segments multiple objects within an end-to-end framework. For the first time, processing multiple objects can be as efficient as processing a single object (Fig. 1c). Compared to previous methods, our training under multi-object scenarios is also more efficient since AOT can associate multiple object regions and learn contrastive feature embeddings among them uniformly.
|
| 60 |
+
|
| 61 |
+
# 4 Associating Objects with Transformers
|
| 62 |
+
|
| 63 |
+
In this section, we introduce our identification mechanism proposed for efficient multi-object VOS. Then, we design a new VOS framework, i.e., long short-term transformer, based on the identification mechanism for constructing hierarchical multi-object matching and propagation.
|
| 64 |
+
|
| 65 |
+
# 4.1 Identification Mechanism for Multi-object Association
|
| 66 |
+
|
| 67 |
+
Many recent VOS methods [26, 23, 34] utilized attention mechanisms and achieved promising results. To formulate, we define $Q \in \mathbb { R } ^ { H W \times C }$ , $K \in \mathbb { R } ^ { T H W \times C }$ , and $V \in \mathbb { R } ^ { T H W \times C }$ as the query embedding of the current frame, the key embedding of the memory frames, and the value embedding of the memory frames respectively, where $T$ , $H$ , $W$ , $C$ denote the temporal, height, width, and channel dimensions. The formula of a common attention-based matching and propagation is,
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
A t t ( Q , K , V ) = C o r r ( Q , K ) V = s o f t m a x ( \frac { Q K ^ { t r } } { \sqrt { C } } ) V ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where a matching map is calculated by the correlation function Corr, and then the value embedding, $V$ , will be propagated into each location of the current frame.
|
| 74 |
+
|
| 75 |
+
In the common single-object propagation [26], the binary mask information in memory frames is embedded into $V$ with an additional memory encoder network and thus can also be propagated to the current frame by using Eq. 2. A convolutional decoder network following the propagated feature will decode the aggregated feature and predict the single-object probability logit of the current frame.
|
| 76 |
+
|
| 77 |
+
The main problem of propagating and decoding multi-object mask information in an end-to-end network is how to adapt the network to different target numbers. To overcome this problem, we propose an identification mechanism consisting of identification embedding and decoding based on attention mechanisms.
|
| 78 |
+
|
| 79 |
+
First, an Identification Embedding mechanism is proposed to embed the masks of multiple different targets into the same feature space for propagation. As seen in Fig. 2b, we initialize an identity bank, $D \in \mathbb { R } ^ { M \times C }$ , where $M$ identification vectors with $C$ dimensions are stored. For embedding multiple different target masks, each target will be randomly assigned a different identification vector. Assuming $N$ $N < M )$ targets are in the video scenery, the formula of embedding the targets’ one-hot mask, $\bar { Y } \in \{ 0 , 1 \} ^ { T H W \times N }$ , into a identification embedding, $E \in \mathbb { R } ^ { T H W \times C }$ , by randomly assigning identification vector from the bank $D$ is,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
E = I D ( Y , D ) = Y P D ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $P \in \{ 0 , 1 \} ^ { N \times M }$ is a random permutation matrix, satisfying that $P ^ { t r } P$ is equal to a $M \times M$ unit matrix, for randomly selecting $N$ identification embeddings. After the $I D$ assignment, different target has different identification embedding, and thus we can propagate all the target identification information from memory frames to the current frame by attaching the identification embedding $E$ with the attention value $V$ , i.e.,
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
V ^ { \prime } = A t t I D ( Q , K , V , Y | D ) = A t t ( Q , K , V + I D ( Y , D ) ) = A t t ( Q , K , V + E ) ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $V ^ { \prime } \in \mathbb { R } ^ { H W \times C }$ aggregates all the multiple targets’ embeddings from the propagation.
|
| 92 |
+
|
| 93 |
+
For Identification Decoding, i.e., predicting all the targets’ probabilities from the aggregated feature $V ^ { \prime }$ , we firstly predict the probability logit for every identity in the bank $D$ by employing a convolutional decoding network $\hat { F } ^ { \mathcal { D } }$ , and then select the assigned ones and calculate the probabilities, i.e.,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
Y ^ { \prime } = s o f t m a x ( P F ^ { \mathcal { D } } ( V ^ { \prime } ) ) = s o f t m a x ( P L ^ { D } ) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $L ^ { D } \in \mathbb { R } ^ { H W \times M }$ is all the $M$ identities’ probability logits, $P$ is the same as the selecting matrix used in the identity assignment (Eq. 3), and $\begin{array} { r } { Y ^ { \dot { \prime } } \in [ 0 , 1 ] ^ { \check { H } W \times N } } \end{array}$ is the probability prediction of all the $N$ targets.
|
| 100 |
+
|
| 101 |
+
For training, common multi-class segmentation losses, such as cross-entropy loss, can be used to optimize the multi-object $Y ^ { \prime }$ regarding the ground-truth labels. The identity bank $D$ is trainable and randomly initialized at the training beginning. To ensure that all the identification vectors have the same opportunity to compete with each other, we randomly reinitialize the identification selecting matrix $P$ in each video sample and each optimization iteration.
|
| 102 |
+
|
| 103 |
+
# 4.2 Long Short-Term Transformer for Hierarchical Matching and Propagation
|
| 104 |
+
|
| 105 |
+
Previous methods [26, 34] always utilize only one layer of attention (Eq. 2) to aggregate singleobject information. In our identification-based multi-object pipeline, we found that a single attention layer cannot fully model multi-object association, which naturally should be more complicated than single-object processes. Thus, we consider constructing hierarchical matching and propagation by using a series of attention layers. Recently, transformer blocks [39] have been demonstrated to be stable and promising in constructing hierarchical attention structures in visual tasks [8, 12]. Based on transformer blocks, we carefully design a Long Short-Term Transformer (LSTT) block for multi-object VOS.
|
| 106 |
+
|
| 107 |
+
Following the common transformer blocks [39, 11], LSTT firstly employs a self-attention layer, which is responsible for learning the association or correlation among the targets within the current frame. Then, LSTT additionally introduces a long-term attention, for aggregating targets’ information from long-term memory frames and a short-term attention, for learning temporal smoothness from nearby short-term frames. The final module is based on a common 2-layer feed-forward MLP with
|
| 108 |
+
|
| 109 |
+
GELU [17] non-linearity in between. Fig. 2c shows the structure of an LSTT block. Notably, all these attention modules are implemented in the form of the multi-head attention [39], i.e., multiple attention modules followed by concatenation and a linear projection. Nevertheless, we only introduce their single-head formulas below for the sake of simplicity.
|
| 110 |
+
|
| 111 |
+
Long-Term Attention is responsible for aggregating targets’ information from past memory frames, which contains the reference frame and stored predicted frames, to the current frame. Since the time intervals between the current frame and past frames are variable and can be long-term, the temporal smoothness is difficult to guarantee. Thus, the long-term attention employs non-local attention like Eq. 2. Let $X _ { l } ^ { t } \in \mathbb { R } ^ { H W \times \mathbf { \breve { C } } }$ denotes the input feature embedding at time $t$ and in block $l$ , where $l \in \{ 1 , . . . , L \}$ is the block index of LSTT, the formula of the long-term attention is,
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
A t t L T ( X _ { l } ^ { t } , X _ { l } ^ { \mathbf { m } } , Y ^ { \mathbf { m } } ) = A t t I D ( X _ { l } ^ { t } W _ { l } ^ { K } , X _ { l } ^ { \mathbf { m } } W _ { l } ^ { K } , X _ { l } ^ { \mathbf { m } } W _ { l } ^ { V } , Y ^ { \mathbf { m } } | D ) ,
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $X _ { l } ^ { \mathbf { m } } = C o n c a t ( X _ { l } ^ { m _ { 1 } } , . . . , X _ { l } ^ { m _ { T } } )$ and $Y ^ { \mathbf { m } } = { C o n c a t } ( Y ^ { m _ { 1 } } , . . . , Y ^ { m _ { T } } )$ are the input feature embeddings and target masks of memory frames with indices $\mathbf { m } = \{ m _ { 1 } , . . . , m _ { T } \}$ . Besides, $W _ { l } ^ { K } \in$ $\mathbb { R } ^ { C \times C _ { k } }$ and $W _ { l } ^ { V } \in \mathbb { R } ^ { C \times C _ { v } }$ are trainable parameters of the space projections for matching and propagation, respectively. Instead of using different projections for ${ \bar { X } } _ { l } ^ { t }$ and $X _ { l } ^ { \mathbf { m } }$ , we found the training of LSTT is more stable with a siamese-like matching, $i . e .$ , matching between the features within the same embedding space $\mathit { l }$ -th features with the same projection of $\breve { W } _ { l } ^ { K }$ ).
|
| 118 |
+
|
| 119 |
+
Short-Term Attention is employed for aggregating information in a spatial-temporal neighbourhood for each current-frame location. Intuitively, the image changes across several contiguous video frames are always smooth and continuous. Thus, the target matching and propagation in contiguous frames can be restricted in a small spatial-temporal neighborhood, leading to better efficiency than non-local processes. Considering $n$ neighbouring frames with indices $\mathbf { n } = \{ t - 1 , . . . , t - n \}$ are in the spatialtemporal neighbourhood, the features and masks of these frames are $X _ { l } ^ { \mathbf { n } } = C o n c a t ( X _ { l } ^ { t - 1 } , . . . , X _ { l } ^ { t - n } )$ and $Y ^ { \mathbf { n } } = C o n c a t ( Y ^ { t - 1 } , . . . , Y ^ { t - n } )$ , and then the formula of the short-term attention at each spatial location $p$ is,
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
A t t S T ( X _ { l } ^ { t } , X _ { l } ^ { { \bf n } } , Y ^ { { \bf n } } | p ) = A t t L T ( X _ { l , p } ^ { t } , X _ { l , N ( p ) } ^ { { \bf n } } , Y _ { l , N ( p ) } ^ { { \bf n } } ) ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $X _ { l , p } ^ { t } \in \mathbb { R } ^ { 1 \times C }$ is the feature of $X _ { l } ^ { t }$ at location $p , { \mathcal { N } } ( p )$ is a $\lambda \times \lambda$ spatial neighbourhood l,p centered at location $p$ , and thus $X _ { l , N ( p ) } ^ { \mathbf { n } }$ land $Y _ { l , \mathcal { N } ( p ) } ^ { \mathbf { n } }$ are the features and masks of the spatial-temporal neighbourhood, respectively, with a shape of $n \lambda ^ { 2 } \times C$ or $n \lambda ^ { 2 } \times N$ .
|
| 126 |
+
|
| 127 |
+
When extracting features of the first frame $t = 1$ , there is no memory frames or previous frames, and hence we use $\bar { X } _ { l } ^ { 1 }$ to replace $X _ { l } ^ { \mathbf { m } }$ and $X _ { l } ^ { \mathbf { n } }$ . In other words, the long-term attention and the short-term attention are changed into self-attentions without adjusting the network structures and parameters.
|
| 128 |
+
|
| 129 |
+
# 5 Implementation Details
|
| 130 |
+
|
| 131 |
+
Network Details: For sufficiently validating the effectiveness of our identification mechanism and LSTT, we mainly use light-weight backbone encoder, MobileNet-V2 [33], and decoder, FPN [20] with Group Normalization [45]. The spatial neighborhood size $\lambda$ is set to 15, and the number of identification vectors, $M$ , is set to 10, which is consistent with the maximum object number in the benchmarks [48, 31]. AOT performs well with PaddlePaddle [1] and PyTorch [28]. More details can be found in the supplementary material.
|
| 132 |
+
|
| 133 |
+
Architecture Variants: We build several AOT variant networks with different LSTT layer number $L$ or long-term memory size m. The hyper-parameters of these variants are: (1) AOT-Tiny: $L = 1$ , $\mathbf { m } = \bar { \{ 1 \} }$ ; (2) AOT-Small: $L = 2$ , $\mathbf { m } = \{ 1 \}$ ; (3) AOT-Base: $L = 3$ , $\mathbf { m } = \{ 1 \}$ ; (4) AOT-Large: $L = 3$ , $\begin{array} { r } { \dot { \mathbf { m } } = \{ 1 , 1 + \delta , 1 + 2 \delta , 1 + 3 \delta , . . . \} . } \end{array}$ . In the experiments, we also equip AOT-L with ResNet50 (R50) [16] or Swin-B [22].
|
| 134 |
+
|
| 135 |
+
AOT-S is a small model with only 2 layers of LSTT block. Compared to AOT-S, AOT-T utilizes only 1 layer of LSTT, and AOT- $\mathbf { B } / \mathbf { L }$ uses 3 layers. In AOT-T/S/B, only the first frame is considered into long-term memory, which is similar to [41, 50], leading to a smooth efficiency. In AOT-L, the predicted frames are stored into long-term memory per $\delta$ frames, following the memory reading strategy [26]. We set $\delta$ to 2/5 for training/testing.
|
| 136 |
+
|
| 137 |
+
Training Details: Following [46, 26, 23, 34], the training stage is divided into two phases: (1) pre-training on sythetic video sequence generated from static image datasets [14, 21, 10, 36, 15] by randomly applying multiple image augmentations [46]. (2) main training on the VOS benchmarks [48, 31] by randomly applying video augmentations [50]. More details are in the supplementary material.
|
| 138 |
+
|
| 139 |
+
Table 1: The quantitative evaluation on multi-object benchmarks, YouTube-VOS [48] and DAVIS 2017 [31]. Y: using YouTube-VOS for training. ∗: using 600p instead of 480p videos in inference. $^ \ddag$ : timing extrapolated from single-object speed assuming linear scaling in the number of objects.
|
| 140 |
+
|
| 141 |
+
<table><tr><td colspan="7">(a) YouTube-VOS</td><td colspan="5">(b) DAVIS 2017</td></tr><tr><td></td><td></td><td colspan="2">Seen</td><td colspan="3">Unseen</td><td>Methods</td><td>J&F</td><td>J</td><td>F</td><td>FPS</td></tr><tr><td>Methods</td><td>J&F</td><td>J</td><td>F</td><td>J</td><td>F</td><td>FPS</td><td colspan="3">Validation2017 Split</td><td></td><td></td></tr><tr><td colspan="3">Validation 2018 Split</td><td></td><td></td><td></td><td></td><td>CFBI [50] (Y)</td><td>81.9</td><td>79.3</td><td>84.5</td><td>5.9</td></tr><tr><td>STM[ICCV19] [26]</td><td>79.4</td><td>79.7</td><td>84.2</td><td>72.8</td><td>80.9</td><td>-</td><td>SST[13](Y)</td><td>82.5</td><td>79.9</td><td>85.1</td><td>1</td></tr><tr><td>KMN[ECCV20] [34]</td><td>81.4</td><td>81.4</td><td>85.6</td><td>75.3</td><td>83.3</td><td></td><td>KMN [34]</td><td>76.0</td><td>74.2</td><td>77.8</td><td>4.2t</td></tr><tr><td>CFBI[ECCV20] [50]</td><td>81.4</td><td>81.1</td><td>85.8</td><td>75.3</td><td>83.4</td><td>3.4</td><td>KMN [34] (Y)</td><td>82.8</td><td>80.0</td><td>85.6</td><td>4.2</td></tr><tr><td>LWL[ECCV20] [6]</td><td>81.5</td><td>80.4</td><td>84.9</td><td>76.4</td><td>84.4</td><td>1</td><td>CFBI+ [51] (Y)</td><td>82.9</td><td>80.1</td><td>85.7</td><td>5.6</td></tr><tr><td>SST[CVPR21] [13]</td><td>81.7</td><td>81.2</td><td>1</td><td>76.0</td><td>1</td><td>1</td><td>AOT-T (Y)</td><td>79.9</td><td>77.4</td><td>82.3</td><td>51.4</td></tr><tr><td>CFBI+[TPAMI21] [51]</td><td>82.8</td><td>81.8</td><td>86.6</td><td>77.1</td><td>85.6</td><td>4.0</td><td>AOT-S</td><td>79.2</td><td>76.4</td><td>82.0</td><td>40.0</td></tr><tr><td>AOT-T</td><td>80.2</td><td>80.1</td><td>84.5</td><td>74.0</td><td>82.2</td><td>41.0</td><td>AOT-S (Y)</td><td>81.3</td><td>78.7</td><td>83.9</td><td>40.0</td></tr><tr><td>AOT-S</td><td>82.6</td><td>82.0</td><td>86.7</td><td>76.6</td><td>85.0</td><td>27.1</td><td>AOT-B (Y)</td><td>82.5</td><td>79.7</td><td>85.2</td><td>29.6</td></tr><tr><td>AOT-B</td><td>83.5</td><td>82.6</td><td>87.5</td><td>77.7</td><td>86.0</td><td>20.5</td><td>AOT-L (Y)</td><td>83.8</td><td>81.1</td><td>86.4</td><td>18.7</td></tr><tr><td>AOT-L</td><td>83.8</td><td>82.9</td><td>87.9</td><td>77.7</td><td>86.5</td><td>16.0</td><td>R50-AOT-L (Y)</td><td>84.9</td><td>82.3</td><td>87.5</td><td>18.0</td></tr><tr><td>R50-AOT-L</td><td>84.1</td><td>83.7</td><td>88.5</td><td>78.1</td><td>86.1</td><td>14.9</td><td>SwinB-AOT-L (Y)</td><td>85.4</td><td>82.4</td><td>88.4</td><td>12.1</td></tr><tr><td>SwinB-AOT-L</td><td>84.5</td><td>84.3</td><td>89.3</td><td>77.9</td><td>86.4</td><td>9.3</td><td>Testing 2017 Split</td><td></td><td></td><td></td><td></td></tr><tr><td colspan="5">Validation 2019 Split</td><td></td><td colspan="5">71.4 78.7</td></tr><tr><td>CFBI[ECCV20] [50]</td><td>81.0</td><td>80.6</td><td>85.1</td><td>75.2</td><td>83.0</td><td>3.4</td><td>CFBI [50] (Y) CFBI* [50](Y)</td><td>75.0 76.6</td><td>73.0</td><td>80.1</td><td>5.3 2.9</td></tr><tr><td>SST[CVPR21] [13]</td><td>81.8</td><td>80.9</td><td>1</td><td>76.6</td><td>-</td><td>-</td><td>KMN* [34] (Y)</td><td>77.2</td><td>74.1</td><td>80.3</td><td>1</td></tr><tr><td>CFBI+[TPAMI21] [51]</td><td>82.6</td><td>81.7</td><td>86.2</td><td>77.1</td><td>85.2</td><td>4.0</td><td>CFBI+* [51](Y)</td><td>78.0</td><td>74.4</td><td>81.6</td><td>3.4</td></tr><tr><td>AOT-T</td><td>79.7</td><td>79.6</td><td>83.8</td><td>73.7</td><td>81.8</td><td>41.0</td><td>AOT-T (Y)</td><td>72.0</td><td>68.3</td><td>75.7</td><td>51.4</td></tr><tr><td>AOT-S</td><td>82.2</td><td>81.3</td><td>85.9</td><td>76.6</td><td>84.9</td><td>27.1</td><td>AOT-S (Y)</td><td>73.9</td><td>70.3</td><td>77.5</td><td>40.0</td></tr><tr><td>AOT-B</td><td>83.3</td><td>82.4</td><td>87.1</td><td>77.8</td><td>86.0</td><td>20.5</td><td>AOT-B (Y)</td><td>75.5</td><td>71.6</td><td>79.3</td><td>29.6</td></tr><tr><td>AOT-L</td><td>83.7</td><td>82.8</td><td>87.5</td><td>78.0</td><td>86.7</td><td>16.0</td><td>AOT-L (Y)</td><td>78.3</td><td>74.3</td><td>82.3</td><td>18.7</td></tr><tr><td>R50-AOT-L</td><td>84.1</td><td>83.5</td><td>88.1</td><td>78.4</td><td>86.3</td><td>14.9</td><td>R50-AOT-L (Y)</td><td>79.6</td><td>75.9</td><td>83.3</td><td>18.0</td></tr><tr><td>SwinB-AOT-L</td><td>84.5</td><td>84.0</td><td>88.8</td><td>78.4</td><td>86.7</td><td>9.3</td><td>SwinB-AOT-L (Y)</td><td>81.2</td><td>77.3</td><td>85.1</td><td>12.1</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>
|
| 142 |
+
|
| 143 |
+
# 6 Experimental Results
|
| 144 |
+
|
| 145 |
+
We evaluate AOT on popular multi-object benchmarks, YouTube-VOS [48] and DAVIS 2017 [31], and single-object benchmark, DAVIS 2016 [30]. For YouTube-VOS experiments, we train our models on the YouTube-VOS 2019 training split. For DAVIS, we train on the DAVIS-2017 training split. When evaluating YouTube-VOS, we use the default 6FPS videos, and all the videos are restricted to be smaller than $1 . 3 \times 4 8 0 p$ resolution. As to DAVIS, the default 480p 24FPS videos are used.
|
| 146 |
+
|
| 147 |
+
The evaluation metric is the $\mathcal { I }$ score, calculated as the average Intersect over Union (IoU) score between the prediction and the ground truth mask, and the $\mathcal { F }$ score, calculated as an average boundary similarity measure between the boundary of the prediction and the ground truth, and their mean value, denoted as $\mathcal { I } \& \mathcal { F }$ . We evaluate all the results on official evaluation servers or with official tools.
|
| 148 |
+
|
| 149 |
+
# 6.1 Compare with the State-of-the-art Methods
|
| 150 |
+
|
| 151 |
+
YouTube-VOS [48] is the latest large-scale benchmark for multi-object video segmentation and is about 37 times larger than DAVIS 2017 (120 videos). Specifically, YouTube-VOS contains 3471 videos in the training split with 65 categories and 474/507 videos in the validation 2018/2019 split with additional 26 unseen categories. The unseen categories do not exist in the training split to evaluate algorithms’ generalization ability.
|
| 152 |
+
|
| 153 |
+
As shown in Table 1a, AOT variants achieve superior performance on YouTube-VOS compared to the previous state-of-the-art methods. With our identification mechanism, AOT-S ( $8 2 . 6 \%$ J &F )
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 3: Qualitative results. (top) Compared with CFBI [50], AOT performs better when segmenting multiple highly similar objects (carousels and zebras). (bottom) AOT fails to segment some tiny objects (ski poles and watch) since AOT has no specific design for processing rare tiny objects.
|
| 157 |
+
|
| 158 |
+
is comparable with $\mathrm { C F B I + }$ [51] $( 8 2 . 8 \% )$ while running about $7 \times$ faster (27.1 vs 4.0FPS). By using more LSTT blocks, AOT-B improves the performance to $8 3 . 5 \%$ . Moreover, AOT-L further improves both the seen and unseen scores by utilizing the memory reading strategy, and our R50-AOT-L $( 8 4 . 1 \% / 8 4 . 1 \% )$ significantly outperforms the previous methods on the validation 2018/2019 split while maintaining an efficient speed (14.9FPS).
|
| 159 |
+
|
| 160 |
+
DAVIS 2017 [31] is a multi-object extension of DAVIS 2016. The validation split of DAVIS 2017 consists of 30 videos with 59 objects, and the training split contains 60 videos with 138 objects. Moreover, the testing split contains 30 more challenging videos with 89 objects in total.
|
| 161 |
+
|
| 162 |
+
Table 1b shows that our R50-AOT-L $( \mathbf { Y } )$ surpasses all the competitors on both the DAVIS-2017 validation $( \mathbf { 8 4 . 9 \% } )$ and testing $( 7 9 . 6 \% )$ splits and maintains an efficient speed (18.0FPS). Notably, such a multiobject speed is the same as our single-object speed on DAVIS 2016. For the first time, processing multiple objects can be as efficient as processing a single object over the AOT framework. We also evaluate our method without training with YouTube-VOS, and AOT-S $( 7 9 . 2 \% )$ performs much better than KMN [34] $( 7 6 . 0 \% )$ by $+ 3 . 2 \%$ .
|
| 163 |
+
|
| 164 |
+
Table 2: The quantitative evaluation on the single-object DAVIS 2016 [30].
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Methods</td><td>J&F</td><td>J</td><td>F</td><td>FPS</td></tr><tr><td>CFBI+ [51] (Y)</td><td>89.9 90.5</td><td>88.7 89.5</td><td>91.1 91.5</td><td>5.9 8.3</td></tr><tr><td>KMN [34](Y) AOT-T (Y)</td><td>86.8</td><td>86.1</td><td>87.4</td><td>51.4</td></tr><tr><td>AOT-S (Y)</td><td>89.4</td><td></td><td>88.6 90.2</td><td>40.0</td></tr><tr><td>AOT-B (Y)</td><td>89.9</td><td></td><td>88.7 91.1</td><td>29.6</td></tr><tr><td>AOT-L (Y)</td><td>90.4</td><td>89.6 91.1</td><td></td><td>18.7</td></tr><tr><td>R50-AOT-L (Y) SwinB-AOT-L (Y)</td><td>91.1 92.0</td><td></td><td>90.1 92.11 90.7 93.3 12.1</td><td>18.0</td></tr></table>
|
| 167 |
+
|
| 168 |
+
DAVIS 2016 [30] is a single-object benchmark containing 20 videos in the validation split. Although our AOT aims at improving multi-object video segmentation, we also achieve a new state-of-the-art performance on DAVIS 2016 (R50-AOT-L $( \mathbf { Y } )$ , $91 . 1 \%$ ). Under single-object scenarios, the multiobject superiority of AOT is limited, but R50-AOT-L still maintains an about $2 \times$ efficiency compared to KMN $( 1 8 . 0 \nu s 8 . 3 \mathrm { F P S } )$ ). Furthermore, our smaller variant, AOT-B $( 8 9 . 9 \% )$ , achieves comparable performance with CFBI+ $( 8 9 . 9 \% )$ while running $5 \times$ faster (29.6 vs 5.9FPS).
|
| 169 |
+
|
| 170 |
+
Apart from the above results, replacing the AOT encoder from commonly used ResNet50 to SwinB can further boost our performance to higher level (Table 1a, 1b, and 2).
|
| 171 |
+
|
| 172 |
+
Qualitative results: Fig. 3 visualizes some qualitative results in comparison with CFBI [50], which only associates each object with its relative background. As demonstrated, CFBI is easier to confuse multiple highly similar objects. In contrast, our AOT tracks and segments all the targets accurately by associating all the objects uniformly. However, AOT fails to segment some tiny objects (ski poles and watch) since we do not make special designs for tiny objects.
|
| 173 |
+
|
| 174 |
+
# 6.2 Ablation Study
|
| 175 |
+
|
| 176 |
+
In this section, we analyze the main components and hyper-parameters of AOT and evaluate their impact on the VOS performance in Table 3.
|
| 177 |
+
|
| 178 |
+
Identity number: The number of the identification vectors, $M$ , have to be larger than the object number in videos. Thus, we set $M$ to 10 in default to be consistent with the maximum object number
|
| 179 |
+
|
| 180 |
+
(a) Identity number
|
| 181 |
+
|
| 182 |
+
Table 3: Ablation study. The experiments are based on AOT-S and conducted on the validation 2018 split of YouTube-VOS [48] without pre-training on synthetic videos. Self: the position embedding type used in the self-attention. Rel: use relative positional embedding [35] on the local attention.
|
| 183 |
+
|
| 184 |
+
<table><tr><td>M J&F</td><td>Jseen Junseen</td></tr><tr><td>10 80.3</td><td>80.6</td></tr><tr><td>79.0</td><td>73.7 79.4</td></tr><tr><td></td><td>72.1 70.8</td></tr><tr><td>20 78.3 30 77.2</td><td>79.4 78.5 70.2</td></tr></table>
|
| 185 |
+
|
| 186 |
+
(c) Local frame number
|
| 187 |
+
|
| 188 |
+
<table><tr><td>n J&F</td><td>Jseen</td><td>Junseen</td></tr><tr><td>1 80.3</td><td>80.6</td><td>73.7</td></tr><tr><td>2</td><td>80.0 79.8</td><td>73.7</td></tr><tr><td>3 79.1</td><td>80.0</td><td>72.2</td></tr><tr><td>0 74.3</td><td>74.9</td><td>67.6</td></tr></table>
|
| 189 |
+
|
| 190 |
+
(b) Local window size
|
| 191 |
+
(d) LSTT block number
|
| 192 |
+
|
| 193 |
+
<table><tr><td>入 J&F</td><td>Jseen</td><td>Junseen</td></tr><tr><td>15 80.3</td><td>80.6</td><td>73.7</td></tr><tr><td>11</td><td>78.8 79.5</td><td>71.9</td></tr><tr><td>7 78.3</td><td>79.3</td><td>70.9</td></tr><tr><td>0 74.3</td><td>74.9</td><td>67.6</td></tr></table>
|
| 194 |
+
|
| 195 |
+
(e) Positional embedding
|
| 196 |
+
|
| 197 |
+
<table><tr><td colspan="3"> Self Rel J&F gseen</td><td></td><td>Junseen</td></tr><tr><td>sine</td><td>√</td><td>80.3</td><td>80.6</td><td>73.7</td></tr><tr><td>none</td><td>√</td><td>80.1</td><td>80.4</td><td>73.5</td></tr><tr><td>sine</td><td>1</td><td>79.7</td><td>80.1</td><td>72.9</td></tr></table>
|
| 198 |
+
|
| 199 |
+
<table><tr><td>L J&F Jseen</td><td></td><td>Junseen</td><td>FPS Param</td></tr><tr><td>2</td><td>80.3 80.6</td><td>73.7</td><td>27.17.0M</td></tr><tr><td>3</td><td>80.9</td><td>81.1 74.0</td><td>20.58.3M</td></tr><tr><td>1</td><td>77.9 78.8</td><td>71.0</td><td>41.0 5.7M</td></tr></table>
|
| 200 |
+
|
| 201 |
+
in the benchmarks [48, 31]. As seen in Table 3a, $M$ larger than 10 leads to worse performance since (1) no training video contains so many objects; (2) embedding more than 10 objects into the space with only 256 dimensions is difficult.
|
| 202 |
+
|
| 203 |
+
Local window size: Table 3b shows that larger local window size, $\lambda$ , results in better performance. Without the local attention, $\lambda = 0$ , the performance of AOT significantly drops from $8 0 . 3 \%$ to $7 4 . 3 \%$ , which demonstrates the necessity of the local attention.
|
| 204 |
+
|
| 205 |
+
Local frame number: In Table 3c, we also try to employ more previous frames in the local attention, but using only the $t - 1$ frame $( 8 0 . 3 \% )$ performs better than using 2/3 frames $( 8 0 . 0 \% / 7 9 . 1 \% )$ . A possible reason is that the longer the temporal interval, the more intense the motion between frames, so it is easier to introduce more errors in the local matching when using an earlier previous frame.
|
| 206 |
+
|
| 207 |
+
LSTT block number: As shown in Table 3d, the AOT performance increases by using more LSTT blocks. Notably, the AOT with only one LSTT block $( 7 7 . 9 \% )$ reaches a fast real-time speed (41.0FPS) on YouTube-VOS, although the performance is $- 2 . 4 \%$ worse than AOT-S $( 8 0 . 3 \% )$ . By adjusting the LSTT block number, we can flexibly balance the accuracy and speed of AOT.
|
| 208 |
+
|
| 209 |
+
Position embedding: In our default setting, we apply fixed sine spatial positional embedding to the self-attention following [8], and our local attention is equipped with learned relative positional embedding [35]. The ablation study is shown in Table 3e, where removing the sine embedding decreases the performance to $8 0 . 1 \%$ slightly. In contrast, the relative embedding is more important than the sine embedding. Without the relative embedding, the performance drops to $7 9 . 7 \%$ , which means the motion relationship between adjacent frames is helpful for local attention. We also tried to apply learned positional embedding to self-attention modules, but no positive effect was observed.
|
| 210 |
+
|
| 211 |
+
# 7 Conclusion
|
| 212 |
+
|
| 213 |
+
This paper proposes a novel and efficient approach for video object segmentation by associating objects with transformers and achieves superior performance on three popular benchmarks. A simple yet effective identification mechanism is proposed to associate, match, and decode all the objects uniformly under multi-object scenarios. For the first time, processing multiple objects in VOS can be efficient as processing a single object by using the identification mechanism. In addition, a long short-term transformer is designed for constructing hierarchical object matching and propagation for VOS. The hierarchical structure allows us to flexibly balance AOT between real-time speed and stateof-the-art performance by adjusting the LSTT number. We hope the identification mechanism will help ease the future study of multi-object VOS and related tasks (e.g., video instance segmentation, interactive VOS, and multi-object tracking), and AOT will serve as a solid baseline.
|
| 214 |
+
|
| 215 |
+
# References
|
| 216 |
+
|
| 217 |
+
[1] Parallel distributed deep learning: Machine learning framework from industrial practice. https: //www.paddlepaddle.org.cn/
|
| 218 |
+
[2] Avinash Ramakanth, S., Venkatesh Babu, R.: Seamseg: Video object segmentation using patch seams. In: CVPR. pp. 376–383 (2014)
|
| 219 |
+
[3] Ba, J.L., Kiros, J.R., Hinton, G.E.: Layer normalization. In: NIPS Workshops (2016)
|
| 220 |
+
[4] Badrinarayanan, V., Galasso, F., Cipolla, R.: Label propagation in video sequences. In: CVPR. pp. 3265–3272. IEEE (2010)
|
| 221 |
+
[5] Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. In: ICLR (2015)
|
| 222 |
+
[6] Bhat, G., Lawin, F.J., Danelljan, M., Robinson, A., Felsberg, M., Van Gool, L., Timofte, R.: Learning what to learn for video object segmentation. In: ECCV (2020)
|
| 223 |
+
[7] Caelles, S., Maninis, K.K., Pont-Tuset, J., Leal-Taixé, L., Cremers, D., Van Gool, L.: One-shot video object segmentation. In: CVPR. pp. 221–230 (2017)
|
| 224 |
+
[8] Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., Zagoruyko, S.: End-to-end object detection with transformers. In: ECCV. pp. 213–229. Springer (2020)
|
| 225 |
+
[9] Chen, Y., Pont-Tuset, J., Montes, A., Van Gool, L.: Blazingly fast video object segmentation with pixel-wise metric learning. In: CVPR. pp. 1189–1198 (2018)
|
| 226 |
+
[10] Cheng, M.M., Mitra, N.J., Huang, X., Torr, P.H., Hu, S.M.: Global contrast based salient region detection. TPAMI 37(3), 569–582 (2014)
|
| 227 |
+
[11] Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: Bert: Pre-training of deep bidirectional transformers for language understanding. In: NAACL. pp. 4171—-4186 (2019)
|
| 228 |
+
[12] Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. In: ICLR (2021)
|
| 229 |
+
[13] Duke, B., Ahmed, A., Wolf, C., Aarabi, P., Taylor, G.W.: Sstvos: Sparse spatiotemporal transformers for video object segmentation. In: CVPR (2021)
|
| 230 |
+
[14] Everingham, M., Van Gool, L., Williams, C.K., Winn, J., Zisserman, A.: The pascal visual object classes (voc) challenge. IJCV 88(2), 303–338 (2010)
|
| 231 |
+
[15] Hariharan, B., Arbeláez, P., Bourdev, L., Maji, S., Malik, J.: Semantic contours from inverse detectors. In: ICCV. pp. 991–998. IEEE (2011)
|
| 232 |
+
[16] He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: CVPR (2016)
|
| 233 |
+
[17] Hendrycks, D., Gimpel, K.: Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415 (2016)
|
| 234 |
+
[18] Hu, Y.T., Huang, J.B., Schwing, A.G.: Videomatch: Matching based video object segmentation. In: ECCV. pp. 54–70 (2018)
|
| 235 |
+
[19] Lin, H., Qi, X., Jia, J.: Agss-vos: Attention guided single-shot video object segmentation. In: ICCV. pp. 3949–3957 (2019)
|
| 236 |
+
[20] Lin, T.Y., Dollár, P., Girshick, R., He, K., Hariharan, B., Belongie, S.: Feature pyramid networks for object detection. In: CVPR. pp. 2117–2125 (2017)
|
| 237 |
+
[21] Lin, T.Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollár, P., Zitnick, C.L.: Microsoft coco: Common objects in context. In: ECCV. pp. 740–755. Springer (2014)
|
| 238 |
+
[22] Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin transformer: Hierarchical vision transformer using shifted windows. In: ICCV (2021)
|
| 239 |
+
[23] Lu, X., Wang, W., Danelljan, M., Zhou, T., Shen, J., Van Gool, L.: Video object segmentation with episodic graph memory networks. In: ECCV (2020)
|
| 240 |
+
[24] Luiten, J., Voigtlaender, P., Leibe, B.: Premvos: Proposal-generation, refinement and merging for video object segmentation. In: ACCV. pp. 565–580 (2018)
|
| 241 |
+
[25] Ngan, K.N., Li, H.: Video segmentation and its applications. Springer Science & Business Media (2011)
|
| 242 |
+
[26] Oh, S.W., Lee, J.Y., Xu, N., Kim, S.J.: Video object segmentation using space-time memory networks. In: ICCV (2019)
|
| 243 |
+
[27] Parmar, N., Vaswani, A., Uszkoreit, J., Kaiser, L., Shazeer, N., Ku, A., Tran, D.: Image transformer. In: ICCV. pp. 4055–4064. PMLR (2018)
|
| 244 |
+
[28] Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., Lerer, A.: Automatic differentiation in pytorch (2017)
|
| 245 |
+
[29] Perazzi, F., Khoreva, A., Benenson, R., Schiele, B., Sorkine-Hornung, A.: Learning video object segmentation from static images. In: CVPR. pp. 2663–2672 (2017)
|
| 246 |
+
[30] Perazzi, F., Pont-Tuset, J., McWilliams, B., Van Gool, L., Gross, M., Sorkine-Hornung, A.: A benchmark dataset and evaluation methodology for video object segmentation. In: CVPR. pp. 724–732 (2016)
|
| 247 |
+
[31] Pont-Tuset, J., Perazzi, F., Caelles, S., Arbeláez, P., Sorkine-Hornung, A., Van Gool, L.: The 2017 davis challenge on video object segmentation. arXiv preprint arXiv:1704.00675 (2017)
|
| 248 |
+
[32] Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I.: Language models are unsupervised multitask learners. OpenAI blog 1(8), 9 (2019)
|
| 249 |
+
[33] Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.C.: Mobilenetv2: Inverted residuals and linear bottlenecks. In: CVPR. pp. 4510–4520 (2018)
|
| 250 |
+
[34] Seong, H., Hyun, J., Kim, E.: Kernelized memory network for video object segmentation. In: ECCV (2020)
|
| 251 |
+
[35] Shaw, P., Uszkoreit, J., Vaswani, A.: Self-attention with relative position representations. In: NAACL. pp. 464–468 (2018)
|
| 252 |
+
[36] Shi, J., Yan, Q., Xu, L., Jia, J.: Hierarchical image saliency detection on extended cssd. TPAMI 38(4), 717–729 (2015)
|
| 253 |
+
[37] Synnaeve, G., Xu, Q., Kahn, J., Likhomanenko, T., Grave, E., Pratap, V., Sriram, A., Liptchinsky, V., Collobert, R.: End-to-end asr: from supervised to semi-supervised learning with modern architectures. In: ICML Workshops (2020)
|
| 254 |
+
[38] Vaswani, A., Ramachandran, P., Srinivas, A., Parmar, N., Hechtman, B., Shlens, J.: Scaling local self-attention for parameter efficient visual backbones. In: CVPR. pp. 12894–12904 (2021)
|
| 255 |
+
[39] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need. In: NIPS (2017)
|
| 256 |
+
[40] Vijayanarasimhan, S., Grauman, K.: Active frame selection for label propagation in videos. In: ECCV. pp. 496–509. Springer (2012)
|
| 257 |
+
[41] Voigtlaender, P., Chai, Y., Schroff, F., Adam, H., Leibe, B., Chen, L.C.: Feelvos: Fast end-to-end embedding learning for video object segmentation. In: CVPR. pp. 9481–9490 (2019)
|
| 258 |
+
[42] Voigtlaender, P., Leibe, B.: Online adaptation of convolutional neural networks for video object segmentation. In: BMVC (2017)
|
| 259 |
+
[43] Wang, X., Girshick, R., Gupta, A., He, K.: Non-local neural networks. In: CVPR. pp. 7794– 7803 (2018)
|
| 260 |
+
[44] Wang, Y., Xu, Z., Wang, X., Shen, C., Cheng, B., Shen, H., Xia, H.: End-to-end video instance segmentation with transformers. In: CVPR. pp. 8741–8750 (2021)
|
| 261 |
+
[45] Wu, Y., He, K.: Group normalization. In: ECCV. pp. 3–19 (2018)
|
| 262 |
+
[46] Wug Oh, S., Lee, J.Y., Sunkavalli, K., Joo Kim, S.: Fast video object segmentation by referenceguided mask propagation. In: CVPR. pp. 7376–7385 (2018)
|
| 263 |
+
[47] Xiao, H., Feng, J., Lin, G., Liu, Y., Zhang, M.: Monet: Deep motion exploitation for video object segmentation. In: CVPR. pp. 1140–1148 (2018)
|
| 264 |
+
[48] Xu, N., Yang, L., Fan, Y., Yue, D., Liang, Y., Yang, J., Huang, T.: Youtube-vos: A large-scale video object segmentation benchmark. arXiv preprint arXiv:1809.03327 (2018)
|
| 265 |
+
[49] Yang, L., Wang, Y., Xiong, X., Yang, J., Katsaggelos, A.K.: Efficient video object segmentation via network modulation. In: CVPR. pp. 6499–6507 (2018)
|
| 266 |
+
[50] Yang, Z., Wei, Y., Yang, Y.: Collaborative video object segmentation by foreground-background integration. In: ECCV (2020)
|
| 267 |
+
[51] Yang, Z., Wei, Y., Yang, Y.: Collaborative video object segmentation by multi-scale foregroundbackground integration. TPAMI (2021)
|
| 268 |
+
[52] Zhang, Z., Fidler, S., Urtasun, R.: Instance-level segmentation for autonomous driving with deep densely connected mrfs. In: CVPR. pp. 669–677 (2016)
|
md/train/hw2VfWAr6t6/hw2VfWAr6t6.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Enabling Fast Differentially Private SGD via Just-in-Time Compilation and Vectorization
|
| 2 |
+
|
| 3 |
+
Pranav Subramani∗
|
| 4 |
+
Cheriton School of Computer Science University of Waterloo
|
| 5 |
+
pranav.subramani@uwaterloo.ca
|
| 6 |
+
|
| 7 |
+
Nicholas Vadivelu∗ Cheriton School of Computer Science University of Waterloo nbvadive@uwaterloo.ca
|
| 8 |
+
|
| 9 |
+
Gautam Kamath Cheriton School of Computer Science University of Waterloo g@csail.mit.edu
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
A common pain point in differentially private machine learning is the significant runtime overhead incurred when executing Differentially Private Stochastic Gradient Descent (DPSGD), which may be as large as two orders of magnitude. We thoroughly demonstrate that by exploiting powerful language primitives, including vectorization, just-in-time compilation, and static graph optimization, one can dramatically reduce these overheads, in many cases nearly matching the best nonprivate running times. These gains are realized in two frameworks: one is JAX, which provides rich support for these primitives through the XLA compiler. We also rebuild core parts of TensorFlow Privacy, integrating more effective vectorization as well as XLA compilation, granting significant memory and runtime improvements over previous release versions. Our proposed approaches allow us to achieve up to $5 0 \mathrm { x }$ speedups compared to the best alternatives. Our code is available at https://github.com/TheSalon/fast-dpsgd.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Machine learning has recently experienced tremedous growth, being used to solve problems with unprecedented accuracy in a myriad of domains. However, not all domains are alike—while many datasets are freely available, we often would like to train ML models on sensitive data. Troublingly, it has been demonstrated that disregarding these concerns, or even using heuristic and best-effort privacy approaches, can result in significant leakage of private information [9, 12]. Differential privacy (DP) [16] has emerged as a strong and rigorous notion of data privacy, capable of protecting against privacy violations in a variety of settings.
|
| 18 |
+
|
| 19 |
+
One of the workhorse algorithms in machine learning is stochastic gradient descent (SGD) which has a differentially private analogue, DPSGD [43, 8, 2] which was introduced as a drop-in replacement for SGD. The primary differences include a per-example gradient clipping step and a batch-level addition of Gaussian noise. While these modifications seem relatively innocuous, they have so far led to non-trivial costs in terms of running time and final accuracy. In this paper, we address and mitigate the running time overhead of DPSGD.
|
| 20 |
+
|
| 21 |
+
Most modern machine learning frameworks allow efficient access to average minibatch gradients, and not at a per-example level. Access to these objects is critical in DPSGD, as well as other applications beyond privacy [52]. Lack of support for fast computation of per-example gradients has been noted and lamented numerous times for both TensorFlow [35, 42, 3] and PyTorch [32, 6].
|
| 22 |
+
|
| 23 |
+
Numerous attempts to avoid these computational roadblocks have been proposed. Goodfellow [20] proposed an algorithmic solution for computing per-example $\ell _ { 2 }$ -norms of the gradients for fullyconnected networks. Other proposed solutions work by exploiting Jacobians [14] or parallelizing over the batch dimension [4]. Several of these approaches are are restricted to specific types of architectures—for example, [20] is restricted to fully-connected layers, though [41] extends this to convolutional layers, and a very recent work [33] further considers layers including recurrent networks, attention, and more. BackPACK [14] currently supports only fully connected and convolutional layers, and while the paper states that it can be extended to recurrent and residual layers, GitHub issues related to implementation of these features have been open since November 2019 [13]. Facebook’s Opacus [51] emphasizes speed and scalability as the main selling points. We briefly mention microbatching, in which comparatively small subsets of the minibatch called “microbatches” of points are averaged before clipping, reducing the number of clipping operations (and thus the running time), at the cost of requiring additional noise to achieve the same privacy guarantee. Since this generally results in significantly worse accuracy, we do not investigate it further in our work. A more thorough description of approaches is provided in Section 2.1.
|
| 24 |
+
|
| 25 |
+
As mentioned in the literature (and thoroughly explored later in this paper), all existing approaches seem to incur moderate to severe running time overhead versus non-private SGD, with slowdowns as large as two orders of magnitude. For instance, Carlini et al. [12] comment “Training a differentially private algorithm is known to be slower than standard training; our implementation of this algorithm is 10-100x slower than standard training,” where their implementation is based on TensorFlow Privacy. Additionally, Thomas et al. [45] document a slowdown from 12 minutes to 14 hours due to the introduction of differential privacy, a 70x slowdown. The effect of these slowdowns can range from an inconvenience when it comes to rapid prototyping of smaller models, to prohibitively expensive for a single training run of a larger model. Overcoming this obstacle is an important step in helping differentially private machine learning transition from its present nascent state to widespread adoption.
|
| 26 |
+
|
| 27 |
+
# 1.1 Results
|
| 28 |
+
|
| 29 |
+
We demonstrate that one can mostly eliminate the significant running time overhead of differentially private SGD by exploiting language primitives such as vectorization, just-in-time (JIT) compilation, and static graph optimization. These features are core primitives within JAX [19, 10] and TensorFlow 2 (TF2) [1], both tensor-processing libraries from Google. These frameworks combine JIT compilation backed by the Accelerated Linear Algebra (XLA) [22] just-in-time compiler (JIT) with auto differentiation for high-performance machine learning. As we will see, JAX is consistently the fastest method for running DPSGD, with running times comparable to the non-private case. Our custom TensorFlow Privacy (TFP) implementation (referred to as Custom TFP), which leverages vectorization and XLA compilation in TensorFlow 2, demonstrates similar performance to JAX and significantly outperforms the existing TFP library. These changes have since been merged into TensorFlow Privacy.
|
| 30 |
+
|
| 31 |
+
Our primary contributions are as follows:
|
| 32 |
+
|
| 33 |
+
1. We thoroughly benchmark several frameworks and libraries for DPSGD.
|
| 34 |
+
2. We extend TensorFlow Privacy to support TF2, more efficient vectorization, and XLA compilation, significantly improving its running time in most cases (referred to as Custom TFP in this paper). We also contribute a variant of our implementation to TensorFlow Privacy, which is now the fastest DPSGD algorithm the library provides.
|
| 35 |
+
3. We demonstrate that methods which use vectorization, JIT compilation, and static graph optimization are consistently the fastest and most memory-efficient: specifically, JAX and Custom TFP.
|
| 36 |
+
4. We find that, despite similarities in the compilation pipeline, JAX is generally faster than Custom TFP. We examine and discuss compiled XLA assembly to explain the discrepancy.
|
| 37 |
+
5. Finally, our supplement contains code to reproduce these experiments, as well as guide researchers and engineers in developing fast code for private ML.
|
| 38 |
+
|
| 39 |
+
Table 1: Median running time (s) per epoch of training various models at batch size 128. FCNN stands for Fully-Connected Neural Network; CNN stands for Convolutinal Neural Network.
|
| 40 |
+
|
| 41 |
+
<table><tr><td></td><td colspan="2">Private Training</td><td>Non-Private Training</td></tr><tr><td>Architecture</td><td>JAX/Custom TFP</td><td>Best Alternative</td><td>Best Time</td></tr><tr><td>FCNN</td><td>0.21</td><td>0.77</td><td>0.55</td></tr><tr><td>CNN</td><td>7.3</td><td>12</td><td>1.7</td></tr><tr><td>LSTM</td><td>8.2</td><td>407</td><td>4.8</td></tr></table>
|
| 42 |
+
|
| 43 |
+
Table 1 summarizes some of our experimental results, with median running time per epoch for a variety of settings. JAX and Custom TFP are consistently the fastest.
|
| 44 |
+
|
| 45 |
+
We observe dramatic improvements for LSTMs [28], potentially significant enough to bring LSTMs from impractical into the realm of feasibility. JAX is able to privately train these models $1 7 \mathbf { x }$ and $5 0 \mathrm { x }$ faster than the best alternative.2 Examining the overhead due to privacy: JAX’s running time increases by roughly 2x, compared to factors closer to $1 0 \mathrm { x }$ for alternatives.
|
| 46 |
+
|
| 47 |
+
For fully-connected and convolutional networks, JAX or Custom TFP almost entirely remove the overhead due to privacy. In fact, the running times are significantly better than some alternatives without privacy. Recall that these are per-epoch times: while an improvement of 0.5 seconds might seem insignificant, this can add up when training for many epochs. We perform an ablation study (Table 2) for all models to pinpoint the source of all improvements.
|
| 48 |
+
|
| 49 |
+
While our investigations show the consistent and substantial superiority of JAX for fast private machine learning, these benefits remain relatively unknown. Though a small number of experts are aware [44], and the official JAX repo contains a toy demonstration [25], before the initial posting of our paper a Google Scholar search revealed only two papers which use JAX for differential privacy [49, 38], and neither emphasizes or even comments on the computational advantages of JAX. Similarly, while efficient per-example gradients have been studied in TensorFlow [5], efficient application of these techniques is not readily available to privacy researchers. We hope that our investigation will document this phenomenon and encourage others to adopt it for their private machine learning needs.
|
| 50 |
+
|
| 51 |
+
# 1.2 Simultaneous and Subsequent Work
|
| 52 |
+
|
| 53 |
+
Simultaneous to our work, [11] employ Johnson-Lindenstrauss projections to quickly approximate per-example gradient norms. This is an algorithmic modification, and will not be functionally equivalent to DPSGD – similar to microbatching, there is a time-accuracy tradeoff (though not as severe in this case).
|
| 54 |
+
|
| 55 |
+
Subsequent to the initial posting of this paper, we worked with Google engineers to implement our improvements into TensorFlow Privacy. Vadivelu contributed an JAX implementation of DPSGD to the Optax library [27]. [7] employed our findings to efficiently privately train BERT-Large. In a recent Opacus whitepaper [51], the authors repeat some of our experiments on more recent versions of these frameworks; we defer to their work for discussion of these results.
|
| 56 |
+
|
| 57 |
+
# 2 Description of Approaches
|
| 58 |
+
|
| 59 |
+
# 2.1 Libraries Enabling DPSGD
|
| 60 |
+
|
| 61 |
+
JAX [19, 10]. JAX is a recently introduced framework for machine learning, defined by its automatic differentiation capabilities and JIT compilation via the XLA compiler [22]. Programs written in pure Python and JAX’s NumPy [26] API can be translated to an intermediate language (XLA-HLO) to be JIT compiled, i.e., to generate custom assembly instructions for the hardware. This enables optimizations such as kernel-fusions, buffer reuse, improved memory layout, and more. Additionally, one of the core functions present in JAX is VMAP, a vectorized map, which enables easy-to-write and efficient batch level parallelism that is fundamental to DPSGD. As we will demonstrate, these enable the fastest approach for DPSGD that we are aware of.
|
| 62 |
+
|
| 63 |
+
Custom TFP. Vectorization and XLA-driven JIT compilation is also available in TensorFlow 2 [1], which we leverage in our implementation, Custom TFP. With these primitives, we achieve performance comparable to JAX and surpassing existing DPSGD implementations in TensorFlow. We augment TensorFlow Privacy to better utilize tf.vectorized_map and follow TensorFlow 2 best practices while retaining the existing functionality.
|
| 64 |
+
|
| 65 |
+
Chain-Rule-Based Per-Example Gradients [20, 41]. This suite of techniques is implemented on top of PyTorch [39]. They support efficient GPU-accelerated per-example gradients for fullyconnected layers via [20], as well as convolutional layers via [41], which we describe in the detail in the following paragraphs.
|
| 66 |
+
|
| 67 |
+
Let $C , D , T$ , and $B$ refer to the number of input channels, output channels, the spatial dimension, and the batch size. The shape of the input $x$ is $( B , C , T )$ . The conventional formula for the discrete convolution can be written as:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\sum _ { c = 0 } ^ { C - 1 } \sum _ { k = 0 } ^ { K - 1 } x [ b , c , t + K ] h [ d , c , k ] .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The gradient of this expression can be efficiently computed via automatic differentiation [40]. PyTorch’s automatic differentiation cannot be parallelized across the batch dimension $b$ [41], which is required to backpropagate through the above expression. Instead, they rewrite the convolution as follows:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\sum _ { c = 0 } ^ { C / G - 1 } \sum _ { k = 0 } ^ { K - 1 } x \left[ b , c , g \frac { C } { G } , t + K \right] h [ d , g , c , k ] ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $G$ is the number of groups and the shape of $x$ is $( 1 , B , C , { \cal T } )$ . The initial convolution is 1-dimensional, while the above expression includes an added dimension. Similarly, to allow backpropagation through a $k$ -dimensional convolutional layer, a $( k + 1 )$ -dimensional convolutional layer is required. This can be achieved by utilizing the group attribute in the convolution function in PyTorch, since splitting it into groups implies that the same convolution is applied to each individual group.
|
| 80 |
+
|
| 81 |
+
BackPACK [14]. The chain rule gives the following expression for the gradient of a loss function:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\nabla _ { \theta ^ { ( i ) } } \ell ( \theta ) = ( J _ { \theta ^ { ( i ) } } z _ { n } ^ { ( i ) } ) ^ { T } \left( \prod _ { j = i } ^ { L - 1 } ( J _ { z _ { n } ^ { ( j ) } } z _ { n } ^ { ( j + 1 ) } ) ^ { T } \right) ( \nabla _ { z _ { n } ^ { ( L ) } } \ell _ { n } ( \theta ) ) .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
In order to compute this quantity, one requires the ability to multiply the Jacobian by a vector and by a matrix, which is not currently supported in PyTorch’s automatic differentiation framework. In BackPACK, Dangel et al. [14] extend several layers within PyTorch to support fast Jacobian-vector and Jacobian-matrix products in order to extract quantities like individual gradients, variance, $\ell _ { 2 }$ - norm of the gradients, and second-order quantities. In particular, to extract first-order gradients, their method multiplies the transposed Jacobian with the outputs of the layer:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\frac { 1 } { N } \nabla _ { \theta ^ { ( i ) } } \ell ( \theta ) = \frac { 1 } { N } ( J _ { \theta ^ { ( i ) } } z _ { n } ^ { ( i ) } ) ^ { T } ( \nabla _ { z _ { n } ^ { ( i ) } } \ell ( \theta ) ) ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $i = 1 , \ldots , N$ and each $\theta ^ { ( i ) }$ has a gradient which is of shape $( N , d ^ { ( i ) } )$ . BackPACK provides efficient computation for the transpose of the Jacobian as well as the Jacobian.
|
| 94 |
+
|
| 95 |
+
Opacus [51]. Opacus is a library for training PyTorch models with differential privacy, recently released by Facebook. It supports per-example gradients, using PyTorch’s forward and backward hooks to propagate gradients. They provide support for several PyTorch layers including LSTM layers, which are not supported in either of the previous two frameworks. Note that Opacus does not support PyTorch’s nn.LSTM but instead implements a separate opacus.layers.DPLSTM, with adjustments that allow individual gradients to propagate through it.
|
| 96 |
+
|
| 97 |
+
PyVacy [48]. Before the release of Opacus (and its predecessor PyTorch-DP), PyVacy was the most popular library for DP machine learning in PyTorch. PyVacy has no custom support for parallelization across the batch dimension for any layer since it processes each sample individually (by way of a for-loop). This generally leads to a large increase in runtime for models trained using PyVacy.
|
| 98 |
+
|
| 99 |
+
TensorFlow Privacy [37] TensorFlow Privacy is a library for differentially private machine learning, built on top of TensorFlow. TensorFlow Privacy has general support for a vectorized implementation of DPSGD via vectorized_map which allows it to parallelize across the batch dimension, used to extract per-example gradients. The library recently introduced a TensorFlow 2 compatible API that leverages GradientTape.jacobian to compute per-example gradients, which we compare seperately to the TensorFlow 1 API in our experiments.
|
| 100 |
+
|
| 101 |
+
# 2.2 Notable Framework Features
|
| 102 |
+
|
| 103 |
+
Static versus Dynamic Graph. TensorFlow and JAX use a static graph to track computation in order to optimize execution and compute gradients. This means the sequence of operations is traced and a large proportion of shapes are determined during the first invocation of the function, allowing for kernel fusion, buffer reuse, and other optimizations on subsequent calls. PyTorch uses a dynamic graph to track computation flow in order to compute gradients, but does not optimize execution. This enables increased dynamism in the shapes and types of computations, at the cost of losing all the aforementioned optimizations.
|
| 104 |
+
|
| 105 |
+
Grappler versus XLA. TensorFlow has two optimization engines: Grappler [21] and XLA. Grappler, TensorFlow’s original graph optimizer, takes as input the computation graph and is able to prune dead nodes, remove redundant computation, improve memory layouts, and more. XLA, TensorFlow’s new optimizing compiler, can perform the same optimizations as Grappler, in addition to generating code for fused kernels. For this reason, XLA has the potential to extract more performance out of TensorFlow graphs than Grappler, but does not always accomplish this due to Grappler’s maturity.
|
| 106 |
+
|
| 107 |
+
JAX and XLA. JAX was built from the ground up to leverage XLA, and so many of its operations map directly to XLA primitives. We often observe that JAX is able to extract better performance out of XLA than TensorFlow.
|
| 108 |
+
|
| 109 |
+
Pytorch and Static Graphs. Recently, PyTorch has released the capability to JIT compile its code through torch.jit or PyTorch XLA [18]. Due to the early nature of these two efforts, they were not successful in JIT compiling the methods we tried, thus we do not consider them further.
|
| 110 |
+
|
| 111 |
+
Just-In-Time Compilation JIT compilation is a method of compilation that happens at runtime, as opposed to before program execution. JAX and TensorFlow perform JIT compilation by recording operations that are executed on tensors/arrays (i.e. “tracing”), generating the low-level instructions to perform these operations, optimizing these instructions, then producing fast low-level kernels. The XLA compiler requires all array shapes to be known at trace-time so it can statically determine how much memory should be allocated for each operation. While compilation can be relatively slow compared to execution $\mathord { \sim } 1 0 \mathrm { x }$ the time), you only pay this price once at the first training iteration, provided the input shapes do not change.
|
| 112 |
+
|
| 113 |
+
# 3 Empirical Findings
|
| 114 |
+
|
| 115 |
+
We evaluate the aforementioned implementations of DPSGD in runtime and memory consumption on three datasets: CIFAR10 [31], a dataset of small colour images with 60,000 training examples of size $3 2 \times 3 2 \times 3$ each, IMDb [36], a movie review sentiment classification dataset with 25,000 training examples padded to a sequence length of 256 each, and Adult [15], containing 45,220 examples with 104 features, which was preprocessed via methods from [29]. These datasets are available for open use and do not contain personally identifiable information or offensive content.
|
| 116 |
+
|
| 117 |
+
We perform our evaluations on three different architectures. We start with the smallest dataset, Adult, training a 5,532-parameter fully-connected neural network (FCNN). Then, we train a CIFAR10 convolutional neural network classifier architecture with 605,226 parameters used by Papernot et al. [38]. For IMDb, we use an LSTM network with 1,081,002 parameters, demonstrating the method on a relatively large model. This selection covers the common data and architecture types at realistic sizes for differentially private learning. In particular, we did not consider the exceptionally large models which are not prevalent in non-private machine learning. Additional experiments can be found in the supplement that are omitted due to space constraints. These experiments cover a wider range of parameters and architectures to elucidate the benefits of using XLA JIT for DPSGD.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 1: Runtimes for the fully connected network on the Adult dataset. We observe that JAX and Custom TFP are the fastest by a large margin in both settings, with DPSGD having low overhead over the non-private setting. The y-axis is truncated for clarity.
|
| 123 |
+
Figure 2: Runtimes for the CNN on the CIFAR10 dataset. We observe that JAX has the fastest runtime in the private case while TensorFlow 2 with XLA and JAX are the fastest in the non-private case at most batch sizes. Similar to the MNIST case, TFP struggles at the largest batch size due to an inability to properly parallelize per-gradient computation with this level of memory consumption. The y-axis is truncated for clarity.
|
| 124 |
+
|
| 125 |
+
We compare a number of different methods for fast DPSGD, including JAX [19, 10], BackPACK [14], the chain-rule based method (CRB) [20, 41], Opacus [51], PyVacy [48], TensorFlow Privacy (TFP) [37] and our modification of TFP, dubbed Custom TFP. For TensorFlow based frameworks, we evaluate performance both with and without XLA JIT compilation in both TF 1 and TF 2. We refer to TensorFlow 2 and JAX as modern XLA-compiled libraries.
|
| 126 |
+
|
| 127 |
+
These architectures and datasets are evaluated in terms of runtime at batch sizes 16, 32, 64, 128, and 256. This showcases a comparison of runtimes across a variety of batch sizes to present a holistic picture of the running times, as well as demonstrating the impact of memory utilization on runtime. Each experiment was run for 20 epochs and the median epoch run-time is reported. The variance of these experiments was low enough that the errors bars are negligible (full results provided in the supplement). Outside of the initial compilation time required for the static graph frameworks, the runtime showed little variance between epochs, resulting in narrow confidence intervals for the epoch runtime (data available upon request). We preprocess all the data in advance and use an identical generator-based dataloader for all frameworks, to ensure consistency.
|
| 128 |
+
|
| 129 |
+
All experiments were run on Ubuntu 18.04 with an Intel Core i7-7800X CPU $3 . 5 0 \mathrm { G H z }$ , 6 cores), NVIDIA GTX Titan V GPU (12GB VRAM), and 32GB of RAM. The code is provided in the supplement and is publicly released.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 3: Runtimes for the LSTM network on the IMDb dataset. JAX is by far the fastest option, resulting in a roughly $5 0 \mathrm { x }$ speedup for batch size 256. The quadratic memory cost of Opacus prevents us from evaluating this implementation at these batch sizes, however, we observe a median runtime of 1024.16s at batch size 10. Excessive memory consumption prevent us from evaluating Custom TFP and TFP at larger batch sizes. An open TensorFlow 2 bug prevents us from evaluating Custom TFP (XLA) in this setting [46]. BackPACK and CRB do not support embedding layers. The y-axis is truncated for clarity.
|
| 133 |
+
|
| 134 |
+
First, we evaluate the FCNN model (Figure 1), where we observe that JAX and Custom TFP are significantly faster than the other options in both the private and non-private setting. With such a simple architecture, the compiler can perform significant optimizations. Notably, JAX and Custom TFP show little overhead over their non-private counterparts. The non-statically compiled frameworks (apart from PyVacy) remain competitive in this setting due to the shallow network size and low parameter count. TFP 2 without XLA performs unexpectedly poorly, due to the Jacobian computation which does not account for per-example independence of gradients.
|
| 135 |
+
|
| 136 |
+
We then evaluate the CIFAR10 CNN model (Figure 2), where JAX is by far the most performant implementation in the private case, and the modern XLA-compiled frameworks are the fastest non-private methods. Custom TFP is noticeably slower than JAX—we conjecture that this is due to different utilization of the JIT compiler, see Section 4. Also, at the largest batch size, TFP’s performance deteriorates due to the memory consumption preventing it from effectively parallelizing the per-example gradient computation.
|
| 137 |
+
|
| 138 |
+
For the final runtime experiment we evaluate the LSTM network (Figure 3). A TensorFlow 2 bug [46] and lack of support from BackPACK and CRB prevent us from evaluating this setting on those implementations. We see a similar phenomenon to the CIFAR10 CNN case for TFP: at larger batch sizes, the library fails to parallelize effectively pessimizing the runtime. TensorFlow and PyTorch benefit from a fast cuDNN LSTM implementation in the non-private case which they fail to leverage in the private case, explaining the significant difference in performance. JAX, on the other hand, uses an LSTM implementation based on primitive operations, which allows it to retain similar performance in both the private and non-private settings.
|
| 139 |
+
|
| 140 |
+
To understand the importance of vectorization (via VMAP) and JIT compilation (JIT), we ablate JAX’s performance on these tasks with and without these two components (Table 2). We observe that JIT alone provides up to a $4 3 5 \mathrm { x }$ improvement, and VMAP alone provides up to a $6 4 \mathrm { x }$ improvement. When used in tandem, both complement each other, providing up to a 5160x improvement.
|
| 141 |
+
|
| 142 |
+
Similarly, we ablate the components in Custom TFP (Table 2). In TensorFlow, vectorized_map automatically compiles the code, preventing us from ablating it alone. We observe that XLA in TensorFlow 2 is able to reclaim performance lost by not vectorizing, seeing that the non-VMAP XLA performance comes close to VMAP Graph performance in many settings. We further see the non-compiled runtimes are not as extreme as seen in JAX: TensorFlow is better optimized to run reasonably fast in all settings.
|
| 143 |
+
|
| 144 |
+
Finally, we explore the memory consumption behaviour of these implementations (Table 3), observing that running time has a strong negative correlation to memory consumption. The modern XLAcompiled libraries provide impressive batch size capability. Also, all the frameworks except JAX and PyVacy struggle with batch sizes on the LSTM. Since PyVacy processes examples sequentially, it has a constant memory consumption with respect to batch size, effectively trading off running time for optimal memory use. The other frameworks are crippled without access to their fused cuDNN LSTM implementation, while JAX has no issues as its LSTM is composed of primitives. Finally, due to the specialized per-example gradient computation afforded by CRB for convolutions, it shows the best memory utilization among the PyTorch frameworks, even beating Custom TFP (without XLA) in the CIFAR10 CNN case.
|
| 145 |
+
|
| 146 |
+
Table 2: Ablation of JIT compilation and vectorization in Custom TFP (left) and JAX (right). Median runtime per epoch for a run of 20 epochs at batch size 128 for DPSGD. In TensorFlow, one can not use vectorization without graph compilation, which is why there is no standalone vectorization. Empty entries are due to confirmed active bugs in TensorFlow [47, 46]. We exclude LSTMs, as JAX runs out of memory without JIT compilation for this model.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Graph</td><td>JIT</td><td>VMAP</td><td>FCNN</td><td>CNN</td><td>LSTM</td></tr><tr><td></td><td></td><td></td><td>147</td><td>561</td><td>717</td></tr><tr><td>√</td><td></td><td></td><td>12.7</td><td>85.5</td><td>361</td></tr><tr><td></td><td>√</td><td></td><td>1.83</td><td>71.5</td><td></td></tr><tr><td>√</td><td></td><td>:</td><td>0.770</td><td>33.8</td><td>68.6</td></tr><tr><td></td><td>√</td><td></td><td>0.209</td><td>23.3</td><td></td></tr></table>
|
| 149 |
+
|
| 150 |
+
<table><tr><td>JIT</td><td>VMAP</td><td>FCNN</td><td>CNN</td></tr><tr><td rowspan="5">·</td><td rowspan="5">√</td><td>1240</td><td>3840</td></tr><tr><td>19.2</td><td>64.8</td></tr><tr><td>2.85</td><td>84.0</td></tr><tr><td>0.239</td><td>7.28</td></tr><tr><td></td><td></td></tr></table>
|
| 151 |
+
|
| 152 |
+
Table 3: Maximum batch size supported by each library before encountering out of memory errors. Missing entries represent missing functionality or bugs in the frameworks. PyVacy handles examples sequentially, giving constant memory consumption with respect to batch size.
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Library</td><td>CNN</td><td>LSTM</td></tr><tr><td>JAX TensorFlow 2 (XLA)</td><td>10,448 15,040</td><td>11,984</td></tr><tr><td>TensorFlow 2</td><td>11,328</td><td>9,221</td></tr><tr><td>TensorFlow 1 (XLA)</td><td>10,880</td><td>5,070</td></tr><tr><td>TensorFlow 1</td><td>11,480</td><td>5,264</td></tr><tr><td>PyTorch</td><td>10,752</td><td>9,943</td></tr></table>
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Library</td><td>CNN</td><td>LSTM</td></tr><tr><td> JAX (DP)</td><td>4,264</td><td>2,487</td></tr><tr><td>Custom TFP (XLA) TFP 2 (XLA)</td><td>3,144 168</td><td></td></tr><tr><td>Custom TFP</td><td>1,944</td><td>137</td></tr><tr><td>TFP 2</td><td>104</td><td>105</td></tr><tr><td>TFP (XLA)</td><td>168</td><td>88</td></tr><tr><td>TFP</td><td>104</td><td>105</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Opacus</td><td>1,920</td><td>10</td></tr><tr><td>BackPACK</td><td>1,216</td><td></td></tr><tr><td>CRB</td><td>2,184</td><td></td></tr><tr><td>PyVacy</td><td>8</td><td>8</td></tr></table>
|
| 157 |
+
|
| 158 |
+
# 4 Discussion
|
| 159 |
+
|
| 160 |
+
JAX and Custom TFP’s runtime advancements can be primarily attributed to the advancement of the compiler present in both of these languages. The XLA compiler performs a variety of operations ranging from memory scheduling to kernel fusion. The memory optimizations are vital for larger models where DPSGD becomes a memory-bound algorithm. One of the core features of XLA is buffer reutilization which has a significant impact on the maximum memory used [22]. Furthermore, the memory scheduler can mitigate peak memory usage to prevent a runtime exception for overusing available memory.
|
| 161 |
+
|
| 162 |
+
The effectiveness of XLA is demonstrated through the peak batch size experiment (which serves as a proxy for memory efficiency): in both the private and non-private settings, XLA far exceeds alternatives in the peak batch size it supports. Through this experiment, we also see the benefits of using small operation primitives as opposed to large fused kernels: TensorFlow and PyTorch both leverage the optimized cuDNN kernel in the non-private setting for performance [23, 17], but cannot in the private setting, leading to significantly worse performance. Modifying all existing cuDNN kernels to enable use in the private case would require a non-trivial engineering investment. JAX instead focuses on optimizing operation primitives, so even in foreign computational circumstances, its performance is comparatively strong. Succinctly, JAX sacrifices the ability to use highly optimized fused kernels for generalizability.
|
| 163 |
+
|
| 164 |
+
Our implementation of Custom TFP leverages the vectorized map for both the forward and backward pass, unlike existing implementations which only use vectorized map for the backward pass (identical to the JAX version). This gives the compiler explicit information about the independence of batches in the computation, enabling significant optimizations, explaining the improvement in Custom TFP compared to the existing TensorFlow implementations. Details about the implementation are provided in the supplementary code.
|
| 165 |
+
|
| 166 |
+
We notice that the runtimes and memory consumption are different between Custom TFP and JAX despite having the same backend compiler. We investigate differences in the XLA-assembly for simple code segments in both frameworks in the supplemental material. TensorFlow 1.0 does not have the same capability to integrate with XLA as TF 2.0 does. The primary optimization available is autoclustering, which we observe does not optimize operations nearly as much as the full JIT.
|
| 167 |
+
|
| 168 |
+
Through the ablation study of VMAP and JIT in JAX shown in Table 2, we observe that both components complement each other. In general, we observe that JIT provides the larger performance gain, as shown with the FCNN. For the CNN, the large matrix operations coupled with JAX’s asynchronous execution [34] allow reasonable utilization of the GPU even without VMAP, which is why we observe less of an improvement from JIT alone in this experiment. The runtimes without these two primitives is significantly slower than the other frameworks–this is because JAX was built ground-up to leverage these primitives [10].
|
| 169 |
+
|
| 170 |
+
In the ablation for Custom TFP in Table 2, we see some key differences with JAX. First, the mechanism for VMAP in TensorFlow 2 is different from that in JAX: JAX performs op-by-op batching without compilation, while TensorFlow always compiles the vectorized map [24]. We observe that the non-compiled code still runs in a reasonable amount of time since TensorFlow is optimized to have a competitive eager execution, while JAX is not. Also, in TensorFlow, XLA’s JIT compilation without vectorization is often able to bring the runtime performance close to that of the graph mode with vectorization, implying that XLA is able to recognize opportunities for parallelization even when the user does not explicitly request it. Finally, we observe the benefit of having a fast, fused implementation for LSTMs: while JAX ran out of memory outside of a compiled and vectorized context, Custom TFP is able to achieve reasonable runtimes by leveraging the fused kernel.
|
| 171 |
+
|
| 172 |
+
# 4.1 Drawbacks
|
| 173 |
+
|
| 174 |
+
While integrating XLA into DPSGD presents a massive runtime and memory advantage, there is a cost. XLA is a subset of all permissable operations in JAX and TensorFlow, requiring users to be cognizant of functionality they use. For example, jax.numpy.unique $\left( \mathbf { x } \right)$ produces a result whose shape is not known at compile time, preventing it from being used with JIT compilation. More subtle errors involving unintended recompilation of code are also possible which can lead to enormous slowdowns.
|
| 175 |
+
|
| 176 |
+
Another potential downside is that these benefits are not observed if the batch size is large enough and the bottleneck becomes the actual network evaluation. In a situation like this, all of the frameworks would perform at approximately the same speeds. However, in practice, this is rarely true and moreso in differentially private machine learning where models are not particularly large.
|
| 177 |
+
|
| 178 |
+
# 5 Conclusion and Future Work
|
| 179 |
+
|
| 180 |
+
We have demonstrated that language primitives like vectorization, JIT compilation, and static graph optimization can dramatically improve the running time of DPSGD, realized by JAX and our Custom TFP. In particular, we find that using JAX can almost entirely remove the computational overhead introduced by DPSGD, thus alleviating a major pain point of private machine learning practitioners.
|
| 181 |
+
|
| 182 |
+
In our work, we focus on conventional set-ups for academic researchers; for future work, it would be insightful to explore the performance of distributed DPSGD, as distributed set-ups are becoming increasingly commonplace. Furthermore, implementing a PyTorch JIT compatible version of DPSGD could provide an alternative to TensorFlow and JAX, particularly if said implementation is compatible with PyTorch XLA. Though these two compilation systems are immature compared to TensorFlow and JAX, they are rapidly improving and should not be ignored. Outside of Python, there are powerful autodifferentiation methods in other more perfomant languages such as Julia [30] and Swift [50] which are worthy of study.
|
| 183 |
+
|
| 184 |
+
# Acknowledgements
|
| 185 |
+
|
| 186 |
+
We would like to thank Roy Frostig for helpful discussions on JAX, Steve Chien and Shuang Song for their work in implementing our improvements in TensorFlow Privacy, Xi He and Om Thakkar for valuable feedback on drafts of this work, and several JAX, TensorFlow, and Opacus developers who helped answer our issues, including James Bradbury, Peter Buchlovsky, Peter Hawkins, Matthew Johnson, Karthik Prasad, Github handle ravikyram, and Qianli Scott Zhu.
|
| 187 |
+
|
| 188 |
+
# Funding Transparency Statement
|
| 189 |
+
|
| 190 |
+
Funding in direct support of this work: an NSERC Discovery Grant, a Compute Canada RRG grant, and a University of Waterloo startup grant.
|
| 191 |
+
|
| 192 |
+
# References
|
| 193 |
+
|
| 194 |
+
[1] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems. https://www.tensorflow.org/, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org.
|
| 195 |
+
[2] Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM Conference on Computer and Communications Security, CCS ’16, pages 308–318, New York, NY, USA, 2016. ACM.
|
| 196 |
+
[3] act65. Custom gradient aggregation methods. https://github.com/tensorflow/ tensorflow/issues/15760, December 2017. URL https://github.com/tensorflow/ tensorflow/issues/15760.
|
| 197 |
+
[4] Ashish Agarwal and Igor Ganichev. Auto-vectorizing tensorflow graphs: Jacobians, autobatching and beyond. arXiv preprint arXiv:1903.04243, 2019.
|
| 198 |
+
[5] Ashish Agarwal and Igor Ganichev. Auto-vectorizing tensorflow graphs: Jacobians, autobatching and beyond, 2019.
|
| 199 |
+
[6] alexdepremia. [feature request] expanding gradient function with variances. https://github. com/pytorch/pytorch/issues/8897, June 2018. URL https://github.com/pytorch/ pytorch/issues/8897.
|
| 200 |
+
[7] Rohan Anil, Badih Ghazi, Vineet Gupta, Ravi Kumar, and Pasin Manurangsi. Large-scale differentially private BERT. arXiv preprint arXiv:2108.01624, 2021.
|
| 201 |
+
[8] Raef Bassily, Adam Smith, and Abhradeep Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In Proceedings of the 55th Annual IEEE Symposium on Foundations of Computer Science, FOCS ’14, pages 464–473, Washington, DC, USA, 2014. IEEE Computer Society.
|
| 202 |
+
[9] Abhishek Bhowmick, John Duchi, Julien Freudiger, Gaurav Kapoor, and Ryan Rogers. Protection against reconstruction and its applications in private federated learning. arXiv preprint arXiv:1812.00984, 2018.
|
| 203 |
+
|
| 204 |
+
[10] 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.
|
| 205 |
+
|
| 206 |
+
[11] Zhiqi Bu, Sivakanth Gopi, Janardhan Kulkarni, Yin Tat Lee, Judy Hanwen Shen, and Uthaipon Tantipongpipat. Fast and memory efficient differentially private-sgd via JL projections. In Advances in Neural Information Processing Systems 34, NeurIPS ’21. Curran Associates, Inc., 2021.
|
| 207 |
+
|
| 208 |
+
[12] Nicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos, and Dawn Song. The secret sharer: Evaluating and testing unintended memorization in neural networks. In 28th USENIX Security Symposium, USENIX Security ’19, pages 267–284. USENIX Association, 2019.
|
| 209 |
+
|
| 210 |
+
[13] Felix Dangel. Support for recurrent units. https://github.com/f-dangel/backpack/ issues/16, 2019. URL https://github.com/f-dangel/backpack/issues/16.
|
| 211 |
+
|
| 212 |
+
[14] Felix Dangel, Frederik Kunstner, and Philipp Hennig. BackPACK: Packing more into backprop. In Proceedings of the 8th International Conference on Learning Representations, ICLR ’20, 2020.
|
| 213 |
+
|
| 214 |
+
[15] Dheeru Dua and Casey Graff. UCI machine learning repository. http://archive.ics.uci. edu/ml, 2017. URL http://archive.ics.uci.edu/ml. License: Open Data Commons.
|
| 215 |
+
|
| 216 |
+
[16] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Proceedings of the 3rd Conference on Theory of Cryptography, TCC ’06, pages 265–284, Berlin, Heidelberg, 2006. Springer.
|
| 217 |
+
|
| 218 |
+
[17] Facebook. Lstm. https://pytorch.org/docs/stable/_modules/torch/nn/modules/ rnn.html#LSTM. URL https://pytorch.org/docs/stable/_modules/torch/nn/ modules/rnn.html#LSTM.
|
| 219 |
+
|
| 220 |
+
[18] FaceBook. Pytorch xla, 2020. URL https://github.com/pytorch/xla.
|
| 221 |
+
|
| 222 |
+
[19] Roy Frostig, Matthew James Johnson, and Chris Leary. Compiling machine learning programs via high-level tracing. In The 1st Conference on Systems and Machine Learning, SysML ’18, 2018.
|
| 223 |
+
|
| 224 |
+
[20] Ian Goodfellow. Efficient per-example gradient computations. arXiv preprint arXiv:1510.01799, 2015.
|
| 225 |
+
|
| 226 |
+
[21] Google. Tensorflow graph optimization with grappler. https://www.tensorflow.org/ guide/graph_optimization, . URL https://www.tensorflow.org/guide/graph_ optimization. License: Apache 2.0 License.
|
| 227 |
+
|
| 228 |
+
[22] Google. XLA: Optimizing compiler for machine learning. https://www.tensorflow.org/ xla, . URL https://www.tensorflow.org/xla. License: Apache 2.0 License.
|
| 229 |
+
|
| 230 |
+
[23] Google. tf.keras.layers.lstm. https://www.tensorflow.org/api_docs/python/tf/ keras/layers/LSTM, . URL https://www.tensorflow.org/api_docs/python/tf/ keras/layers/LSTM.
|
| 231 |
+
|
| 232 |
+
[24] Google. tf.vectorized_map. https://www.tensorflow.org/api_docs/python/tf/ vectorized_map, . URL https://www.tensorflow.org/api_docs/python/tf/ vectorized_map.
|
| 233 |
+
|
| 234 |
+
[25] Google. differentially_private_sgd.py. https://github.com/google/jax/blob/master/ examples/differentially_private_sgd.py, April 2019. URL https://github.com/ google/jax/blob/master/examples/differentially_private_sgd.py. License: Apache License 2.0.
|
| 235 |
+
|
| 236 |
+
[26] Charles R Harris, K Jarrod Millman, Stéfan J van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J Smith, et al. Array programming with numpy. Nature, 585(7825):357–362, 2020.
|
| 237 |
+
|
| 238 |
+
[27] Matteo Hessel, David Budden, Fabio Viola, Mihaela Rosca, Eren Sezener, and Tom Hennigan. Optax: composable gradient transformation and optimisation, in JAX!, 2020. URL http: //github.com/deepmind/optax.
|
| 239 |
+
|
| 240 |
+
[28] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 241 |
+
|
| 242 |
+
[29] Roger Iyengar, Joseph P Near, Dawn Song, Om Thakkar, Abhradeep Thakurta, and Lun Wang. Towards practical differentially private convex optimization. In Proceedings of the 40th IEEE Symposium on Security and Privacy, SP ’19, pages 299–316, Washington, DC, USA, 2019. IEEE Computer Society.
|
| 243 |
+
|
| 244 |
+
[30] Julia. Juliadiff. https://www.juliadiff.org/. URL https://www.juliadiff.org/.
|
| 245 |
+
|
| 246 |
+
[31] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
|
| 247 |
+
|
| 248 |
+
[32] Frederik Kunstner. [feature request] simple and efficient way to get gradients of each element of a sum. https://github.com/pytorch/pytorch/issues/7786, May 2018. URL https: //github.com/pytorch/pytorch/issues/7786.
|
| 249 |
+
|
| 250 |
+
[33] Jaewoo Lee and Daniel Kifer. Scaling up differentially private deep learning with fast perexample gradient clipping. arXiv preprint arXiv:2009.03106, 2020.
|
| 251 |
+
|
| 252 |
+
[34] Anselm Levskaya and Matthew James Johnson. Asynchronous dispatch. https:// jax.readthedocs.io/en/latest/async_dispatch.html, 2019. URL https://jax. readthedocs.io/en/latest/async_dispatch.html.
|
| 253 |
+
|
| 254 |
+
[35] Zachary C. Lipton. Gradients of non-scalars (higher rank jacobians). https://github. com/tensorflow/tensorflow/issues/675, January 2016. URL https://github.com/ tensorflow/tensorflow/issues/675.
|
| 255 |
+
|
| 256 |
+
[36] Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142–150, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P11-1015. License: No explicit license, but explicitly is made available for research.
|
| 257 |
+
|
| 258 |
+
[37] Nicolas Papernot, Andrew Galen, and Steven Chien. Tensorflow privacy. https://github. com/tensorflow/privacy, December 2018. URL https://github.com/tensorflow/ privacy. License: Apache 2.0 License.
|
| 259 |
+
|
| 260 |
+
[38] Nicolas Papernot, Abhradeep Thakurta, Shuang Song, Steve Chien, and Úlfar Erlingsson. Tempered sigmoid activations for deep learning with differential privacy. arXiv preprint arXiv:2007.14191, 2020.
|
| 261 |
+
|
| 262 |
+
[39] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, highperformance deep learning library. In Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library. pdf. License: BSD.
|
| 263 |
+
|
| 264 |
+
[40] Louis B Rall. Automatic Differentiation: Techniques and Applications, volume 120 of Lecture Notes in Computer Science. Springer, 1981.
|
| 265 |
+
|
| 266 |
+
[41] Gaspar Rochette, Andre Manoel, and Eric W Tramel. Efficient per-example gradient computations in convolutional neural networks. arXiv preprint arXiv:1912.06015, 2019.
|
| 267 |
+
|
| 268 |
+
[42] seerdecker. Provide unaggregated gradients tensors. https://github.com/tensorflow/ tensorflow/issues/4897, October 2016. URL https://github.com/tensorflow/ tensorflow/issues/4897.
|
| 269 |
+
|
| 270 |
+
[43] Shuang Song, Kamalika Chaudhuri, and Anand D Sarwate. Stochastic gradient descent with differentially private updates. In Proceedings of the 2013 IEEE Global Conference on Signal and Information Processing, GlobalSIP ’13, pages 245–248, Washington, DC, USA, 2013. IEEE Computer Society.
|
| 271 |
+
|
| 272 |
+
[44] Kunal Talwar. Personal communication, July 2020.
|
| 273 |
+
|
| 274 |
+
[45] Aleena Thomas, David Adelani, Ali Davody, Aditya Mogadala, and Dietrich Klakow. Investigating the impact of pre-trained word embeddings on memorization in neural networks. In Proceedings of the 23rd International Conference on Text, Speech and Dialogue, TSD $^ { , } 2 0$ , 2020.
|
| 275 |
+
|
| 276 |
+
[46] Nicholas Vadivelu. Xla compilation does not work with embeddings layer. https: //github.com/tensorflow/tensorflow/issues/43687, October 2020. URL https: //github.com/tensorflow/tensorflow/issues/43687.
|
| 277 |
+
|
| 278 |
+
[47] Nicholas Vadivelu. Xla compilation bug. https://github.com/tensorflow/tensorflow/ issues/43723, October 2020. URL https://github.com/tensorflow/tensorflow/ issues/43723.
|
| 279 |
+
|
| 280 |
+
[48] Chris Waites. Pyvacy. https://github.com/ChrisWaites/pyvacy/network, March 2019. URL https://github.com/ChrisWaites/pyvacy. License: Apache 2.0 License.
|
| 281 |
+
|
| 282 |
+
[49] Chris Waites and Rachel Cummings. Differentially private normalizing flows for privacypreserving density estimation. ICML Workshop on Invertible Neural Networks, Normalizing Flows, and Explicit Likelihood Models, 2020.
|
| 283 |
+
|
| 284 |
+
[50] Richard Wei, Dan Zheng, Marc Rasi, and Bart Chrzaszcz. Differentiable programming manifesto. URL https://github.com/apple/swift/blob/main/docs/ DifferentiableProgramming.md.
|
| 285 |
+
|
| 286 |
+
[51] Ashkan Yousefpour, Igor Shilov, Alexandre Sablayrolles, Davide Testuggine, Karthik Prasad, Mani Malek, John Nguyen, Sayan Gosh, Akash Bharadwaj, Jessica Zhao, Graham Cormode, and Ilya Mironov. Opacus: User-friendly differential privacy library in PyTorch. arXiv preprint arXiv:2109.12298, 2021.
|
| 287 |
+
|
| 288 |
+
[52] Peilin Zhao and Tong Zhang. Stochastic optimization with importance sampling for regularized loss minimization. In Proceedings of the 32nd International Conference on Machine Learning, ICML ’15, pages 1–9. JMLR, Inc., 2015.
|
md/train/ioyq7NsR1KJ/ioyq7NsR1KJ.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adversarial Graph Augmentation to Improve Graph Contrastive Learning
|
| 2 |
+
|
| 3 |
+
Susheel Suresh Purdue University suresh43@purdue.edu
|
| 4 |
+
|
| 5 |
+
Pan Li∗ Purdue University panli@purdue.edu
|
| 6 |
+
|
| 7 |
+
Cong Hao Georgia Tech callie.hao@gatech.edu
|
| 8 |
+
|
| 9 |
+
Jennifer Neville Purdue University and Microsoft Research jenneville@microsoft.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Self-supervised learning of graph neural networks (GNN) is in great need because of the widespread label scarcity issue in real-world graph/network data. Graph contrastive learning (GCL), by training GNNs to maximize the correspondence between the representations of the same graph in its different augmented forms, may yield robust and transferable GNNs even without using labels. However, GNNs trained by traditional GCL often risk capturing redundant graph features and thus may be brittle and provide sub-par performance in downstream tasks. Here, we propose a novel principle, termed adversarial-GCL (AD-GCL), which enables GNNs to avoid capturing redundant information during the training by optimizing adversarial graph augmentation strategies used in GCL. We pair AD-GCL with theoretical explanations and design a practical instantiation based on trainable edge-dropping graph augmentation. We experimentally validate AD-GCL2 by comparing with the state-of-the-art GCL methods and achieve performance gains of up-to $14 \%$ in unsupervised, $6 \%$ in transfer, and $3 \%$ in semi-supervised learning settings overall with 18 different benchmark datasets for the tasks of molecule property regression and classification, and social network classification.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Graph representation learning (GRL) aims to encode graph-structured data into low-dimensional vector representations, which has recently shown great potential in many applications in biochemistry, physics and social science [1–3]. Graph neural networks (GNNs), inheriting the power of neural networks [4, 5], have become the almost de facto encoders for GRL [6–9]. GNNs have been mostly studied in cases with supervised end-to-end training [10–16], where a large number of task-specific labels are needed. However, in many applications, annotating labels of graph data takes a lot of time and resources [17, 18], e.g., identifying pharmacological effect of drug molecule graphs requires living animal experiments [19]. Therefore, recent research efforts are directed towards studying self-supervised learning for GNNs, where only limited or even no labels are needed [18, 20–31].
|
| 18 |
+
|
| 19 |
+
Designing proper self-supervised-learning principles for GNNs is crucial, as they drive what information of graph-structured data will be captured by GNNs and may heavily impact their performance in downstream tasks. Many previous works adopt the edge-reconstruction principle to match traditional network-embedding requirement [32–35], where the edges of the input graph are expected to be reconstructed based on the output of GNNs [20, 21, 36]. Experiments showed that these GNN models learn to over-emphasize node proximity [23] and may lose subtle but crucial structural information, thus failing in many tasks including node-role classification [16, 35, 37, 38] and graph classification [17].
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: The AD-GCL principle and its instantiation based on learnable edge-dropping augmentation. ADGCL contains two components for graph data encoding and graph data augmentation. The GNN encoder $f ( \cdot )$ maximizes the mutual information between the original graph $G$ and the augmented graph $t ( G )$ while the GNN augmenter optimizes the augmentation $T ( \cdot )$ to remove the information from the original graph. The instantiation of AD-GCL proposed in this work uses edge dropping: An edge $e$ of $G$ is randomly dropped according to Bernoulli $\left( \omega _ { e } \right)$ , where $\omega _ { e }$ is parameterized by the GNN augmenter.
|
| 23 |
+
|
| 24 |
+
To avoid the above issue, graph contrastive learning (GCL) has attracted more attention recently [18, 22, 23, 25–31]. GCL leverages the mutual information maximization principle (InfoMax) [39] that aims to maximize the correspondence between the representations of a graph (or a node) in its different augmented forms [18, 24, 25, 28–31]. Perfect correspondence indicates that a representation precisely identifies its corresponding graph (or node) and thus the encoding procedure does not decrease the mutual information between them.
|
| 25 |
+
|
| 26 |
+
However, researchers have found that the InfoMax principle may be risky because it may push encoders to capture redundant information that is irrelevant to the downstream tasks: Redundant information suffices to identify each graph to achieve InfoMax, but encoding it yields brittle representations and may severely deteriorate the performance of the encoder in the downstream tasks [40]. This observation reminds us of another principle, termed information bottleneck (IB) [41–46]. As opposed to InfoMax, IB asks the encoder to capture the minimal sufficient information for the downstream tasks. Specifically, IB minimizes the information from the original data while maximizing the information that is relevant to the downstream tasks. As the redundant information gets removed, the encoder learnt by IB tends to be more robust and transferable. Recently, IB has been applied to GNNs [47, 48]. But IB needs the knowledge of the downstream tasks that may not be available.
|
| 27 |
+
|
| 28 |
+
Hence, a natural question emerges: When the knowledge of downstream tasks are unavailable, how to train GNNs that may remove redundant information? Previous works highlight some solutions by designing data augmentation strategies for GCL but those strategies are typically task-related and sub-optimal. They either leverage domain knowledge [25, 28, 30], e.g., node centralities in network science or molecule motifs in bio-chemistry, or depend on extensive evaluation on the downstream tasks, where the best strategy is selected based on validation performance [24, 30].
|
| 29 |
+
|
| 30 |
+
In this paper, we approach this question by proposing a novel principle that pairs GCL with adversarial training, termed AD-GCL, as shown in Fig.1. We particularly focus on training self-supervised GNNs for graph-level tasks, though the idea may be generalized for node-level tasks. AD-GCL consists of two components: The first component contains a GNN encoder, which adopts InfoMax to maximize the correspondence/mutual information between the representations of the original graph and its augmented graphs. The second component contains a GNN-based augmenter, which aims to optimize the augmentation strategy to decrease redundant information from the original graph as much as possible. AD-GCL essentially allows the encoder capturing the minimal sufficient information to distinguish graphs in the dataset. We further provide theoretical explanations of AD-GCL. We show that with certain regularization on the search space of the augmenter, AD-GCL can yield a lower bound guarantee of the information related to the downstream tasks, while simultaneously holding an upper bound guarantee of the redundant information from the original graphs, which matches the aim of the IB principle. We further give an instantiation of AD-GCL: The GNN augmenter adopts a task-agnostic augmentation strategy and will learn an input-graph-dependent non-uniform-edge-drop probability to perform graph augmentation.
|
| 31 |
+
|
| 32 |
+
Finally, we extensively evaluate AD-GCL on 18 different benchmark datasets for molecule property classification and regression, and social network classification tasks in different setting viz. unsupervised learning (Sec. 5.1), transfer learning (Sec. 5.3) and semi-supervised learning (Sec. 5.4) learning. AD-GCL achieves significant performance gains in relative improvement and high mean ranks over the datasets compared to state-of-the-art baselines. We also study the theoretical aspects of AD-GCL with apt experiments and analyze the results to offer fresh perspectives (Sec. 5.2): Interestingly, we observe that AD-GCL outperforms traditional GCL based on non-optimizable augmentation across almost the entire range of perturbation levels.
|
| 33 |
+
|
| 34 |
+
# 2 Notations and Preliminaries
|
| 35 |
+
|
| 36 |
+
We first introduce some preliminary concepts and notations for further exposition. In this work, we consider attributed graphs $G = ( V , E )$ where $V$ is a node set and $E$ is an edge set. $G$ may have node attributes $\{ X _ { v } \in \mathbb { R } ^ { \breve { F } } \mid ^ { \cdot } v \in V \}$ and edge attributes $\{ X _ { e } \in \mathbb { R } ^ { F } \mid e \in E \}$ of dimension $F$ . We denote the set of the neighbors of a node $v$ as $\mathcal { N } _ { v }$ .
|
| 37 |
+
|
| 38 |
+
Learning Graph Representations. Given a set of graphs $G _ { i }$ , $i = 1 , 2 , . . . , n$ , in some universe $\mathcal { G }$ , the aim is to learn an encoder $f : \mathcal { G } \mathbb { R } ^ { d }$ , where $f ( G _ { i } )$ can be further used in some downstream task. We also assume that $G _ { i }$ ’s are all IID sampled from an unknown distribution $\mathbb { P } _ { \mathcal { G } }$ defined over $\mathcal { G }$ . In a downstream task, each $G _ { i }$ is associated with a label $y _ { i } \in \mathcal { V }$ . Another model $q : \mathbb { R } ^ { d } \mathcal { V }$ will be learnt to predict $Y _ { i }$ based on $q ( f ( G _ { i } ) )$ . We assume $( G _ { i } , Y _ { i } )$ ’s are IID sampled from a distribution $\mathbb { P } _ { \mathcal { G } \times \mathcal { y } } = \mathbb { P } _ { \mathcal { y } | \mathcal { G } } \mathbb { P } _ { \mathcal { G } }$ , where $\mathbb { P } _ { \mathcal { V } | \mathcal { G } }$ is the conditional distribution of the graph label in the downstream task given the graph.
|
| 39 |
+
|
| 40 |
+
Graph Neural Networks (GNNs). In this work, we focus on using GNNs, message passing GNNs in particular [49], as the encoder $f$ . For a graph $G = ( V , E )$ , every node $v \in V$ will be paired with a node representation $h _ { v }$ initialized as $h _ { v } ^ { ( 0 ) } = X _ { v }$ . These representations will be updated by a GNN. During the $k ^ { \mathrm { { t h } } }$ iteration, each $h _ { v } ^ { ( k - 1 ) }$ is updated using $v ^ { \prime } \mathrm { s }$ neighbourhood information expressed as,
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
h _ { v } ^ { ( k ) } = \mathrm { U P D A T E } ^ { ( k ) } \Bigg ( h _ { v } ^ { ( k - 1 ) } , \mathrm { A G G R E G A T E } ^ { ( k ) } \Big ( \big \{ ( h _ { u } ^ { ( k - 1 ) } , X _ { u v } ) \mid u \in \mathcal { N } _ { v } \big \} \Big ) \Bigg )
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where AGGREGATE $( \cdot )$ is a trainable function that maps the set of node representations and edge attributes $X _ { u v }$ to an aggregated vector, $\mathrm { U P D A T E } ( \cdot )$ is another trainable function that maps both $v$ ’s current representation and the aggregated vector to $v$ ’s updated representation. After $K$ iterations of Eq. 1, the graph representation is obtained by pooling the final set of node representations as,
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
f ( G ) : \triangleq h _ { G } = \mathrm { P O O L } \big ( \{ h _ { v } ^ { ( K ) } \mid v \in V \} \big )
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
For design choices regarding aggregation, update and pooling functions we refer the reader to [3, 7, 8].
|
| 53 |
+
|
| 54 |
+
The Mutual Information Maximization Principle. GCL is built upon the InfoMax principle [39], which prescribes to learn an encoder $f$ that maximizes the mutual information or the correspondence between the graph and its representation. The rationale behind GCL is that a graph representation $f ( G )$ should capture the features of the graph $G$ so that representation can distinguish this graph from other graphs. Specifically, the objective of GCL follows
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\operatorname { I n f o M a x : } \quad \operatorname* { m a x } _ { f } I ( G ; f ( G ) ) , \quad \operatorname { w h e r e } G \sim \mathbb { P } _ { \mathcal { G } } .
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $I ( X _ { 1 } ; X _ { 2 } )$ denotes the mutual information between two random variables $X _ { 1 }$ and $X _ { 2 }$ [50].
|
| 61 |
+
|
| 62 |
+
Note that the encoder $f ( \cdot )$ given by GNNs is not injective in the graph space $\mathcal { G }$ due to its limited expressive power [14, 15]. Specifically, for the graphs that cannot be distinguished by 1-WL test [51], GNNs will associate them with the same representations. We leave more discussion on 1-WL test in Appendix C. In contrast to using CNNs as encoders, one can never expect GNNs to identify all the graphs in $\mathcal { G }$ based their representations, which introduces a unique challenge for GCL.
|
| 63 |
+
|
| 64 |
+
# 3 Adversarial Graph Contrastive Learning
|
| 65 |
+
|
| 66 |
+
In this section, we introduce our adversarial graph contrastive learning (AD-GCL) framework and one of its instantiations based on edge perturbation.
|
| 67 |
+
|
| 68 |
+
# 3.1 Theoretical Motivation and Formulation of AD-GCL
|
| 69 |
+
|
| 70 |
+
The InfoMax principle in Eq. 3 could be problematic in practice for general representation learning. Tschannen et al. have shown that for image classification, representations capturing the information that is entirely irrelevant to the image labels are also able to maximize the mutual information but such representations are definitely not useful for image classification [40]. A similar issue can also be observed in graph representation learning, as illustrated by Fig.2: We consider a binary graph classification problem with graphs in the dataset ogbg-molbace [52]. Two GNN encoders with exactly the same architecture are trained to keep mutual information maximization between graph representations and the input graphs, but one of the GNN encoders in the same time is further supervised by random graph labels. Although the GNN encoder supervised by random labels still keeps one-to-one correspondance between every input graph and its representation (i.e., mutual information maximization), we may observe significant performance degeneration of this GNN encoder when evaluating it over the downstream ground-truth labels. More detailed experiment setup is left in Appendix G.1.
|
| 71 |
+
|
| 72 |
+
This observation inspires us to rethink what a good graph representation is. Recently, the information bottleneck has applied to learn graph representations [47, 48]. Specifically, the objective of graph information bottleneck (GIB) follows
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\operatorname* { m a x } _ { f } I ( f ( G ) ; Y ) - \beta I ( G ; f ( G ) ) ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $( G , Y ) \sim \mathbb { P } _ { \mathcal { G } \times \mathcal { Y } } , \beta$ is a positive constant. Comparing Eq. 3 and Eq. 4, we may observe the different requirements between InfoMax and GIB: InfoMax asks for maximizing the information from the original graph, while GIB asks for minimizing such information but simultaneously maximizing the information that is relevant to the downstream tasks. As GIB asks to remove redundant information, GIB naturally avoids the issue encountered in Fig.2. Removing extra information also makes GNNs trained w.r.t. GIB robust to adverserial attack and strongly transferrable [47, 48].
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: Two GNNs keep the mutual information maximized between graphs and their representations. Simultaneously, they get supervised by ground-truth labels (green) and random labels (blue) respectively. The curves show their testing performance on predicting ground-truth labels.
|
| 82 |
+
|
| 83 |
+
Unfortunately, GIB requires the knowledge of the class labels $Y$ from the downstream task and thus does not apply to self-supervised training of GNNs where there are few or no labels. Then, the question is how to learn robust and transferable GNNs in a self-supervised way.
|
| 84 |
+
|
| 85 |
+
To address this, we will develop a GCL approach that uses adversarial learning to avoid capturing redundant information during the representation learning. In general, GCL methods use graph data augmentation (GDA) processes to perturb the original observed graphs and decrease the amount of information they encode. Then, the methods apply InfoMax over perturbed graph pairs (using different GDAs) to train an encoder $f$ to capture the remaining information.
|
| 86 |
+
|
| 87 |
+
Definition 1 (Graph Data Augmentation (GDA)). For a graph $G \in { \mathcal { G } }$ , $T ( G )$ denotes a graph data augmentation of $G$ , which is a distribution defined over $\mathcal { G }$ conditioned on $G$ . We use $t ( G ) \in { \mathcal { G } }$ to denote a sample of $T ( G )$ .
|
| 88 |
+
|
| 89 |
+
Specifically, given two ways of GDA $T _ { 1 }$ and $T _ { 2 }$ , the objective of GCL becomes
|
| 90 |
+
|
| 91 |
+
GDA-GCL: $\operatorname* { m a x } _ { f } I ( f ( t _ { 1 } ( G ) ) ; f ( t _ { 2 } ( G ) ) )$ , where $G \sim \mathbb { P } _ { \mathcal { G } , } t _ { i } ( G ) \sim T _ { i } ( G ) , i \in \{ 1 , 2 \} .$
|
| 92 |
+
|
| 93 |
+
In practice, GDA processes are often pre-designed based on either domain knowledge or extensive evaluation, and improper choice of GDA may severely impact the downstream performance [17, 24]. We will review a few GDAs adopted in existing works in Sec.4.
|
| 94 |
+
|
| 95 |
+
In contrast to previous predefined GDAs, our idea, inspired by GIB, is to learn the GDA process (over a parameterized family), so that the encoder $f$ can capture the minimal information that is sufficient to identify each graph.
|
| 96 |
+
|
| 97 |
+
AD-GCL: We optimize the following objective, over a GDA family $\tau$ (defined below).
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\operatorname* { m i n } _ { T \in { \mathcal { T } } } \operatorname* { m a x } _ { f } I ( f ( G ) ; f ( t ( G ) ) ) , \quad { \mathrm { w h e r e ~ } } G \sim \mathbb { P } _ { \mathcal { G } } , t ( G ) \sim T ( G ) ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Definition 2 (Graph Data Augmentation Family). Let $\tau$ denote a family of different GDAs $T _ { \Phi } ( \cdot )$ , where $\Phi$ is the parameter in some universe. A $T _ { \Phi } ( \cdot ) \in \mathcal { T }$ is a specific GDA with parameter $\Phi$ .
|
| 104 |
+
|
| 105 |
+
The min-max principle in AD-GCL aims to train the encoder such that even with a very aggressive GDA (i.e., where $t ( G )$ is very different from $G$ ), the mutual information $/$ the correspondence between the perturbed graph and the original graph can be maximized. Compared with the two GDAs adopted in GDA-GCL (Eq.5), AD-GCL views the original graph $G$ as the anchor while pushing its perturbation $T ( G )$ as far from the anchor as it can. The automatic search over $T \in { \mathcal { T } }$ saves a great deal of effort evaluating different combinations of GDA as adopted in [24].
|
| 106 |
+
|
| 107 |
+
Relating AD-GCL to the downstream task. Next, we will theoretically characterize the property of the encoder trained via AD-GCL. The analysis here not only further illustrates the rationale of AD-GCL but helps design practical $\tau$ when some knowledge of $Y$ is accessible. But note that our analysis does not make any assumption on the availability of $Y$ .
|
| 108 |
+
|
| 109 |
+
Note that GNNs learning graph representations is very different from CNNs learning image representations because GNNs are never injective mappings between the graph universe $\mathcal { G }$ and the representation space $\mathbb { R } ^ { d }$ , because the expressive power of GNNs is limited by the 1-WL test [14, 15, 51]. So, we need to define a quotient space of $\mathcal { G }$ based on the equivalence given by the 1-WL test.
|
| 110 |
+
|
| 111 |
+
Definition 3 (Graph Quotient Space). Define the equivalence $\cong$ between two graphs $G _ { 1 } \cong G _ { 2 }$ if $G _ { 1 }$ , $G _ { 2 }$ cannot be distinguished by the $I$ -WL test. Define the quotient space $\mathcal { G } ^ { \prime } = \mathcal { G } / \cong$ .
|
| 112 |
+
|
| 113 |
+
So every element in the quotient space, i.e., $G ^ { \prime } \in \mathcal { G } ^ { \prime }$ , is a representative graph from a family of graphs that cannot be distinguished by the 1-WL test. Note that our definition also allows attributed graphs.
|
| 114 |
+
|
| 115 |
+
Definition 4 (Probability Measures in $\mathcal { G } ^ { \prime }$ ). Define $\mathbb { P } _ { \mathcal { G } ^ { \prime } }$ over the space $\mathcal { G } ^ { \prime }$ such that $\mathbb { P } _ { \mathcal { G } ^ { \prime } } ( G ^ { \prime } ) =$ $\mathbb { P } _ { \mathcal { G } } ( G \cong G ^ { \prime } )$ for any $G ^ { \prime } \in \mathcal { G } ^ { \prime }$ . Further define $\begin{array} { r } { \mathbb { P } _ { \mathcal { G } ^ { \prime } \times \mathcal { V } } ( \bar { G } ^ { \prime } , Y ^ { \prime } ) = \mathbb { P } _ { \mathcal { G } \times \mathcal { V } } ( G \cong G ^ { \prime } , Y = Y ^ { \prime } ) } \end{array}$ . Given $a$ GDA $T ( \cdot )$ defined over $\mathcal { G }$ , define a distribution on $\mathcal { G } ^ { \prime }$ , $T ^ { \prime } ( G ^ { \prime } ) = \mathbb { E } _ { G \sim \mathbb { P } _ { \mathcal { G } } } [ T ( G ) | G \cong G ^ { \prime } ] .$ for $G ^ { \prime } \in \mathcal { G } ^ { \prime }$ .
|
| 116 |
+
|
| 117 |
+
Now, we provide our theoretical results and give their implication. The proof is in the Appendix B.
|
| 118 |
+
|
| 119 |
+
Theorem 1. Suppose the encoder $f$ is implemented by a GNN as powerful as the $^ { l }$ -WL test. Suppose $\mathcal { G }$ is a countable space and thus $\mathcal { G } ^ { \prime }$ is a countable space. Then, the optimal solution $( f ^ { * } , T ^ { * } )$ to AD-GCL satisfies, letting $T ^ { \prime * } ( G ^ { \prime } ) = \mathbb { E } _ { G \sim \mathbb { P } _ { \mathcal { G } } } [ T ^ { * } ( G ) | { \bar { G } } \cong G ^ { \prime } ] ,$ ,
|
| 120 |
+
|
| 121 |
+
1. $\begin{array} { r l r } { I ( f ^ { * } ( t ^ { * } ( G ) ) ; G \mid Y ) } & { \leq } & { \operatorname* { m i n } _ { T \in { \mathcal T } } I ( t ^ { \prime } ( G ^ { \prime } ) ; G ^ { \prime } ) \ - \ I ( t ^ { \prime * } ( G ^ { \prime } ) ; Y ) , } \end{array}$ , where $t ^ { \prime } ( G ^ { \prime } ) \sim T ^ { \prime } ( G ^ { \prime } ) ,$ $t ^ { \prime * } ( G ^ { \prime } ) \sim T ^ { \prime * } ( G ^ { \prime } )$ , $( G , Y ) \sim \mathbb { P } _ { \mathcal { G } \times \mathcal { Y } }$ and $( G ^ { \prime } , Y ) \sim \mathbb { P } _ { \mathcal { G } ^ { \prime } \times \mathcal { Y } }$ .
|
| 122 |
+
|
| 123 |
+
2. $I ( f ^ { * } ( G ) ; Y ) \geq I ( f ^ { * } ( t ^ { \prime * } ( G ^ { \prime } ) ) ; Y ) = I ( t ^ { \prime * } ( G ^ { \prime } ) ; Y ) .$ , where $t ^ { \prime * } ( G ^ { \prime } ) \sim T ^ { \prime * } ( G ^ { \prime } )$ , $( G , Y ) \sim \mathbb { P } _ { \mathcal { G } \times \mathcal { Y } }$ and $( G ^ { \prime } , Y ) \sim \mathbb { P } _ { \mathcal { G } ^ { \prime } \times \mathcal { Y } }$ .
|
| 124 |
+
|
| 125 |
+
The statement 1 in Theorem 1 guarantees a upper bound of the information that is captured by the representations but irrelevant to the downstream task, which matches our aim. This bound has a form very relevant to the GIB principle (Eq.4 when $\beta = 1$ ), since $\begin{array} { r l } { \operatorname* { m i n } _ { T \in \mathcal { T } } I ( t ^ { \prime } ( G ^ { \prime } ) ; G ^ { \prime } ) - I ( t ^ { \prime * } ( G ^ { \prime } ) ; Y ) \ge } \end{array}$ $\begin{array} { r } { \operatorname* { m i n } _ { f } [ I ( f ( G ) ; G ) - I ( \bar { f } ( G ) ; \bar { Y } ) ] } \end{array}$ , where $f$ is a GNN encoder as powerful as the 1-WL test. But note that this inequality also implies that the encoder given by AD-GCL may be worse than the optimal encoder given by GIB $\begin{array} { r } { \beta = 1 , } \end{array}$ ). This makes sense as GIB has the access to the downstream task $Y$ .
|
| 126 |
+
|
| 127 |
+
The statement 2 in Theorem 1 guarantees a lower bound of the mutual information between the learnt representations and the labels of the downstream task. As long as the GDA family $\tau$ has a good control, $\begin{array} { r } { I ( t ^ { \prime * } ( G ^ { \prime } ) ; Y ) \ge \operatorname* { m i n } _ { T \in \mathcal { T } } I ( t ^ { \prime } ( G ^ { \prime } ) ; Y ) } \end{array}$ and $I ( f ^ { * } ( G ) ; { \bar { Y } } )$ thus cannot be too small. This implies that it is better to regularize when learning over $\tau$ . In our instantiation, based on edge-dropping augmentation (Sec. 3.2), we regularize the ratio of dropped edges per graph.
|
| 128 |
+
|
| 129 |
+
# 3.2 Instantiation of AD-GCL via Learnable Edge Perturbation
|
| 130 |
+
|
| 131 |
+
We now introduce a practical instantiation of the AD-GCL principle (Eq. 6) based on learnable edge-dropping augmentations as illustrated in Fig. 1. (See Appendix $\mathrm { D }$ for a summary of AD-GCL in its algorithmic form.) The objective of AD-GCL has two folds: (1) Optimize the encoder $f$ to maximize the mutual information between the representations of the original graph $G$ and its augmented graph $t ( G )$ ; (2) Optimize the GDA $T ( G )$ where $t ( G )$ is sampled to minimize such a mutual information. We always set the encoder as a GNN $f _ { \Theta }$ with learnable parameters $\Theta$ and next we focus on the GDA, $T _ { \Phi } ( G )$ that has learnable parameters $\Phi$ .
|
| 132 |
+
|
| 133 |
+
Learnable Edge Dropping GDA model $T _ { \Phi } ( \cdot )$ . Edge dropping is the operation of deleting some edges in a graph. As a proof of concept, we adopt edge dropping to formulate the GDA family $\tau$ . Other types of GDAs such as node dropping, edge adding and feature masking can also be paired with our AD-GCL principle. Interestingly, in our experiments, edge-dropping augmentation optimized by AD-GCL has already achieved much better performance than any pre-defined random
|
| 134 |
+
|
| 135 |
+
GDAs even carefully selected via extensive evaluation [24] (See Sec.5). Another reason that supports edge dropping is due to our Theorem 1 statement 2, which shows that good GDAs should keep some information related to the downstream tasks. Many GRL downstream tasks such as molecule classification only depends on the structural fingerprints that can be represented as subgraphs of the original graph [53]. Dropping a few edges may not change those subgraph structures and thus keeps the information sufficient to the downstream classification. But note that this reasoning does not mean that we leverage domain knowledge to design GDA, as the family $\tau$ is still broad and the specific GDA still needs to be optimized. Moreover, experiments show that our instantiation also works extremely well on social network classification and molecule property regression, where the evidence of subgraph fingerprints may not exist any more.
|
| 136 |
+
|
| 137 |
+
Parameterizing $T _ { \Phi } ( \cdot )$ . For each $G = ( V , E )$ , we set $T _ { \Phi } ( G )$ , $T \in { \mathcal { T } }$ as a random graph model [54, 55] conditioning on $G$ . Each sample $t ( G ) \sim T _ { \Phi } ( G )$ is a graph that shares the same node set with $G$ while the edge set of $t ( G )$ is only a subset of $E$ . Each edge $e \in E$ will be associated with a random variable $p _ { e } \sim \mathrm { B e r n o u l l i } ( \omega _ { e } )$ , where $e$ is in $t ( G )$ if $p _ { e } = 1$ and is dropped otherwise.
|
| 138 |
+
|
| 139 |
+
We parameterize the Bernoulli weights $\omega _ { e }$ by leveraging another GNN, i.e., the augmenter, to run on $G$ according to Eq.1 of $K$ layers, get the final-layer node representations $\{ h _ { v } ^ { ( K ) } | v \in V \}$ and set
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\omega _ { e } = \mathbf { M L P } ( [ h _ { u } ^ { ( K ) } ; h _ { z } ^ { ( K ) } ] ) , \quad \mathrm { w h e r e } e = ( u , z ) \operatorname { a n d } \left\{ h _ { v } ^ { ( K ) } ~ | ~ v \in V \right\} = \mathbf { G N N - a u g m e n t e r } ( G ) .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
To train $T ( G )$ in an end-to-end fashion, we relax the discrete $p _ { e }$ to be a continuous variable in $[ 0 , 1 ]$ and utilize the Gumbel-Max reparametrization trick [56, 57]. Specifically, $p _ { e } = \mathrm { S i g m o i d } ( ( \log \delta -$ $\log ( 1 - \delta ) + \omega _ { e } ) / \tau )$ , where $\delta \sim \mathrm { U n i f o r m } ( 0 , 1 )$ . As temperature hyper-parameter $\tau 0$ , $p _ { e }$ gets closer to being binary. Moreover, the gradients $\frac { \partial p _ { e } } { \partial \omega _ { e } }$ are smooth and well defined. This style of edge dropping based on a random graph model has also been used for parameterized explanations of GNNs [58].
|
| 146 |
+
|
| 147 |
+
Regularizing $T _ { \Phi } ( \cdot )$ . As shown in Theorem 1, a reasonable GDA should keep a certain amount of information related to the downstream tasks (statement 2). Hence, we expect the GDAs in the edge dropping family $\tau$ not to perform very aggressive perturbation. Therefore, we regularize the ratio of edges being dropped per graph by enforcing the following constraint: For a graph $G$ and its augmented graph $t ( G )$ , we add $\textstyle \sum _ { e \in E } \omega _ { e } / | E |$ to the objective, where $\omega _ { e }$ is defined in Eq.7 indicates the probability that $e$ gets dropped.
|
| 148 |
+
|
| 149 |
+
Putting everything together, the final objective is as follows.
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\operatorname* { m i n } _ { \Phi } \operatorname* { m a x } _ { \Theta } I ( f _ { \Theta } ( G ) ; f _ { \Theta } ( t ( G ) ) ) + \lambda _ { \mathrm { r e g } } \mathbb { E } _ { G } \big [ \sum _ { e \in E } \omega _ { e } / | E | \big ] , \mathrm { w h e r e } G \sim \mathbb { P } _ { \mathcal { G } } , t ( G ) \sim T _ { \Phi } ( G ) .
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
Note $\Phi$ corresponds to the learnable parameters of the augmenter GNN and MLP used to derive the $\omega _ { e }$ ’s and $\Theta$ corresponds to the learnable parameters of the GNN $f$ .
|
| 156 |
+
|
| 157 |
+
Estimating the objective in Eq.8. In our implementation, the second (regularization) term is easy to estimate empirically. For the first (mutual information) term, we adopt InfoNCE as the estimator [59–61], which is known to be a lower bound of the mutual information and is frequently used for contrastive learning [40, 59, 62]. Specfically, during the training, given a minibatch of $m$ graphs $\{ G _ { i } \} _ { i = 1 } ^ { m }$ , let $z _ { i , 1 } = g ( f _ { \Theta } ( G _ { i } ) )$ and $z _ { i , 2 } = g ( f _ { \Theta } ( t ( G _ { i } ) ) )$ where $g ( \cdot )$ is the projection head implemented by a 2-layer MLP as suggested in [62]. With $s i m ( \cdot , \cdot )$ denoting cosine similarity, we estimate the mutual information for the mini-batch as follows.
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
I ( f _ { \Theta } ( G ) ; f _ { \Theta } ( t ( G ) ) ) \to \hat { I } = \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \log \frac { \exp ( s i m ( z _ { i , 1 } , z _ { i , 2 } ) ) } { \sum _ { i ^ { \prime } = 1 , i ^ { \prime } \neq i } ^ { m } \exp ( s i m ( z _ { i , 1 } , z _ { i ^ { \prime } , 2 } ) ) }
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
# 4 Related Work
|
| 164 |
+
|
| 165 |
+
GNNs for GRL is a broad field and gets a high-level review in the Sec. 1. Here, we focus on the topics that are most relevant to graph contrastive learning (GCL).
|
| 166 |
+
|
| 167 |
+
Contrastive learning (CL) [39, 59, 60, 63–65] was initially proposed to train CNNs for image representation learning and has recently achieved great success [62,66]. GCL applies the idea of CL on GNNs. In contrast to the case of CNNs, GCL trained using GNNs posts us new fundamental challenges. An image often has multiple natural views, say by imposing different color filters and so on. Hence, different views of an image give natural contrastive pairs for CL to train CNNs. However, graphs are more abstract and the irregularity of graph structures typically provides crucial information. Thus, designing contrastive pairs for GCL must play with irregular graph structures and thus becomes more challenging. Some works use different parts of a graph to build contrastive pairs, including nodes v.s. whole graphs [18, 67], nodes v.s. nodes [68], nodes v.s. subgraphs [17, 69]. Other works adopt graph data augmentations (GDA) such as edge perturbation [31] to generate contrastive pairs. Recently. GraphCL [24] gives an extensive study on different combinations of GDAs including node dropping, edge perturbation, subgraph sampling and feature masking. Extensive evaluation is required to determine good combinations. MVGRL [25] and GCA [30] leverage the domain knowledge of network science and adopt network centrality to perform GDAs. Note that none of the above methods consider optimizing augmentations. In contrast, our principle AD-GCL provides theoretical guiding principles to optimize augmentations. Very recently, JOAO [70] adopts a bi-level optimization framework sharing some high-level ideas with our adversarial training strategy but has several differences: 1) the GDA search space in JOAO is set as different types of augmentation with uniform perturbation, such as uniform edge/node dropping while we allow augmentation with non-uniform perturbation. 2) JOAO relaxes the GDA combinatorial search problem into continuous space via Jensen’s inequality and adopts projected gradient descent to optimize. Ours, instead, adopts Bayesian modeling plus reparameterization tricks to optimize. The performance comparison between AD-GCL and JOAO for the tasks investigated in Sec. 5 is given in Appendix H.
|
| 168 |
+
|
| 169 |
+
Tian et al. [71] has recently proposed the InfoMin principle that shares some ideas with AD-GCL but there are several fundamental differences. Theoretically, InfoMin needs the downstream tasks to supervise the augmentation. Rephrased in our notation, the optimal augmentation $T _ { I M } ( G )$ given by InfoMin (called the sweet spot in [71]) needs to satisfy $I ( t _ { I M } ( G ) ; Y ) = I ( G ; Y )$ and $\bar { I } ( t _ { I M } ( \bar { G } ) ; G | Y ) = 0$ , $t _ { I M } ( G ) \sim T _ { I M } \bar { ( G ) }$ , neither of which are possible without the downstreamtask knowledge. Instead, our Theorem 1 provides more reasonable arguments and creatively suggests using regularization to control the tradeoff. Empirically, InfoMin is applied to CNNs while AD-GCL is applied to GNNs. AD-GCL needs to handle the above challenges due to irregular graph structures and the limited expressive power of GNNs [14, 15], which InfoMin does not consider.
|
| 170 |
+
|
| 171 |
+
# 5 Experiments and Analysis
|
| 172 |
+
|
| 173 |
+
This section is devoted to the empirical evaluation of the proposed instantiation of our AD-GCL principle. Our initial focus is on unsupervised learning which is followed by analysis of the effects of regularization. We further apply AD-GCL to transfer and semi-supervised learning. Summary of datasets and training details for specific experiments are provided in Appendix E and G respectively.
|
| 174 |
+
|
| 175 |
+
# 5.1 Unsupervised Learning
|
| 176 |
+
|
| 177 |
+
In this setting, an encoder (specifically GIN [72]) is trained with different self-supervised methods to learn graph representations, which are then evaluated by feeding these representations to make prediction for the downstream tasks. We use datasets from Open Graph Benchmark (OGB) [52], TU Dataset [73] and ZINC [74] for graph-level property classification and regression. More details regarding the experimental setting are provided in the Appendix G.
|
| 178 |
+
|
| 179 |
+
We consider two types of AD-GCL, where one is with a fixed regularization weight $\lambda _ { \mathrm { { r e g } } } ~ = ~ 5$ (Eq.8), termed AD-GCL-FIX, and another is with $\lambda _ { \mathrm { r e g } }$ tuned over the validation set among $\{ 0 . 1 , 0 . 3 , 0 . 5 , 1 . 0 , 2 . 0 , 5 . 0 , 1 0 . 0 \}$ , termed AD-GCL-OPT. AD-GCL-FIX assumes any information from the downstream task as unavailable while AD-GCL-OPT assumes the augmentation search space has some weak information from the downstream task. A full range of analysis on how $\lambda _ { \mathrm { r e g } }$ impacts AD-GCL will be investigated in Sec. 5.2. We compare AD-GCL with three unsupervised/selfsupervised learning baselines for graph-level tasks, which include randomly initialized untrained GIN (RU-GIN) [72], InfoGraph [18] and GraphCL [24]. Previous works [18, 24] show that they generally outperform graph kernels [75–77] and network embedding methods [33, 34, 78, 79].
|
| 180 |
+
|
| 181 |
+
We also adopt GCL with GDA based on non-adversarial edge dropping (NAD-GCL) for ablation study. NAD-GCL drops the edges of a graph uniformly at random. We consider NAD-GCL-FIX and NAD-GCL-OPT with different edge drop ratios. NAD-GCL-GCL adopts the edge drop ratio of AD-GCL-FIX at the saddle point of the optimization (Eq.8) while NAD-GCL-OPT optimally tunes the edge drop ratio over the validation datasets to match AD-GCL-OPT. We also adopt fully supervised GIN (F-GIN) to provide an anchor of the performance. We stress that all methods adopt GIN [72] as the encoder. Except F-GIN, all methods adopt a downstream linear classifier or regressor with the same hyper-parameters for fair comparison. Adopting linear models was suggested by [40], which explicitly attributes any performance gain/drop to the quality of learnt representations.
|
| 182 |
+
|
| 183 |
+
<table><tr><td></td><td>Dataset</td><td>NCI1</td><td>PROTEINS</td><td>MUTAG</td><td>DD</td><td>COLLAB</td><td>RDT-B</td><td>RDT-M5K</td><td>IMDB-B</td><td>IMDB-M</td></tr><tr><td></td><td>F-GIN</td><td>78.27±1.35</td><td>72.39 ± 2.76</td><td>90.41 ± 4.61</td><td>74.87 ±3.56</td><td>74.82 ±0.92</td><td>86.79 ± 2.04</td><td>53.28 ± 3.17</td><td>71.83 ± 1.93</td><td>48.46 ± 2.31</td></tr><tr><td></td><td>RU-GIN [72]</td><td>62.98 ±0.10</td><td>69.03±0.33</td><td>87.61 ±0.39</td><td>74.22 ±0.30</td><td>63.08±0.10</td><td>58.97 ±0.13</td><td>27.52 ± 0.61</td><td>51.86±0.33</td><td>32.81 ±0.57</td></tr><tr><td>peraeer</td><td>InfoGraph [18]</td><td>68.13± 0.59</td><td>72.57 ± 0.65</td><td>87.71 ± 1.77</td><td>75.23 ±0.39</td><td>70.35± 0.64</td><td>78.79 ± 2.14</td><td>51.11 ± 0.55</td><td>71.11 ± 0.88</td><td>48.66 ± 0.67</td></tr><tr><td></td><td>GraphCL [24]</td><td>68.54± 0.55</td><td>72.86 ± 1.01</td><td>88.29 ± 1.31</td><td>74.70± 0.70</td><td>71.26 ± 0.55</td><td>82.63 ± 0.99</td><td>53.05 ±0.40</td><td>70.80± 0.77</td><td>48.49 ± 0.63</td></tr><tr><td></td><td>NAD-GCL-FIX</td><td>69.23±0.60</td><td>72.81 ± 0.71</td><td>88.58 ± 1.58</td><td>74.55±0.55</td><td>71.56 ±0.58</td><td>83.41 ±0.66</td><td>52.72 ± 0.71</td><td>70.94 ± 0.77</td><td>48.33± 0.47</td></tr><tr><td></td><td>NAD-GCL-OPT</td><td>69.30± 0.32</td><td>73.18 ± 0.71</td><td>89.05 ± 1.06</td><td>74.55 ±0.55</td><td>72.04 ± 0.67</td><td>83.74±0.76</td><td>53.43± 0.26</td><td>71.94 ± 0.59</td><td>49.01 ± 0.93</td></tr><tr><td></td><td>AD-GCL-FIX</td><td>69.67 ± 0.51*</td><td>73.59± 0.65</td><td>89.25 ± 1.45</td><td>74.49 ±0.52</td><td>73.32 ± 0.61*</td><td>85.52 ±0.79*</td><td>53.00±0.82</td><td>71.57 ± 1.01</td><td>49.04 ±0.53</td></tr><tr><td></td><td>AD-GCL-OPT</td><td>69.67± 0.51*</td><td>73.81 ± 0.46*</td><td>89.70 ± 1.03</td><td>75.10 ± 0.39</td><td>73.32 ± 0.61*</td><td>85.52 ± 0.79*</td><td>54.93 ± 0.43*</td><td>72.33 ± 0.56*</td><td>49.89 ± 0.66*</td></tr><tr><td colspan="11">Regression (Downstream Classifier - Linear Regression + L2)</td></tr><tr><td></td><td>Task Dataset</td><td>molesol</td><td>mollipo</td><td>molfreesolv</td><td>ZINC-10K</td><td>molbace</td><td>molbbbp</td><td>Classification (Downstream Classifier - Logistic Regression + L2) molclintox</td><td>moltox21</td><td>molsider</td></tr><tr><td></td><td>Metric</td><td></td><td>RMSE (shared) (↓)</td><td></td><td>MAE(↓)</td><td></td><td></td><td>ROC-AUC % (shared) (↑)</td><td></td><td></td></tr><tr><td></td><td>F-GIN</td><td>1.173 ± 0.057</td><td>0.757 ± 0.018</td><td>2.755 ± 0.349</td><td>0.254± 0.005</td><td>72.97± 4.00</td><td>68.17 ± 1.48</td><td>88.14 ± 2.51</td><td>74.91 ± 0.51</td><td>57.60 ± 1.40</td></tr><tr><td></td><td></td><td></td><td>1.075±0.022</td><td>7.526 ± 2.119</td><td>0.809±0.022</td><td>75.07± 2.23</td><td>64.48 ± 2.46</td><td>72.29 ± 4.15</td><td>71.53± 0.74</td><td>62.29 ± 1.12</td></tr><tr><td>Besgereg</td><td>RU-GIN [72] InfoGraph [18]</td><td>1.706 ± 0.180</td><td>1.005 ± 0.023</td><td>10.005 ± 4.819</td><td>0.890 ± 0.017</td><td>74.74 ± 3.64</td><td>66.33 ± 2.79</td><td>64.50± 5.32</td><td>69.74 ± 0.57</td><td>60.54 ± 0.90</td></tr><tr><td></td><td>GraphCL [24]</td><td>1.344 ± 0.178 1.272 ± 0.089</td><td>0.910 ± 0.016</td><td>7.679 ± 2.748</td><td>0.627 ± 0.013</td><td>74.32± 2.70</td><td>68.22 ± 1.89</td><td>74.92 ± 4.42</td><td>72.40 ± 1.01</td><td>61.76 ± 1.11</td></tr><tr><td></td><td>NAD-GCL-FIX</td><td>1.392 ± 0.065</td><td>0.952 ± 0.024</td><td>5.840 ±0.877</td><td>0.609 ±0.010</td><td>73.60±2.73</td><td>66.12 ± 1.80</td><td>73.32 ±3.66</td><td>71.65 ± 0.94</td><td>60.41 ± 1.48</td></tr><tr><td>8</td><td>NAD-GCL-OPT</td><td>1.242 ± 0.096</td><td>0.897 ± 0.022</td><td>5.840 ±0.877</td><td>0.609 ± 0.010</td><td>73.69 ± 3.67</td><td>67.70 ± 1.78</td><td>74.40 ± 4.92</td><td>71.65 ± 0.94</td><td>61.14 ± 1.43</td></tr><tr><td></td><td>AD-GCL-FIX</td><td>1.217 ±0.087</td><td>0.842±0.028*</td><td>5.150±0.624*</td><td>0.578±0.012*</td><td>76.37±2.03</td><td>68.24 ± 1.47</td><td>80.77 ± 3.92</td><td>71.42±0.73</td><td></td></tr><tr><td></td><td>AD-GCL-OPT</td><td>1.136 ± 0.050*</td><td>0.812 ± 0.020*</td><td>4.145 ± 0.369*</td><td>0.544± 0.004*</td><td>77.27 ± 2.56</td><td>69.54 ± 1.92</td><td>80.77 ± 3.92</td><td>72.92 ± 0.86</td><td>63.19 ±0.95 63.19 ± 0.95</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Table 1: Unsupervised learning performance for (TOP) biochemical and social network classification in TU datasets [73] (Averaged accuracy $\pm$ std. over 10 runs) and (BOTTOM) chemical molecules property prediction in OGB datasets [52] (mean $\pm$ std. over 10 runs). $\mathbf { B o l d / B o l d ^ { \star } }$ indicats our methods outperform baselines with $\geq 0 . 5 / \geq 2$ std respectively. Fully supervised (F-GIN) results are shown only for placing GRL methods in perspective. Ablation-study (AB-S) results do not count as baselines.
|
| 186 |
+
|
| 187 |
+
Tables 1 show the results for unsupervised graph level property prediction in social and chemical domains respectively. We witness the big performance gain of AD-GCL as opposed to all baselines across all the datasets. Note GraphCL utilizes extensive evaluation to select the best combination of augmentions over a broad GDA family including node-dropping, edge dropping and subgraph sampling. Our results indicate that such extensive evaluation may not be necessary while optimizing the augmentation strategy in an adversarial way is greatly beneficial.
|
| 188 |
+
|
| 189 |
+
We stress that edge dropping is not cherry picked as the search space of augmentation strategies. Other search spaces may even achieve better performance, while an extensive investigation is left for the future work.
|
| 190 |
+
|
| 191 |
+
Moreover, AD-GCL also clearly improves upon the performance against its non-adversarial counterparts (NAD-GCL) across all the datasets, which further demonstrates stable and significant advantages of the AD-GCL principle. Essentially, the input-graph-dependent augmentation learnt by AD-GCL yields much benefit. Finally, we compare AD-GCL-FIX with AD-GCL-OPT. Interestingly, two methods achieve comparable results though AD-GCL-OPT is sometimes better. This observation implies that the AD-GCL principle may be robust to the choice of $\lambda _ { \mathrm { r e g } }$ and thus motivates the analysis in the next subsection. Moreover, weak information from the downstream tasks indeed help with controlling the search space and further betters the performance. We also list the optimal $\lambda _ { \mathrm { r e g } }$ ’s of AD-GCL-OPT for different datasets in Appendix F.1 for the purpose of comparison and reproduction.
|
| 192 |
+
|
| 193 |
+
# 5.1.1 Note on the linear downstream classifier
|
| 194 |
+
|
| 195 |
+
We find that the choice of the downstream classifier can significantly affect the evaluation of the self-supervised representations. InfoGraph [18] and GraphCL [24] adopt a non-linear SVM model as the downstream classifier. Such a non-linear model is more powerful than the linear model we adopt and thus causes some performance gap between the results showed in Table 1 (TOP) and (BOTTOM) and their original results (listed in Appendix G.2.1 as Table 8). We argue that using a non-linear SVM model as the downstream classifier is unfair, because the performance of even a randomly initialized untrained GIN (RU-GIN) is significantly improved (comparing results from Table 1 (TOP) to Table 8 ). Therefore, we argue for adopting a linear classifier protocol as suggested by [40]. That having been said, our methods (both AD-GCL-FIX and AD-GCL-OPT) still performs significantly better than baselines in most cases, even when a non-linear SVM classifer is adopted, as shown in Table 8. Several relative gains are there no matter whether the downstream classifier is a simple linear model (Tables 1) or a non-linear SVM model (Table 8). AD-GCL methods significantly outperform InfoGraph in 5 over 8 datasets and GraphCL in 6 over 8 datasets. This further provides the evidence for the effectiveness of our method. Details on the practical benefits of linear downstream models can be found in Appendix G.2.1.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 3: (a) $\lambda _ { \mathrm { { r e g } } } \nu . s .$ . expected edge drop ratio ${ \mathbb E } _ { \mathcal G } [ \sum _ { e } \omega _ { e } / | E | ]$ (measured at saddle point of Eq.8). (b) Training dynamics of expected drop ratio for $\lambda _ { \mathrm { r e g } }$ . (c) Validation performance for graph classification v.s. edge drop ratio. Compare AD-GCL and GCL with non-adversarial edge dropping. The markers on AD-GCL’s performance curves show the $\lambda _ { \mathrm { r e g } }$ used.
|
| 199 |
+
|
| 200 |
+
# 5.2 Analysis of Regularizing the GDA Model
|
| 201 |
+
|
| 202 |
+
Here, we study how different $\lambda _ { \mathrm { r e g } }$ ’s impact the expected edge drop ratio of AD-GCL at the saddle point of Eq.8 and further impact the model performance on the validation datasets. Due to the page limitation, we focus on classification tasks in the main text while leaving the discussion on regression tasks in the Appendix F.2. Figure 3 shows the results.
|
| 203 |
+
|
| 204 |
+
As shown in Figure 3(a), a large $\lambda _ { \mathrm { r e g } }$ tends to yield a small expected edge drop ratio at the convergent point, which matches our expectation. $\lambda _ { \mathrm { r e g } }$ ranging from 0.1 to 10.0 corresponds to dropping almost everything $80 \%$ edges) to nothing $- 1 0 \%$ edges). The validation performance in Figure 3(c) is out of our expectation. We find that for classification tasks, the performance of the encoder is extremely robust to different choices of $\lambda _ { \mathrm { r e g } }$ ’s when trained w.r.t. the AD-GCL principle, though the edge drop ratios at the saddle point are very different. However, the non-adversarial counterpart NAD-GCL is sensitive to different edge drop ratios, especially on the molecule dataset (e.g., ogbg-molclitox, ogbg-molbbbp). We actually observe the similar issue of NAD-GCL across all molecule datasets (See Appendix F.3). More interesting aspects of our results appear at the extreme cases. When $\lambda _ { \mathrm { r e g } } \geq 5 . 0$ the convergent edge drop ratio is close to 0, which means no edge dropping, but AD-GCL still significantly outperforms naive GCL with small edge drop ratio. When $\lambda _ { \mathrm { r e g } } = 0 . 3$ , the convergent edge drop ratio is greater than 0.6, which means dropping more than half of the edges, but AD-GCL still keeps reasonable performance. We suspect that such benefit comes from the training dynamics of AD-GCL (examples as shown in Figure 3(b)). Particularly, optimizing augmentations allows for non-uniform edge-dropping probability. During the optimization procedure, AD-GCL pushes high drop probability on redundant edges while low drop probability on critical edges, which allows the encoder to differentiate redundant and critical information. This cannot be fully explained by the final convergent edge drop ratio and motivates future investigation of AD-GCL from a more in-depth theoretical perspective.
|
| 205 |
+
|
| 206 |
+
# 5.3 Transfer Learning
|
| 207 |
+
|
| 208 |
+
Next, we evaluate the GNN encoders trained by AD-GCL on transfer learning to predict chemical molecule properties and biological protein functions. We follow the setting in [17] and use the same datasets: GNNs are pre-trained on one dataset using self-supervised learning and later fine-tuned on another dataset to test out-of-distribution performance. Here, we only consider AD-GCL-FIX as AD-GCL-OPT is only expected to have better performance. We adopt baselines including no pre-trained GIN (i.e., without self-supervised training on the first dataset and with only fine-tuning), InfoGraph [18], GraphCL [24], three different pre-train strategies in [17] including edge prediction,
|
| 209 |
+
|
| 210 |
+
<table><tr><td colspan="4">Pre-TrainDataset</td><td colspan="5">ZINC2M</td><td>PPI-306K</td></tr><tr><td>Fine-TuneDataset</td><td>BBBP</td><td>Tox21</td><td>SIDER</td><td>ClinTox</td><td>BACE</td><td>HIV</td><td>MUV</td><td>ToxCast</td><td>PPI</td></tr><tr><td>No Pre-Train</td><td>65.8± 4.5</td><td>74.0±0.8</td><td>57.3 ± 1.6</td><td>58.0±4.4</td><td>70.1 ± 5.4</td><td>75.3 ± 1.9</td><td>71.8± 2.5</td><td>63.4±0.6</td><td>64.8 ±1.0</td></tr><tr><td>EdgePred [17]</td><td>67.3 ± 2.4</td><td>76.0±0.6</td><td>60.4±0.7</td><td>64.1 ± 3.7</td><td>79.9± 0.9</td><td>76.3 ± 1.0</td><td>74.1 ± 2.1</td><td>64.1± 0.6</td><td>65.7 ± 1.3</td></tr><tr><td>AttrMasking [17]</td><td>64.3 ± 2.8</td><td>76.7 ±0.4</td><td>61.0 ±0.7</td><td>71.8 ± 4.1</td><td>79.3 ± 1.6</td><td>77.2 ± 1.1</td><td>74.7 ± 1.4</td><td>64.2 ± 0.5</td><td>65.2 ± 1.6</td></tr><tr><td>ContextPred [17]</td><td>68.0± 2.0</td><td>75.7 ±0.7</td><td>60.9 ±0.6</td><td>65.9±3.8</td><td>79.6 ± 1.2</td><td>77.3 ± 1.0</td><td>75.8 ± 1.7</td><td>63.9±0.6</td><td>64.4 ± 1.3</td></tr><tr><td>InfoGraph [18]</td><td>68.8±0.8</td><td>75.3± 0.5</td><td>58.4±0.8</td><td>69.9±3.0</td><td>75.9 ± 1.6</td><td>76.0±0.7</td><td>75.3 ± 2.5</td><td>62.7 ± 0.4</td><td>64.1 ± 1.5</td></tr><tr><td>GraphCL [24]</td><td>69.68 ± 0.67</td><td>73.87 ± 0.66</td><td>60.53 ±0.88</td><td>75.99 ± 2.65</td><td>75.38 ± 1.44</td><td>78.47 ± 1.22</td><td>69.8± 2.66</td><td>62.40 ±0.57</td><td>67.88 ± 0.85</td></tr><tr><td>AD-GCL-FIX</td><td>70.01 ±1.07</td><td>76.54 ± 0.82</td><td>63.28±0.79</td><td>79.78 ± 3.52</td><td>78.51 ±0.80</td><td>78.28 ± 0.97</td><td>72.30 ± 1.61</td><td>63.07±0.72</td><td>68.83 ± 1.26</td></tr><tr><td>Our Ranks</td><td>1</td><td>2</td><td>1</td><td>1</td><td>4</td><td>2</td><td>5</td><td>5</td><td>1</td></tr></table>
|
| 211 |
+
|
| 212 |
+
Table 2: Transfer learning performance for chemical molecules property prediction (mean ROC-AUC ± std. over 10 runs). Bold indicates our methods outperform baselines with $\geq 0 . 5$ std..
|
| 213 |
+
|
| 214 |
+
<table><tr><td>Dataset</td><td>NCI1</td><td>PROTEINS</td><td>DD</td><td>COLLAB</td><td>RDT-B</td><td>RDT-M5K</td></tr><tr><td>No Pre-Train</td><td>73.72 ± 0.24</td><td>70.40± 1.54</td><td>73.56± 0.41</td><td>73.71± 0.27</td><td>86.63± 0.27</td><td>51.33 ± 0.44</td></tr><tr><td>SS-GCN-A</td><td>73.59 ± 0.32</td><td>70.29 ±0.64</td><td>74.30± 0.81</td><td>74.19 ± 0.13</td><td>87.74 ± 0.39</td><td>52.01 ±0.20</td></tr><tr><td>GAE [20]</td><td>74.36± 0.24</td><td>70.51 ± 0.17</td><td>74.54± 0.68</td><td>75.09 ± 0.19</td><td>87.69 ± 0.40</td><td>53.58 ±0.13</td></tr><tr><td>InfoGraph [18]</td><td>74.86 ± 0.26</td><td>72.27 ± 0.40</td><td>75.78± 0.34</td><td>73.76 ± 0.29</td><td>88.66 ± 0.95</td><td>53.61 ± 0.31</td></tr><tr><td>GraphCL [24]</td><td>74.63 ± 0.25</td><td>74.17 ± 0.34</td><td>76.17 ± 1.37</td><td>74.23 ± 0.21</td><td>89.11 ± 0.19</td><td>52.55± 0.45</td></tr><tr><td>AD-GCL-FIX Our Ranks</td><td>75.18 ± 0.31 1</td><td>73.96± 0.47 2</td><td>77.91±0.73* 1</td><td>75.82± 0.26* 1</td><td>90.10±0.15* 1</td><td>53.49±0.28 3</td></tr></table>
|
| 215 |
+
|
| 216 |
+
Table 3: Semi-supervised learning performance with $10 \%$ labels on TU datasets [73] (10-Fold Accuracy $( \% ) \pm$ std over 5 runs). Bold/Bold⋆ indicate our methods outperform baselines with $\geq 0 . 5 \ \mathrm { s t d } / \geq 2$ std respectively.
|
| 217 |
+
|
| 218 |
+
node attribute masking and context prediction that utilize edge, node and subgraph context respectively.
|
| 219 |
+
More detailed setup is given in Appendix G.
|
| 220 |
+
|
| 221 |
+
According to Table 2, AD-GCL-FIX significantly outperforms baselines in 3 out of 9 datasets and achieves a mean rank of 2.4 across these 9 datasets which is better than all baselines. Note that although AD-GCL only achieves 5th on some datasets, AD-GCL still significantly outperforms InfoGraph [18] and GraphCL [24], both of which are strong GNN self-training baselines. In contrast to InfoGraph [18] and GraphCL [24], AD-GCL achieves some performance much closer to those baselines (EdgePred, AttrMasking and ContextPred) based on domain knowledge and extensive evaluation in [17]. This is rather significant as our method utilizes only edge dropping GDA, which again shows the effectiveness of the AD-GCL principle.
|
| 222 |
+
|
| 223 |
+
# 5.4 Semi-Supervised Learning
|
| 224 |
+
|
| 225 |
+
Lastly, we evaluate AD-GCL on semi-supervised learning for graph classification on the benchmark TU datasets [73]. We follow the setting in [24]: GNNs are pre-trained on one dataset using selfsupervised learning and later fine-tuned based on $10 \%$ label supervision on the same dataset. Again, we only consider AD-GCL-FIX and compare it with several baselines in [24]: 1) no pre-trained GCN, which is directly trained by the $10 \%$ labels from scratch, 2) SS-GCN-A, a baseline that introduces more labelled data by creating random augmentations and then gets trained from scratch, 3) a predictive method GAE [20] that utilizes adjacency reconstruction in the pre-training phase, and GCL methods, 4) InfoGraph [18] and 5) GraphCL [24]. Note that here we have to keep the encoder architecture same and thus AD-GCL-FIX adopts GCN as the encoder. Table 3 shows the results. AD-GCL-FIX significantly outperforms baselines in 3 out of 6 datasets and achieves a mean rank of 1.5 across these 6 datasets, which again demonstrates the strength of AD-GCL.
|
| 226 |
+
|
| 227 |
+
# 6 Conclusions
|
| 228 |
+
|
| 229 |
+
In this work we have developed a theoretically motivated, novel principle: AD-GCL that goes a step beyond the conventional InfoMax objective for self-supervised learning of GNNs. The optimal GNN encoders that are agnostic to the downstream tasks are the ones that capture the minimal sufficient information to identify each graph in the dataset. To achieve this goal, AD-GCL suggests to better graph contrastive learning via optimizing graph augmentations in an adversarial way. Following this principle, we developed a practical instantiation based on learnable edge dropping. We have extensively analyzed and demonstrated the benefits of AD-GCL and its instantiation with real-world datasets for graph property prediction in unsupervised, transfer and semi-supervised learning settings.
|
| 230 |
+
|
| 231 |
+
# Acknowledgments and Disclosure of Funding
|
| 232 |
+
|
| 233 |
+
We greatly thank the actionable suggestions given by reviewers and the area chair. S.S. and J.N. are supported by the National Science Foundation under contract numbers CCF-1918483 and IIS1618690. P.L. is partly supported by the 2021 JP Morgan Faculty Award and the National Science Foundation (NSF) award HDR-2117997.
|
| 234 |
+
|
| 235 |
+
# References
|
| 236 |
+
|
| 237 |
+
[1] A. W. Senior, R. Evans, J. Jumper, J. Kirkpatrick, L. Sifre, T. Green, C. Qin, A. Žídek, A. W. Nelson, A. Bridgland et al., “Improved protein structure prediction using potentials from deep learning,” Nature, vol. 577, no. 7792, pp. 706–710, 2020.
|
| 238 |
+
[2] J. Shlomi, P. Battaglia, and J.-R. Vlimant, “Graph neural networks in particle physics,” Machine Learning: Science and Technology, vol. 2, no. 2, p. 021001, 2020.
|
| 239 |
+
[3] W. L. Hamilton, “Graph representation learning,” Synthesis Lectures on Artificial Intelligence and Machine Learning, vol. 14, no. 3, pp. 1–159, 2020.
|
| 240 |
+
[4] K. Hornik, M. Stinchcombe, H. White et al., “Multilayer feedforward networks are universal approximators.” Neural Networks, vol. 2, no. 5, pp. 359–366, 1989.
|
| 241 |
+
[5] G. Cybenko, “Approximation by superpositions of a sigmoidal function,” Mathematics of control, signals and systems, vol. 2, no. 4, pp. 303–314, 1989.
|
| 242 |
+
[6] F. Scarselli, M. Gori, A. C. Tsoi, M. Hagenbuchner, and G. Monfardini, “The graph neural network model,” IEEE Transactions on Neural Networks, vol. 20, no. 1, pp. 61–80, 2008.
|
| 243 |
+
[7] I. Chami, S. Abu-El-Haija, B. Perozzi, C. Ré, and K. Murphy, “Machine learning on graphs: A model and comprehensive taxonomy,” arXiv preprint arXiv:2005.03675, 2020.
|
| 244 |
+
[8] Z. Zhang, P. Cui, and W. Zhu, “Deep learning on graphs: A survey,” IEEE TKDE, 2020.
|
| 245 |
+
[9] W. L. Hamilton, R. Ying, and J. Leskovec, “Representation learning on graphs: Methods and applications,” IEEE Data Engineering Bulletin, vol. 40, no. 3, pp. 52–74, 2017.
|
| 246 |
+
[10] T. N. Kipf and M. Welling, “Semi-supervised classification with graph convolutional networks,” in International Conference on Learning Representations, 2017.
|
| 247 |
+
[11] H. Dai, B. Dai, and L. Song, “Discriminative embeddings of latent variable models for structured data,” in International Conference on Machine Learning. PMLR, 2016, pp. 2702–2711.
|
| 248 |
+
[12] P. Velickovi ˇ c, G. Cucurull, A. Casanova, A. Romero, P. Liò, and Y. Bengio, “Graph attention ´ networks,” in International Conference on Learning Representations, 2018.
|
| 249 |
+
[13] M. Zhang, Z. Cui, M. Neumann, and Y. Chen, “An end-to-end deep learning architecture for graph classification,” in the AAAI Conference on Artificial Intelligence, 2018, pp. 4438–4445.
|
| 250 |
+
[14] K. Xu, W. Hu, J. Leskovec, and S. Jegelka, “How powerful are graph neural networks?” in International Conference on Learning Representations, 2019.
|
| 251 |
+
[15] C. Morris, M. Ritzert, M. Fey, W. L. Hamilton, J. E. Lenssen, G. Rattan, and M. Grohe, “Weisfeiler and leman go neural: Higher-order graph neural networks,” in the AAAI Conference on Artificial Intelligence, vol. 33, 2019, pp. 4602–4609.
|
| 252 |
+
[16] P. Li, Y. Wang, H. Wang, and J. Leskovec, “Distance encoding: Design provably more powerful neural networks for graph representation learning,” Advances in Neural Information Processing Systems, vol. 33, 2020.
|
| 253 |
+
[17] W. Hu, B. Liu, J. Gomes, M. Zitnik, P. Liang, V. Pande, and J. Leskovec, “Strategies for pre-training graph neural networks,” International Conference on Learning Representations, 2020.
|
| 254 |
+
[18] F.-Y. Sun, J. Hoffmann, and J. Tang, “Infograph: Unsupervised and semi-supervised graph-level representation learning via mutual information maximization,” arXiv preprint arXiv:1908.01000, 2019.
|
| 255 |
+
[19] H. G. Vogel, Drug discovery and evaluation: pharmacological assays. Springer Science & Business Media, 2002.
|
| 256 |
+
[20] T. N. Kipf and M. Welling, “Variational graph auto-encoders,” arXiv preprint arXiv:1611.07308, 2016.
|
| 257 |
+
[21] A. Grover, A. Zweig, and S. Ermon, “Graphite: Iterative generative modeling of graphs,” in International Conference on Machine Learning. PMLR, 2019, pp. 2434–2444.
|
| 258 |
+
[22] Z. Peng, W. Huang, M. Luo, Q. Zheng, Y. Rong, T. Xu, and J. Huang, “Graph representation learning via graphical mutual information maximization,” in Proceedings of The Web Conference 2020, 2020.
|
| 259 |
+
[23] P. Velickovi ˇ c, W. Fedus, W. L. Hamilton, P. Liò, Y. Bengio, and R. D. Hjelm, “Deep graph ´ infomax,” arXiv preprint arXiv:1809.10341, 2018.
|
| 260 |
+
[24] Y. You, T. Chen, Y. Sui, T. Chen, Z. Wang, and Y. Shen, “Graph contrastive learning with augmentations,” Advances in Neural Information Processing Systems, vol. 33, 2020.
|
| 261 |
+
[25] K. Hassani and A. H. Khasahmadi, “Contrastive multi-view representation learning on graphs,” in International Conference on Machine Learning. PMLR, 2020, pp. 4116–4126.
|
| 262 |
+
[26] Y. Xie, Z. Xu, Z. Wang, and S. Ji, “Self-supervised learning of graph neural networks: A unified review,” arXiv preprint arXiv:2102.10757, 2021.
|
| 263 |
+
[27] Y. Liu, S. Pan, M. Jin, C. Zhou, F. Xia, and P. S. Yu, “Graph self-supervised learning: A survey,” arXiv preprint arXiv:2103.00111, 2021.
|
| 264 |
+
[28] S. Zhang, Z. Hu, A. Subramonian, and Y. Sun, “Motif-driven contrastive learning of graph representations,” arXiv preprint arXiv:2012.12533, 2020.
|
| 265 |
+
[29] S. Thakoor, C. Tallec, M. G. Azar, R. Munos, P. Velickovi ˇ c, and M. Valko, “Bootstrapped ´ representation learning on graphs,” arXiv preprint arXiv:2102.06514, 2021.
|
| 266 |
+
[30] Y. Zhu, Y. Xu, F. Yu, Q. Liu, S. Wu, and L. Wang, “Graph contrastive learning with adaptive augmentation,” arXiv preprint arXiv:2010.14945, 2020.
|
| 267 |
+
[31] J. Qiu, Q. Chen, Y. Dong, J. Zhang, H. Yang, M. Ding, K. Wang, and J. 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, 2020, pp. 1150– 1160.
|
| 268 |
+
[32] M. Belkin and P. Niyogi, “Laplacian eigenmaps for dimensionality reduction and data representation,” Neural computation, vol. 15, no. 6, pp. 1373–1396, 2003.
|
| 269 |
+
[33] B. Perozzi, R. Al-Rfou, and S. Skiena, “Deepwalk: Online learning of social representations,” in Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, 2014, pp. 701–710.
|
| 270 |
+
[34] A. Grover and J. Leskovec, “node2vec: Scalable feature learning for networks,” in the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016, pp. 855–864.
|
| 271 |
+
[35] L. F. Ribeiro, P. H. Saverese, and D. R. Figueiredo, “struc2vec: Learning node representations from structural identity,” in the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2017, pp. 385–394.
|
| 272 |
+
[36] W. Hamilton, Z. Ying, and J. Leskovec, “Inductive representation learning on large graphs,” in Advances in Neural Information Processing Systems, 2017.
|
| 273 |
+
[37] K. Henderson, B. Gallagher, T. Eliassi-Rad, H. Tong, S. Basu, L. Akoglu, D. Koutra, C. Faloutsos, and L. Li, “Rolx: structural role extraction & mining in large graphs,” in the ACM SIGKDD international conference on Knowledge discovery and data mining, 2012, pp. 1231–1239.
|
| 274 |
+
[38] C. Donnat, M. Zitnik, D. Hallac, and J. Leskovec, “Learning structural node embeddings via diffusion wavelets,” in the ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2018, pp. 1320–1329.
|
| 275 |
+
[39] R. Linsker, “Self-organization in a perceptual network,” Computer, vol. 21, no. 3, pp. 105–117, 1988.
|
| 276 |
+
[40] M. Tschannen, J. Djolonga, P. K. Rubenstein, S. Gelly, and M. Lucic, “On mutual information maximization for representation learning,” in International Conference on Learning Representations, 2020.
|
| 277 |
+
[41] N. Tishby, F. C. Pereira, and W. Bialek, “The information bottleneck method,” arXiv preprint physics/0004057, 2000.
|
| 278 |
+
[42] N. Tishby and N. Zaslavsky, “Deep learning and the information bottleneck principle,” in 2015 IEEE Information Theory Workshop (ITW). IEEE, 2015.
|
| 279 |
+
[43] Z. Goldfeld and Y. Polyanskiy, “The information bottleneck problem and its applications in machine learning,” IEEE Journal on Selected Areas in Information Theory, 2020.
|
| 280 |
+
[44] A. A. Alemi, I. Fischer, J. V. Dillon, and K. Murphy, “Deep variational information bottleneck,” arXiv preprint arXiv:1612.00410, 2016.
|
| 281 |
+
[45] X. B. Peng, A. Kanazawa, S. Toyer, P. Abbeel, and S. Levine, “Variational discriminator bottleneck: Improving imitation learning, inverse rl, and gans by constraining information flow,” arXiv preprint arXiv:1810.00821, 2018.
|
| 282 |
+
[46] 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.” in International Conference on Learning Representations, 2017.
|
| 283 |
+
[47] T. Wu, H. Ren, P. Li, and J. Leskovec, “Graph information bottleneck,” in Advances in Neural Information Processing Systems, 2020.
|
| 284 |
+
[48] J. Yu, T. Xu, Y. Rong, Y. Bian, J. Huang, and R. He, “Recognizing predictive substructures with subgraph information bottleneck,” International Conference on Learning Representations, 2021.
|
| 285 |
+
[49] J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, and G. E. Dahl, “Neural message passing for quantum chemistry,” in International Conference on Machine Learning. JMLR. org, 2017.
|
| 286 |
+
[50] T. M. Cover and J. A. Thomas, Elements of Information Theory. John Wiley & Sons, 2012.
|
| 287 |
+
[51] B. Weisfeiler and A. Leman, “A reduction of a graph to a canonical form and an algebra arising during this reduction,” Nauchno-Technicheskaya Informatsia, 1968.
|
| 288 |
+
[52] W. Hu, M. Fey, M. Zitnik, Y. Dong, H. Ren, B. Liu, M. Catasta, and J. Leskovec, “Open graph benchmark: Datasets for machine learning on graphs,” arXiv preprint arXiv:2005.00687, 2020.
|
| 289 |
+
[53] D. Duvenaud, D. Maclaurin, J. Aguilera-Iparraguirre, R. Gómez-Bombarelli, T. Hirzel, A. Aspuru-Guzik, and R. P. Adams, “Convolutional networks on graphs for learning molecular fingerprints,” Advances in Neural Information Processing Systems, vol. 2015, pp. 2224–2232, 2015.
|
| 290 |
+
[54] E. N. Gilbert, “Random graphs,” The Annals of Mathematical Statistics, vol. 30, no. 4, pp. 1141–1144, 1959.
|
| 291 |
+
[55] P. Erdos and A. Rényi, “On random graphs i.” ˝ Publ. Math. Debrecen, vol. 6, pp. 290–297, 1959.
|
| 292 |
+
[56] C. J. Maddison, A. Mnih, and Y. W. Teh, “The concrete distribution: A continuous relaxation of discrete random variables,” in International Conference on Learning Representations, 2017.
|
| 293 |
+
[57] E. Jang, S. Gu, and B. Poole, “Categorical reparameterization with gumbel-softmax,” in International Conference on Learning Representations, 2017.
|
| 294 |
+
[58] D. Luo, W. Cheng, D. Xu, W. Yu, B. Zong, H. Chen, and X. Zhang, “Parameterized explainer for graph neural network,” Advances in Neural Information Processing Systems, vol. 33, 2020.
|
| 295 |
+
[59] A. v. d. Oord, Y. Li, and O. Vinyals, “Representation learning with contrastive predictive coding,” arXiv preprint arXiv:1807.03748, 2018.
|
| 296 |
+
[60] Y. Tian, D. Krishnan, and P. Isola, “Contrastive multiview coding,” arXiv preprint arXiv:1906.05849, 2019.
|
| 297 |
+
[61] B. Poole, S. Ozair, A. Van Den Oord, A. Alemi, and G. Tucker, “On variational bounds of mutual information,” in International Conference on Machine Learning, 2019.
|
| 298 |
+
[62] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, “A simple framework for contrastive learning of visual representations,” in International Conference on Machine Learning. PMLR, 2020, pp. 1597–1607.
|
| 299 |
+
[63] S. Becker and G. E. Hinton, “Self-organizing neural network that discovers surfaces in randomdot stereograms,” Nature, vol. 355, no. 6356, pp. 161–163, 1992.
|
| 300 |
+
[64] O. Henaff, “Data-efficient image recognition with contrastive predictive coding,” in International Conference on Machine Learning. PMLR, 2020, pp. 4182–4192.
|
| 301 |
+
[65] R. D. Hjelm, A. Fedorov, S. Lavoie-Marchildon, K. Grewal, P. Bachman, A. Trischler, and Y. Bengio, “Learning deep representations by mutual information estimation and maximization,” in International Conference on Learning Representations, 2019.
|
| 302 |
+
[66] T. Chen, S. Kornblith, K. Swersky, M. Norouzi, and G. Hinton, “Big self-supervised models are strong semi-supervised learners,” arXiv preprint arXiv:2006.10029, 2020.
|
| 303 |
+
[67] P. Velickovi ˇ c, W. Fedus, W. L. Hamilton, P. Liò, Y. Bengio, and R. D. Hjelm, “Deep graph ´ infomax,” arXiv preprint arXiv:1809.10341, 2018.
|
| 304 |
+
[68] Z. Peng, W. Huang, M. Luo, Q. Zheng, Y. Rong, T. Xu, and J. Huang, “Graph representation learning via graphical mutual information maximization,” in Proceedings of The Web Conference 2020, 2020, pp. 259–270.
|
| 305 |
+
[69] Y. Jiao, Y. Xiong, J. Zhang, Y. Zhang, T. Zhang, and Y. Zhu, “Sub-graph contrast for scalable self-supervised graph representation learning,” arXiv preprint arXiv:2009.10273, 2020.
|
| 306 |
+
[70] Y. You, T. Chen, Y. Shen, and Z. Wang, “Graph contrastive learning automated,” arXiv preprint arXiv:2106.07594, 2021.
|
| 307 |
+
[71] Y. Tian, C. Sun, B. Poole, D. Krishnan, C. Schmid, and P. Isola, “What makes for good views for contrastive learning?” in Advances in Neural Information Processing Systems, 2020.
|
| 308 |
+
[72] K. Xu, W. Hu, J. Leskovec, and S. Jegelka, “How powerful are graph neural networks?” in International Conference on Learning Representations, 2019.
|
| 309 |
+
[73] C. Morris, N. M. Kriege, F. Bause, K. Kersting, P. Mutzel, and M. Neumann, “Tudataset: A collection of benchmark datasets for learning with graphs,” in ICML 2020 Workshop on Graph Representation Learning and Beyond ( $G R L +$ 2020), 2020. [Online]. Available: www.graphlearning.io
|
| 310 |
+
[74] V. P. Dwivedi, C. K. Joshi, T. Laurent, Y. Bengio, and X. Bresson, “Benchmarking graph neural networks,” arXiv preprint arXiv:2003.00982, 2020.
|
| 311 |
+
[75] N. M. Kriege, F. D. Johansson, and C. Morris, “A survey on graph kernels,” Applied Network Science, vol. 5, no. 1, pp. 1–42, 2020.
|
| 312 |
+
[76] P. Yanardag and S. Vishwanathan, “Deep graph kernels,” in Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, 2015, pp. 1365–1374.
|
| 313 |
+
[77] N. Shervashidze, P. Schweitzer, E. J. v. Leeuwen, K. Mehlhorn, and K. M. Borgwardt, “Weisfeiler-lehman graph kernels,” Journal of Machine Learning Research, vol. 12, no. Sep, pp. 2539–2561, 2011.
|
| 314 |
+
[78] A. Narayanan, M. Chandramohan, R. Venkatesan, L. Chen, Y. Liu, and S. Jaiswal, “graph2vec: Learning distributed representations of graphs,” arXiv preprint arXiv:1707.05005, 2017.
|
| 315 |
+
[79] B. Adhikari, Y. Zhang, N. Ramakrishnan, and B. A. Prakash, “Sub2vec: Feature learning for subgraphs,” in Pacific-Asia Conference on Knowledge Discovery and Data Mining. Springer, 2018, pp. 170–182.
|
| 316 |
+
[80] T. M. Cover, Elements of information theory. John Wiley & Sons, 1999.
|
| 317 |
+
[81] L. Babai, “Groups, graphs, algorithms: The graph isomorphism problem,” in Proc. ICM, vol. 3. World Scientific, 2018, pp. 3303–3320.
|
| 318 |
+
[82] H. A. Helfgott, J. Bajpai, and D. Dona, “Graph isomorphisms in quasi-polynomial time,” arXiv preprint arXiv:1710.04574, 2017.
|
| 319 |
+
[83] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay, “Scikit-learn: Machine learning in Python,” Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011.
|
| 320 |
+
[84] C. Zhu, R. H. Byrd, P. Lu, and J. Nocedal, “Algorithm 778: L-bfgs-b: Fortran subroutines for large-scale bound-constrained optimization,” ACM Transactions on Mathematical Software (TOMS), vol. 23, no. 4, pp. 550–560, 1997.
|
| 321 |
+
[85] R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin, “Liblinear: A library for large linear classification,” Journal of Machine Learning Research, vol. 9, pp. 1871–1874, 2008.
|
md/train/jnRqf0CzBK/jnRqf0CzBK.md
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HIERARCHICAL PROBABILISTIC MODEL FOR BLIND SOURCE SEPARATION VIA LEGENDRE TRANSFORMATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present a novel blind source separation (BSS) method, called information geometric blind source separation (IGBSS). Our formulation is based on the loglinear model equipped with a hierarchically structured sample space, which has theoretical guarantees to uniquely recover a set of source signals by minimizing the KL divergence from a set of mixed signals. Source signals, received signals, and mixing matrices are realized as different layers in our hierarchical sample space. Our empirical results have demonstrated on images and time series data that our approach is superior to well established techniques and is able to separate signals with complex interactions.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The objective of blind source separation (BSS) is to identify a set of source signals from a set of multivariate mixed signals1. BSS is widely used for applications which are considered to be the “cocktail party problem”. Examples include image/signal processing (Isomura & Toyoizumi, 2016), artifact removal in medical imaging (Vigario et al., 1998), and electroencephalogram (EEG) signal ´ separation (Congedo et al., 2008). Currently, there are a number of solutions for the BSS problem. The most widely used approaches are variations of principal component analysis (PCA) (Pearson, 1901; Murphy, 2012) and independent component analysis (ICA) (Comon, 1994; Murphy, 2012). However, they all have limitations with their approaches.
|
| 12 |
+
|
| 13 |
+
PCA and its modern variations such as sparse PCA (SPCA) (Zou et al., 2006), non-linear PCA (NLPCA) (Scholz et al., 2005), and Robust PCA $\mathrm { { X u } }$ et al., 2010) extract a specified number of components with the largest variance under an orthogonal constraint, which are composed of a linear combination of variables. They create a set of uncorrelated orthogonal basis vectors that represent the source signal. The basis vectors with the $N$ largest variance are called the principal components and is the output of the model. PCA has shown to be effective for many applications such as dimensionality reduction and feature extraction. However, for BSS, PCA makes the assumption that the source signals are orthogonal, which is often not the case in most practical applications.
|
| 14 |
+
|
| 15 |
+
Similarly, ICA also attempts to find the $N$ components with the largest variance, but relaxes the orthogonality constraint. All variations of ICA such as infomax (Bell & Sejnowski, 1995), FastICA (Hyvarinen & Oja, 2000) and JADE (Cardoso, 1999) separate a multivariate signal into addi- ¨ tive subcomponents by maximizing statistical independence of each component. ICA assumes that each component is non-gaussian and the relationship between the source signal and the mixed signal is an affine transformation. In addition to these assumptions, ICA is sensitive to the initialization of the weights as the optimization is non-convex and is likely to converge to a local optimum.
|
| 16 |
+
|
| 17 |
+
Other potential methods which can perform BSS include non-negative matrix factorization (NMF) (Lee & Seung, 2001; Berne et al., 2007), dictionary learning (DL) (Olshausen & Field, 1997), and reconstruction ICA (RICA) (Le et al., 2011). NMF, DL and RICA are degenerate approaches to recover the source signal from the mixed signal. These approaches are more typically used for feature extraction. NMF factorizes a matrix into two matrices with nonnegative elements representing weights and features. The features extracted by NMF can be used to recover the source signal. More recently there are more advanced techniques that uses Short-time Fourier transform (STFT) to transform the signal into the frequency domain to construct a spectrogram before applying NMF (Sawada et al., 2019). However, NMF does not maximize statistical independence which is required to completely separate the mixed signal into the source signal, and it is also sensitive to initialization as the optimization is non-convex. Due to the non-convexity, additional constraints or heuristics for weight initialization is often applied to NMF to achieve better results (Ding et al., 2008; Boutsidis & Gallopoulos, 2008). DL can be thought of as a variation of the ICA approaches which requires an over-complete basis vector for the mixing matrix. DL may be advantageous because additional constraints such as a positive code or a dictionary can be applied to the model. However, since it requires an over-complete basis vector, information may be lost when reconstructing the source signal. In addition, like all the other approaches, DL is also non-convex and it is sensitive to the initialization of the weights.
|
| 18 |
+
|
| 19 |
+
All previous approaches have limitations such as loss of information or non-convex optimization and require constraints or assumptions such as orthogonality or an affine transformation which are not ideal for BSS. In the following, we introduce our approach to BSS, called IGBSS (Information Geometric BSS), using the log-linear model (Agresti, 2012), which can introduce relationships between possible states into its sample space (Sugiyama et al., 2017). Unlike the previous approaches, our proposed approach does not have the assumptions or limitations that they require. We provide a flexible solution by introducing a hierarchical structure between signals into our model, which allows us to treat interactions between signals that are more complex than an affine transformation. Unlike other existing methods, our approach does not require the inversion of the mixing matrix and is able to recover the sign of the signal. Thanks to the well-developed information geometric analysis of the log-linear model (Amari, 2001), optimization of our method is achieved via convex optimization, hence it always arrives at the globally optimal unique solution. Moreover, we theoretically show that it always minimizes the Kullback–Leibler (KL) divergence from a set of mixed signals to a set of source signals. Our experimental results demonstrate that our hierarchical model leads to better separation of signals including complex interaction such as higher-order feature interactions (Luo & Sugiyama, 2019) than existing methods.
|
| 20 |
+
|
| 21 |
+
# 2 FORMULATION
|
| 22 |
+
|
| 23 |
+
BSS is formulated as a function $f$ that separates a set of received signals $X$ into a set of source signals $Z$ , i.e., $Z = f ( X )$ . For example, if one employs ICA based formulation, the BSS problem reduces to ${ \bf X } = { \bf A } { \bf Z }$ , where the received signal $\mathbf { X } \in \mathbf { \mathbb { R } } ^ { L \times M }$ with $L$ signals with the sample size $M$ is affine transformation of the source signal $\mathbf { Z } \in \mathbb { R } ^ { N \times M }$ with $N$ signals and a mixing matrix $\mathbf { A } \in \mathbb { R } ^ { L \times N }$ . The objective is to estimate $\mathbf { Z }$ by learning A given $\mathbf { X }$ . Our idea is to use the log-linear model (Agresti, 2012), which is a well-known energy-based model, to take non-affine transformation into account and formulate BSS as a convex optimization problem.
|
| 24 |
+
|
| 25 |
+
# 2.1 LOG-LINEAR MODEL ON PARTIALLY ORDERED SET
|
| 26 |
+
|
| 27 |
+
We use the log-linear model given in the form of
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\log p ( \omega ) = \sum _ { s \in \mathcal { S } } \mathbf { 1 } _ { s \preceq \omega } \theta _ { s } - \psi ( \theta ) ,
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $p ( \omega ) \in ( 0 , 1 )$ is probability of each state $\omega \in \Omega$ and ${ \mathcal { S } } \subseteq \Omega$ is a parameter space such that a parameter value $\theta _ { s } \in \mathbb { R }$ is associated with each $s \in S$ , and $\psi ( \theta )$ is the partition function so that $\begin{array} { r } { \sum _ { \omega \in \Omega } p ( \omega ) = 1 } \end{array}$ . In this formulation, we assume that the set $\Omega$ of possible states, equivalent to the sample space in the statistical sense, is a partially ordered set (poset); that is, it is equipped with a partial order $\stackrel { \left. } { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b \ b { \ b { \ b { \ b \ b { \ b { \ b \ b { \ b { \ b \ b { \ b } } } } } } } } } } } } } } } } } } } } } \preceq \stackrel { \right. } { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b { \ b \ b { \ b { \ b } } } } } } } } } } } } } } $ (Gierz et al., 2003) and $\mathbf { 1 } _ { s \preceq \omega } = 1$ if $s \preceq \omega$ and 0 otherwise. This formulation is firstly introduced by Sugiyama et al. (2016) and used to model the matrix balancing problem (Sugiyama et al., 2017), which includes Boltzmann machines as a special case (Luo $\&$ Sugiyama, 2019). If we index $\Omega$ as $\boldsymbol { \Omega } = \{ \omega _ { 1 } , \omega _ { 2 } , \ldots , \omega _ { | \Omega | } \}$ , we obtain the following matrix form:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\log p = \mathbf { F } \pmb { \theta } - \pmb { \psi } ( \theta ) ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\pmb { p } \in ( 0 , 1 ) ^ { | \Omega | }$ with $p _ { i } = p ( \omega _ { i } )$ , $\pmb { \theta } \in \mathbb { R } ^ { | \Omega | }$ such that $\theta _ { i } = \theta _ { \omega _ { i } }$ if $\omega _ { i } \in \mathcal { S }$ and $\theta _ { i } = 0$ otherwise, $\mathbf { F } = ( f _ { i j } ) \in \{ 0 , 1 \} ^ { | \Omega | \times | \Omega | }$ with $f _ { i j } = \mathbf { 1 } _ { \omega _ { j } \preceq \omega _ { i } }$ , and $\boldsymbol { \psi } ( \boldsymbol { \theta } ) = ( \boldsymbol { \psi } ( \boldsymbol { \theta } ) , \ldots , \boldsymbol { \psi } ( \boldsymbol { \theta } ) ) \in \mathbb { R } ^ { | \Omega | }$ . Each vector is treated as a column vector, and log is entry-wise operation. This matrix form is often used as a general form of the log-linear model (Coull & Agresti, 2003) and $\mathbf { F }$ is called a model matrix, which represents relationship between states. The assumption to the log-linear model is that $\mathbf { F }$ is needed to be non-singular, and Sugiyama et al. (2017) showed that Equation (1) with a poset $\Omega$ always provides a non-singular model matrix; that is, $\mathbf { F }$ is regular as long as each entry is given as $f _ { i j } = \mathbf { 1 } _ { \omega _ { j } \preceq \omega _ { i } }$ . This property is powerful in mathematical modeling as we can introduce any partial order structure into $\Omega$ , which we will use to introduce our hierarchical structure in tne next subsection to solve BSS.
|
| 40 |
+
|
| 41 |
+
# 2.2 LAYER CONFIGURATION FOR BLIND SOURCE SEPARATION
|
| 42 |
+
|
| 43 |
+
Our key idea is to introduce a hierarchical layered structure into the sample space $\Omega$ of the log-linear model to achieve BSS. We call this model information geometric BSS (IGBSS) as its optimality is supported by the tight connection between the log-linear model and information geometric property of the space of distributions (statistical manifold), which will be shown in the next subsection. We implement three layers of BSS, the mixing layer, the source layer, and the received layer, into $\Omega$ as partial orders and learn the joint representation on it using the log-linear model. The received layer and the source layer represent the input received signal and the output source signal of BSS, respectively, and the mixing layer encodes information of how to mix the source signal. In the following, we consistently assume that $L$ is the number of received signals, $M$ is the sample size, and $N$ is the number of source signals.
|
| 44 |
+
|
| 45 |
+
Let us construct three layers in the sample space $\Omega$ as $\Omega = \{ \bot \} \cup \mathcal { A } \cup \mathcal { Z } \cup \dot { \mathcal { X } }$ with $\mathcal { A } = \{ a _ { 1 1 } , \ldots , a _ { L N } \}$ , $\mathcal { Z } = \{ z _ { 1 1 } , \ldots , z _ { N M } \}$ , and $\mathcal { X } = \{ x _ { 1 1 } , . . . , x _ { L M } \}$ . The element $\perp$ denotes the least element, and it acts as a partition function and $\theta _ { \perp } ~ = ~ - \psi ( \theta )$ always holds. We use 2D indexing of elements in each layer to make the correspondence between our formulation and ICA based formulation clear; that is, these three layers $A , { \mathcal { Z } }$ , and $\mathcal { X }$ are analogue to a mixing matrix $\mathbf { \bar { A } } \in \mathbb { R } ^ { L \times N }$ , a source matrix $\mathbf { Z } \in \mathbb { R } ^ { N \times M }$ , and a received matrix $\mathbf { X } \in \mathbb { R } ^ { L \times M }$ , respectively2. We will also use symbols $\omega$ and $s$ to denote elements of $\Omega$ , i.e., they can be $\perp$ , $a _ { l n }$ , $z _ { n m }$ , and $x _ { l m }$ . It is always assumed that the parameter space of the loglinear model $\mathcal { S } = \mathcal { A } \cup \mathcal { Z } \subset \Omega$ , meaning that mixing and source layers are used as parameters to represent distributions in our model. Here we introduce a partial order $\preceq$ between layers. Define
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 1: An example of our sample space. Dashed lines show removed partial orders to allow for learning.
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { a _ { i j } \preceq z _ { i ^ { \prime } j ^ { \prime } } } & { \mathrm { i f ~ } j = i ^ { \prime } , } \\ { a _ { i j } \diamond { \not \perp } z _ { i ^ { \prime } j ^ { \prime } } } & { \mathrm { o t h e r w i s e } , } \end{array} \right. \quad \left\{ \begin{array} { l l } { z _ { i j } \preceq x _ { i ^ { \prime } j ^ { \prime } } } & { \mathrm { i f ~ } j = j ^ { \prime } , } \\ { z _ { i j } \diamond { \not \perp } x _ { i ^ { \prime } j ^ { \prime } } } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \end{array}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
for each element in three layers $A , { \mathcal { Z } }$ , and $\mathcal { X }$ , and we do not any ordering among elements in the same layer. Since it is a partial order, transitivity always holds, for example, $a _ { 1 1 } \preceq x _ { 2 2 }$ as $a _ { 1 1 } \preceq z _ { 1 2 }$ and $z _ { 1 2 } \preceq x _ { 2 2 }$ . The first condition encodes the structure such that the source layer is higher than the mixing layer, and the second condition encodes that the received layer is higher than the source layer. An example of our sample space with $L = M = N = 2$ is illustrated in Figure 1.
|
| 55 |
+
|
| 56 |
+
The joint distribution for BSS is described by the log-linear model in Equation (1) over the sample space $\Omega = \{ \bot \} \cup \mathcal { A } \cup \mathcal { Z } \cup \mathcal { X }$ equipped with the partial order defined in Equation (2). If we learn the joint distribution from a received signal $\mathbf { X }$ , we will obtain probabilities on the source layer $p ( z _ { 1 1 } ) , \allowbreak . . . , p ( z _ { N M } )$ , which represents normalized source signals. The rational of our approach is given as follows: The connections between each layer is structured so that the log-linear model performs a similar computation with the ICA based approach ${ \bf X } = { \bf A } { \bf Z }$ . Our structure ensures that each $p ( x _ { l m } )$ is determined by $( \theta _ { a _ { l n } } ) _ { n \in [ N ] }$ and $( \theta _ { z _ { m n } } ) _ { n \in [ N ] }$ with $[ N ] = \{ 1 , \dots , N \}$ , as we always have $a _ { l n } \preceq x _ { l m }$ and $z _ { n m } \preceq x _ { l m }$ . Moreover, this formulation allows us to model more complex interaction than affine transformation, such as higher-order interactions, between signals if we additionally include partial order structure into $\mathcal { Z }$ and/or $\mathcal { A }$ , which cannot be treated by a simple matrix multiplication.
|
| 57 |
+
|
| 58 |
+
# 2.3 OPTIMIZATION
|
| 59 |
+
|
| 60 |
+
We train the log-linear model by minimizing the KL divergence from an empirical distribution $\hat { p }$ , which is identical to the normalized received signal $\mathbf { X } \in \breve { \mathbb { R } } ^ { L \times M }$ , to the model joint distribution $p$ given by Equation (1) or, equivalently, maximizing the likelihood. More precisely, we normalize a given $\mathbf { X }$ by dividing each entry by the sum of all entries; that is, an empirical distribution $\hat { p }$ is obtained as $\hat { p } ( x _ { l m } ) \bar { = } ~ x _ { l m } / \bar { \sum _ { l , m } } { x _ { l m } }$ . If $\mathbf { X }$ contains negative values, an exponential kernel $\exp { ( { x } _ { l m } ) / { \sum } _ { l , m } } \exp { ( { x } _ { l m } ) }$ or min-max normalization $( x _ { l m } + \epsilon - \mathrm { m i n } ( \mathbf X ) ) / ( \mathrm { m a x } ( \mathbf X ) + \epsilon - \mathrm { m i n } ( \mathbf X ) )$ can be used, where $\epsilon$ is some arbitrary small value to avoid zero probability. We also assume that $\hat { p } ( a _ { l n } ) = 0$ and $\hat { p } ( z _ { n m } ) = 0$ for all $a _ { l n } \in \mathcal { A }$ and $z _ { n m } \in \mathcal { Z }$ . The objective function is given as
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\underset { p \in \mathfrak { P } _ { \theta } } { \arg \operatorname* { m i n } } \mathrm { D } _ { \mathrm { K L } } \left( \hat { p } \| p \right) = \underset { p \in \mathfrak { P } _ { \theta } } { \arg \operatorname* { m i n } } \sum _ { \omega \in \Omega } \hat { p } ( \omega ) \log \frac { \hat { p } ( \omega ) } { p ( \omega ) } ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where ${ \mathfrak { P } } _ { \theta }$ is the set of distributions that can be represented by Equation (1) with our structured sample space $\Omega = \{ \bot \} \cup \mathcal { A } \cup \mathcal { Z } \cup \mathcal { X }$ and $S = A \cup \mathcal { Z }$ .
|
| 67 |
+
|
| 68 |
+
The remarkable property of our model is that this optimization problem is convex and it is guaranteed that gradient-based methods can always arrive at the globally optimal unique solution. To show this, we analyze the geometric structure of the statistical manifold, the set of probability distributions, generated by the log-linear model. Let $\Omega ^ { + } = \Omega \backslash \{ \bot \}$ . First we introduce another parameterization $\bar { ( \eta _ { \omega } ) } _ { \omega \in \Omega ^ { + } }$ of the log-linear model, which is defined as
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\eta _ { \omega } = \sum _ { s \in \Omega } \mathbf { 1 } _ { \omega \preceq s } p ( s ) .
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
Note that $\eta _ { \perp } = 1$ always holds and we do not include it into parameters. In addition, for theoretical consistency we change the parameter space used in Equation (1) from $s$ to $\Omega ^ { + }$ and assume that $\theta _ { \omega } ~ = ~ 0$ if $\omega ~ \notin ~ { \mathcal { S } }$ . Again we do not include $\theta _ { \perp }$ as a parameter as it is the partition function. Two parameters $( \theta _ { \omega } ) _ { \omega \in \Omega ^ { + } }$ and $( \eta _ { \omega } ) _ { \omega \in \Omega ^ { + } }$ have clear statistical interpretation as it is widely known that any log-linear model belongs to the exponential family, where $\theta$ and $\eta$ correspond to natural and expectation parameters, respectively. $\theta$ and $\eta$ are connected via a Legendre transformation which means that they are both differentiable and have a one-to-one correspondence. To simplify the notation, we denote by $\hat { \theta }$ and $\hat { \eta }$ the corresponding $\theta$ and $\eta$ of the empirical distribution $\hat { p }$ . Let $\mathfrak { P } = \{ p \ | \ 0 < p ( \omega ) \ < \ 1$ for all $\omega \in \Omega \}$ be the set of all probability distributions. This set forms a statistical manifold with dually flat structure, which is the canonical geometric structure in information geometry (Amari, 2016), with its dual coordinate system $( ( \theta _ { \omega } ) _ { \omega \in \Omega ^ { + } } , ( \eta _ { \omega } ) _ { \omega \in \Omega ^ { + } } )$ ; that is, both of $( \theta _ { \omega } ) _ { \omega \in \Omega ^ { + } }$ and $( \eta _ { \omega } ) _ { \omega \in \Omega ^ { + } }$ work as coordinate systems and determine a distribution in $\mathfrak { P }$ . The Riemannian metric with respect to $\theta$ is given as
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
g _ { s s ^ { \prime } } = \frac { \partial \eta _ { s } } { \partial \theta _ { s ^ { \prime } } } = \mathbb { E } \left[ \frac { \partial \log p ( \boldsymbol { \omega } ) } { \partial \theta _ { s } } \frac { \partial \log p ( \boldsymbol { \omega } ) } { \partial \theta _ { s ^ { \prime } } } \right] = \sum _ { \boldsymbol { \omega } \in \Omega } \mathbf { 1 } _ { s \preceq \boldsymbol { \omega } } \mathbf { 1 } _ { s ^ { \prime } \preceq \boldsymbol { \omega } } p ( \boldsymbol { \omega } ) - \eta _ { s } \eta _ { s ^ { \prime } } ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
which coincides with the Fisher information (Sugiyama et al., 2017, Theorem 3) and we will use it for natural gradient.
|
| 81 |
+
|
| 82 |
+
Now we consider two submanifolds $\mathfrak { P } _ { \theta } , \mathfrak { P } _ { \eta } \subseteq \mathfrak { P }$ , which we define as
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r l r } & { \mathfrak { P } _ { \theta } = \left\{ p \in \mathfrak { P } \mid \theta _ { \omega } = 0 , \forall \omega \in \mathcal { E } \right\} , \qquad } & { \mathcal { E } = \Omega ^ { + } \backslash \mathcal { S } , } \\ & { \mathfrak { P } _ { \eta } = \left\{ p \in \mathfrak { P } \mid \eta _ { \omega } = \hat { \eta } _ { \omega } , \forall \omega \in \mathcal { M } \right\} , \qquad } & { \mathcal { M } = \mathcal { S } . } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Note that this ${ \mathfrak { P } } _ { \theta }$ coincides with that in Equation (3). The submanifold ${ \mathfrak { P } } _ { \theta }$ is called an $e$ -flat submanifold and $\mathfrak { P } _ { \eta }$ an $m$ -flat submanifold in information geometry. The highlight of considering these two types of submanifolds is that, if $\mathcal { E } \cap \mathcal { M } = \emptyset$ and $\bar { \mathcal { E } } \cup \mathcal { M } \overset { \cdot } { = } \Omega ^ { + }$ , it is theoretically guaranteed that the intersection $\mathfrak { P } _ { \theta } \cap \mathfrak { P } _ { \eta }$ is always a singleton and it is the optimizer of Equation (3) (Amari, 2009, Theorem 3), that is, it is the globally optimal solution of our model.
|
| 89 |
+
|
| 90 |
+
Optimization is achieved by $e$ -projection, which seeks $\mathfrak { P } _ { \theta } \cap \mathfrak { P } _ { \eta }$ in the $e$ -flat submanifold ${ \mathfrak { P } } _ { \theta }$ . The $e$ -projection is always convex optimization as ${ \mathfrak { P } } _ { \theta }$ is convex with respect to $\theta$ ; this is because $\theta$ is
|
| 91 |
+
|
| 92 |
+
# Algorithm 1 Information Geometric BSS
|
| 93 |
+
|
| 94 |
+
1: Function $\mathrm { I G B S S } ( \mathbf { X } , S )$ :
|
| 95 |
+
2: Compute $\hat { p }$ from $\mathbf { X }$
|
| 96 |
+
3: Compute $\hat { \pmb { \eta } } = ( \hat { \eta } _ { s } ) _ { s \in \mathcal { S } }$ from $\hat { p }$
|
| 97 |
+
4: Initialize $( \theta _ { s } ) _ { s \in { \mathcal { S } } }$ (randomly or $\theta _ { s } = 0$ )
|
| 98 |
+
5: repeat
|
| 99 |
+
6: Compute $p$ using the current parameter $( \theta _ { s } ) _ { s \in { \mathcal { S } } }$
|
| 100 |
+
7: Compute $( \eta _ { s } ) _ { s \in { \mathcal { S } } }$ from $p$
|
| 101 |
+
8: $( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { Z } } ( \eta _ { \omega } ) _ { \omega \in \mathcal { Z } } - ( \hat { \eta } _ { \omega } ) _ { \omega \in \mathcal { Z } }$
|
| 102 |
+
9: $( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { A } } ( \eta _ { \omega } ) _ { \omega \in \mathcal { A } } - ( \hat { \eta } _ { \omega } ) _ { \omega \in \mathcal { A } }$
|
| 103 |
+
10: Compute the Fisher information matrix for source layer $\mathbf { G } _ { Z }$ and the mixing layer $\mathbf { G } _ { A }$
|
| 104 |
+
11: $( \theta _ { \omega } ) _ { \omega \in \mathcal { Z } } ^ { \bullet } ( \theta _ { \omega } ) _ { \omega \in \mathcal { Z } } - \mathbf { G } _ { Z } ^ { - 1 } ( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { Z } }$
|
| 105 |
+
12: $( \theta _ { \omega } ) _ { \omega \in \mathcal { A } } \gets ( \theta _ { \omega } ) _ { \omega \in \mathcal { A } } - \mathbf { G } _ { A } ^ { - 1 } ( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { A } }$
|
| 106 |
+
13: until convergence of $( \theta _ { s } ) _ { s \in { \mathcal { S } } }$
|
| 107 |
+
14: End Function
|
| 108 |
+
|
| 109 |
+
a coordinate system of ${ \mathfrak { P } } _ { \theta }$ that is linearly constrained on $\theta$ . We can therefore use the standard gradient descent strategy to optimize the log-linear model. The derivative of the KL divergence with respect to $\theta _ { s }$ is known to be the difference between expectation parameters $\eta$ (Sugiyama et al., 2017, Theorem 2): $( \partial / \partial \theta _ { s } ) D _ { \mathrm { K L } } ( \hat { p } \parallel p ) = \eta _ { s } - \hat { \eta } _ { s }$ , and the KL divergence $D _ { \mathrm { K L } } ( \hat { p } \Vert p )$ is minimized if and only if $\eta _ { s } = \hat { \eta } _ { s }$ for all $s \in S$ .
|
| 110 |
+
|
| 111 |
+
From our definition of $\Omega$ in Equation (2), we have $\eta _ { z _ { k l } } = \eta _ { z _ { k ^ { \prime } l } }$ for all $z _ { k l } , z _ { k ^ { \prime } l } \in \mathcal { Z }$ . Therefore all elements in the source layer will learn the same value. This problem can be avoided by removing some of partial orders between source and received layers. We propose to systematically remove the partial order $z _ { i j } \preceq x _ { i ^ { \prime } j ^ { \prime } }$ if $i = i ^ { \prime }$ to ensure $\eta _ { z _ { k l } } \neq \eta _ { z _ { k ^ { \prime } l } }$ (see Figure 1), while other strategies are possible as long as $\eta _ { z _ { k l } } \neq \eta _ { z _ { k ^ { \prime } l } }$ is satisfied, for example, random deletion of such orders.
|
| 112 |
+
|
| 113 |
+
Using the above results, gradient descent can be directly applied to achieve Equation (3). However, this may need a large number of iterations to reach convergence. To reduce the number of iterations, we propose to use natural gradient (Amari, 1998), which is a second-order optimization approach and will also always find the global optimum. Let us re-index $S = A \cup \mathcal { Z }$ as $\boldsymbol { S } = \{ s _ { 1 } , s _ { 2 } , \ldots , s _ { | \boldsymbol { S } | } \}$ and assume that $\pmb { \theta } = [ \theta _ { s _ { 1 } } , \ldots , \theta _ { s _ { | \pmb { S } | } } ] ^ { \mathrm { T } }$ and $\pmb { \eta } = [ \eta _ { s _ { 1 } } , \dots , \eta _ { s _ { | S | } } ] ^ { \mathrm { T } }$ . In each step of natural gradient, the current $\pmb \theta$ is updated to $\theta _ { \mathrm { n e x t } }$ by the following formula:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\pmb { \theta } _ { \mathrm { n e x t } } = \pmb { \theta } - \mathbf { G } ^ { - 1 } ( \pmb { \eta } - \hat { \pmb { \eta } } )
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\mathbf { G } = ( g _ { i j } ) \in \mathbb { R } ^ { | S | \times | S | }$ is the Fisher information matrix such that each $g _ { i j }$ is given as $g _ { s _ { i } s _ { j } }$ in Equation (5).
|
| 120 |
+
|
| 121 |
+
Although the natural gradient requires much less iterations compared to the gradient descent, matrix inversion $\mathbf { G } ^ { - 1 }$ is computationally expensive as it has the complexity of $\mathcal { O } ( | \boldsymbol { S } | ^ { 3 } )$ . In addition, FIM values are often too small and optimization becomes numerically unstable. To solve these problems, we separate the update steps in the source layer and the mixing layer:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\begin{array} { r } { ( \theta _ { \omega , \mathrm { n e x t } } ) _ { \omega \in \mathcal { Z } } = ( \theta _ { \omega } ) _ { \omega \in \mathcal { Z } } - \mathbf { G } _ { Z } ^ { - 1 } ( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { Z } } , } \\ { ( \theta _ { \omega , \mathrm { n e x t } } ) _ { \omega \in \mathcal { A } } = ( \theta _ { \omega } ) _ { \omega \in \mathcal { A } } - \mathbf { G } _ { A } ^ { - 1 } ( \Delta \eta _ { \omega } ) _ { \omega \in \mathcal { A } } , } \end{array}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $\mathbf { G } _ { Z }$ and $\mathbf { G } _ { A }$ are the Fisher information matrices for source and mixing layers, respectively. Note that this also leads to the same global optimum. They are constructed by assuming all the other parameters are fixed. This approach reduces the time complexity to $O ( | \mathcal { Z } | ^ { 3 } + | \mathcal { A } | ^ { 3 } )$ . The full algorithm using natural gradient is given in Algorithm 1. Computation of $p$ from $\theta$ and $\eta$ from $p$ can be achieved using Equations (1) and (4). We also give more explicit description of $p$ and $\eta$ for each layer in Appendix. The time complexity to compute $p$ in Algorithm 1 Line 6 is $\mathcal { O } ( | \Omega | | S | )$ . The complexity to compute $\Delta \eta$ in Algorithm 1 Line 8 and Line 9 is $\mathcal { O } ( \vert \mathcal { Z } \vert ) + \mathcal { O } ( \vert A \vert ) = \mathcal { O } ( \vert S \vert )$ . Therefore the total complexity of each iteration is $\mathcal { O } ( \vert \mathcal { Z } \vert ^ { 3 } + \vert \mathcal { A } \vert ^ { 3 } + \vert \Omega \vert \vert \boldsymbol { S } \vert )$ .
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 2: First-order interaction experiment.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 3: Third-order interaction experiment.
|
| 134 |
+
|
| 135 |
+
Table 1: Signal-to-Noise Ratio of reconstructed signal. $( \ast )$ Results for Figure 2. (†) Results for Figure 3. Scores are means $\pm$ standard deviation after 40 runs. We have applied different weight initialization after each run.
|
| 136 |
+
|
| 137 |
+
<table><tr><td rowspan="2">Exp.</td><td rowspan="2">Order</td><td colspan="4">Root Mean Squared Error (RMSE)</td><td colspan="4">Signal-to-noise ratio (SNR)(units in dB)</td></tr><tr><td>IGBSS</td><td>FastICA</td><td>DL</td><td>NMF</td><td>IGBSS</td><td>FastICA</td><td>DL</td><td>NMF</td></tr><tr><td rowspan="3">1</td><td>First*</td><td>0.252 ±0.000</td><td>0.300± 0.089</td><td>0.394 ± 0.041</td><td>0.622 ± 0.000</td><td>12.588 ± 0.000</td><td>11.688 ± 4.829</td><td>6.810± 0.008</td><td>1.704 ± 0.000</td></tr><tr><td>Second</td><td>0.260 ±0.000</td><td>0.285 ± 0.096</td><td>0.441 ± 0.080</td><td>0.662 ± 0.000</td><td>10.729 ± 0.000</td><td>12.353±4.255</td><td>0.526 ± 0.448</td><td>-3.426 ±0.000</td></tr><tr><td>Thirdt</td><td>0.252 ±0.000</td><td>0.260 ± 0.111</td><td>0.362 ± 0.030</td><td>0.612 ±0.000</td><td>12.588 ± 0.000</td><td>12.922 ± 5.590</td><td>1.471 ± 0.358</td><td>0.039 ±0.000</td></tr><tr><td rowspan="3">2</td><td>First</td><td>0.133± 0.000</td><td>0.284± 0.064</td><td>0.474 ± 0.067</td><td>0.591± 0.000</td><td>14.215±0.000</td><td>11.218 ± 1.964</td><td>2.098 ± 2.140</td><td>-0.940± 0.000</td></tr><tr><td>Second</td><td>0.256 ±0.000</td><td>0.263 ± 0.066</td><td>0.576± 0.008</td><td>0.684± 0.000</td><td>10.612 ±0.000</td><td>11.986 ± 2.157</td><td>-1.589 ± 0.269</td><td>-3.675 ± 0.000</td></tr><tr><td>Third</td><td>0.282 ± 0.000</td><td>0.239 ± 0.056</td><td>0.593 ± 0.007</td><td>0.665± 0.000</td><td>9.346 ± 0.000</td><td>11.475 ± 2.145</td><td>-2.274 ± 0.227</td><td>-4.073 ± 0.000</td></tr><tr><td rowspan="3">3</td><td>First</td><td>0.155 ± 0.000</td><td>0.699 ± 0.047</td><td>0.478 ± 0.121</td><td>0.628 ± 0.000</td><td>11.285 ± 0.000</td><td>10.785 ± 2.176</td><td>1.448 ± 4.249</td><td>0.628 ±0.000</td></tr><tr><td>Second</td><td>0.200±0.000</td><td>0.280 ± 0.049</td><td>0.515 ± 0.007</td><td>0.709 ±0.000</td><td>10.862 ±0.000</td><td>10.171 ± 2.353</td><td>0.529 ±0.228</td><td>-5.579 ± 0.000</td></tr><tr><td>Third</td><td>0.203±0.000</td><td>0.239 ± 0.056</td><td>0.536± 0.006</td><td>0.682 ± 0.000</td><td>11.075 ± 0.000</td><td>11.041 ± 2.708</td><td>-0.244± 0.185</td><td>-4.961± 0.000</td></tr></table>
|
| 138 |
+
|
| 139 |
+
# 3 EXPERIMENTS
|
| 140 |
+
|
| 141 |
+
We empirically examine the effectiveness of IGBSS to perform BSS using real-world image and synthetic time-series datasets for an affine transformation and higher-order interactions between signals. All experiments were run on CentOS Linux 7 with Intel Xeon CPU E5-2623 v4 and Nvidia QuadroGP100 3.
|
| 142 |
+
|
| 143 |
+
# 3.1 BLIND SOURCE SEPARATION FOR AFFINE TRANSFORMATIONS ON IMAGES
|
| 144 |
+
|
| 145 |
+
In our experiments, we use three benchmark images widely used in computer vision from the University of Southern California’s Signal and Image Processing Institute (USC-SIPI)4, which include “airplane (F-16)”, “lake” and “peppers”. Each image is standardized to have $3 2 \mathrm { x } 3 2 $ pixels with red, green and blue color channels with integer values between 0 and 255 to represent the intensity of each pixel. These images shown in Figure 2a are the source signal $\mathbf { Z }$ which are unknown to the model. They are only used as ground truth to evaluate the model’s output. The equation ${ \bf X } = { \bf A } { \bf Z }$ is used to generate the received signal $\mathbf { X }$ by randomly generating values for a mixing matrix A using the uniform distribution which generates real numbers between 1 and 6. The images are then rescaled to integer values within the range between 0 and 255. The received signal $\mathbf { X }$ , which is the input to the model, is the three images shown in Figure 2b. The three images for the mixed signal may look visually similar, however, they are actually superposition of the source signal with different intensity. The objective of our model is to reconstruct the source signal $\mathbf { Z }$ without knowing the mixing matrix A.
|
| 146 |
+
|
| 147 |
+
We compare our approach to FastICA (Hyvarinen & Oja, 2000) with the ¨ log cosh function as the signal prior, dictionary learning (DL) (Olshausen & Field, 1997) with constraint for positive dictionary and positive code, and NMF with the coordinate descent solver and non-negative double singular value decomposition (NNDSVD) initialization (Boutsidis & Gallopoulos, 2008) with zero values replaced with the mean of the input.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: Time series signal experiment.
|
| 151 |
+
|
| 152 |
+
Since BSS is an unsupervised learning problem, the order of the signal is not recovered. We identify the corresponding signal by taking all permutations of the output and calculate the minimum euclidean distance with the ground truth. The permutation which returns the minimum error is considered as the correct order of the image. The scale of the output is also not recovered, thereby we have used min-max normalization to the output of each model.
|
| 153 |
+
|
| 154 |
+
Separation results for images are shown in Figure 2. Our proposed approach IGBSS is able to recover majority of the “shape” of the source signal, while the intensity of each image appears to larger than the ground truth for all images. Small residuals of each image can be seen on the other images. For instance, in the airplane (F-16) image, there residuals from the lake image can be clearly seen. Compared to the reconstruction of IGBSS with FastICA, DL and NMF, IGBSS performs significantly better as all the other approaches are unable to clearly separate the mixed signal. FastICA was unable to provide a reasonable reconstruction with 3 mixed signal. To overcome this limitation of FastICA, we randomly generated another column of the mixing matrix and append it to the current mixing matrix to create 4 mixed signals as an input to FastICA to recover a more reasonable signal.
|
| 155 |
+
|
| 156 |
+
The root mean square error (RMSE) of the Euclidean distance and the signal-to-noise ratio (SNR) between the reconstruction and the ground truth is calculated to quantify results of each method. The SNR is computed by $\mathrm { S N R } _ { d B } = 2 0 \log _ { 1 0 } ( z _ { \mathrm { n o r m } } / | ( z - z _ { \mathrm { n o r m } } ) | )$ . The full results are shown in Table 1 (top row for each experiment). In the table, we present three experiments with different RGB images from USC-SIPI dataset, for each experiment we generate a new mixing matrix, where the second and the third experiments uses images of “mandrill”, “splash”, “jelly beans” and “mandrill”, “lake”, “peppers”, respectively. Ground truth and resulting images for second and third experiments are presented in Supplement. Our results clearly show that IGBSS is superior to other methods, that is, IGBSS has consistently produced the lowest RMSE error for every experiment. When looking at the SNR ratio, our model has produce the highest SNR for majority of the cases and is always able to recover the same result after each run as it is formulated as convex optimization.
|
| 157 |
+
|
| 158 |
+
# 3.2 BLIND SOURCE SEPARATION WITH HIGHER-ORDER FEATURE INTERACTIONS
|
| 159 |
+
|
| 160 |
+
We demonstrate the ability of BSS for our model to include higher-order feature interactions in BSS. We use the same benchmark images in the standard BSS as the source signal $\mathbf { Z }$ for our experiment. We generate the higher-order feature interactions of the received signal by using the multiplicative product of the source signal. If we take into account up to $k$ th order interaction $( k \leq N )$ ,
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\begin{array} { l } { { \displaystyle x _ { l m } = \sum _ { n } a _ { l n } z _ { n m } + \sum _ { n 1 } \sum _ { n _ { 2 } > n _ { 1 } } a _ { l n _ { 1 } n _ { 2 } } z _ { n _ { 1 } m } z _ { n _ { 2 } m } + \sum _ { n 1 } \sum _ { n _ { 2 } > n _ { 1 } } \sum _ { n _ { 3 } > n _ { 2 } } a _ { l n _ { 1 } n _ { 2 } n _ { 3 } } z _ { n _ { 1 } m } z _ { n _ { 2 } m } z _ { n _ { 3 } m } } } \\ { { \displaystyle \qquad + \cdot \cdot + \sum _ { n _ { 1 } } \cdot \cdot \cdot \sum _ { n _ { k } > n _ { k - 1 } } a _ { l n _ { 1 } . . . n _ { k } } z _ { n _ { 1 } m } \cdot . . \ z _ { n _ { k } m } . } } \end{array}
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
All the other known approaches take into account only first order interactions (that is, affine transformation) between features. Differently, our model can directly incorporate the higher-order features as we do not have any assumption of the affine transformation. When we consider up to $k \mathrm { t h }$ order interactions, we additionally include elements corresponding to new mixing parameters into the mixing layer. For example, if $k = 2$ , nodes for $a _ { l n _ { 1 } n _ { 2 } }$ are added and $a _ { l n _ { 1 } n _ { 2 } } \ \preceq \ z _ { n m }$ if $n _ { 1 } = n$ or $n _ { 2 } = n$ . Figure 3 shows experimental results for the third-order feature experiment. Our approach IGBSS shows superior reconstruction of the source signal to other approaches. All the other approaches except for NMF is able to achieve reasonable reconstruction. NMF is able to recover the “shape” of the image, however, unlike IBSS, NMF is a degenerate approach, so it is unable to recover all color channels in the correct proportion, creating discoloring for the image which is clearly shown in the SNR values. Since the proportion of the intensity of the pixel is not recovered. In terms of both of the RMSE and the SNR shown in Table 1, IGBSS again shows the best results for both second- and third-order interactions of signals across three experiments.
|
| 167 |
+
|
| 168 |
+
Table 2: Quantitative results for time-series separation experiment (mean $\pm$ standard deviation with 40 runs).
|
| 169 |
+
(a) Root Mean Squared Error (RMSE)
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Order</td><td>IGBSS (min-max)</td><td>IGBSS (exp)</td><td>FastICA</td></tr><tr><td>First</td><td>0.702 ±0.000</td><td>0.703±0.000</td><td>0.414± 0.286</td></tr><tr><td>Second</td><td>0.921 ± 0.000</td><td>0.921 ± 0.000</td><td>1.700 ± 0.167</td></tr><tr><td>Third</td><td>0.967 ± 0.000</td><td>0.961± 0.000</td><td>1.388 ± 0.178</td></tr></table>
|
| 172 |
+
|
| 173 |
+
(b) Signal-to-noise (SNR) (units in dB)
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Order</td><td>IGBSS (min-max)</td><td>IGBSS (exp)</td><td>FastICA</td></tr><tr><td>First</td><td>3.596±0.000</td><td>3.600±0.000</td><td>15.391± 3.813</td></tr><tr><td>Second</td><td>0.291± 0.000</td><td>0.042 ± 0.000</td><td>-5.803 ± 1.124</td></tr><tr><td>Third</td><td>0.340 ± 0.000</td><td>0.128 ± 0.000</td><td>-3.427 ± 1.249</td></tr></table>
|
| 176 |
+
|
| 177 |
+
# 3.3 TIME SERIES DATA ANALYSIS
|
| 178 |
+
|
| 179 |
+
We demonstrate the effectiveness of our model on time series data. In our experiments, we create three signals with 500 observations each using the sinusoidal function, sign function, and the sawtooth function. The synthetic data simulates typical signals from a wide range of applications including audio, medical and sensors. We randomly generate a mixing matrix by drawing from a uniform distribution with values between 0.5 and 2. In our experiment, we provide comparison of using both min-max normalization and exponential kernel as a pre-processing step and compare our approach with FastICA.
|
| 180 |
+
|
| 181 |
+
Experimental results are illustrated in Figure 4. These results show that IGBSS is superior to all the ICA approaches because it is able to recover both the shape of the signal and the sign of the signal, while all the other ICA approaches are only able to recover the shape of the signal and are unable to recover the sign of the signal. This means that ICA could recover a flipped signal. We have paired the recovered signal of ICA with the ground truth by finding the signal and sign with the lowest RMSE error. In any practical application, this is not possible for ICA because the latent signal is unknown. Through visual inspection, IGBSS is able to recover all visual signals with high accuracy, while FastICA is only able to recover the first-order interaction and it is unable to produce a reasonable recovery for second- and third-order interactions. In addition to our visual comparison, we have also performed a quantitative analysis on the experimental results using RMSE error with the ground truth. Results are shown in Table 2. FastICA has shown to have better performance for First-Order interactions. However, for second- and third-order SNR results for FastICA is unable to recover a reasonable signal because the noise is more dominant. IGBSS has shown superior performance and is able to recover the signal for second- and third-order interactions with better scores for both RMSE and SNR.
|
| 182 |
+
|
| 183 |
+
# 4 CONCLUSION
|
| 184 |
+
|
| 185 |
+
We have proposed a novel blind source separation (BSS) method, called Information Geometric Blind Source Separation (IGBSS). We have formulated our approach using the log-linear model, which enables us to introduce a hierarchical structure into its sample space to achieve BSS. We have theoretically shown that IGBSS has desirable properties for BSS such as unique recover of source signals as it solves the convex optimization problem by minimizing the KL divergence from mixed signals to source signals. We have experimentally shown that IGBSS recovers images and signals closer to the ground truth than independent component analysis (ICA), dictionary learning (DL) and non-negative matrix factorization (NMF). Thanks to the flexibility of the hierarchical structure, IGBSS is able to separate signals with complex interactions such as higher-order interactions. Our model is superior to the other approaches because it is non-degenerate and is able to recover the sign of the signal. Since our approach is flexible and requires less assumptions than alternative approaches, it can be applied to various real world applications such as medical imaging, signal processing, and image processing.
|
| 186 |
+
|
| 187 |
+
REFERENCES
|
| 188 |
+
A. Agresti. Categorical Data Analysis. Wiley, 3 edition, 2012.
|
| 189 |
+
S. Amari. Information geometry on hierarchy of probability distributions. IEEE Transactions on Information Theory, 47(5):1701–1711, 2001.
|
| 190 |
+
Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural Computation, 10(2):251– 276, 1998.
|
| 191 |
+
Shun-Ichi. Amari. Information geometry and its applications: Convex function and dually flat manifold. In F. Nielsen (ed.), Emerging Trends in Visual Computing: LIX Fall Colloquium, ETVC 2008, Revised Invited Papers, pp. 75–102. Springer, 2009.
|
| 192 |
+
Shun-Ichi. Amari. Information Geometry and Its Applications. Springer, 2016.
|
| 193 |
+
Anthony J Bell and Terrence J Sejnowski. An information-maximization approach to blind separation and blind deconvolution. Neural Computation, 7(6):1129–1159, 1995.
|
| 194 |
+
Olivier Berne, C Joblin, Y Deville, JD Smith, M Rapacioli, JP Bernard, J Thomas, W Reach, and A Abergel. Analysis of the emission of very small dust particles from spitzer spectro-imagery data using blind signal separation methods. Astronomy & Astrophysics, 469(2):575–586, 2007.
|
| 195 |
+
Christos Boutsidis and Efstratios Gallopoulos. SVD based initialization: A head start for nonnegative matrix factorization. Pattern Recognition, 41(4):1350–1362, 2008.
|
| 196 |
+
Jean-Franc¸ois Cardoso. High-order contrasts for independent component analysis. Neural Computation, 11(1):157–192, 1999.
|
| 197 |
+
Pierre Comon. Independent component analysis, a new concept? Signal Processing, 36(3):287–314, 1994.
|
| 198 |
+
Marco Congedo, Cedric Gouy-Pailler, and Christian Jutten. On the blind source separation of human ´ electroencephalogram by approximate joint diagonalization of second order statistics. Clinical Neurophysiology, 119(12):2677–2686, 2008.
|
| 199 |
+
B. A. Coull and A. Agresti. Generalized log-linear models with random effects, with application to smoothing contingency tables. Statistical Modelling, 3(4):251–271, 2003.
|
| 200 |
+
Chris HQ Ding, Tao Li, and Michael I Jordan. Convex and semi-nonnegative matrix factorizations. IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(1):45–55, 2008.
|
| 201 |
+
Gerhard Gierz, Karl Heinrich Hofmann, Klaus Keimel, Jimmie D Lawson, Michael Mislove, and Dana S Scott. Continuous lattices and domains, volume 93. Cambridge university press, 2003.
|
| 202 |
+
Aapo Hyvarinen and Erkki Oja. Independent component analysis: algorithms and applications. ¨ Neural Networks, 13(4-5):411–430, 2000.
|
| 203 |
+
Takuya Isomura and Taro Toyoizumi. A local learning rule for independent component analysis. Scientific Reports, 6:28073, 2016.
|
| 204 |
+
Quoc V Le, Alexandre Karpenko, Jiquan Ngiam, and Andrew Y Ng. ICA with reconstruction cost for efficient overcomplete feature learning. In Advances in Neural Information Processing Systems 24, pp. 1017–1025, 2011.
|
| 205 |
+
Daniel D Lee and H Sebastian Seung. Algorithms for non-negative matrix factorization. In Advances in Neural Information Processing Systems 13, pp. 556–562, 2001.
|
| 206 |
+
Simon Luo and Mahito Sugiyama. Bias-variance trade-off in hierarchical probabilistic models using higher-order feature interactions. In Proceedings of the 33rd AAAI Conference on Artificial Intelligence, pp. 4488–4495, 2019.
|
| 207 |
+
Kevin P Murphy. Machine Learning: A Probabilistic Perspective. MIT press, 2012.
|
| 208 |
+
Bruno A Olshausen and David J Field. Sparse coding with an overcomplete basis set: A strategy employed by V1? Vision Research, 37(23):3311–3325, 1997.
|
| 209 |
+
Karl Pearson. LIII. 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.
|
| 210 |
+
Hiroshi Sawada, Nobutaka Ono, Hirokazu Kameoka, Daichi Kitamura, and Hiroshi Saruwatari. A review of blind source separation methods: two converging routes to ILRMA originating from ICA and NMF. APSIPA Transactions on Signal and Information Processing, 8, 2019.
|
| 211 |
+
Matthias Scholz, Fatma Kaplan, Charles L Guy, Joachim Kopka, and Joachim Selbig. Non-linear PCA: a missing data approach. Bioinformatics, 21(20):3887–3895, 2005.
|
| 212 |
+
Mahito Sugiyama, Hiroyuki Nakahara, and Koji Tsuda. Information decomposition on structured space. In 2016 IEEE International Symposium on Information Theory, pp. 575–579, 2016.
|
| 213 |
+
Mahito Sugiyama, Hiroyuki Nakahara, and Koji Tsuda. Tensor balancing on statistical manifold. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 3270–3279, 2017.
|
| 214 |
+
Ricardo Vigario, Veikko Jousm ´ aki, Matti H ¨ am¨ al¨ ainen, Riitta Hari, and Erkki Oja. Independent ¨ component analysis for identification of artifacts in magnetoencephalographic recordings. In Advances in Neural Information Processing Systems 10, pp. 229–235, 1998.
|
| 215 |
+
Huan Xu, Constantine Caramanis, and Sujay Sanghavi. Robust PCA via outlier pursuit. In Advances in Neural Information Processing Systems, pp. 2496–2504, 2010.
|
| 216 |
+
Hui Zou, Trevor Hastie, and Robert Tibshirani. Sparse principal component analysis. Journal of Computational and Graphical Statistics, 15(2):265–286, 2006.
|
| 217 |
+
|
| 218 |
+
# A APPENDIX
|
| 219 |
+
|
| 220 |
+
# A.1 PARAMETER COMPUTATION FOR EACH LAYER
|
| 221 |
+
|
| 222 |
+
In the following, we give $p , \eta$ , and the gradient for each layer, which are used in gradient descent.
|
| 223 |
+
|
| 224 |
+
Received Layer (Input Layer): Probability $p ( x )$ on the received layer $x \in \mathcal { X }$ is obtained as
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
\begin{array} { c } { \log p ( x ) = \displaystyle \sum _ { z \in \mathcal { Z } } \mathbf { 1 } _ { z \preceq x } \theta _ { z } + \displaystyle \sum _ { a \in \mathcal { A } } \mathbf { 1 } _ { a \preceq x } \theta _ { a } + \theta _ { \perp } , } \\ { \eta _ { x } = \displaystyle \sum _ { x ^ { \prime } \in \mathcal { X } } \mathbf { 1 } _ { x \preceq x ^ { \prime } } p ( x ^ { \prime } ) = p ( x ) . } \end{array}
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
We do not need to compute gradient for the received layer as there is no parameter on this layer and $\theta _ { x } = 0$ for all $x \in \mathcal { X }$ .
|
| 231 |
+
|
| 232 |
+
Source Layer (Output Layer): Probability $p ( z )$ on the source layer for each $z \in { \mathcal { Z } }$ is given as
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
\begin{array} { c } { { \displaystyle \log p ( z ) = \sum _ { z ^ { \prime } \in \mathcal { Z } , \atop { z \in \mathcal { X } } } \mathbf { 1 } _ { z ^ { \prime } \preceq z } \theta _ { z ^ { \prime } } + \sum _ { a \in \mathcal { A } } \mathbf { 1 } _ { a \preceq z } \theta _ { a } + \theta _ { \bot } = \theta _ { z } + \sum _ { a \in \mathcal { A } } \mathbf { 1 } _ { a \preceq z } \theta _ { a } + \theta _ { \bot } , } } \\ { { \displaystyle \eta _ { z } = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { z \preceq x } p ( x ) + \sum _ { z ^ { \prime } \in \mathcal { Z } } \mathbf { 1 } _ { z \preceq z ^ { \prime } } p ( z ^ { \prime } ) = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { z \preceq x } p ( x ) + p ( z ) . } } \end{array}
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
Thus the gradient for the source layer is given as
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
\frac { \partial } { \partial \theta _ { z } } D _ { K L } ( \hat { p } \| p ) = \eta _ { z } - \hat { \eta } _ { z } = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { z \preceq x } \left( p ( x ) - \hat { p } ( x ) \right) + p ( z ) .
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
Mixing Layer: Probability $p ( a )$ on this layer for each $a \in { \mathcal { A } }$ is given as
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\begin{array} { c } { { \displaystyle \log p ( a ) = \sum _ { a ^ { \prime } \in \mathcal { A } } \mathbf { 1 } _ { a ^ { \prime } \preceq a } \theta _ { a ^ { \prime } } + \theta _ { \bot } = \theta _ { a } + \theta _ { \bot } , } } \\ { { \displaystyle \eta _ { a } = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { a \preceq x } p ( x ) + \sum _ { z \in \mathcal { Z } } \mathbf { 1 } _ { a \preceq z } p ( z ) + \sum _ { a ^ { \prime } \in \mathcal { A } } \mathbf { 1 } _ { a \preceq a ^ { \prime } } p ( a ^ { \prime } ) } } \\ { { \displaystyle = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { a \preceq x } p ( x ) + \sum _ { z \in \mathcal { Z } } \mathbf { 1 } _ { a \preceq z } p ( z ) + p ( a ) . } } \end{array}
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
The gradient of the mixing layer is given as
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\frac { \partial } { \partial \theta _ { a } } D _ { K L } ( \hat { p } \| p ) = \eta _ { a } - \hat { \eta } _ { a } = \sum _ { x \in \mathcal { X } } \mathbf { 1 } _ { a \preceq x } \left( p ( x ) - \hat { p } ( x ) \right) + \sum _ { z \in \mathcal { Z } } \mathbf { 1 } _ { a \preceq z } p ( z ) + p ( a ) .
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
Parameter values $\theta _ { a }$ in the mixing layer represent the degree of mixing between source signals. Hence they can be used to perform feature selection and extraction. For example, if $\theta _ { a } = 0$ in the extreme case, the corresponding node $a$ does not have any contribution to the source mixing.
|
| 257 |
+
|
| 258 |
+
# A.2 FEATURE EXTRACTION FOR A 2D POINT CLOUD EXPERIMENT
|
| 259 |
+
|
| 260 |
+
We demonstrate the effectiveness for IGBSS to identify independent components on a 2-dimensional point cloud to be used for feature extraction or dimensionality reduction. In our experiment, we generate a 2-dimensional point cloud using two standard Student’s $t$ -distribution with 1.3 degree of freedom and have scaled the first dimension by $1 / 5$ and the second dimension by $1 / 1 0$ to the point cloud, illustrated in Figure 5a. Then we have randomly generated a mixing matrix for our experiment to generate a mixed signal shown in Figure 5b. We run the experiment on our model IGBSS using min-max normalization as a pre-processing step and compare it to PCA and ICA. We apply the reverse transformation of the min-max normalization on the recovered signal and have plotted the results in Figure 5. From the experimental results, we can see that PCA is able to recover the same scale of the point cloud. However, the sign of the signal is not recovered as we have recovered reversed sign of the signal. PCA also recovers signals which are orthogonal to the largest variance. Therefore the axes of the point cloud recovered by PCA does not align with the source signal in Figure 5a, that is, the axes do not run parallel to the $\mathbf { X } ^ { - }$ and y- axes but instead is still in the same orientation as the mixed signal. This is not what we want as the signal is still mixed, and we would like to recover the signal in the same orientation as the source signal in blind source separation. ICA aims to recover statistically independent signals that are generally considered as the axes with the largest variances and not necessarily orthogonal to each other. However, the limitations of ICA is that it is unable to recover the sign and the scale of the signal. Therefore the scale of the recovered signal does not match with the source signal. In our experiment, we have plotted the results with unit variance as the recovered signal is generally unnormalized in ICA. Since our experiment is synthetically generated, we are able to quantitatively measure the the error in each approach by normalizing both the recovered signal and the source signal by its standard deviation then computing the root mean squared error (RMSE) and the signal-to-noise ratio (SNR). The results of this is shown in Table 3. Our proposed approach IGBSS has clear advantages, where it is able to recover the same orientation as the source signal as well as preserve the signal.
|
| 261 |
+
|
| 262 |
+
Table 3: Signal-to-Noise Ratio (SNR) and Root Mean Square Error (RMSE) between the recovered signal and the latent source signal for the 2-dimensional point cloud experiment.
|
| 263 |
+
|
| 264 |
+
<table><tr><td>Model</td><td>PCA</td><td>ICA</td><td>IGBSS</td></tr><tr><td>RMSE</td><td>2.011</td><td>1.445</td><td>1.421</td></tr><tr><td>SNR</td><td>25.997</td><td>27.431</td><td>27.503</td></tr></table>
|
| 265 |
+
|
| 266 |
+
# A.3 RUNTIME ANALYSIS
|
| 267 |
+
|
| 268 |
+
In our experiment, we used a learning rate of 1.0 for gradient descent. Although the time complexity for each iteration of natural gradient is $\mathcal { O } ( \vert \mathcal { Z } \vert ^ { 3 } + \vert \bar { \mathcal { A } } \vert ^ { 3 } + \vert \Omega \vert \vert S \vert )$ , which is larger than $\mathcal { O } ( | \Omega | \bar { | } S | ^ { 2 } )$ for gradient descent, natural gradient is able to reach convergence faster because it is quadratic convergence and requires significantly less iterations compared to gradient descent, which linearly converges. Increasing the size of the input will increase the size of $| \Omega |$ only, while the number of parameters $| { \mathcal { Z } } | , | \mathbf { A } |$ remain this same. Since the complexity of natural gradient is linear with respect to the size $| \Omega |$ of the input, increasing the size of the input is unlikely to increase the runtime significantly. Our experimental analysis in Figure 6 supports this analysis: our model scales linearly for both natural gradient and gradient descent when increasing the order of interactions in our model. This is because for practical application it is unlikely that $| { \mathcal { A } } | > | { \mathcal { Z } } |$ . The different between the runtime for natural gradient and gradient descent becomes larger as the order of interactions increased.
|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
Figure 5: 2-dimensional point cloud experiment.
|
| 272 |
+
|
| 273 |
+
# A.4 SIGN INVERSION IN ICA
|
| 274 |
+
|
| 275 |
+
When demonstrate the problem of the sign inversion in ICA. We use the same experimental set-up explained in Section 3.1 on blind source separation for affine transformation. We run the experiment on the dataset used for experimental 1 for the first order experiment and have shown the output of several runs in FastICA to show the problem of the sign inversion in Figure 7. For the 6 runs, we can see that none of the experiments were able to obtain the correct sign of the signal. This means that apply FastICA to applications where the sign of the signal is important is quite problematic.
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 6: Experimental analysis of the scalability of number of parameters and higher-order features in the model for both natural gradient approach and gradient descent
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 7: Six different runs of FastICA with the same experimental input experimental dataset as exp1 with first order interactions. The different results can demonstrate that the FastICA model is non-convex leading to potential problemic results such as the sign inversion.
|
md/train/lE1AB4stmX/lE1AB4stmX.md
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A TRANSFORMER-BASED FRAMEWORK FOR MULTIVARIATE TIME SERIES REPRESENTATION LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous Authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this work we propose for the first time a transformer-based framework for unsupervised representation learning of multivariate time series. Pre-trained models can be potentially used for downstream tasks such as regression and classification, forecasting and missing value imputation. We evaluate our models on several benchmark datasets for multivariate time series regression and classification and show that they exceed current state-of-the-art performance, even when the number of training samples is very limited, while at the same time offering computational efficiency. We show that unsupervised pre-training of our transformer models offers a substantial performance benefit over fully supervised learning, even without leveraging additional unlabeled data, i.e., by reusing the same data samples through the unsupervised objective.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Multivariate time series (MTS) are an important type of data that is ubiquitous in a wide variety of domains, including science, medicine, finance, engineering and industrial applications. Despite the recent abundance of MTS data in the much touted era of “Big Data”, the availability of labeled data in particular is far more limited: extensive data labeling is often prohibitively expensive or impractical, as it may require much time and effort, special infrastructure or domain expertise. For this reason, in all aforementioned domains there is great interest in methods which can offer high accuracy by using only a limited amount of labeled data or by leveraging the existing plethora of unlabeled data.
|
| 12 |
+
|
| 13 |
+
There is a large variety of modeling approaches for univariate and multivariate time series, with deep learning models recently challenging or replacing the state of the art in tasks such as forecasting, regression and classification (De Brouwer et al., 2019; Tan et al., 2020a; Fawaz et al., 2019b). However, unlike in domains such as Computer Vision or Natural Language Processing (NLP), the dominance of deep learning for time series is far from established: in fact, non-deep learning methods such as TS-CHIEF (Shifaz et al., 2020), HIVE-COTE (Lines et al., 2018), and ROCKET (Dempster et al., 2020) currently hold the record on time series regression and classification dataset benchmarks (Tan et al., 2020a; Bagnall et al., 2017), matching or even outperforming sophisticated deep architectures such as InceptionTime (Fawaz et al., 2019a) and ResNet (Fawaz et al., 2019b).
|
| 14 |
+
|
| 15 |
+
In this work, we investigate, for the first time, the use of a transformer encoder for unsupervised representation learning of multivariate time series, as well as for the tasks of time series regression and classification. Transformers are an important, recently developed class of deep learning models, which were first proposed for the task of natural language translation (Vaswani et al., 2017) but have since come to monopolize the state-of-the-art performance across virtually all NLP tasks (Raffel et al., 2019). A key factor for the widespread success of transformers in NLP is their aptitude for learning how to represent natural language through unsupervised pre-training (Brown et al., 2020; Raffel et al., 2019; Devlin et al., 2018). Besides NLP, transformers have also set the state of the art in several domains of sequence generation, such as polyphonic music composition (Huang et al., 2018).
|
| 16 |
+
|
| 17 |
+
Transformer models are based on a multi-headed attention mechanism that offers several key advantages and renders them particularly suitable for time series data (see Appendix section A.4 for details). Inspired by the impressive results attained through unsupervised pre-training of transformer models in NLP, as our main contribution, in the present work we develop a generally applicable methodology (framework) that can leverage unlabeled data by first training a transformer model to extract dense vector representations of multivariate time series through an input denoising (autoregressive) objective. The pre-trained model can be subsequently applied to several downstream tasks, such as regression, classification, imputation, and forecasting. Here, we apply our framework for the tasks of multivariate time series regression and classification on several public datasets and demonstrate that transformer models can convincingly outperform all current state-of-the-art modeling approaches, even when only having access to a very limited amount of training data samples (on the order of hundreds of samples), an unprecedented success for deep learning models. Importantly, despite common preconceptions about transformers from the domain of NLP, where top performing models have billions of parameters and require days to weeks of pre-training on many parallel GPUs or TPUs, we also demonstrate that our models, using at most hundreds of thousands of parameters, can be trained even on CPUs, while training them on GPUs allows them to be trained as fast as even the fastest and most accurate non-deep learning based approaches.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Regression and classification of time series: Currently, non-deep learning methods such as TSCHIEF (Shifaz et al., 2020), HIVE-COTE (Lines et al., 2018), and ROCKET (Dempster et al., 2020) constitute the state of the art for time series regression and classification based on evaluations on public benchmarks (Tan et al., 2020a; Bagnall et al., 2017), followed by CNN-based deep architectures such as InceptionTime (Fawaz et al., 2019a) and ResNet (Fawaz et al., 2019b). ROCKET, which on average is the best ranking method, is a fast method that involves training a linear classifier on top of features extracted by a flat collection of numerous and various random convolutional kernels. HIVE-COTE and TS-CHIEF (itself inspired by Proximity Forest (Lucas et al., 2019)), are very sophisticated methods which incorporate expert insights on time series data and consist of large, heterogeneous ensembles of classifiers utilizing shapelet transformations, elastic similarity measures, spectral features, random interval and dictionary-based techniques; however, these methods are highly complex, involve significant computational cost, cannot benefit from GPU hardware and scale poorly to datasets with many samples and long time series; moreover, they have been developed for and only been evaluated on univariate time series.
|
| 22 |
+
|
| 23 |
+
Unsupervised learning for multivariate time series: Recent work on unsupervised learning for multivariate time series has predominantly employed autoencoders, trained with an input reconstruction objective and implemented either as Multi-Layer Perceptrons (MLP) or RNN (most commonly, LSTM) networks. As interesting variations of the former, Kopf et al. (2019) and Fortuin et al. (2019) additionally incorporated Variational Autoencoding into this approach, but focused on clustering and the visualization of shifting sample topology with time. As an example of the latter, Malhotra et al. (2017) presented a multi-layered RNN sequence-to-sequence autoencoder, while Lyu et al. (2018) developed a multi-layered LSTM with an attention mechanism and evaluated both an input reconstruction (autoencoding) as well as a forecasting loss for unsupervised representation learning of Electronic Healthcare Record multivariate time series.
|
| 24 |
+
|
| 25 |
+
As a novel take on autoencoding, and with the goal of dealing with missing data, Bianchi et al. (2019) employ a stacked bidirectional RNN encoder and stacked RNN decoder to reconstruct the input, and at the same time use a user-provided kernel matrix as prior information to condition internal representations and encourage learning similarity-preserving representations of the input. They evaluate the method on the tasks of missing value imputation and classification of time series under increasing “missingness” of values.
|
| 26 |
+
|
| 27 |
+
A distinct approach is followed by Zhang et al. (2019), who use a composite convolutional - LSTM network with attention and a loss which aims at reconstructing correlation matrices between the variables of the multivariate time series input. They use and evaluate their method only for the task of anomaly detection.
|
| 28 |
+
|
| 29 |
+
Finally, Jansen et al. (2018) rely on a triplet loss and the idea of temporal proximity (the loss rewards similarity of representations between proximal segments and penalizes similarity between distal segments of the time series) for unsupervised representation learning of non-speech audio data. This idea is explored further by Franceschi et al. (2019), who combine the triplet loss with a deep causal dilated CNN, in order to make the method effective for very long time series.
|
| 30 |
+
|
| 31 |
+
Transformer models for time series: Recently, a full encoder-decoder transformer architecture was employed for univariate time series forecasting: Li et al. (2019) showed superior performance compared to the classical statistical method ARIMA, the recent matrix factorization method TRMF, an RNN-based autoregressive model (DeepAR) and an RNN-based state space model (DeepState) on 4 public forecasting datasets, while Wu et al. (2020) used a transformer to forecast influenza prevalence and similarly showed performance benefits compared to ARIMA, an LSTM and a GRU Seq2Seq model with attention, and Lim et al. (2020) used a transformer for multi-horizon univariate forecasting, supporting interpretation of temporal dynamics. Finally, Ma et al. (2019) use an encoder-decoder architecture with a variant of self-attention for imputation of missing values in multivariate, geo-tagged time series and outperform classic as well as the state-of-the-art, RNN-based imputation methods on 3 public and 2 competition datasets for imputation.
|
| 32 |
+
|
| 33 |
+
By contrast, our work aspires to generalize the use of transformers from solutions to specific generative tasks (which require the full encoder-decoder architecture) to a framework which allows for unsupervised pre-training and with minor modifications can be readily used for a wide variety of downstream tasks; this is analogous to the way BERT (Devlin et al., 2018) converted a translation model into a generic framework based on unsupervised learning, an approach which has become a de facto standard and established the dominance of transformers in NLP.
|
| 34 |
+
|
| 35 |
+
# 3 METHODOLOGY
|
| 36 |
+
|
| 37 |
+
# 3.1 BASE MODEL
|
| 38 |
+
|
| 39 |
+
At the core of our method lies a transformer encoder, as described in the original transformer work by Vaswani et al. (2017); however, we do not use the decoder part of the architecture. A schematic diagram of the generic part of our model, common across all considered tasks, is shown in Figure 1. We refer the reader to the original work for a detailed description of the transformer model, and here present the proposed changes that make it compatible with multivariate time series data, instead of sequences of discrete word indices.
|
| 40 |
+
|
| 41 |
+
In particular, each training sample $\mathbf { X } \in \mathbb { R } ^ { w \times m }$ , which is a multivariate time series of length $w$ and $m$ different variables, constitutes a sequence of $w$ feature vectors $\mathbf { x _ { t } } \in \mathbb { R } ^ { m }$ : $\mathbf { X } \in \mathbb { R } ^ { w \times m } =$ $[ \mathbf { x _ { 1 } } , \mathbf { x _ { 2 } } , \ldots , \mathbf { x _ { w } } ]$ . The original feature vectors $\mathbf { x _ { t } }$ are first normalized (for each dimension, we subtract the mean and divide by the variance across the training set samples) and then linearly projected onto a $d$ -dimensional vector space, where $d$ is the dimension of the transformer model sequence element representations (typically called model dimension):
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\mathbf { u _ { t } } = \mathbf { W _ { p } } \mathbf { x _ { t } } + \mathbf { b _ { p } }
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\mathbf { W _ { p } } \in \mathbb { R } ^ { d \times m }$ , $\mathbf { b _ { p } } \in \mathbb { R } ^ { d }$ are learnable parameters and $\mathbf { u _ { t } } \in \mathbb { R } ^ { d } , t = 0 , \dots , w$ are the model input vectors1. These will become the queries, keys and values of the self-attention layer, after adding the positional encodings and multiplying by the corresponding matrices.
|
| 48 |
+
|
| 49 |
+
We note that the above formulation also covers the univariate time series case, i.e., $m = 1$ , although we only evaluate our approach on multivariate time series in the scope of this work. We additionally note that the input vectors $\mathbf { u _ { t } }$ need not necessarily be obtained from the (transformed) feature vectors at a time step $t$ : because the computational complexity of the model scales as $O ( w ^ { 2 } )$ and the number of parameters2 as $O ( w )$ with the input sequence length $w$ , to obtain $\mathbf { u _ { t } }$ in case the granularity (temporal resolution) of the data is very fine, one may instead use a 1D-convolutional layer with 1 input and $d$ output channels and kernels $K _ { i }$ of size $( k , m )$ , where $k$ is the width in number of time steps and $i$ the output channel:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
u _ { t } ^ { \phantom { \dagger } } = u ( t , i ) = \sum _ { j } \sum _ { h } x ( t + j , h ) K _ { i } ( j , h ) , \quad i = 1 , \ldots , d
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 1: Left: Generic model architecture, common to all tasks. The feature vector $\mathbf { x _ { t } }$ at each time step $t$ is linearly projected to a vector $\mathbf { u _ { t } }$ of the same dimensionality $d$ as the internal representation vectors of the model and is fed to the first self-attention layer to form the keys, queries and values after adding a positional encoding. Right: Training setup of the unsupervised pre-training task. We mask a proportion $r$ of each variable sequence in the input independently, such that across each variable, time segments of mean length $l _ { m }$ are masked, each followed by an unmasked segment of mean length $\begin{array} { r } { l _ { u } ^ { \mathbf { \bar { \alpha } } } = \frac { 1 - r } { r } l _ { m } } \end{array}$ . Using a linear layer on top of the final vector representations $\mathbf { z _ { t } }$ , at each time step the model tries to predict the full, uncorrupted input vectors $\mathbf { x _ { t } }$ ; however, only the predictions on the masked values are considered in the Mean Squared Error loss.
|
| 57 |
+
|
| 58 |
+
In this way, one may control the temporal resolution by using a stride or dilation factor greater than 1. Moreover, although in the present work we only used equation 1, one may use equation 2 as an input to compute the keys and queries and equation 1 to compute the values of the self-attention layer. This is particularly useful in the case of univariate time series, where self-attention would otherwise match (consider relevant/compatible) all time steps which share similar values for the independent variable, as noted by Li et al. (2019).
|
| 59 |
+
|
| 60 |
+
Finally, since the transformer is a feed-forward architecture that is insensitive to the ordering of input, in order to make it aware of the sequential nature of the time series, we add positional encodings $\mathbf { \bar { W } _ { p o s } } \in \mathbb { R } ^ { w \times d }$ to the input vectors $U \in \mathbb { R } ^ { w \times d } = [ \mathbf { u _ { 1 } } , \dots , \mathbf { u _ { w } } ]$ : $U ^ { \prime } = U + W _ { \mathrm { p o s } }$ .
|
| 61 |
+
|
| 62 |
+
Instead of deterministic, sinusoidal encodings, which were originally proposed by Vaswani et al. (2017), we use fully learnable positional encodings, as we observed that they perform better for all datasets presented in this work. Based on the performance of our models, we also observe that the positional encodings generally appear not to significantly interfere with the numerical information of the time series, similar to the case of word embeddings; we hypothesize that this is because they are learned so as to occupy a different, approximately orthogonal, subspace to the one in which the projected time series samples reside. This approximate orthogonality condition is much easier to satisfy in high dimensional spaces.
|
| 63 |
+
|
| 64 |
+
An important consideration regarding time series data is that individual samples may display considerable variation in length. This issue is effectively dealt with in our framework: after setting a maximum sequence length $w$ for the entire dataset, shorter samples are padded with arbitrary values, and we generate a padding mask which adds a large negative value to the attention scores for the padded positions, before computing the self-attention distribution with the softmax function. This forces the model to completely ignore padded positions, while allowing the parallel processing of samples in large minibatches.
|
| 65 |
+
|
| 66 |
+
Transformers in NLP use layer normalization after computing self-attention and after the feedforward part of each encoder block, leading to significant performance gains over batch normalization, as originally proposed by Vaswani et al. (2017). However, here we instead use batch normalization, because it can mitigate the effect of outlier values in time series, an issue that does not arise in NLP word embeddings. Additionally, the inferior performance of batch normalization in NLP has been mainly attributed to extreme variation in sample length (i.e., sentences in most tasks) (Shen et al., 2020), while in the datasets we examine this variation is much smaller. In Table 11 of the Appendix we show that batch normalization can indeed offer a very significant performance benefit over layer normalization, while the extent can vary depending on dataset characteristics.
|
| 67 |
+
|
| 68 |
+
# 3.2 REGRESSION AND CLASSIFICATION
|
| 69 |
+
|
| 70 |
+
The base model architecture presented in Section 3.1 and depicted in Figure 1 can be used for the purposes of regression and classification with the following modification: the final representation vectors $\mathbf { z _ { t } } \in \bar { \mathbb { R } } ^ { d }$ corresponding to all time steps are concatenated into a single vector $\bar { \bar { \mathbf { z } } } \in \mathbb { R } ^ { d \cdot w } =$ $[ \mathbf { z _ { 1 } } ; \hdots ; \mathbf { z _ { w } } ]$ , which serves as the input to a linear output layer with parameters $\mathbf { W _ { o } } \in \mathbb { R } ^ { n \times ( d \cdot w ) }$ , $\mathbf { b _ { o } } \in \mathbb { R } ^ { n }$ , where $n$ is the number of scalars to be estimated for the regression problem (typically $n = 1 \AA$ ), or the number of classes for the classification problem:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\hat { \mathbf { y } } = \mathbf { W _ { o } } \bar { \mathbf { z } } + \mathbf { b _ { o } }
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
In the case of regression, the loss for a single data sample will simply be the squared error ${ \mathcal { L } } =$ $\| { \hat { \mathbf { y } } } - \mathbf { y } \| ^ { 2 }$ , where $\mathbf { y } \in \mathbb { R } ^ { n }$ are the ground truth values. We clarify that regression in the context of this work means predicting a numeric value for a given sequence (time series sample). This numeric value is of a different nature than the numerical data appearing in the time series: for example, given a sequence of simultaneous temperature and humidity measurements of 9 rooms in a house, as well as weather and climate data such as temperature, pressure, humidity, wind speed, visibility and dewpoint, we wish to predict the total energy consumption in $\mathbf { k W h }$ of a house for that day. The parameter $n$ corresponds to the number of scalars (or the dimensionality of a vector) to be estimated.
|
| 77 |
+
|
| 78 |
+
In the case of classification, the predictions $\hat { \mathbf { y } }$ will additionally be passed through a softmax function to obtain a distribution over classes, and its cross-entropy with the categorical ground truth labels will be the sample loss.
|
| 79 |
+
|
| 80 |
+
Finally, when fine-tuning the pre-trained models, we allow training of all weights; instead, freezing all layers except for the output layer would be equivalent to using static, pre-extracted time-series representations of the time series. In Table 12 in the Appendix we show the trade-off in terms of speed and performance when using a fully trainable model versus static representations.
|
| 81 |
+
|
| 82 |
+
# 3.3 UNSUPERVISED PRE-TRAINING
|
| 83 |
+
|
| 84 |
+
As a task for the unsupervised pre-training of our model we consider the autoregressive task of denoising the input: specifically, we set part of the input to 0 and ask the model to predict the masked values. The corresponding setup is depicted in the right part of Figure 1. A binary noise mask $\mathbf { M } \in \mathbb { R } ^ { w \times m }$ , is created independently for each training sample, and the input is masked by elementwise multiplication: $\tilde { \mathbf { X } } = \bar { \mathbf { M } } \odot \mathbf { X }$ . On average, a proportion $r$ of each mask column of length $w$ (corresponding to a single variable in the multivariate time series) is set to 0 by alternating between segments of 0s and 1s. We choose the state transition probabilities such that each masked segment (sequence of 0s) has a length that follows a geometric distribution with mean $l _ { m }$ and is succeeded by an unmasked segment (sequence of 1s) of mean length $\begin{array} { r } { l _ { u } = \frac { 1 - r } { r } l _ { m } } \end{array}$ . We chose $l _ { m } = 3$ for all presented experiments. The reason why we wish to control the length of the masked sequence, instead of simply using a Bernoulli distribution with parameter $r$ to set all mask elements independently at random, is that very short masked sequences (e.g., of 1 masked element) in the input can often be trivially predicted with good approximation by replicating the immediately preceding or succeeding values or by the average thereof. In order to obtain enough long masked sequences with relatively high likelihood, a very high masking proportion $r$ would be required, which would render the overall task detrimentally challenging. Following the process above, at each time step on average $r \cdot m$ variables will be masked. We empirically chose $r = 0 . 1 5$ for all presented experiments. This input masking process is different from the “cloze type” masking used by NLP models such as BERT, where a special token and thus word embedding vector replaces the original word embedding, i.e., the entire feature vector at affected time steps. We chose this masking pattern because it encourages the model to learn to attend both to preceding and succeeding segments in individual variables, as well as to existing contemporary values of the other variables in the time series, and thereby to learn to model inter-dependencies between variables. In Table 10 in the Appendix we show that this masking scheme is more effective than other possibilities for denoising the input.
|
| 85 |
+
|
| 86 |
+
Using a linear layer with parameters $\mathbf { W _ { o } } \in \mathbb { R } ^ { m \times d }$ , $\mathbf { b _ { o } } \in \mathbb { R } ^ { m }$ on top of the final vector representations $\mathbf { z _ { t } } \in \dot { \mathbb { R } } ^ { d }$ , for each time step the model concurrently outputs its estimate $\hat { \mathbf { x } } _ { \mathbf { t } }$ of the full, uncorrupted input vectors $\mathbf { x _ { t } }$ ; however, only the predictions on the masked values (with indices in the set $M \equiv \{ ( t , i ) : m _ { t , i } = 0 \}$ , where $m _ { t , i }$ are the elements of the mask $\mathbf { M }$ ), are considered in the Mean Squared Error loss for each data sample:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal { \hat { \mathbf { x _ { t } } } } = \mathbf { W _ { o } } \mathbf { z _ { t } } + \mathbf { b _ { o } } \\ { \mathcal { L \mathbf { \mathbf { \mathbf { \phi } } } } _ { \mathrm { M S E } } = \frac { 1 } { | M | } \sum _ { ( t , i ) \in M } \sum _ { } \left( \hat { x } ( t , i ) - x ( t , i ) \right) ^ { 2 } }
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
This objective differs from the one used by denoising autoencoders, where the loss considers reconstruction of the entire input, under (typically Gaussian) noise corruption. Also, we note that the approach described above differs from simple dropout on the input embeddings, both with respect to the statistical distributions of masked values, as well as the fact that here the masks also determine the loss function. In fact, we additionally use a dropout of $10 \%$ when training all of our supervised and unsupervised models.
|
| 93 |
+
|
| 94 |
+
# 4 EXPERIMENTS & RESULTS
|
| 95 |
+
|
| 96 |
+
In the experiments reported below we use the predefined training - test set splits of the benchmark datasets and train all models long enough to ensure convergence. We do this to account for the fact that training the transformer models in a fully supervised way typically requires more epochs than fine-tuning the ones which have already been pre-trained using the unsupervised methodology of Section 3.3. Because the benchmark datasets are very heterogeneous in terms of number of samples, dimensionality and length of the time series, as well as the nature of the data itself, we observed that we can obtain better performance by a cursory tuning of hyperparameters (such as the number of encoder blocks, the representation dimension, number of attention heads or dimension of the feedforward part of the encoder blocks) separately for each dataset. To select hyperparameters, for each dataset we randomly split the training set in two parts, $80 \% - 2 0 \%$ , and used the $20 \%$ as a validation set for hyperparameter tuning. After fixing the hyperparameters, the entire training set was used to train the model again, which was finally evaluated on the test set. A set of hyperparameters which has consistently good performance on all datasets is shown in Table 14 in the Appendix, alongside the hyperparameters that we have found to yield the best performance for each dataset (Tables 15, 16, 17, 18.
|
| 97 |
+
|
| 98 |
+
# 4.1 REGRESSION
|
| 99 |
+
|
| 100 |
+
We select a diverse range of 6 datasets from the Monash University, UEA, UCR Time Series Regression Archive Tan et al. (2020a) in a way so as to ensure diversity with respect to the dimensionality and length of time series samples, as well as the number of samples (see Appendix Table 3 for dataset characteristics). Table 1 shows the Root Mean Squared Error achieved by of our models, named TST for “Time Series Transformer”, including a variant trained only through supervision, and one first pre-trained on the same training set in an unsupervised way. We compare them with the currently best performing models as reported in the archive. Our transformer models rank first on all but two of the examined datasets, for which they rank second. They thus achieve an average rank of 1.33, setting them clearly apart from all other models; the overall second best model, XGBoost, has an average rank of 3.5, ROCKET (which outperformed ours on one dataset) on average ranks in 5.67th place and Inception (which outperformed ours on the second dataset) also has an average rank of 5.67. On average, our models attain $30 \%$ lower RMSE than the mean RMSE among all models, and approx. $16 \%$ lower RMSE than the overall second best model (XGBoost), with absolute improvements varying among datasets from approx. $4 \%$ to $36 \%$ . We note that all other deep learning methods achieve performance close to the middle of the ranking or lower. In Table 1 we report the ”average relative difference from mean” metric $r _ { j }$ for each model $j$ , the over $N$ datasets:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
r _ { j } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { R ( i , j ) - \bar { R } _ { i } } { \bar { R } _ { i } } , \quad \bar { R } _ { i } = \frac { 1 } { M } \sum _ { k = 1 } ^ { M } R ( i , k )
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
, where $R ( i , j )$ is the RMSE of model $j$ on dataset $i$ and $M$ is the number of models.
|
| 107 |
+
|
| 108 |
+
Importantly, we also observe that the pre-trained transformer models outperform the fully supervised ones in 3 out of 6 datasets. This is interesting, because no additional samples are used for pre-training: the benefit appears to originate from reusing the same training samples for learning through an unsupervised objective. To further elucidate this observation, we investigate the following questions:
|
| 109 |
+
|
| 110 |
+
Q1: Given a partially labeled dataset of a certain size, how will additional labels affect performance? This pertains to one of the most important decisions that data owners face, namely, to what extent will further annotation help. To clearly demonstrate this effect, we choose the largest dataset we have considered from the regression archive $1 2 . 5 \mathrm { k }$ samples), in order to avoid the variance introduced by small set sizes. The left panel of Figure 2 (where each marker is an experiment) shows how performance on the entire test set varies with an increasing proportion of labeled training set data used for supervised learning. As expected, with an increasing proportion of available labels performance improves both for a fully supervised model, as well as the same model that has been first pre-trained on the entire training set through the unsupervised objective and then fine-tuned. Interestingly, not only does the pre-trained model outperform the fully supervised one, but the benefit persists throughout the entire range of label availability, even when the models are allowed to use all labels; this is consistent with our previous observation on Table 1 regarding the advantage of reusing samples.
|
| 111 |
+
|
| 112 |
+
Q2: Given a labeled dataset, how will additional unlabeled samples affect performance? In other words, to what extent does unsupervised learning make it worth collecting more data, even if no additional annotations are available? This question differs from the above, as we now only scale the availability of data samples for unsupervised pre-training, while the number of labeled samples is fixed. The right panel of Figure 2 (where each marker is an experiment) shows that, for a given number of labels (shown as a percentage of the totally available labels), the more data samples are used for unsupervised learning, the lower the error achieved (note that the horizontal axis value 0 corresponds to fully supervised training only, while all other values to unsupervised pre-training followed by supervised fine-tuning). This trend is more linear in the case of supervised learning on $20 \%$ of the labels (approx. 2500). Likely due to a small sample (here, meaning set) effect, in the case of having only $10 \%$ of the labels (approx. 1250) for supervised learning, the error first decreases rapidly as we use more samples for unsupervised pre-training, and then momentarily increases, before it decreases again (for clarity, the same graphs are shown separately in Figure 3 in the Appendix). Consistent with our observations above, it is interesting to again note that, for a given number of labeled samples, even reusing a subset of the same samples for unsupervised pretraining improves performance: for the 1250 labels (blue diamonds of the right panel of Figure 2 or left panel of Figure 3 in the Appendix) this can be observed in the horizontal axis range [0, 0.1], and for the 2500 labels (blue diamonds of the right panel of Figure 2 or right panel of Figure 3 in the Appendix) in the horizontal axis range [0, 0.2].
|
| 113 |
+
|
| 114 |
+
# 4.2 CLASSIFICATION
|
| 115 |
+
|
| 116 |
+
We select a set of 11 multivariate datasets from the UEA Time Series Classification Archive (Bagnall et al., 2018) with diverse characteristics in terms of the number, dimensionality and length of time series samples, as well as the number of classes (see Appendix Table 4). As this archive is new, there have not been many reported model evaluations; we follow Franceschi et al. (2019) and use as a baseline the best performing method studied by the creators of the archive, $\mathrm { D T W _ { D } }$ (dimensionDependent DTW), together with the method proposed by Franceschi et al. (2019) themselves (a dilation-CNN leveraging unsupervised and supervised learning). Additionally, we use the publicly available implementations Tan et al. (2020b) of ROCKET, which is currently the top performing model for univariate time series and one of the best in our regression evaluation, and XGBoost, which is one of the most commonly used models for univariate and multivariate time series, and also the best baseline model in our regression evaluation (Section 4.1). Finally, we did not find any reported evaluations of RNN-based models on any of the UCR/UEA archives, possibly because of a common perception for long training and inference times, as well as difficulty in training (Fawaz et al., 2019b); therefore, we implemented a stacked LSTM model and also include it in the comparison. The performance of the baselines alongside our own models are shown in Table 2 in terms of accuracy, to allow comparison with reported values.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 2: Dataset: BeijingPM25Quality. Left: Root Mean Squared Error of a fully supervised transformer (orange circles) and the same model pre-trained (blue diamonds) on the training set through the unsupervised objective and then fine-tuned on available labels, versus the proportion of labeled data in the training set. Right: Root Mean Squared Error of a given model as a function of the number of samples (here, shown as a proportion of the total number of samples in the training set) used for unsupervised pre-training. For supervised learning, two levels of label availability are depicted: $10 \%$ (purple circles) and $20 \%$ (green squares) of all training data labels. Note that a horizontal axis value of 0 means fully supervised learning only, while all other values correspond to unsupervised pre-training followed by supervised fine-tuning.
|
| 120 |
+
|
| 121 |
+
Table 1: Performance on multivariate regression datasets, in terms of Root Mean Squared Error. Bold indicates best values, underlining indicates second best.
|
| 122 |
+
|
| 123 |
+
<table><tr><td colspan="10"></td></tr><tr><td></td><td></td><td>Random</td><td>XGBoost</td><td></td><td>5-NN</td><td>1-NN-</td><td>5-NN-</td><td></td><td></td><td></td><td>TST</td><td>Ours</td><td>TST</td></tr><tr><td>Dataset</td><td>SVR</td><td>Forest</td><td></td><td>1-NN-ED</td><td>-ED</td><td>DTWD</td><td>DTWD</td><td>Rocket</td><td>FCN</td><td>ResNet</td><td>Inception</td><td>(sup.only)</td><td>(pretrained)</td></tr><tr><td>AppliancesEnergy</td><td>3.457</td><td>3.455</td><td>3.489</td><td>5.231</td><td>4.227</td><td>6.036</td><td>4.019</td><td>2.299</td><td>2.865</td><td>3.065</td><td>4.435</td><td>2.228</td><td>2.375</td></tr><tr><td>BenzeneConcentr.</td><td>4.790</td><td>0.855</td><td>0.637</td><td>6.535</td><td>5.844</td><td>4.983</td><td>4.868</td><td>3.360</td><td>4.988</td><td>4.061</td><td>1.584</td><td>0.517</td><td>0.494</td></tr><tr><td>BeijingPM10</td><td>110.574</td><td>94.072</td><td>93.138</td><td>139.229</td><td>115.669</td><td>139.134</td><td>115.502</td><td>120.057</td><td>94.348</td><td>95.489</td><td>96.749</td><td>91.344</td><td>86.866</td></tr><tr><td>BeijingPM25</td><td>75.734</td><td>63.301</td><td>59.495</td><td>88.193</td><td>74.156</td><td>88.256</td><td>72.717</td><td>62.769</td><td>59.726</td><td>64.462</td><td>62.227</td><td>60.357</td><td>53.492</td></tr><tr><td>LiveFuelMoisture</td><td>43.021</td><td>44.657</td><td>44.295</td><td>58.238</td><td>46.331</td><td>57.111</td><td>46.290</td><td>41.829</td><td>47.877</td><td>51.632</td><td>51.539</td><td>42.607</td><td>43.138</td></tr><tr><td>IEEEPPG</td><td>36.301</td><td>32.109</td><td>31.487</td><td>33.208</td><td>27.111</td><td>37.140</td><td>33.572</td><td>36.515</td><td>34.325</td><td>33.150</td><td>23.903</td><td>25.042</td><td>27.806</td></tr><tr><td>AvgRel. diff.frommean</td><td>0.097</td><td>-0.172</td><td>-0.197</td><td>0.377</td><td>0.152</td><td>0.353</td><td>0.124</td><td>-0.048</td><td>0.021</td><td>0.005</td><td>-0.108</td><td>-0.301</td><td>-0.303</td></tr><tr><td>Avg Rank</td><td>7.166</td><td>4.5</td><td>3.5</td><td>10.833</td><td>8</td><td>11.167</td><td>7.667</td><td>5.667</td><td>6.167</td><td>6.333</td><td>5.666</td><td></td><td>1.333</td></tr></table>
|
| 124 |
+
|
| 125 |
+
It can be seen that our models performed best on 7 out of the 11 datasets, achieving an average rank of 1.7, followed by ROCKET, which performed best on 3 datasets and on average ranked 2.3th. The dilation-CNN (Franceschi et al., 2019) and XGBoost, which performed best on the remaining 1 dataset, tied and on average ranked $3 . 7 \mathrm { t h }$ and 3.8th respectively. Interestingly, we observe that all datasets on which ROCKET outperformed our model were very low dimensional (specifically, 3-dimensional). Although our models still achieved the second best performance for UWaveGestureLibrary, in general we believe that this indicates a relative weakness of our current models when dealing with very low dimensional time series. As discussed in Section 3.1, this may be due to the problems introduced by a low-dimensional representation space to the attention mechanism, as well as the added positional embeddings; to mitigate this issue, in future work we intend to use a 1D-convolutional layer to extract more meaningful representations of low-dimensional input features (see Section 3.1). Conversely, our models performed particularly well on very highdimensional datasets (FaceDetection, HeartBeat, InsectWingBeat, PEMS-SF), and/or datasets with relatively more training samples. As a characteristic example, on InsectWingBeat (which is by far the largest dataset with $3 0 \mathrm { k }$ samples and contains time series of 200 dimensions and highly irregular length) our model reached an accuracy of 0.689, while all other methods performed very poorly - the second best was XGBoost with an accuracy of 0.369. However, we note that our model performed exceptionally well also on datasets with only a couple of hundred samples, which in fact constitute 8 out of the 11 examined datasets.
|
| 126 |
+
|
| 127 |
+
Table 2: Accuracy on multivariate classification datasets. Bold indicates best and underlining second best values. A dash indicates that the corresponding method failed to run on this dataset.
|
| 128 |
+
|
| 129 |
+
<table><tr><td colspan="3">Ours</td><td rowspan="2"></td><td rowspan="2">XGBoost</td><td rowspan="2"></td><td rowspan="2"></td><td rowspan="2"></td></tr><tr><td>Dataset</td><td>TST (pretrained)</td><td>TST (sup. only)</td></tr><tr><td>EthanolConcentration</td><td>0.326</td><td>0.337</td><td>Rocket 0.452</td><td>0.437</td><td>LSTM 0.323</td><td>Frans. et al 0.289</td><td>DTW_D 0.323</td></tr><tr><td>FaceDetection</td><td>0.689</td><td>0.681</td><td>0.647</td><td>0.633</td><td>0.577</td><td>0.528</td><td>0.529</td></tr><tr><td>Handwriting</td><td>0.359</td><td>0.305</td><td>0.588</td><td>0.158</td><td>0.152</td><td>0.533</td><td>0.286</td></tr><tr><td>Heartbeat</td><td>0.776</td><td>0.776</td><td>0.756</td><td>0.732</td><td>0.722</td><td>0.756</td><td>0.717</td></tr><tr><td>JapaneseVowels</td><td>0.997</td><td>0.994</td><td>0.962</td><td>0.865</td><td>0.797</td><td>0.989</td><td>0.949</td></tr><tr><td>InsectWingBeat</td><td>0.687</td><td>0.684</td><td>=</td><td>0.369</td><td>0.176</td><td>0.16</td><td></td></tr><tr><td>PEMS-SF</td><td>0.896</td><td>0.919</td><td>0.751</td><td>0.983</td><td>0.399</td><td>0.688</td><td>0.711</td></tr><tr><td>SelfRegulationSCP1</td><td>0.922</td><td>0.925</td><td>0.908</td><td>0.846</td><td>0.689</td><td>0.846</td><td>0.775</td></tr><tr><td>SelfRegulationSCP2</td><td>0.604</td><td>0.589</td><td>0.533</td><td>0.489</td><td>0.466</td><td>0.556</td><td>0.539</td></tr><tr><td>SpokenArabicDigits</td><td>0.998</td><td>0.993</td><td>0.712</td><td>0.696</td><td>0.319</td><td>0.956</td><td>0.963</td></tr><tr><td>UWaveGestureLibrary</td><td>0.913</td><td>0.903</td><td>0.944</td><td>0.759</td><td>0.412</td><td>0.884</td><td>0.903</td></tr><tr><td>Avg Accuracy</td><td>0.748</td><td>0.742</td><td>0.725</td><td>0.659</td><td>0.486</td><td>0.703</td><td>0.669</td></tr><tr><td>(excl. InsectWingBeat) Avg Rank</td><td colspan="2">1.7</td><td>2.3</td><td>3.8</td><td>5.4</td><td>3.7</td><td>4.1</td></tr></table>
|
| 130 |
+
|
| 131 |
+
Finally, we observe that the pre-trained transformer models performed better than the fully supervised ones in 8 out of 11 datasets, sometimes by a substantial margin.Again, no additional samples were available for unsupervised pre-training, so the benefit appears to originate from reusing the same samples.
|
| 132 |
+
|
| 133 |
+
# 5 CONCLUSION
|
| 134 |
+
|
| 135 |
+
In this work we propose a novel framework for multivariate time series representation learning based on the transformer encoder architecture. The framework includes an unsupervised pre-training scheme, which we show that can offer substantial performance benefits over fully supervised learning, even without leveraging additional unlabeled data, i.e., by reusing the same data samples. By evaluating our framework on several public multivariate time series datasets from various domains and with diverse characteristics, we demonstrate that it is currently the best performing method for regression and classification, even for datasets where only a few hundred training samples are available.
|
| 136 |
+
|
| 137 |
+
# REFERENCES
|
| 138 |
+
|
| 139 |
+
A. Bagnall, J. Lines, A. Bostrom, J. Large, and E. Keogh. The great time series classification bake off: a review and experimental evaluation of recent algorithmic advances. Data Mining and Knowledge Discovery, 31:606–660, 2017.
|
| 140 |
+
Anthony Bagnall, Hoang Anh Dau, Jason Lines, Michael Flynn, James Large, Aaron Bostrom, Paul Southam, and Eamonn Keogh. The UEA multivariate time series classification archive, 2018. arXiv:1811.00075 [cs, stat], October 2018. arXiv: 1811.00075.
|
| 141 |
+
Iz Beltagy, Matthew E. Peters, and Arman Cohan. Longformer: The Long-Document Transformer. arXiv:2004.05150 [cs], April 2020. URL http://arxiv.org/abs/2004.05150. arXiv: 2004.05150.
|
| 142 |
+
|
| 143 |
+
Filippo Maria Bianchi, Lorenzo Livi, Karl Øyvind Mikalsen, Michael Kampffmeyer, and Robert Jenssen. Learning representations of multivariate time series with missing data. Pattern Recognition, 96:106973, December 2019. ISSN 0031-3203. doi: 10.1016/j.patcog.2019.106973.
|
| 144 |
+
|
| 145 |
+
T. Brown, B. Mann, Nick Ryder, Melanie Subbiah, J. Kaplan, P. Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, G. Kruger, ¨ Tom Henighan, R. Child, Aditya Ramesh, D. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, E. Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, J. Clark, Christopher Berner, Sam McCandlish, A. Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. ArXiv, abs/2005.14165, 2020.
|
| 146 |
+
|
| 147 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, and Ruslan Salakhutdinov. Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context. arXiv:1901.02860 [cs, stat], June 2019. URL http://arxiv.org/abs/1901.02860. arXiv: 1901.02860.
|
| 148 |
+
|
| 149 |
+
Edward De Brouwer, Jaak Simm, Adam Arany, and Yves Moreau. GRU-ODE-Bayes: Continuous Modeling of Sporadically-Observed Time Series. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d\textquotesingle Alche-Buc, E. Fox, and R. Garnett (eds.), ´ Advances in Neural Information Processing Systems 32, pp. 7379–7390. Curran Associates, Inc., 2019.
|
| 150 |
+
|
| 151 |
+
Angus Dempster, Franccois Petitjean, and Geoffrey I. Webb. ROCKET: exceptionally fast and accurate time series classification using random convolutional kernels. Data Mining and Knowledge Discovery, 2020. doi: 10.1007/s10618-020-00701-z.
|
| 152 |
+
|
| 153 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. CoRR, abs/1810.04805, 2018. eprint: 1810.04805.
|
| 154 |
+
|
| 155 |
+
H. Fawaz, B. Lucas, G. Forestier, Charlotte Pelletier, D. Schmidt, Jonathan Weber, Geoffrey I. Webb, L. Idoumghar, Pierre-Alain Muller, and Franccois Petitjean. InceptionTime: Finding AlexNet for Time Series Classification. ArXiv, 2019a. doi: 10.1007/s10618-020-00710-y.
|
| 156 |
+
|
| 157 |
+
Hassan Fawaz, Germain Forestier, Jonathan Weber, Lhassane Idoumghar, and Pierre-Alain Muller. Deep learning for time series classification: a review. Data Mining and Knowledge Discovery, 33 (4):917–963, July 2019b. ISSN 1573-756X. doi: 10.1007/s10618-019-00619-1.
|
| 158 |
+
|
| 159 |
+
Vincent Fortuin, M. Huser, Francesco Locatello, Heiko Strathmann, and G. R ¨ atsch. SOM-VAE: ¨ Interpretable Discrete Representation Learning on Time Series. ICLR, 2019.
|
| 160 |
+
|
| 161 |
+
Jean-Yves Franceschi, Aymeric Dieuleveut, and Martin Jaggi. Unsupervised Scalable Representation Learning for Multivariate Time Series. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d\textquotesingle Alche-Buc, E. Fox, and R. Garnett (eds.), ´ Advances in Neural Information Processing Systems 32, pp. 4650–4661. Curran Associates, Inc., 2019.
|
| 162 |
+
|
| 163 |
+
Sepp Hochreiter. The Vanishing Gradient Problem During Learning Recurrent Neural Nets and Problem Solutions. Int. J. Uncertain. Fuzziness Knowl.-Based Syst., 6(2):107–116, April 1998. ISSN 0218-4885. doi: 10.1142/S0218488598000094. Place: River Edge, NJ, USA Publisher: World Scientific Publishing Co., Inc.
|
| 164 |
+
|
| 165 |
+
Cheng-Zhi Anna Huang, Ashish Vaswani, Jakob Uszkoreit, Ian Simon, Curtis Hawthorne, Noam Shazeer, Andrew M Dai, Matthew D Hoffman, Monica Dinculescu, and Douglas Eck. Music transformer: Generating music with long-term structure. In International Conference on Learning Representations, 2018.
|
| 166 |
+
|
| 167 |
+
A. Jansen, M. Plakal, Ratheet Pandya, D. Ellis, Shawn Hershey, Jiayang Liu, R. C. Moore, and R. A. Saurous. Unsupervised Learning of Semantic Audio Representations. 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018. doi: 10.1109/ICASSP. 2018.8461684.
|
| 168 |
+
|
| 169 |
+
A. Kopf, Vincent Fortuin, Vignesh Ram Somnath, and M. Claassen. Mixture-of-Experts Variational Autoencoder for clustering and generating from similarity-based representations. ICLR 2019, 2019.
|
| 170 |
+
|
| 171 |
+
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. In Advances in Neural Information Processing Systems, pp. 5243–5253, 2019.
|
| 172 |
+
|
| 173 |
+
Bryan Lim, Sercan O. Arik, Nicolas Loeff, and Tomas Pfister. Temporal fusion transformers for interpretable multi-horizon time series forecasting, 2020.
|
| 174 |
+
|
| 175 |
+
J. Lines, Sarah Taylor, and Anthony J. Bagnall. Time Series Classification with HIVE-COTE. ACM Trans. Knowl. Discov. Data, 2018. doi: 10.1145/3182382.
|
| 176 |
+
|
| 177 |
+
Benjamin Lucas, Ahmed Shifaz, Charlotte Pelletier, Lachlan O’Neill, Nayyar Zaidi, Bart Goethals, Francois Petitjean, and Geoffrey I. Webb. Proximity Forest: An effective and scalable distancebased classifier for time series. Data Mining and Knowledge Discovery, 33(3):607–635, May 2019. ISSN 1384-5810, 1573-756X. doi: 10.1007/s10618-019-00617-3. arXiv: 1808.10594.
|
| 178 |
+
|
| 179 |
+
Xinrui Lyu, Matthias Hueser, Stephanie L. Hyland, George Zerveas, and Gunnar Raetsch. Improving Clinical Predictions through Unsupervised Time Series Representation Learning. In Proceedings of the NeurIPS 2018 Workshop on Machine Learning for Health, 2018. eprint: 1812.00490.
|
| 180 |
+
|
| 181 |
+
J. Ma, Zheng Shou, Alireza Zareian, Hassan Mansour, A. Vetro, and S. Chang. Cdsa: Cross-dimensional self-attention for multivariate, geo-tagged time series imputation. ArXiv, abs/1905.09904, 2019.
|
| 182 |
+
|
| 183 |
+
P. Malhotra, T. Vishnu, L. Vig, Puneet Agarwal, and G. Shroff. TimeNet: Pre-trained deep recurrent neural network for time series classification. ESANN, 2017.
|
| 184 |
+
|
| 185 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In Proceedings of the 30th International Conference on International Conference on Machine Learning - Volume 28, ICML’13, pp. III–1310–III–1318, Atlanta, GA, USA, June 2013. JMLR.org.
|
| 186 |
+
|
| 187 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, W. Li, and Peter J. Liu. Exploring the Limits of Transfer Learning with a Unified Text-toText Transformer. ArXiv, abs/1910.10683, 2019.
|
| 188 |
+
|
| 189 |
+
Sheng Shen, Zhewei Yao, Amir Gholami, Michael W. Mahoney, and Kurt Keutzer. PowerNorm: Rethinking Batch Normalization in Transformers. arXiv:2003.07845 [cs], June 2020. arXiv: 2003.07845.
|
| 190 |
+
|
| 191 |
+
Ahmed Shifaz, Charlotte Pelletier, F. Petitjean, and Geoffrey I. Webb. TS-CHIEF: a scalable and accurate forest algorithm for time series classification. Data Mining and Knowledge Discovery, 2020. doi: 10.1007/s10618-020-00679-8.
|
| 192 |
+
|
| 193 |
+
C. Tan, C. Bergmeir, Franc¸ois Petitjean, and Geoffrey I. Webb. Monash University, UEA, UCR Time Series Regression Archive. ArXiv, 2020a.
|
| 194 |
+
|
| 195 |
+
Chang Wei Tan, Christoph Bergmeir, Francois Petitjean, and Geoffrey I Webb. Time series regression. arXiv preprint arXiv:2006.12672, 2020b.
|
| 196 |
+
|
| 197 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 5998–6008. Curran Associates, Inc., 2017.
|
| 198 |
+
|
| 199 |
+
Neo Wu, Bradley Green, Xue Ben, and Shawn O’Banion. Deep transformer models for time series forecasting: The influenza prevalence case, 2020.
|
| 200 |
+
|
| 201 |
+
Chuxu Zhang, Dongjin Song, Yuncong Chen, Xinyang Feng, C. Lumezanu, Wei Cheng, Jingchao Ni, B. Zong, H. Chen, and Nitesh V. Chawla. A Deep Neural Network for Unsupervised Anomaly Detection and Diagnosis in Multivariate Time Series Data. In AAAI, 2019. doi: 10.1609/aaai. v33i01.33011409.
|
| 202 |
+
|
| 203 |
+
# A APPENDIX
|
| 204 |
+
|
| 205 |
+
# A.1 ADDITIONAL POINTS & FUTURE WORK
|
| 206 |
+
|
| 207 |
+
Execution time for training: While a precise comparison in terms of training time is well out of scope for the present work, in Section A.3 of the Appendix we demonstrate that our transformerbased method is economical in terms of its use of computational resources. However, alternative self-attention schemes, such as sparse attention patterns (Li et al., 2019), recurrence (Dai et al., 2019) or compressed (global-local) attention (Beltagy et al., 2020), can help drastically reduce the $O ( w ^ { 2 } )$ complexity of the self-attention layers with respect to the time series length $w$ , which is the main performance bottleneck.
|
| 208 |
+
|
| 209 |
+
Imputation and forecasting: The model and training process described in Section 3.3 is exactly the setup required to perform imputation of missing values, without any modifications, and we observed that it was possible to achieve very good results following this method; as a rough indication, our models could reach Root Mean Square Errors very close to 0 when asked to perform the input denoising (autoregressive) task on the test set, after being subjected to unsupervised pre-training on the training set. We also show example results of imputation on one of the datasets presented in this work in Figure 5. However, we defer a systematic quantitative comparison with the state of the art to future work. Furthermore, we note that one may simply use different patterns of masking to achieve different objectives, while the rest of the model and setup remain the same. For example, using a mask which conceals the last part of all variables simultaneously, one may perform forecasting (see Figure 4 in Appendix), while for longer time series one may additionally perform this process within a sliding window. Again, we defer a systematic investigation to future work.
|
| 210 |
+
|
| 211 |
+
Extracted representations: The representations $\mathbf { z _ { t } }$ extracted by the transformer models can be used directly for evaluating similarity between time series, clustering, visualization and any other use cases where time series representations are used in practice. A valuable benefit offered by transformers is that representations can be independently addressed for each time step; this means that, for example, a greater weight can be placed at the beginning, middle or end of the time series, which allows to selectively compare time series, visualize temporal evolution of samples etc.
|
| 212 |
+
|
| 213 |
+
Table 3: Multivariate Regression Datasets
|
| 214 |
+
|
| 215 |
+
<table><tr><td>Dataset</td><td>Train Size</td><td>Test Size</td><td>Length</td><td>Dimension</td><td>Missing Values</td></tr><tr><td>AppliancesEnergy</td><td>96</td><td>42</td><td>144</td><td>24</td><td>No</td></tr><tr><td>BenzeneConcentration</td><td>3433</td><td>5445</td><td>240</td><td>8</td><td>Yes</td></tr><tr><td>BeijingPM10Quality</td><td>12432</td><td>5100</td><td>24</td><td>9</td><td>Yes</td></tr><tr><td>BeijingPM25Quality</td><td>12432</td><td>5100</td><td>24</td><td>9</td><td>Yes</td></tr><tr><td>LiveFuelMoistureContent</td><td>3493</td><td>1510</td><td>365</td><td>7</td><td>No</td></tr><tr><td>IEEEPPG</td><td>1768</td><td>1328</td><td>1000</td><td>5</td><td>No</td></tr></table>
|
| 216 |
+
|
| 217 |
+
Table 4: Multivariate Classification Datasets
|
| 218 |
+
|
| 219 |
+
<table><tr><td>Dataset</td><td>TrainSize</td><td>TestSize</td><td>NumDimensions</td><td>SeriesLength</td><td>NumClasses</td></tr><tr><td>EthanolConcentration</td><td>261</td><td>263</td><td>3</td><td>1751</td><td>4</td></tr><tr><td>FaceDetection</td><td>5890</td><td>3524</td><td>144</td><td>62</td><td>2</td></tr><tr><td>Handwriting</td><td>150</td><td>850</td><td>3</td><td>152</td><td>26</td></tr><tr><td>Heartbeat</td><td>204</td><td>205</td><td>61</td><td>405</td><td>2</td></tr><tr><td>InsectWingbeat</td><td>30000</td><td>20000</td><td>200</td><td>30</td><td>10</td></tr><tr><td>JapaneseVowels</td><td>270</td><td>370</td><td>12</td><td>29</td><td>9</td></tr><tr><td>PEMS-SF</td><td>267</td><td>173</td><td>963</td><td>144</td><td>7</td></tr><tr><td>SelfRegulationSCP1</td><td>268</td><td>293</td><td>6</td><td>896</td><td>2</td></tr><tr><td>SelfRegulationSCP2</td><td>200</td><td>180</td><td>7</td><td>1152</td><td>2</td></tr><tr><td>SpokenArabicDigits</td><td>6599</td><td>2199</td><td>13</td><td>93</td><td>10</td></tr><tr><td>UWaveGestureLibrary</td><td>120</td><td>320</td><td>3</td><td>315</td><td>8</td></tr></table>
|
| 220 |
+
|
| 221 |
+
Table 5: Standard deviation of the Root Mean Square Error displayed by the Time Series Transformer models on multivariate regression datasets
|
| 222 |
+
|
| 223 |
+
<table><tr><td rowspan=2 colspan=1>Dataset</td><td rowspan=1 colspan=2>Standarddeviation</td></tr><tr><td rowspan=1 colspan=1>SupervisedTST</td><td rowspan=1 colspan=1>Pre-trainedTST</td></tr><tr><td rowspan=5 colspan=1>AppliancesEnergyBenzeneConcentrationBeijingPM10QualityBeijingPM25QualityLiveFuelMoistureContentIEEEPPG</td><td rowspan=1 colspan=1>0.240</td><td rowspan=1 colspan=1>0.163</td></tr><tr><td rowspan=1 colspan=1>0.031</td><td rowspan=1 colspan=1>0.092</td></tr><tr><td rowspan=3 colspan=1>0.6890.1890.7351.079</td><td rowspan=1 colspan=1>0.8130.253</td></tr><tr><td rowspan=1 colspan=1>0.013</td></tr><tr><td rowspan=1 colspan=1>1.607</td></tr></table>
|
| 224 |
+
|
| 225 |
+
# A.2 CRITERIA FOR DATASET SELECTION
|
| 226 |
+
|
| 227 |
+
We select a diverge range of datasets from the Monash University, UEA, UCR Time Series Regression and Classification Archives, in a way so as to ensure diversity with respect to the dimensionality and length of time series samples, as well as the number of samples. Additionally, we have tried to include both ”easy” and ”difficult” datasets (where the baselines perform very well or less well). In the following we provide a more detailed rationale for each of the selected multivariate datasets.
|
| 228 |
+
|
| 229 |
+
EthanolConcentration: very low dimensional, very few samples, moderate length, large number of classes, challenging
|
| 230 |
+
|
| 231 |
+
FaceDetection: very high dimensional, many samples, very short length, minimum number of classes
|
| 232 |
+
|
| 233 |
+
Handwriting: very low dimensional, very few samples, moderate length, large number of classes
|
| 234 |
+
|
| 235 |
+
Heartbeat: high dimensional, very few samples, moderate length, minimum number of classes
|
| 236 |
+
|
| 237 |
+
JapaneseVowels: very heterogeneous sample length, moderate num. dimensions, very few samples, very short length, moderate number of classes, all baselines perform well
|
| 238 |
+
|
| 239 |
+
InsectWingBeat: very high dimensional, many samples, very short length, moderate number of classes, very challenging
|
| 240 |
+
|
| 241 |
+
PEMS-SF: extremely high dimensional, very few samples, moderate length, moderate number of classes
|
| 242 |
+
|
| 243 |
+
SelfRegulationSCP1: Few dimensions, very few samples, long length, minimum number of classes, baselines perform well
|
| 244 |
+
|
| 245 |
+
SelfRegulationSCP2: similar to SelfRegulationSCP1, but challenging
|
| 246 |
+
|
| 247 |
+
SpokenArabicDigits: Moderate number of dimensions, many samples, very heterogeneous length, moderate number of classes, most baselines perform well
|
| 248 |
+
|
| 249 |
+
UWaveGestureLibrary: very low dimensional, very few samples, moderate length, moderate number of classes, baselines perform well
|
| 250 |
+
|
| 251 |
+
# A.3 EXECUTION TIME
|
| 252 |
+
|
| 253 |
+
We recorded the times required for training our fully supervised models until convergence on a GPU, as well as for the currently fastest and top performing (in terms of classification accuracy and regression error) baseline methods, ROCKET and XGBoost on a CPU. These have been shown to be orders of magnitude faster than methods such as TS-CHIEF, Proximity Forest, Elastic Ensembles, DTW and HIVE-COTE, but also deep learning based methods Dempster et al. (2020). Although XGBoost and ROCKET are incomparably faster than the transformer on a CPU, as can be seen in Table 7 in the Appendix, exploiting commercial GPUs and the parallel processing capabilities of a transformer typically enables as fast (and sometimes faster) training times as these (currently fastest available) methods. In practice, despite allowing for many hundreds of epochs, using a GPU we never trained our models longer than 3 hours on any of the examined datasets.
|
| 254 |
+
|
| 255 |
+
Table 6: Standard deviation of accuracy displayed by the Time Series Transformer models on multivariate classification datasets
|
| 256 |
+
|
| 257 |
+
<table><tr><td rowspan=2 colspan=3>Dataset</td><td rowspan=1 colspan=2>Standarddeviation</td></tr><tr><td rowspan=1 colspan=1>Supervised TST</td><td rowspan=1 colspan=1>Pre-trained TST</td></tr><tr><td rowspan=11 colspan=3>EthanolConcentrationFaceDetectionHandwritingHeartbeatInsectWingbeatJapanese VowelsPEMS-SFSelfRegulationSCP1SelfRegulationSCP2SpokenArabicDigitsUWaveGestureLibrary</td><td rowspan=1 colspan=1>0.024</td><td rowspan=1 colspan=1>0.002</td></tr><tr><td rowspan=1 colspan=1>0.007</td><td rowspan=1 colspan=1>0.006</td></tr><tr><td rowspan=1 colspan=1>0.020</td><td rowspan=1 colspan=1>0.006</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>0.018</td><td rowspan=1 colspan=1>0.018</td></tr><tr><td rowspan=1 colspan=2>t</td><td rowspan=1 colspan=1>0.003</td><td rowspan=1 colspan=1>0.026</td></tr><tr><td rowspan=1 colspan=1>0.000</td><td rowspan=1 colspan=1>0.0016</td></tr><tr><td rowspan=1 colspan=1>0.017</td><td rowspan=1 colspan=1>0.003</td></tr><tr><td rowspan=1 colspan=1>0.005</td><td rowspan=1 colspan=1>0.006</td></tr><tr><td rowspan=1 colspan=1>0.020</td><td rowspan=1 colspan=1>0.003</td></tr><tr><td rowspan=1 colspan=1>0.0003</td><td rowspan=1 colspan=1>0.001</td></tr><tr><td rowspan=1 colspan=1>0.005</td><td rowspan=1 colspan=1>0.003</td></tr></table>
|
| 258 |
+
|
| 259 |
+
<table><tr><td>Dataset</td><td>Rocket</td><td>XGBoost</td><td>TST (GPU)</td></tr><tr><td>EthanolConcentration</td><td>41.937</td><td>3.760</td><td>34.72</td></tr><tr><td>FaceDetection</td><td>279.033</td><td>57.832</td><td>67.8</td></tr><tr><td>Handwriting</td><td>6.705</td><td>1.836</td><td>134.4</td></tr><tr><td>Heartbeat</td><td>35.825</td><td>3.013</td><td>2.57</td></tr><tr><td>InsectWingBeat</td><td>=</td><td>64.883</td><td>4565</td></tr><tr><td>JapaneseVowels</td><td>5.032</td><td>0.527</td><td>4.71</td></tr><tr><td>PEMS-SF</td><td>369.198</td><td>150.879</td><td>341</td></tr><tr><td>SelfRegulationSCP1</td><td>30.578</td><td>0.967</td><td>3.46</td></tr><tr><td>SelfRegulationSCP2</td><td>28.286</td><td>1.213</td><td>97.3</td></tr><tr><td>SpokenArabicDigits</td><td>65.143</td><td>3.129</td><td>73.2</td></tr><tr><td>UWaveGestureLibrary</td><td>3.078</td><td>0.636</td><td>2.90</td></tr></table>
|
| 260 |
+
|
| 261 |
+
Table 7: Total training time (time until maximum accuracy is recorded) in seconds: for the fastest currently available methods (Rocket, XGBoost) on the same CPU, as well as for our fully supervised transformer models on a GPU. On a CPU, training for our model is typically at least an order of magnitude slower.
|
| 262 |
+
|
| 263 |
+
As regards deep learning models, LSTMs are well known to be slow, as they require $O ( w )$ sequential operations (where $w$ is the length of the time series) for each sample, with the complexity per layer scaling as $O ( N \cdot d ^ { 2 } )$ , where $d$ is the internal representation dimension (hidden state size). We refer the reader to the original transformer paper (Vaswani et al., 2017) for a detailed discussion about how tranformers compare to Convolutional Neural Networks in terms of computational efficiency.
|
| 264 |
+
|
| 265 |
+
<table><tr><td colspan="10">Ranks</td><td colspan="5"></td></tr><tr><td>Dataset Name</td><td>TST</td><td>SVR</td><td>Random Forest</td><td></td><td>XGBoost</td><td>1-NN 5-NN -ED -ED</td><td></td><td>1-NN- DTWD</td><td>5-NN- DTWD</td><td>Rocket</td><td>FCN</td><td>ResNet</td><td>Inception</td><td>Rel diff from 2nd best</td></tr><tr><td>AppliancesEnergy</td><td>1</td><td></td><td>5</td><td></td><td>7</td><td>11 9</td><td></td><td>12</td><td>8</td><td></td><td></td><td>4</td><td>10</td><td>-0.361</td></tr><tr><td>BenzeneConcentration</td><td>1</td><td>677</td><td>3</td><td></td><td>2</td><td>12 11</td><td></td><td>9</td><td></td><td>2</td><td>30</td><td>6</td><td>4</td><td>-0.225</td></tr><tr><td>BeijingPM10Quality</td><td>1</td><td></td><td>3</td><td></td><td>2</td><td>12 9</td><td></td><td>11</td><td></td><td>10</td><td>4</td><td>5</td><td>6</td><td>-0.067</td></tr><tr><td>BeijingPM25Quality</td><td>1</td><td>10</td><td>6</td><td>2</td><td></td><td>11 9</td><td></td><td>12</td><td></td><td>5</td><td>3</td><td>7</td><td>4</td><td>-0.101</td></tr><tr><td>LiveFuelMoistureContent</td><td>2</td><td>3</td><td>5</td><td>4</td><td>12</td><td>7</td><td></td><td>11</td><td></td><td>1</td><td>8</td><td>10</td><td>9</td><td>-0.038</td></tr><tr><td>IEEEPPG</td><td>2</td><td>10</td><td>5</td><td>4</td><td></td><td>7 3</td><td></td><td>12</td><td>88868</td><td>11</td><td>9</td><td>6</td><td>1</td><td></td></tr></table>
|
| 266 |
+
|
| 267 |
+
Table 8: Relative ranks of all methods on Regression datasets. Last column indicates relative diff of our method from the 2nd best, whenever the rank is 1.
|
| 268 |
+
|
| 269 |
+
Table 9: Relative ranks of methods on the Classification datasets. The last column is the relative diff of our method from the 2nd best, whenever we rank 1st.
|
| 270 |
+
|
| 271 |
+
<table><tr><td>Problem</td><td>TST</td><td>Rocket</td><td>XGBoost</td><td>LSTM</td><td>Franseschi et al</td><td>DTW_D</td><td>Rel.Diff from 2nd best</td></tr><tr><td>EthanolConcentration</td><td>4</td><td>1</td><td>2</td><td>3</td><td>6</td><td>5</td><td></td></tr><tr><td>FaceDetection</td><td>1</td><td>2</td><td>3</td><td>4</td><td>6</td><td>5</td><td>-0.041</td></tr><tr><td>Handwriting</td><td>3</td><td>1</td><td>5</td><td>6</td><td>2</td><td>4</td><td></td></tr><tr><td>Heartbeat</td><td>1</td><td>2</td><td>4</td><td>5</td><td>3</td><td>6</td><td>-0.02</td></tr><tr><td> JapaneseVowels</td><td>1</td><td>3</td><td>5</td><td>6</td><td>2</td><td>4</td><td>-0.008</td></tr><tr><td>PEMS-SF</td><td>2</td><td>3</td><td>1</td><td>6</td><td>5</td><td>4</td><td></td></tr><tr><td>SelfRegulationSCP1</td><td>1</td><td>2</td><td>3</td><td>6</td><td>4</td><td>5</td><td>-0.017</td></tr><tr><td>SelfRegulationSCP2</td><td>1</td><td>4</td><td>5</td><td>6</td><td>2</td><td>3</td><td>-0.055</td></tr><tr><td>SpokenArabicDigits</td><td>1</td><td>4</td><td>5</td><td>6</td><td>3</td><td>2</td><td>-0.035</td></tr><tr><td>UWaveGestureLibrary</td><td>2</td><td>1</td><td>5</td><td>6</td><td>4</td><td>3</td><td></td></tr></table>
|
| 272 |
+
|
| 273 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Task (Metric)</td><td rowspan=1 colspan=1>Sep., Bern.</td><td rowspan=1 colspan=1>Sync.,Bern.</td><td rowspan=1 colspan=1>Sep., Stateful</td><td rowspan=1 colspan=1>Sync.,Stateful</td></tr><tr><td rowspan=1 colspan=1>HeartbeatInsectWingbeatSpokenArabicDigitsPEMS-SF</td><td rowspan=1 colspan=1>Classif. (Accuracy)Classif. (Accuracy)Classif. (Accuracy)Classif. (Accuracy)</td><td rowspan=1 colspan=1>0.7610.6410.9940.873</td><td rowspan=1 colspan=1>0.7560.6320.9940.879</td><td rowspan=1 colspan=1>0.7760.6870.9980.896</td><td rowspan=1 colspan=1>0.7510.6890.9960.879</td></tr><tr><td rowspan=1 colspan=1>BenzeneConcentrationBeijingPM25QualityLiveFuelMoistureContent</td><td rowspan=1 colspan=1>Regress..(RMSE)Regress.(RMSE)Regress.(RMSE)</td><td rowspan=1 colspan=1>0.68157.24144.398</td><td rowspan=1 colspan=1>0.49359.52943.519</td><td rowspan=1 colspan=1>0.49453.49243.138</td><td rowspan=1 colspan=1>0.68459.63243.420</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 10: Comparison of four different input value masking schemes evaluated for unsupervised learning on 4 classification and 3 regression datasets. Two of the variants involve separately generating the mask for each variable, and two involve a single distribution over “time steps”, applied synchronously to all variables. Also, two of the variants involve sampling each “time step” independently based on a Bernoulli distribution with parameter $p = r = 1 5 \%$ , while the remaining two involve using a Markov chain with two states, “masked” or “unmasked”, with different transition probabilities $\begin{array} { r } { { p _ { m } = \frac { 1 } { l _ { m } } } } \end{array}$ and $\begin{array} { r } { p _ { u } = p _ { m } \frac { r } { 1 - r } } \end{array}$ , such that the masked sequences follow a geometric distribution with a mean length of $l _ { m } = 3$ and each variable is masked on average by $r = 1 5 \%$ . We observe that our proposed scheme, separately masking each variable through stateful generation, performs consistently well and shows the overall best performance across all examined datasets.
|
| 276 |
+
|
| 277 |
+
Table 11: Performance comparison between using layer normalization and batch normalization in our supervised transformer model. The batch size is 128.
|
| 278 |
+
|
| 279 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Task (Metric)</td><td rowspan=1 colspan=1>LayerNorm</td><td rowspan=1 colspan=1>BatchNorm</td></tr><tr><td rowspan=1 colspan=1>HeartbeatInsectWingbeatSpokenArabicDigitsPEMS-SF</td><td rowspan=1 colspan=1>Classif.(Accuracy)Classif.(Accuracy)Classif.(Accuracy)Classif.(Accuracy)</td><td rowspan=1 colspan=1>0.7410.6580.9930.832</td><td rowspan=1 colspan=1>0.7760.6840.9930.919</td></tr><tr><td rowspan=1 colspan=1>BenzeneConcentrationBeijingPM25QualityLiveFuelMoistureContent</td><td rowspan=1 colspan=1>Regress.(RMSE)Regress.(RMSE)Regress.(RMSE)</td><td rowspan=1 colspan=1>2.05361.08242.993</td><td rowspan=1 colspan=1>0.51660.35742.607</td></tr></table>
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 3: Root Mean Squared Error of a given model as a function of the number of samples (here, shown as a proportion of the total number of samples in the training set) used for unsupervised pretraining. Two levels of label availability (used for supervised learning) are depicted: $10 \%$ (left panel) and $20 \%$ (right panel) of all training data labels. Note that a horizontal axis value of 0 means fully supervised learning only, while all other values correspond to unsupervised pre-training followed by supervised fine-tuning.
|
| 283 |
+
|
| 284 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">Task (Metric)</td><td colspan="2">Static</td><td colspan="2">Fine-tuned</td></tr><tr><td>Metric</td><td>Epoch time (s)</td><td>Metric</td><td>Epoch time (s)</td></tr><tr><td rowspan="3">Heartbeat InsectWingbeat SpokenArabicDigits</td><td>Classif. . (Accuracy)</td><td>0.756</td><td>0.082</td><td>0.776</td><td>0.14</td></tr><tr><td>Classif. (Accuracy)</td><td>0.236</td><td>4.52</td><td>0.687</td><td>6.21</td></tr><tr><td>Classif. . (Accuracy)</td><td>0.996</td><td>1.29</td><td>0.998</td><td>2.00</td></tr><tr><td rowspan="3">PEMS-SF BenzeneConcentration BeijingPM25Quality LiveFuelMoistureContent</td><td>Classif. ( (Accuracy) (RMSE)</td><td>0.844</td><td>0.208</td><td>0.896</td><td>0.281</td></tr><tr><td>Regress.</td><td>4.684</td><td>0.697</td><td>0.494</td><td>1.101</td></tr><tr><td>Regress. (RMSE) Regress. (RMSE)</td><td>65.608 48.724</td><td>1.91 1.696</td><td>53.492 43.138</td><td>2.68 3.57</td></tr></table>
|
| 285 |
+
|
| 286 |
+
Table 12: Performance comparison between allowing all layers of a pre-trained transformer to be fine-tuned, versus using static (“extracted”) representations of the time series as input to the output layer (which is equivalent to freezing all model layers except for the output layer). The per-epoch training time on a GPU is also shown.
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 4: Masking schemes within our transformer encoder framework: for implementation of forecasting objective (left), for an alternative unsupervised learning objective involving a single noise distribution over time steps, applied synchronously to all variables (right).
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 5: Top: Imputation of missing values in the test set of BenzeneConcentration dataset. The continuous blue line is the ground truth signal, the light blue circles indicate the values hidden from the model and the orange dots its prediction. We observe that imputed values approximate true values very well, even in cases of rapid transitions and in cases where many contiguous values are missing. Bottom: Same, shown for 5 different dimensions of the time series (here, these are concentrations of different substances) as columns and 4 different, randomly selected samples as rows.
|
| 293 |
+
|
| 294 |
+
# A.4 ADVANTAGES OF TRANSFORMERS
|
| 295 |
+
|
| 296 |
+
Transformer models are based on a multi-headed attention mechanism that offers several key advantages and renders them particularly suitable for time series data:
|
| 297 |
+
|
| 298 |
+
• They can concurrently take into account long contexts of input sequence elements and learn to represent each sequence element by selectively attending to those input sequence elements which the model considers most relevant. They do so without position-dependent prior bias; this is to be contrasted with RNN-based models: a) even bi-directional RNNs treat elements in the middle of the input sequence differently from elements close to the two endpoints, and b) despite careful design, even LSTM (Long Short Term Memory) and GRU (Gated Recurrent Unit) networks practically only retain information from a limited number of time steps stored inside their hidden state (vanishing gradient problem (Hochreiter, 1998; Pascanu et al., 2013)), and thus the context used for representing each sequence element is inevitably local.
|
| 299 |
+
• Multiple attention heads can consider different representation subspaces, i.e., multiple aspects of relevance between input elements. For example, in the context of a signal with two frequency components, $1 / T _ { 1 }$ and $1 / T _ { 2 }$ , one attention head can attend to neighboring time points, while another one may attend to points spaced a period $T _ { 1 }$ before the currently examined time point, a third to a period $T _ { 2 }$ before, etc. This is to be contrasted with attention mechanisms in RNN models, which learn a single global aspect/mode of relevance between sequence elements.
|
| 300 |
+
• After each stage of contextual representation (i.e., transformer encoder layer), attention is redistributed over the sequence elements, taking into account progressively more abstract representations of the input elements as information flows from the input towards the output. By contrast, RNN models with attention use a single distribution of attention weights to extract a representation of the input, and most typically attend over a single layer of representation (hidden states).
|
| 301 |
+
|
| 302 |
+
A.5 HYPERPARAMETERS
|
| 303 |
+
|
| 304 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>activation</td><td>gelu</td></tr><tr><td>dropout</td><td>0.1</td></tr><tr><td>learning rate</td><td>0.001</td></tr><tr><td>pos. encoding</td><td>learnable</td></tr></table>
|
| 305 |
+
|
| 306 |
+
Table 13: Common (fixed) hyperparameters used for all transformer models.
|
| 307 |
+
|
| 308 |
+
Table 14: Hyperparameter configuration that performs reasonably well for all transformer models.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>dim.model</td><td>128</td></tr><tr><td>dim.feedforward</td><td>256</td></tr><tr><td>num.heads</td><td>16</td></tr><tr><td>num.encoder blocks</td><td>3</td></tr><tr><td>batch size</td><td>128</td></tr></table>
|
| 311 |
+
|
| 312 |
+
Table 15: Supervised TST model hyperparameters for the multivariate regression datasets
|
| 313 |
+
|
| 314 |
+
<table><tr><td>Dataset</td><td>num. blocks</td><td>num. heads</td><td>dim.model</td><td>dim.feedforward</td></tr><tr><td>AppliancesEnergy BenzeneConcentration</td><td>3</td><td>8</td><td>128</td><td>512</td></tr><tr><td></td><td>3</td><td>8</td><td>128</td><td>256</td></tr><tr><td>BeijingPM10Quality</td><td>3</td><td>8</td><td>64</td><td>256</td></tr><tr><td>BeijingPM25Quality</td><td>3</td><td>8</td><td>64 (128)</td><td>256</td></tr><tr><td>LiveFuelMoistureContent</td><td>3</td><td>8</td><td>64</td><td>256</td></tr><tr><td>IEEEPPG</td><td>3</td><td>8</td><td>512</td><td>512</td></tr></table>
|
| 315 |
+
|
| 316 |
+
Table 16: Unsupervised TST model hyperparameters for the multivariate regression datasets
|
| 317 |
+
|
| 318 |
+
<table><tr><td>Dataset</td><td>num. blocks</td><td>num.heads</td><td>dim.model</td><td>dim.feedforward</td></tr><tr><td>AppliancesEnergy BenzeneConcentration</td><td>3 1</td><td>16 8</td><td>128</td><td>512</td></tr><tr><td></td><td></td><td></td><td>128</td><td>256</td></tr><tr><td>BeijingPM10Quality</td><td>3</td><td>8</td><td>64</td><td>256</td></tr><tr><td>BeijingPM25Quality</td><td>3</td><td>8</td><td>128</td><td>256</td></tr><tr><td>LiveFuelMoistureContent</td><td>3</td><td>8</td><td>64</td><td>256</td></tr><tr><td>IEEEPPG</td><td>4</td><td>16</td><td>512</td><td>512</td></tr></table>
|
| 319 |
+
|
| 320 |
+
Table 17: Supervised TST model hyperparameters for the multivariate classification datasets
|
| 321 |
+
|
| 322 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>num.blocks</td><td rowspan=1 colspan=1>num.heads</td><td rowspan=1 colspan=1>dim.model</td><td rowspan=1 colspan=1>dim.feedforward</td></tr><tr><td rowspan=10 colspan=1>EthanolConcentrationFaceDetectionHandwritingHeartbeatJapaneseVowelsPEMS-SFSelfRegulationSCP1SelfRegulationSCP2SpokenArabicDigitsUWaveGestureLibrary</td><td rowspan=2 colspan=1>13</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>128</td><td rowspan=2 colspan=1>512256</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>128</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>64</td><td rowspan=2 colspan=1>256256</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>256</td></tr></table>
|
| 323 |
+
|
| 324 |
+
Table 18: Unsupervised TST model hyperparameters for the multivariate classification datasets
|
| 325 |
+
|
| 326 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>num. blocks</td><td rowspan=1 colspan=1>num.heads</td><td rowspan=1 colspan=1>dim.model</td><td rowspan=1 colspan=1>dim.feedforward</td></tr><tr><td rowspan=10 colspan=1>EthanolConcentrationFaceDetectionHandwritingHeartbeatJapaneseVowelsPEMS-SFSelfRegulationSCP1SelfRegulationSCP2SpokenArabicDigitsUWaveGestureLibrary</td><td rowspan=2 colspan=1>13</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>512</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>512</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>512</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>256</td></tr><tr><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>16</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>512</td></tr></table>
|
md/train/luGQiBeRMxd/luGQiBeRMxd.md
ADDED
|
@@ -0,0 +1,543 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CORRATTACK: BLACK-BOX ADVERSARIAL ATTACKWITH STRUCTURED SEARCH
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present a new method for score-based adversarial attack, where the attacker queries the loss-oracle of the target model. Our method employs a parameterized search space with a structure that captures the relationship of the gradient of the loss function. We show that searching over the structured space can be approximated by a time-varying contextual bandits problem, where the attacker takes feature of the associated arm to make modifications of the input, and receives an immediate reward as the reduction of the loss function. The time-varying contextual bandits problem can then be solved by a Bayesian optimization procedure, which can take advantage of the features of the structured action space. The experiments on ImageNet and the Google Cloud Vision API demonstrate that the proposed method achieves the state of the art success rates and query efficiencies for both undefended and defended models.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Although deep learning has many applications, it is known that neural networks are vulnerable to adversarial examples, which are small perturbations of inputs that can fool neural networks into making wrong predictions (Szegedy et al., 2014). While adversarial noise can easily be found when the neural models are known (referred to as white-box attack) (Kurakin et al., 2016). However, in real world scenarios models are often unknown, this situation is referred to as black-box attack.
|
| 12 |
+
|
| 13 |
+
Some methods (Liu et al., 2016; Papernot et al., 2016) use the transfer-based attack, which generates adversarial examples on a substitute model and transfer the adversarial noise to the target model. However, the transferability is limited and its effectiveness relies highly on the similarity between the networks (Huang & Zhang, 2020). If two networks are very different, transfer-based methods will have low success rates.
|
| 14 |
+
|
| 15 |
+
In practice, most computer vision API such as the Google Cloud Vision API allow users to access the scores or probabilities of the classification results. Therefore, the attacker may query the black-box model and perform zeroth order optimization to find an adversarial example without the knowledge of the target model. Due to the availability of scores, this scenario is called score-based attack.
|
| 16 |
+
|
| 17 |
+
There have been a line of studies on black-box attack which directly estimate the gradient direction of the underlying model, and apply (stochastic) gradient descent to the input image (Ilyas et al., 2018; 2019; Chen et al., 2017; Huang & Zhang, 2020; Tu et al., 2018; Li et al., 2019). In this paper, we take another approach and formulate score-based attack as a time-varying contextual bandits problem. At each state, the attacker may change the adversarial perturbation and get the reward as the reduction of the loss. And the attacker would receive some features about the arms before making the decision. By limiting the action space to image blocks, the associated bandits problem exhibits local correlation structures and the slow varying property suitable for learning. Therefore, we may use the location and other features of the blocks to estimate the reward for the future selection of the actions.
|
| 18 |
+
|
| 19 |
+
Using the above insights, we propose a new method called CorrAttack, which utilizes the local correlation structure and the slow varying property of the underlying bandits problem. CorrAttack uses Bayesian optimization with Gaussian process regression (Rasmussen, 2003) to model the correlation and select optimal actions. A forgetting strategy is added to the algorithm so that the Gaussian process regression can handle the time-varying changes. CorrAttack can effectively find blocks with the largest rewards. The resulting method achieves much lower numbers of average queries and higher success rates than prior methods with a similar action space (Moon et al., 2019).
|
| 20 |
+
|
| 21 |
+
It is worth noting that BayesOpt (Ru et al., 2020) and Bayes-Attack (Shukla et al., 2019) also employ Bayesian optimization for score-based attack. However, their Gaussian process regression directly models the loss as a function of the image, whose dimension can be more than one thousand. Therefore, their speed is slow especially for BayesOpt, which uses slow additive kernel. CorrAttack, on the other hand, searches over a much limited action space and models the reward as a function of the low dimensional feature. Therefore, the optimization of CorrAttack is more efficient, and the method is significantly faster than BayesOpt.
|
| 22 |
+
|
| 23 |
+
We summarize the contributions of this work as follows:
|
| 24 |
+
|
| 25 |
+
1. We formulate the score-based adversarial attack as a time-varying contextual bandits, and show that the reward function has slow varying properties. In our new formulation, the attacker could take advantage of the features to model the reward of the arms with learning techniques. Compared to the traditional approach, the use of learning in the proposed framework greatly improves the efficiency of searching over optimal actions. 2. We propose a new method, CorrAttack, which uses Bayesian optimization with Gaussian process regression to learn the reward of each action, by using the feature of the arms. 3. The experiments show that CorrAttack achieves the state of the art performance on ImageNet and Google Cloud Vision API for both defended and undefended models.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
There have been a line of works focusing on black-box adversarial attack. Here, we give a brief review of various existing methods.
|
| 30 |
+
|
| 31 |
+
Transfer-Based Attack Transfer-based attack assumes the transferability of adversarial examples across different neural networks. It starts with a substitute model that is in the same domain as the target model. The adversaries can be easily generated on the white-box substitute model, and be transferred to attack the target model (Papernot et al., 2016). The approach, however, depends highly on the similarity of the networks. If two networks are distinct, the success rate of transferred attack would rapidly decrease (Huang & Zhang, 2020). Besides, we may not access the data for training the substitute model in practice.
|
| 32 |
+
|
| 33 |
+
Score-based Attack Many approaches estimate the gradient with the output scores of the target network. However, the high dimensionality of input images makes naive coordinate-wise search impossible as it requires millions of queries. ZOO (Chen et al., 2017) is an early work of gradient estimation, which estimates the gradient of an image block and perform block-wise gradient descent. NES (Wierstra et al., 2008) and CMA-ES (Hansen, 2016) are two evolution strategies that can perform query efficient score-based attack Ilyas et al. (2018); Meunier et al. (2019). Instead of the gradient itself, SignHunter (Al-Dujaili & O’Reilly, 2020a) just estimates the sign of gradient to reduce the complexity. AutoZOOM (Tu et al., 2018) uses bilinear transformation or autoencoder to reduce the sampling space and accelerate the optimization process. In the same spirit, data prior can be used to improve query efficiency (Ilyas et al., 2019). Besides, MetaAttack (Du et al., 2020) takes a meta learning approach to learn gradient patterns from prior information, which reduces queries for attacking targeted model.
|
| 34 |
+
|
| 35 |
+
Many zeroth order optimization methods for black-box attacks rely on gradient estimation. However, there are some research works using gradient free methods to perform black-box attack. BayesOpt and Bayes-Attack (Ru et al., 2020; Shukla et al., 2019) employ Bayesian optimization to find the adversarial examples. They use Gaussian process regression on the embedding and apply bilinear transformation to resize the embedding to the size of image. Although the bilinear transformation could alleviate the high dimensionality of images, the dimension of their embeddings are still in the thousands, which makes Bayesian optimization very ineffective and computationally expensive. A different method, PARSI, poses the attack on $\ell _ { \infty }$ norm as a discrete optimization problem over $\{ - \varepsilon , \varepsilon \} ^ { d }$ (Moon et al., 2019). It uses a Lazy-Greedy algorithm to search over the space $\{ - \varepsilon , \varepsilon \} ^ { d }$ to find an adversarial example. SimBA (Guo et al., 2018) also employs a discrete search space targeted at $\ell _ { 2 }$ norm.
|
| 36 |
+
|
| 37 |
+
Decision-based Attack Decision-based attack assumes the attacker could only get the output label of the model. Boundary Attack and its variants (Brendel et al., 2017; Chen et al., 2020; Li et al., 2020) are designed for the setting. However, the information received by the attacker is much smaller than score-based attack, and it would take many more queries than score-based attack to successfully attack an image.
|
| 38 |
+
|
| 39 |
+
# 3 PRELIMINARIES
|
| 40 |
+
|
| 41 |
+
A Gaussian process (Rasmussen, 2003) is a prior distribution defined on some bounded set $\mathcal { Z }$ , and is determined by a mean function $\mu : \mathcal { Z } \to \mathbb { R }$ and a covariance kernel $\kappa : \mathcal { Z } \times \mathcal { Z } \to \mathbb { R }$ . Given $n$ observations $\mathcal { D } _ { n } = \{ ( z _ { i } , f ( z _ { i } ) ) \} _ { i = 1 } ^ { n }$ , the prior distribution on $f ( z _ { 1 : n } )$ is
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
f ( z _ { 1 : n } ) \sim \mathrm { N o r m a l } ( \mu _ { 0 } ( z _ { 1 : n } ) , \kappa _ { 0 } ( z _ { 1 : n } , z _ { 1 : n } ) ) ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where we use compact notation for functions applied to collections of input points: $z _ { 1 : n }$ indicates the sequence $z _ { 1 } , \cdots , z _ { n }$ $z _ { n } , f ( z _ { 1 : n } ) = [ f ( z _ { 1 } ) , \cdot \cdot \cdot , f ( z _ { n } ) ] ,$ , $\mu _ { 0 } ( z _ { 1 : n } ) = \bar { [ \mu _ { 0 } ( z _ { 1 } ) , \cdot \cdot \cdot , \mu _ { 0 } ( z _ { n } ) ] }$ , $\kappa _ { 0 } ( z _ { 1 : n } , z _ { 1 : n } ) = [ \kappa _ { 0 } ( z _ { 1 } , z _ { 1 } ) , \cdot \cdot \cdot , \kappa _ { 0 } ( z _ { 1 } , z _ { n } ) ; \cdot \cdot \cdot ; \kappa _ { 0 } ( z _ { n } , z _ { 1 } ) , \cdot \cdot \cdot , \kappa _ { 0 } ( z _ { n } , z _ { n } ) ; ] .$
|
| 48 |
+
|
| 49 |
+
Gaussian process (GP) with mean Now we wish to infer the value of $f ( z )$ $\mu _ { n }$ and covariance at some new point $\sigma _ { n } ^ { 2 }$ : $z$ , the posterior process $f ( z ) | \mathcal { D } _ { n }$ is also a
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r l } & { f ( z ) \lvert \mathcal { D } _ { n } \sim \mathrm { N o r m a l } ( \mu _ { n } ( z ) , \sigma _ { n } ^ { 2 } ( z ) ) , } \\ & { \quad \mu _ { n } ( z ) = \kappa _ { 0 } ( z , z _ { 1 : n } ) \kappa _ { 0 } ( z _ { 1 : n } , z _ { 1 : n } ) ^ { - 1 } ( f ( z _ { 1 : n } ) - \mu _ { 0 } ( z _ { 1 : n } ) ) + \mu _ { 0 } ( z ) , } \\ & { \quad \sigma _ { n } ^ { 2 } ( z ) = \kappa _ { 0 } ( z , z ) - \kappa _ { 0 } ( z , z _ { 1 : n } ) \kappa _ { 0 } ( z _ { 1 : n } , z _ { 1 : n } ) ^ { - 1 } \kappa _ { 0 } ( z _ { 1 : n } , z ) . } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
As a optimization method to maximize a function $f$ , Bayesian optimization models the function to make decisions about where to evaluate the next point $z$ . Assuming we already obtained observations $\mathcal { D } _ { t - 1 } = \{ ( z _ { i } , f ( z _ { i } ) ) \} _ { i = 1 } ^ { t - 1 }$ , to determine the next point $z _ { t }$ for evaluation, we first use the posterior GP to define an acquisition function $\varphi _ { t } : \mathcal { Z } \mathbb { R }$ , which models the utility of evaluating $f ( z )$ for any $z \in { \mathcal { Z } }$ . We then evaluate $f ( z _ { t } )$ with
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
z _ { t } = \arg \operatorname* { m a x } _ { \mathcal { Z } } \varphi _ { t } ( z ) .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
In this work, we use the expected improvement (EI) acquisition function (Mockus et al., 1978)
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\varphi _ { t } ( z ) = \sqrt { \sigma _ { n } ^ { 2 } ( z ) } ( \gamma ( z ) \Phi ( \gamma ( z ) ) + \phi ( \gamma ( z ) ) ) \qquad \mathrm { w i t h } \qquad \gamma ( z ) = \frac { \mu _ { n } ( z ) - f ( z _ { b e s t } ) } { \sqrt { \sigma _ { n } ^ { 2 } ( z ) } } ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
which measures the expected improvement over the current best value $z _ { b e s t . } = \arg \operatorname* { m a x } _ { z _ { i } } f ( z _ { i } )$ according to the posterior GP. Here $\Phi ( \cdot )$ and $\phi ( \cdot )$ are the cdf and pdf of $\mathcal { N } ( 0 , I )$ respectively.
|
| 68 |
+
|
| 69 |
+
# 4 SCORE-BASED BLACK-BOX ATTACK
|
| 70 |
+
|
| 71 |
+
Suppose a classifier $F ( x )$ has input $x$ and label $y$ . An un-targeted adversarial example $x _ { a d v }$ satisfies:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\underset { j \in \{ 1 , \cdots C \} } { \arg \operatorname* { m a x } } F ( x _ { a d v } ) _ { j } \neq y \qquad \mathrm { a n d } \qquad \| x _ { a d v } - x \| _ { p } \leq \varepsilon ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $C$ is the number of classes. While an adversarial example for targeted attack means the maximum position of $F ( x )$ should be the targeted class $q$ : arg $\mathrm { m a \bar { x } } _ { j \in \{ 1 , \cdots C \} } \mathbf { \bar { F } } ( x _ { a d v } ) _ { j } = q$ . In order to find $x _ { a d v }$ , we may optimize a surrogate loss function $\ell ( x , y )$ (e.g hinge loss).
|
| 78 |
+
|
| 79 |
+
In this work, we consider adversarial attack as a time-varying contextual bandits problem. At each time $t$ , we observe a state $x _ { t }$ which is a modification of the original input $x _ { 0 }$ . Before taking arm $a _ { t } \in \mathcal { A } \subset \mathbb { R } ^ { d }$ , we could observe the feature $z$ of arms. And $a _ { t }$ would modify state $x _ { t }$ to $x _ { t + 1 }$ according to
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
x _ { t + 1 } = \underset { s \in \{ x _ { t } + a _ { t } , x _ { t } \} } { \arg \operatorname* { m i n } } \ell \left( \Pi _ { B _ { p } \left( x , \varepsilon \right) } \left( s \right) , y \right)
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
with reward function $r ( x _ { t } , a _ { t } ) = \ell ( x _ { t + 1 } , y ) - \ell ( x _ { t } , y )$ and the checking step tries to remove negative reward. In this frame, we would like to estimate the reward $r ( x _ { t } , a _ { t } )$ with feature $z _ { t }$ using learning, and then pick $a _ { t }$ to maximize the reward. Observe that
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\boldsymbol { r } ( x _ { t } , a _ { t } ) \approx \nabla _ { x } \ell ( x _ { t } , y ) ^ { \top } ( x _ { t + 1 } - x _ { t } ) ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where the gradient $\nabla _ { x _ { t } } \ell ( x _ { t } , y )$ is unknown. It follows from the formulation that we may rewrite $r ( x _ { t } , a _ { t } )$ as a function
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
r ( x _ { t } , a _ { t } ) \approx f ( x _ { t } , x _ { t + 1 } - x _ { t } ) .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Since in general, we make small steps from one iteration to the next iteration, $\delta _ { t } ( a _ { t } ) = x _ { t + 1 } - x _ { t }$ is small. We may approximate the reward with fixed gradient locally with
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
f ( x _ { t } , \delta _ { t } ) = \tilde { f } _ { t } ( a _ { t } ) ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
We may consider the learning of reward as a time-varying contextual bandits problem with reward function $\tilde { f } _ { t } ( \boldsymbol a _ { t } )$ for arm $a _ { t }$ at time $t$ . Since $x _ { t + 1 } - x _ { t }$ is small, this time-varying bandits has slowvarying property: the function $\tilde { f } _ { t }$ changes slowly from time $t$ to time $t + 1$ .
|
| 104 |
+
|
| 105 |
+
In the proposed framework, our goal is to learn the time-varying bandits reward $\tilde { f } _ { t } ( \boldsymbol a _ { t } )$ with feature $z _ { t }$ . We use Gaussian process regression to model the reward function using recent historic data since the reward function is slow-varying, and describe the details in the subsequent sections.
|
| 106 |
+
|
| 107 |
+
We note that the most general action space contains all $a _ { t } \in \mathbb { R } ^ { d }$ , where $d$ is the number of image pixels. However, it is impossible to explore the arms in such a large space. In this work, we choose a specific class of actions $\mathcal { A } = \{ a _ { i } \} _ { i = 1 } ^ { n }$ , $n$ is the image blocks of different sizes. It covers the space of the adversarial perturbations while maintaining good complexity. We also find the location and the PCA of the blocks a good component of the feature $z$ associated with the arm. Besides, modifying a block only affects the state locally. Therefore the reward function remains similar after state changes.
|
| 108 |
+
|
| 109 |
+
# 4.1 STRUCTURED SEARCH WITH GAUSSIAN PROCESS REGRESSION AND BAYESIAN OPTIMIZATION
|
| 110 |
+
|
| 111 |
+
Define the block size as $b$ , we divide the image into several blocks $E = \{ e _ { 0 0 0 } , e _ { 0 0 1 } , \cdot \cdot \cdot , e _ { h w c } \}$ , where the block is $b \times b$ square of pixels and $( \bar { h } , w , c ) = ( \mathrm { h e i g h t } / b$ , width/ $\mathit { b }$ , channel). Each block $e _ { i j k }$ is associated with the feature $z _ { e _ { i j k } }$ such as the location of the block.
|
| 112 |
+
|
| 113 |
+
Suppose we have time-varying bandits with state $x _ { t }$ and unknown reward function $\tilde { f } _ { t }$ at time $t$ . By taking the action $a _ { e _ { i j k } }$ , we change the individual block $e _ { i j k }$ of $x _ { t }$ and get $x _ { t + 1 }$ with reward $\tilde { f } _ { t } \big ( a _ { e _ { i j k } } \big )$ . We consider two ways of taking action $a _ { e _ { i j k } }$ on block $e _ { i j k }$ : CorrAttackDiff and CorrAttackFlip.
|
| 114 |
+
|
| 115 |
+
Finite Difference CorrAttackDiff: For action $a _ { e _ { i j k } }$ , the attacker will query $\ell ( x _ { t } + \eta e _ { i j k } , y )$ and $\ell ( x _ { t } - \eta e _ { i j k } , y )$ , and choose
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
a _ { e _ { i j k } } = \underset { s \in \{ \eta e _ { i j k } , - \eta e _ { i j k } \} } { \arg \operatorname* { m i n } } \ell ( x _ { t } + s , y ) .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
The action space $\mathcal { A } = \{ a _ { e _ { i j k } } | e _ { i j k } \in E \}$ .
|
| 122 |
+
|
| 123 |
+
In our framework, the bandits problem can also be regarded as learning the conditional gradient over actions. That is, when $\eta$ is small, we try to choose action $a _ { t }$ with
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
a _ { t } = \underset { e _ { i j k } \in E } { \arg \operatorname* { m i n } } e _ { i j k } ^ { \top } \nabla _ { x _ { t } } \ell ( x _ { t } , y )
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
which is the conditional gradient over the set of blocks.
|
| 130 |
+
|
| 131 |
+
Discrete Approximation CorrAttackFlip: In general, adversarial attack with $\ell _ { \infty }$ budget can be formulated as constrained optimization with $\| x _ { a d v } - x \| _ { \infty } \leq \epsilon .$ . However, PARSI (Moon et al., 2019) limits the space to $\{ - \varepsilon , + \varepsilon \} _ { \mathrm { ~ . ~ } } ^ { d }$ , which leads to better performance for black-box attack (Moon et al., 2019). The continuous optimization problem becomes a discrete optimization problems as follows:
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\begin{array} { l } { \mathrm { m a x i m i z e } ~ \ell ( x _ { a d v } , y ) \Longrightarrow \quad \mathrm { m a x i m i z e } ~ \ell ( x _ { a d v } , y ) } \\ { \mathrm { s u b j e c t } \mathrm { t o } ~ \| x _ { a d v } - x \| _ { \infty } \leq \epsilon \qquad \mathrm { s u b j e c t } \mathrm { t o } ~ x _ { a d v } - x \in \{ \epsilon , - \epsilon \} ^ { d } . } \end{array}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Following PARSI, we consider two stages to perform structured search. When flipping $\varepsilon$ to $- \varepsilon$ , $a _ { e _ { i j k } }$ changes the block to $- \varepsilon$ and $\mathcal { A } \bar { = } \{ - 2 \varepsilon e _ { i j k } | e _ { i j k } \in E \}$ . When changing $- \varepsilon$ to $\varepsilon$ , ${ \mathcal { A } } =$ $\{ 2 \bar { \varepsilon } e _ { i j k } | e _ { i j k } \in E \}$ instead.
|
| 138 |
+
|
| 139 |
+
Gaussian Process (GP) Regression: We model the difference function
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r } { g _ { t } ( a _ { t } ) = \ell ( \Pi _ { B _ { p } ( x , \varepsilon ) } \left( x _ { t } + a _ { t } \right) , y ) - \ell ( x _ { t } , y ) } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
instead of the reward function $\tilde { f } _ { t } ( a _ { t } ) \geq 0$ , as the difference function could be negative, providing more information about the negative arms in $\mathcal { A }$ . We would collect historic actions with feature and difference $\{ z _ { k } , g _ { k } ( a _ { k } ) ) \} _ { k = 1 } ^ { t }$ and learn the difference to make choices at a later stage. At each time $t$ we use the Gaussian process regression to model the correlation between the features $z _ { e _ { i j k } }$ and use Bayesian optimization to select the next action. More specifically, the same as eq. (2), we let
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
g _ { t } \big ( a _ { e _ { i j k } } \big ) | \mathcal { D } _ { t } \sim \mathrm { N o r m a l } ( \mu _ { t } \big ( z _ { e _ { i j k } } \big ) , \sigma _ { t } ^ { 2 } \big ( z _ { e _ { i j k } } \big ) \big ) ,
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where $\mathcal { D } _ { t } = \{ z _ { k } , g _ { k } ( a _ { k } ) ) \} _ { k = t - \tau } ^ { t }$ is the difference of evaluated blocks $e _ { t - \tau : t }$ with feature $z _ { e _ { t - \tau : t } }$ and $\tau$ is a parameter to forget old samples. Then we use EI acquisition function to pick up the next action $a _ { t + 1 }$ in $\mathcal { A }$ . More specifically, the same as eq. (4), we let
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
a _ { t + 1 } = \underset { \mathcal { A } } { \arg \operatorname* { m a x } } \big ( \sqrt { \sigma _ { t } ^ { 2 } \big ( z _ { e _ { i j k } } \big ) } \big ( \gamma \big ( z _ { e _ { i j k } } \big ) \Phi \big ( \gamma \big ( z _ { e _ { i j k } } \big ) \big ) + \phi \big ( \gamma \big ( z _ { e _ { i j k } } \big ) \big ) \big ) \big )
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
As the difference function $g _ { t }$ is varying, we take two strategies in Algorithm 2 to update the previous samples to make sure GP regression learns the current difference function well. The first strategy is to remove old samples in $\mathcal { D } _ { t }$ . Even if the bandits are slowly varying, the difference function will change significantly after a significant number of rounds. Therefore, we need to forget samples before $t - \tau$ . The second strategy is to remove samples near the last block $e _ { i _ { t } j _ { t } k _ { t } }$ in $\mathcal { D } _ { t }$ . As we discuss later, the difference function may change significantly in a local region near the last selected block. Therefore previous samples in this local region will be inaccurate. The resulting algorithm for CorrAttack is shown in Algorithm 1, which mainly follows standard procedure of Bayesian optimization.
|
| 158 |
+
|
| 159 |
+
# Algorithm 1 CorrAttack
|
| 160 |
+
|
| 161 |
+
Require: Loss function $\ell ( \cdot , \cdot )$ , Input $x _ { 0 }$ and its label $_ y$ , Action space $\mathcal { A } = \{ a _ { e _ { i j k } } \vert e _ { i j k } \in E \}$ , Parameter c, $\tau$ $\alpha$
|
| 162 |
+
1: Build set $\mathcal { D } _ { 0 } = \{ ( z _ { e _ { i _ { p } j _ { p } k _ { p } } } , g _ { 0 } ( a _ { e _ { i _ { p } j _ { p } k _ { p } } } ) ) \} _ { p = 1 } ^ { m }$ using latin hypercube sampling from $\boldsymbol { A }$
|
| 163 |
+
2: repeat
|
| 164 |
+
3: Fit the parameter of Normal $( \mu _ { t } ( z _ { e _ { i j k } } ) , \sigma _ { t } ^ { 2 } ( z _ { e _ { i j k } } ) )$ on $\mathcal { D } _ { t }$ according to Equation (12)
|
| 165 |
+
4: Calculate acquisition function $\varphi _ { t } \big ( z _ { e _ { i j k } } \big )$ and according to Equation (13)
|
| 166 |
+
5: Select $a _ { e _ { i _ { t } j _ { t } k _ { t } } } = \arg \operatorname* { m a x } _ { A } \varphi _ { t } ( z _ { e _ { i j k } } )$ according to Equation (13)
|
| 167 |
+
6: $\begin{array} { r } { x _ { t + 1 } = \arg \operatorname* { m i n } _ { s \in \{ x _ { t } + a _ { e _ { i _ { t } j _ { t } k _ { t } } } , x _ { t } \} } \ell ( \Pi _ { B _ { p } \left( x , \varepsilon \right) } \left( s \right) , y ) } \end{array}$
|
| 168 |
+
7: Update sample set $\mathcal { D } _ { t }$ with Algorithm 2 Dt+1 = UPDATESAMPLES(Dt, xt, xt+1, eitjtkt , gt+1(aeitjtkt ), τ, α)
|
| 169 |
+
|
| 170 |
+
# Algorithm 2 Update Samples
|
| 171 |
+
|
| 172 |
+
Require: Sample set $\mathcal { D } _ { t }$ , State $x _ { t } , x _ { t + 1 }$ , Block $e _ { i { t j t } } k _ { t }$ , Difference $g _ { t + 1 } { \left( a _ { e _ { i _ { t } j _ { t } k _ { t } } } \right) }$ , Paramter $\tau$ , $\alpha$
|
| 173 |
+
1: if $\boldsymbol { x } _ { t + 1 } \neq \boldsymbol { x } _ { t }$ then
|
| 174 |
+
2: $\mathcal { D } _ { t + 1 } = \mathcal { D } _ { t } \setminus \{ ( z _ { e _ { i j k } } , g ) \in \mathcal { D } _ { t } | | i - i _ { t } | + | j - j _ { t } | \leq \alpha \}$
|
| 175 |
+
3: else
|
| 176 |
+
4: $\mathcal { D } _ { t + 1 } = \mathcal { D } _ { t } \cup \{ ( z _ { e _ { i _ { t } j _ { t } k _ { t } } } , g _ { t + 1 } ( a _ { e _ { i _ { t } j _ { t } k _ { t } } } ) ) \}$
|
| 177 |
+
5: end if
|
| 178 |
+
6: Remove the earliest sample from $\mathcal { D }$ if the cardinality $| \mathcal { D } | > \tau$
|
| 179 |
+
7: return $\mathcal { D } _ { t + 1 }$
|
| 180 |
+
|
| 181 |
+
# 4.2 FEATURES AND SLOW VARYING PROPERTY
|
| 182 |
+
|
| 183 |
+
Features of Contextual Bandits: We use a four dimensional vector as the feature $z _ { e _ { i j k } }$
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
z _ { e _ { i j k } } = ( i , j , k , p c a )
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
where $i , j , k$ is the location of the block. And pca is the first component of PCA decomposition of $[ x _ { 0 } ( e _ { 0 0 0 } ) , x _ { 0 } ( e _ { 0 0 1 } ) , \cdot \cdot \cdot x _ { 0 } ( e _ { h w c } ) ]$ . $x _ { 0 } ( e _ { i j k } )$ means the block of natural image at the given position.
|
| 190 |
+
|
| 191 |
+
The reward function depends on the gradient in Equation (7). It has been shown that the gradient $\nabla _ { x } \ell ( x , y )$ has local dependencies (Ilyas et al., 2019). Suppose two coordinates $e _ { i j k }$ and $e _ { l p q }$ are close, then $\nabla _ { x } \ell ( x , y ) _ { i j k } \approx \nabla _ { x } \ell ( x , y ) _ { l p q }$ . We consider the finite difference of the block $e _ { i j k }$
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
\Delta _ { t } ( e _ { i j k } ) = \ell \left( x _ { t } + \eta e _ { i j k } , y \right) - \ell \left( x _ { t } - \eta e _ { i j k } , y \right) \approx 2 \eta e _ { i j k } ^ { \top } \nabla _ { x _ { t } } \ell \left( x _ { t } , y \right)
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
where $\eta$ is a small step size. When $\eta$ is small, the reward can be approximated by the average of the gradients around a small region, which also has local dependencies. In fact, the local structure of the reward will also be persevered when the block size and $\eta$ is large. Figure 1 shows one example of the finite difference $\bar { \Delta } _ { t } ( e _ { i j k } )$ obtained on ImageNet dataset with ResNet50. This shows blocks with closer locations are more likely to have similar reward. Therefore, we add the location of the block as the feature so that it uses historic data to find the arm with the largest reward.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 1: Finite difference of the perturbation for three channels on one image from ImageNet with ResNet50. $h = w = 2 8$ , $b = 8$ and $\eta = 0 . 0 5$ . Lighter block means larger finite difference.
|
| 201 |
+
|
| 202 |
+
In addition to the location of the difference, we may add other features. The block of the image itself forms a strong feature for the regression, but the dimension of the block is too high for GP regression. Therefore, we use PCA to lower the dimension and add the first component into the feature vector.
|
| 203 |
+
|
| 204 |
+
Slow Varying Property In addition to the local dependencies of finite difference, the difference would also be slow varying if we just change a small region of $x _ { t }$ . Let $x _ { t + 1 } = x _ { t } - \eta e _ { i _ { t } j _ { t } k _ { t } }$ , Figure 2 shows the difference of $\Delta _ { t } ( e _ { i j k } )$ and $\Delta _ { t + 1 } ( e _ { i j k } )$ , which is centralized in a small region near $e _ { i _ { t } j _ { t } k _ { t } }$ Reward function is based on the finite difference, which also has the slow varying property. It could be explained by the local property of convolution. When $\eta$ is small, the finite difference can be approximated with gradient and the local Hessian:
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
\Delta _ { t + 1 } ( e _ { i j k } ) - \Delta _ { t } ( e _ { i j k } ) \approx \eta ^ { 2 } e _ { i j k } ^ { \top } \nabla _ { x _ { t } } ^ { 2 } \ell ( x _ { t } , y ) e _ { i _ { t } j _ { t } k _ { t } }
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
The difference is much smaller than $\Delta _ { t } ( e _ { i j k } )$ . Today’s neural networks are built with stacks of convolutions and non-linear operations. Since these operations are localized in a small region, the Hessian of a neural network is also localized and the reward function only changes near $e _ { i _ { t } j _ { t } k _ { t } }$ .
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 2: Difference of finite difference on each block after changing block $e _ { 1 5 , 1 8 , 1 }$ of Figure 1, which is the lightest pixel in the picture. Darker blocks imply smaller difference in finite difference, which is almost zero in the majority of the image except the part near the changed block.
|
| 214 |
+
|
| 215 |
+
# 4.3 HIERARCHICAL BAYESIAN OPTIMIZATION SEARCH
|
| 216 |
+
|
| 217 |
+
Recent black-box approaches (Chen et al., 2017; Moon et al., 2019) exploit the hierarchical image structure for query efficiency. Following these approaches, we take a hierarchical approach and perform the accelerated local search in Algorithm 1 from a coarse grid (large blocks) to a fine grid (smaller blocks). The algorithm for hierarchical attack iteratively performs Algorithm 1 at one block size, and then divides the blocks into smaller sizes. At each block size, we build a Gaussian process to model the difference function, and perform structured search with the blocks until $\mathrm { m a x } _ { \boldsymbol { A } } \bar { \varphi } _ { t } ( z _ { e _ { i j k } } ) < c$ . When dividing the blocks into smaller sizes, we will build a new block set $E$ with action $a _ { e _ { i j k } }$ and new feature $z _ { e _ { i j k } }$ , but keep the $x _ { t }$ in last block size as $x _ { 0 }$ in new block size. Define the stage as $\mathcal { S } = \{ 0 , 1 , \cdots , s \}$ and initial block size as $b$ . The block at stage $s$ is ${ \frac { b } { 2 ^ { s } } } \times { \frac { b } { 2 ^ { s } } }$ square of pixels and $( h , w , c ) = ( 2 ^ { s } * \mathrm { h e i g h t } / b , 2 ^ { s } * \mathrm { w i d t h } / b$ , channel).
|
| 218 |
+
|
| 219 |
+
The overall hierarchical accelerated local search algorithm is shown in Appendix A. It is important to note that most of the attacks terminate in the early stages and rarely need to run on fine scales.
|
| 220 |
+
|
| 221 |
+
Table 1: Success rate and average queries of un-targeted attack on 1000 samples of ImageNet. $\varepsilon = 0 . 0 5$ . Since BayesOpt and Bayes-Attack needs thousands of hours to run all samples, we only test 20 samples, which are marked as \*, the complexity and running time could be referred to C.6.
|
| 222 |
+
|
| 223 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="2">VGG16</td><td colspan="2">Resnet50</td><td colspan="2">Densenet121</td></tr><tr><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td></tr><tr><td>ZOO</td><td>81.93%</td><td>2003</td><td>63.68%</td><td>1795</td><td>76.73%</td><td>1864</td></tr><tr><td>NES</td><td>99.72%</td><td>700</td><td>99.19%</td><td>1178</td><td>99.72%</td><td>1074</td></tr><tr><td>NAttack</td><td>100%</td><td>293</td><td>99.73%</td><td>401</td><td>100%</td><td>375</td></tr><tr><td>Bandits</td><td>94.75%</td><td>389</td><td>96.92%</td><td>433</td><td>98.09%</td><td>635</td></tr><tr><td>PARSI</td><td>100%</td><td>365</td><td>99.73%</td><td>432</td><td>100%</td><td>387</td></tr><tr><td>Square Attack</td><td>100%</td><td>79</td><td>100%</td><td>112</td><td>100%</td><td>86</td></tr><tr><td>SignHunter</td><td>100%</td><td>104</td><td>100%</td><td>145</td><td>100%</td><td>118</td></tr><tr><td>CorrAttackDiff</td><td>100%</td><td>389</td><td>99.86%</td><td>419</td><td>99.86%</td><td>334</td></tr><tr><td>CorrAttackFlip</td><td>100%</td><td>130</td><td>100%</td><td>150</td><td>100%</td><td>113</td></tr><tr><td>BayesOpt*</td><td>100%</td><td>182</td><td>100%</td><td>214</td><td>100%</td><td>223</td></tr><tr><td>Bayes-Attack*</td><td>100%</td><td>244</td><td>100%</td><td>254</td><td>100%</td><td>213</td></tr><tr><td>CorrAttackFlip*</td><td>100%</td><td>110</td><td>100%</td><td>96</td><td>100%</td><td>87</td></tr></table>
|
| 224 |
+
|
| 225 |
+
Table 2: Success rate and average queries of targeted attack on ImageNet. $\varepsilon = 0 . 0 5$ and query limit is 10000. As BayesOpt and Bayes-Attack run very slow, we do not include them for the targeted attack.
|
| 226 |
+
|
| 227 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="2">VGG16</td><td colspan="2">Resnet50</td><td colspan="2">Densenet121</td></tr><tr><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td></tr><tr><td>ZOO</td><td>1.1%</td><td>2884</td><td>0.8%</td><td>3018</td><td>1.1%</td><td>3309</td></tr><tr><td>NES</td><td>80.82%</td><td>4582</td><td>52.73%</td><td>5762</td><td>64.21%</td><td>5427</td></tr><tr><td>NAttack</td><td>91.86%</td><td>4045</td><td>89.05%</td><td>3799</td><td>91.97%</td><td>4389</td></tr><tr><td>Bandits</td><td>50.62%</td><td>5379</td><td>40.18%</td><td>5672</td><td>43.53%</td><td>5434</td></tr><tr><td>PARSI</td><td>76.28%</td><td>3229</td><td>64.88%</td><td>3403</td><td>75.09%</td><td>3246</td></tr><tr><td>Square Attack</td><td>96.69%</td><td>2060</td><td>89.52%</td><td>2807</td><td>95.38%</td><td>2280</td></tr><tr><td>SignHunter</td><td>93.52%</td><td>2999</td><td>83.71%</td><td>3905</td><td>90.75%</td><td>3632</td></tr><tr><td>CorrAttackDiff</td><td>88.41%</td><td>3826</td><td>81.84%</td><td>4064</td><td>91.29%</td><td>3513</td></tr><tr><td>CorrAttackFlip</td><td>98.07 %</td><td>2191</td><td>96.39%</td><td>2531</td><td>99.41%</td><td>2019</td></tr></table>
|
| 228 |
+
|
| 229 |
+
# 5 EXPERIMENTS
|
| 230 |
+
|
| 231 |
+
We evaluated the number of queries versus the success rates of CorrAttack on both undefended and defended network on ImageNet (Russakovsky et al., 2015). Moreover, we attacked Google Cloud Vision API to show that CorrAttack can generalize to a true black-box model.
|
| 232 |
+
|
| 233 |
+
We used the common hinge loss proposed in the CW attack (Carlini & Wagner, 2017). We compared two versions of CorrAttack : CorrAttackDiff and CorrAttackFlip, to ZOO (Chen et al., 2017), NES (Ilyas et al., 2018), NAttack (Li et al., 2019), Bandits (Ilyas et al., 2019), PARSI (Moon et al., 2019), Square Attack (Andriushchenko et al., 2020), SignHunter(Al-Dujaili & O’Reilly, 2020b), BayesOpt (Ru et al., 2020) and Bayes-Attack (Shukla et al., 2019). We only test adversarial attack on $\ell _ { \infty }$ norm. The details of the Gaussian processes regression and the hyperparameters of CorrAttack are given in the Appendix B. We shall mention that CorrAttack is not sensitive to the hyperparameters. The hyperparameters of other methods follow those suggested by the original papers.
|
| 234 |
+
|
| 235 |
+
# 5.1 UNDEFENDED NETWORK
|
| 236 |
+
|
| 237 |
+
We randomly select 1000 images from the validation set of ImageNet and only attack correctly classified images. The query efficiency of CorrAttack is tested on VGG16 (Simonyan & Zisserman, 2014), Resnet50 (He et al., 2016) and Densenet121 (Huang et al., 2017), which are the most commonly used network structures. We set $\varepsilon = 0 . 0 5$ and the query limit to be 10000 except for BayesOpt and Bayes-Attack. For targeted attacks, we randomly choose the target class for each image and the target classes are maintained the same for the evaluation of different algorithms. The results are shown in Table 1 and 2. CorrAttackFlip outperforms other methods by a large margin.
|
| 238 |
+
|
| 239 |
+
Table 3: Success rate and average queries of un-targeted attack on defended model. Since BayesOpt and Bayes-Attack take thousands of hours to run, we only tested on 10 samples from ImageNet with $\varepsilon = 0 . 0 5$ and 1000 query limit, which are marked as \*.
|
| 240 |
+
|
| 241 |
+
<table><tr><td>Method</td><td>ZOO</td><td>NES</td><td>NAttack</td><td>Bandits</td><td>PARSI</td></tr><tr><td>Success Queries</td><td>28.57% 1954</td><td>24.13% 3740</td><td>74.38% 1078</td><td>55.82%</td><td>73.40%</td></tr><tr><td>Method</td><td>SignHunter</td><td>Square Attack</td><td></td><td>1873 CorrAttackDiff</td><td>1529 CorrAttackFlip</td></tr><tr><td>Success Queries</td><td>68.97%</td><td>73.89%</td><td></td><td>64.86%</td><td>79.15%</td></tr><tr><td>Method</td><td>1392 BayesAttack*</td><td>1086</td><td>BayesOpt*</td><td>1599</td><td>1036 CorrAttackFlip*</td></tr><tr><td>Success</td><td>50.00%</td><td></td><td>50.00%</td><td></td><td>60.00%</td></tr><tr><td>Queries</td><td>129</td><td></td><td>406</td><td></td><td>206</td></tr></table>
|
| 242 |
+
|
| 243 |
+
Table 4: Success rate and average queries of un-targeted attack on Google Cloud Vision API. $\varepsilon = 0 . 0 5$
|
| 244 |
+
|
| 245 |
+
<table><tr><td>Method</td><td>NAttack</td><td>BayesOpt</td><td>PARSI</td><td>CorrAttackFlip</td></tr><tr><td>Success</td><td>70.00%</td><td>30.00%</td><td>70.00%</td><td>80.00%</td></tr><tr><td>Queries</td><td>142</td><td>129</td><td>235</td><td>155</td></tr></table>
|
| 246 |
+
|
| 247 |
+
As BayesOpt and Bayes-Attack takes tens of thousands of hours to attack 1000 images, we compare them with CorrAttack $\mathrm { F l i p }$ only on 20 images and un-targeted attack. The query limit is also reduced to 1000 as the time for BayesOpt and Bayes-Attack quickly increases as more samples add into the Gaussian distribution. The time comparison between three models is shown in Appendix C.6.
|
| 248 |
+
|
| 249 |
+
Optimality of Bayesian optimization Appendix C.1 shows the rank the actions found by CorrAttack.
|
| 250 |
+
The attacker could find the action with large reward quickly.
|
| 251 |
+
|
| 252 |
+
Varying $\varepsilon$ We also test the algorithms at different budget of adversarial perturbations at $\varepsilon = 0 . 0 4$ and $\varepsilon = 0 . 0 6$ on Resnet50. As it is shown in Appendix C.2, CorrAttack shows a consistently better performance at different $\varepsilon$ .
|
| 253 |
+
|
| 254 |
+
Ablation study on random choices Appendix C.3 shows the ablation study of random version of CorrAttackDiff and CorrAttackFlip. In both cases, Bayesian optimization helps to gain better query efficiency.
|
| 255 |
+
|
| 256 |
+
Ablation study on hierarchical attack We perform ablation study on the hierarchical attack and the result is shown in Appendix C.4. Hierarchical structure accelerates the CorrAttack and eliminates the sensitivity of choosing initial block size.
|
| 257 |
+
|
| 258 |
+
Ablation study on features Appendix C.5 demonstrates how the feature of the contextual bandits affects the performance of attack. PCA would help to improve the efficiency of attack.
|
| 259 |
+
|
| 260 |
+
# 5.2 DEFENDED NETWORK
|
| 261 |
+
|
| 262 |
+
To evaluate the effectiveness of CorrAttack on adversarially defended networks, we tested our method on one of the SOTA robust model (Xie et al., 2018) on ImageNet. The weight is downloaded from Github1. "ResneXt DenoiseAll" is chosen as the target model as it achieves the best performance. We set $\varepsilon = 0 . 0 5$ and the maximum number of queries is 10000. As BayesOpt runs very slowly, the attack is also performed on 10 images and the query limit is 1000. The result is shown in Table 3. CorrAttackFlip still outperforms other methods.
|
| 263 |
+
|
| 264 |
+
# 5.3 GOOGLE CLOUD VISION API
|
| 265 |
+
|
| 266 |
+
We also attacked Google Cloud Vision API, a real world black-box model for classification. The target is to remove the top-1 label out of the classification output. We choose 10 images for the ImageNet dataset and set the query limit to be 500 due to high cost to use the API. We compare CorrAttackFlip with NAttack, BayesOpt and PARSI. The result is shown in Table 4. We also show one example of the classification output in Appendix C.9
|
| 267 |
+
|
| 268 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 269 |
+
|
| 270 |
+
We formulate the score-based adversarial attack as a time-varying contextual bandits and propose a new method CorrAttack. By performing structured search on the blocks of the image, the bandits has the slow varying property. CorrAttack takes advantage of the the features of the arm, and uses Bayesian optimization with Gaussian process regression to learn the reward function. The experiment shows that CorrAttack can quickly find the action with large reward and CorrAttack achieves superior query efficiency and success rate on ImageNet and Google Cloud Vision API.
|
| 271 |
+
|
| 272 |
+
We only include basic features for learning the bandits. Other features like embedding from the transfer-based attack Huang & Zhang (2020) may be taken into account in the future work. While our work only focuses on adversarial attack on $\ell _ { \infty }$ norm, the same contextual bandits formulation could be generalized to other $\ell _ { p }$ norm to improve query efficiency. Besides, defense against CorrAttack may be achieved with adversarial training on CorrAttack , but it may not be able to defend other attacks in the meantime.
|
| 273 |
+
|
| 274 |
+
# REFERENCES
|
| 275 |
+
|
| 276 |
+
Abdullah Al-Dujaili and Una-May O’Reilly. Sign bits are all you need for black-box attacks. In International Conference on Learning Representations, 2020a. URL https://openreview. net/forum?id ${ . } = { }$ SygW0TEFwH.
|
| 277 |
+
Abdullah Al-Dujaili and Una-May O’Reilly. Sign bits are all you need for black-box attacks. In International Conference on Learning Representations, 2020b. URL https://openreview. net/forum?id ${ . } = { }$ SygW0TEFwH.
|
| 278 |
+
Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion, and Matthias Hein. Square attack: a query-efficient black-box adversarial attack via random search. 2020.
|
| 279 |
+
Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. arXiv preprint arXiv:1712.04248, 2017.
|
| 280 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE Symposium on Security and Privacy (SP), pp. 39–57. IEEE, 2017.
|
| 281 |
+
Jianbo Chen, Michael I Jordan, and Martin J Wainwright. Hopskipjumpattack: A query-efficient decision-based attack. In 2020 IEEE Symposium on Security and Privacy (SP), pp. 1277–1294. IEEE, 2020.
|
| 282 |
+
Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 15–26. ACM, 2017.
|
| 283 |
+
Kun Dong, David Eriksson, Hannes Nickisch, David Bindel, and Andrew G Wilson. Scalable log determinants for gaussian process kernel learning. In Advances in Neural Information Processing Systems, pp. 6327–6337, 2017.
|
| 284 |
+
Jiawei Du, Hu Zhang, Joey Tianyi Zhou, Yi Yang, and Jiashi Feng. Query-efficient meta attack to deep neural networks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ Skxd6gSYDS.
|
| 285 |
+
Jacob Gardner, Geoff Pleiss, Kilian Q Weinberger, David Bindel, and Andrew G Wilson. Gpytorch: Blackbox matrix-matrix gaussian process inference with gpu acceleration. In Advances in Neural Information Processing Systems, pp. 7576–7586, 2018.
|
| 286 |
+
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.
|
| 287 |
+
|
| 288 |
+
Nikolaus Hansen. The cma evolution strategy: A tutorial. arXiv preprint arXiv:1604.00772, 2016.
|
| 289 |
+
|
| 290 |
+
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, pp. 770–778, 2016.
|
| 291 |
+
|
| 292 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700–4708, 2017.
|
| 293 |
+
|
| 294 |
+
Zhichao Huang and Tong Zhang. Black-box adversarial attack with transferable model-based embedding. In International Conference on Learning Representations, 2020. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SJxhNTNYwB.
|
| 295 |
+
|
| 296 |
+
Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. 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. 2137–2146, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR.
|
| 297 |
+
|
| 298 |
+
Andrew Ilyas, Logan Engstrom, and Aleksander Madry. Prior convictions: Black-box adversarial attacks with bandits and priors. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ BkMiWhR5K7.
|
| 299 |
+
|
| 300 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
|
| 301 |
+
|
| 302 |
+
Huichen Li, Xiaojun Xu, Xiaolu Zhang, Shuang Yang, and Bo Li. Qeba: Query-efficient boundarybased blackbox attack. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1221–1230, 2020.
|
| 303 |
+
|
| 304 |
+
Yandong Li, Lijun Li, Liqiang Wang, Tong Zhang, and Boqing Gong. Nattack: Learning the distributions of adversarial examples for an improved black-box attack on deep neural networks. arXiv preprint arXiv:1905.00441, 2019.
|
| 305 |
+
|
| 306 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. arXiv preprint arXiv:1611.02770, 2016.
|
| 307 |
+
|
| 308 |
+
Laurent Meunier, Jamal Atif, and Olivier Teytaud. Yet another but more efficient black-box adversarial attack: tiling and evolution strategies. arXiv preprint arXiv:1910.02244, 2019.
|
| 309 |
+
|
| 310 |
+
Jonas Mockus, Vytautas Tiesis, and Antanas Zilinskas. The application of bayesian methods for seeking the extremum. Towards global optimization, 2(117-129):2, 1978.
|
| 311 |
+
|
| 312 |
+
Seungyong Moon, Gaon An, and Hyun Oh Song. Parsimonious black-box adversarial attacks via efficient combinatorial optimization. arXiv preprint arXiv:1905.06635, 2019.
|
| 313 |
+
|
| 314 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016.
|
| 315 |
+
|
| 316 |
+
Carl Edward Rasmussen. Gaussian processes in machine learning. In Summer School on Machine Learning, pp. 63–71. Springer, 2003.
|
| 317 |
+
|
| 318 |
+
Binxin Ru, Adam Cobb, Arno Blaas, and Yarin Gal. Bayesopt adversarial attack. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum? id $=$ Hkem-lrtvH.
|
| 319 |
+
|
| 320 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 321 |
+
|
| 322 |
+
Satya Narayan Shukla, Anit Kumar Sahu, Devin Willmott, and J Zico Kolter. Black-box adversarial attacks with bayesian optimization. arXiv preprint arXiv:1909.13857, 2019.
|
| 323 |
+
|
| 324 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 325 |
+
|
| 326 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, 2014. URL http://arxiv.org/abs/1312.6199.
|
| 327 |
+
|
| 328 |
+
Chun-Chen Tu, Paishun Ting, Pin-Yu Chen, Sijia Liu, Huan Zhang, Jinfeng Yi, Cho-Jui Hsieh, and Shin-Ming Cheng. Autozoom: Autoencoder-based zeroth order optimization method for attacking black-box neural networks. arXiv preprint arXiv:1805.11770, 2018.
|
| 329 |
+
|
| 330 |
+
Daan Wierstra, Tom Schaul, Jan Peters, and Jürgen Schmidhuber. Natural evolution strategies. 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence), pp. 3381–3387, 2008.
|
| 331 |
+
|
| 332 |
+
Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. arXiv preprint arXiv:1812.03411, 2018.
|
| 333 |
+
|
| 334 |
+
A ALGORITHM
|
| 335 |
+
|
| 336 |
+
# Algorithm 3 Split Block
|
| 337 |
+
|
| 338 |
+
Require: Set of blocks $E$ , Block size $^ { b }$ , $E ^ { \prime } = \emptyset$
|
| 339 |
+
1: for each block $e \in E$ do
|
| 340 |
+
2: Split the block $e$ into 4 blocks $\{ e _ { 1 } , e _ { 2 } , e _ { 3 } , e _ { 4 } \}$ with size b/2
|
| 341 |
+
3: $\bar { E ^ { \prime } } E ^ { \prime } \cup \{ e _ { 1 } , e _ { 2 } , e _ { 3 } , e _ { 4 } \}$
|
| 342 |
+
4: end for
|
| 343 |
+
5: return $E ^ { \prime }$ ;
|
| 344 |
+
|
| 345 |
+
# Algorithm 4 Hierarchical CorrAttackDiff
|
| 346 |
+
|
| 347 |
+
Require: Loss function $\ell ( \cdot , \cdot )$ , Input image $_ x$ and its label $y$ , Initial Block size $b$ , Set of blocks $E$ containing all blocks of the image, Threshold $c , \tau , \alpha$ , Step size $\eta$ , Adversarial budget $\varepsilon$
|
| 348 |
+
1: $x _ { 0 } = x$
|
| 349 |
+
2: repeat
|
| 350 |
+
3: Choose $A = \{ a _ { e _ { i j k } } | e _ { i j k } \in E \}$ with Equation (8)
|
| 351 |
+
4: Run CorrAttack on current block size $x =$ CORRATTACK $( \ell ( \cdot , \cdot ) , x , y , A , c , \tau , \alpha )$
|
| 352 |
+
5: if $b > 1$ then
|
| 353 |
+
6: Split the blocks into finer blocks using Algorithm 3 $\bar { E } = \mathrm { S P L I T B L O C K } ( E , b )$
|
| 354 |
+
7: $b \gets b / 2$
|
| 355 |
+
8: end if
|
| 356 |
+
9: until $\ell$ converges
|
| 357 |
+
10: return $x _ { K }$ ;
|
| 358 |
+
|
| 359 |
+
# Algorithm 5 Hierarchical CorrAttackFlip
|
| 360 |
+
|
| 361 |
+
Require: Loss function $\ell ( \cdot , \cdot )$ , Input image $x$ and its label $_ y$ , Block size $b$ , Set of blocks $E$ containing all blocks
|
| 362 |
+
of the image, Threshold $c , \tau , \alpha$ , Adversarial budget $\varepsilon$
|
| 363 |
+
1: $x _ { 0 } = x$
|
| 364 |
+
2: for $e _ { i j k } \in E$ do
|
| 365 |
+
3: Randomly draw $v$ from $\{ - \varepsilon , \varepsilon \}$
|
| 366 |
+
4: $x _ { 0 } [ e _ { i j k } ] = v + x _ { 0 } [ e _ { i j k } ]$
|
| 367 |
+
5: end for
|
| 368 |
+
6: repeat
|
| 369 |
+
7: $\begin{array} { r l } & { \mathbf { \Phi } _ { A _ { n } } ^ { \mathrm { \bf { k } } } = \{ 2 \varepsilon e _ { i j k } \in E | e _ { i j k } ^ { \top } ( x _ { k } - x ) < 0 \} } \\ & { \mathbf { \Phi } _ { \mathrm { { R u n } } } ^ { \mathrm { \bf { R u n } } } \mathrm { C o r r A t t a c k ~ f i j p i n g - } \varepsilon \tan \varepsilon } \\ & { \tilde { x } _ { k } = \mathrm { { C O R R A T A C K } } \left( \ell ( \cdot , \cdot ) , x _ { k } , y , A _ { n } , c , \tau , \alpha \right) } \\ & { A _ { p } = \{ - 2 \varepsilon e _ { i j k } \in E | e _ { i j k } ^ { \top } ( \tilde { x } _ { k } - x ) > 0 \} } \\ & { \mathbf { \Phi } _ { \mathrm { { R u n } } } ^ { \mathrm { \bf { R u n } } } { \mathrm { C o r r A t t a c k ~ f i i p p i n g ~ } } \varepsilon \tan - \varepsilon } \\ & { x _ { k + 1 } = { \mathrm { C O R R A T T A C K } } \left( \ell ( \cdot , \cdot ) , \tilde { x } _ { k } , y , A _ { p } , c , \tau , \alpha \right) } \\ & { \mathbf { \Phi } _ { \ast e _ { i } } ^ { \mathrm { \bf { \alpha } } } \quad \mathbf { \Phi } _ { \ast } ^ { \mathrm { \bf { 1 } } } \mathbf { \Phi } _ { \ast } \mathbf { \Phi } _ { \ast } \mathbf { \Phi } _ { \ast } \mathbf { \Phi } _ { \ast } \mathbf { \Phi } _ { \ast } } \end{array}$
|
| 370 |
+
8:
|
| 371 |
+
9:
|
| 372 |
+
10:
|
| 373 |
+
11: if $b > 1$ then
|
| 374 |
+
12: Split the blocks into finer blocks using Algorithm 3
|
| 375 |
+
E = SPLITBLOCK(E, b)
|
| 376 |
+
13: b ← b/2
|
| 377 |
+
14: end if
|
| 378 |
+
15: until $\ell$ converges
|
| 379 |
+
16: return xK;
|
| 380 |
+
|
| 381 |
+
# B DETAILS OF EXPERIMENT SETTING
|
| 382 |
+
|
| 383 |
+
We use the hinge loss for all the experiments. For un-targeted attacks,
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\ell _ { \mathrm { u n t a r g e t } } ( x , y ) = \operatorname* { m a x } \left\{ F ( x ) _ { y } - \operatorname* { m a x } _ { j \neq y } F ( x ) _ { j } , - \omega \right\}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
and for targeted attacks,
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\ell _ { \mathrm { t a r g e t } } ( x , y ) = \operatorname* { m a x } \left\{ \operatorname* { m a x } _ { j } F ( x ) _ { j } - F ( x ) _ { t } , - \omega \right\} .
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
Here $F$ represents the logits of the network outputs, $t$ is the target class, and $\omega$ denotes the margin. The image will be projected into the $\varepsilon$ -ball. Besides, the value of the image will be clipped to range $[ 0 , 1 ]$ .
|
| 396 |
+
|
| 397 |
+
# B.1 GAUSSIAN PROCESS REGRESSION AND BYAESIAN OPTIMIZATION
|
| 398 |
+
|
| 399 |
+
We further provide details on both the computational scaling and modeling setup for the GP regression.
|
| 400 |
+
|
| 401 |
+
To address computational issues, we use GPyTorch (Gardner et al., 2018) for scalable GP regression. GPyTorch follows (Dong et al., 2017) to solve linear systems using the conjugate gradient (CG) method and approximates the log-determinant via the Lanczos process. Without GPyTorch, running BO with a GP regression for more than a few thousand evaluations would be infeasible as classical approaches to GP regression scale cubically in the number of data points.
|
| 402 |
+
|
| 403 |
+
On the modeling side, the GP is parameterized using a Matérn- $5 / 2$ kernel with ARD and a constant mean function for all experiments. The GP hyperparameters are fitted before proposing a new batch by optimizing the log-marginal likelihood. The domain is rescaled to $[ 0 , 1 ] ^ { d }$ and the function values are standardized before fitting the GP regression. We use a Matérn- ${ \cdot 5 / 2 }$ kernel with ARD for CorrAttack and use the following bounds for the hyperparameters: (length scale) $\lambda _ { i } \in [ 0 . 0 0 5 , 2 . 0 ]$ (output scale) $\lambda _ { i } ^ { \prime } \in [ 0 . 0 5 , 2 0 . 0 ]$ , (noise variance) $\sigma ^ { \tilde { 2 } } \stackrel { . } { \in } [ \stackrel { . } { 0 } . 0 0 0 5 , 0 . 1 \stackrel { . } { }$ ].
|
| 404 |
+
|
| 405 |
+
# B.2 HYPERPARAMETERS
|
| 406 |
+
|
| 407 |
+
For CorrAttack in Algorithm 4 and Algorithm 5, we set the initial block size $b$ to be 32 and the step size $\eta$ for CorrAttackDiff is 0.03. In Algorithm 1, we use the initial sampling ratio $m = 0 . 0 3 n$ at the start point for Gaussian process regression, the threshold $c = 1 0 ^ { - 4 }$ to decide when to stop the search of current block size. In Algorithm 2, the threshold is different for different block size. For CorrAttackFlip, $\alpha = 1 , 1 , 2 , 2 , 3$ for block size 32, 16, 8, 4, 2 and for CorrAttackDiff, $\alpha = 0 , 0 , 1 , 1 , 2$ for block size 32, 16, 8, 4, 2. We set $\tau = 3 m = 0 . 0 9 n$ to remove the earliest samples from $D$ once $| D | > \alpha$ . The Adam optimizer is used to optimize the mean $\mu$ and covariance $\kappa$ of Gaussian process, where the iteration is 1 and the learning rate is 0.1.
|
| 408 |
+
|
| 409 |
+
For PARSI, the block size is set to 32 as CorrAttack , other hyperparameters are the same as the original paper.
|
| 410 |
+
|
| 411 |
+
For Bandits, Bayes-Attack and BayesOpt, the hyperparameters are the same as the original paper.
|
| 412 |
+
|
| 413 |
+
We optimize the hyperparameters for ZOO, NES. For un-targeted attack on NES, we set the sample size to be 50, learning rate to be 0.1. For targeted attack on NES, the sample size is also 50 and the learning rate is 0.05. The learning is decay by $50 \%$ if the loss doesn’t decrease for 20 iterations.
|
| 414 |
+
|
| 415 |
+
For NAttack, we set the hyperparameters the same as NES and add momentum and learning rate decay, which are not mentioned in the original paper.
|
| 416 |
+
|
| 417 |
+
For ZOO, we set the learning rate to 1.0 and sample size to be 50. Other setting follows the original paper.
|
| 418 |
+
|
| 419 |
+
# C ADDITIONAL EXPERIMENTS
|
| 420 |
+
|
| 421 |
+
# C.1 OPTIMALITY OF BAYESIAN OPTIMIZATION
|
| 422 |
+
|
| 423 |
+
Figure 3 shows the reward function that the Bayesian optimization could find in the action set. CorrAttack could find the action with high reward within just a few queries. It shows that the Gaussian process regression could model the correlation of the reward function and the Bayesian optimization could use it to optimize the time-varying contextual bandits.
|
| 424 |
+
|
| 425 |
+
# C.2 VARYING THE ADVERSARIAL BUDGET
|
| 426 |
+
|
| 427 |
+
We test CorrAttack on different adversarial budget on ImageNet for both un-targeted attack and targeted attack. Table 5 and Table 6 show the success rate and average queries for $\varepsilon = 0 . 0 4 , 0 . 0 5 , 0 . 0 6$ CorrAttackFlip achieves the best performance among all methods.
|
| 428 |
+
|
| 429 |
+

|
| 430 |
+
Figure 3: The rank of the reward function that the Bayesian optimization could find in the action set for different block size. The rank and query are normalized by the cardinality of the action set.
|
| 431 |
+
|
| 432 |
+
Table 5: Success rate and average queries of un-targeted attack on different $\varepsilon$ . Query limit is 10000
|
| 433 |
+
|
| 434 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="2">ε = 0.04</td><td colspan="2">ε= 0.05</td><td colspan="2">ε= 0.06</td></tr><tr><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td></tr><tr><td>Z00</td><td>63.28%</td><td>1915</td><td>63.68%</td><td>1794</td><td>64.88%</td><td>1507</td></tr><tr><td>NES</td><td>99.06%</td><td>1230</td><td>99.19%</td><td>1178</td><td>99.19%</td><td>1160</td></tr><tr><td>NAttack</td><td>99.73%</td><td>529</td><td>99.73%</td><td>401</td><td>99.73%</td><td>369</td></tr><tr><td>Bandits</td><td>95.86%</td><td>898</td><td>96.92%</td><td>694</td><td>97.06%</td><td>567</td></tr><tr><td>PARSI</td><td>99.73%</td><td>508</td><td>99.73%</td><td>432</td><td>100%</td><td>387</td></tr><tr><td>CorrAttackDiff</td><td>99.86%</td><td>479</td><td>99.86%</td><td>419</td><td>99.78%</td><td>373</td></tr><tr><td>CorrAttackFlip</td><td>100%</td><td>203</td><td>100%</td><td>150</td><td>100%</td><td>107</td></tr></table>
|
| 435 |
+
|
| 436 |
+
Table 6: Success rate and average queries of targeted attack on different $\varepsilon$ . Query limit is 10000
|
| 437 |
+
|
| 438 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="2">ε=0.04</td><td colspan="2">ε=0.05</td><td colspan="2">ε = 0.06</td></tr><tr><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td></tr><tr><td>ZOO</td><td>0.80%</td><td>3514</td><td>0.80%</td><td>3018</td><td>0.93%</td><td>1938</td></tr><tr><td>NES</td><td>49.13%</td><td>5901</td><td>52.73%</td><td>5762</td><td>56.48%</td><td>5884</td></tr><tr><td>NAttack</td><td>78.24%</td><td>5019</td><td>89.05%</td><td>3799</td><td>90.25%</td><td>4321</td></tr><tr><td>Bandits</td><td>31.78%</td><td>5721</td><td>40.19%</td><td>5672</td><td>43.39%</td><td>5609</td></tr><tr><td>PARSI</td><td>57.00%</td><td>3599</td><td>64.88%</td><td>3403</td><td>68.75%</td><td>3250</td></tr><tr><td>CorrAttackDiff</td><td>78.70%</td><td>4472</td><td>81.84%</td><td>4064</td><td>85.31%</td><td>3837</td></tr><tr><td>CorrAttackFlip</td><td>93.44%</td><td>2689</td><td>96.39 %</td><td>2531</td><td>97.50%</td><td>2194</td></tr></table>
|
| 439 |
+
|
| 440 |
+
# C.3 ABLATION STUDY ON RANDOM CHOICES
|
| 441 |
+
|
| 442 |
+
Table 7 and Table 8 show the ablation study on the strategy to choose action $x _ { t + 1 }$ in the line 6 of Algorithm 1. The process of Bayesian optimization helps to accelerate the optimization. As targeted attack is more complicated and requires larger number of queries, CorrAttack has more advantage in this scenario.
|
| 443 |
+
|
| 444 |
+
# C.4 ABLATION STUDY ON HIERARCHICAL ATTACK
|
| 445 |
+
|
| 446 |
+
We perform un-targeted attack on Resnet50 as shown in Table 10. Hierarchical attack lowers the average queries and improves the query efficiency. Besides, hierarchical attack avoids the problem of choosing block size. As shown in Table 10, block size for non-hierarchical is essential for the performance.
|
| 447 |
+
|
| 448 |
+
# C.5 ABLATION STUDY ON FEATURES
|
| 449 |
+
|
| 450 |
+
Table 11 shows the success rate and average queries for CorrAttackwith different features. We perform ablation study on the features of the contextual bandits. One contains just the location of the
|
| 451 |
+
|
| 452 |
+
Table 7: Ablation study on random choices with success rate and average queries of un-targeted attack on ImageNet. $\varepsilon = 0 . 0 5$ and query limit is 10000
|
| 453 |
+
|
| 454 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="2">VGG16</td><td colspan="2">Resnet50</td><td colspan="2">Densenet121</td></tr><tr><td>Success</td><td>Queries</td><td> Success</td><td>Queries</td><td>Success</td><td>Queries</td></tr><tr><td>CorrAttackDiff Random</td><td>100%</td><td>456</td><td>99.86%</td><td>491</td><td>100%</td><td>375</td></tr><tr><td>CorrAttackDiff Bayes</td><td>100%</td><td>389</td><td>99.86%</td><td>419</td><td>100%</td><td>334</td></tr><tr><td>CorrAttackFlip Random</td><td>100%</td><td>143</td><td>100%</td><td>176</td><td>100%</td><td>132</td></tr><tr><td>CorrAttackFlip Baye s</td><td>100%</td><td>130</td><td>100%</td><td>150</td><td>100%</td><td>113</td></tr></table>
|
| 455 |
+
|
| 456 |
+
Table 8: Ablation study on random choices with success rate and average queries of targeted attack on ImageNet. $\varepsilon = 0 . 0 5$ and query limit is 10000
|
| 457 |
+
|
| 458 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="2">VGG16</td><td colspan="2">Resnet50</td><td colspan="2">Densenet121</td></tr><tr><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td></tr><tr><td>CorrAttackDiff Random</td><td>83.72%</td><td>4388</td><td>74.76%</td><td>4644</td><td>85.30%</td><td>4113</td></tr><tr><td>CorrAttackDiff Bayes</td><td>88.41%</td><td>3826</td><td>81.84%</td><td>4064</td><td>91.29 %</td><td>3513</td></tr><tr><td>CorrAttackFlip Random</td><td>96.42%</td><td>2545</td><td>92.92%</td><td>3066</td><td>96.87%</td><td>2556</td></tr><tr><td>CorrAttackFlip Baye s</td><td>98.07%</td><td>2191</td><td>96.39%</td><td>2531</td><td>99.41%</td><td>2019</td></tr></table>
|
| 459 |
+
|
| 460 |
+
Table 9: Ablation study on random choices with success rate and average queries of un-targeted attack on defended model ImageNet. $\varepsilon = 0 . 0 5$ and query limit is 10000
|
| 461 |
+
|
| 462 |
+
<table><tr><td>Method</td><td>CorrAttackDif Random</td><td>CorrAttackDiff Bayes</td><td>CorrAttackFlip Random</td><td>CorrAttackFlip Bayes</td></tr><tr><td>Success</td><td>57.47%</td><td>64.86%</td><td>71.42%</td><td>79.15%</td></tr><tr><td>Queries</td><td>1645</td><td>1599</td><td>1159</td><td>1036</td></tr></table>
|
| 463 |
+
|
| 464 |
+
Table 10: Success rate and average queries of un-targeted attack on Resnet50 for Hierarchical Strategy.
|
| 465 |
+
|
| 466 |
+
<table><tr><td>Method</td><td>Fixed Size 4</td><td>Fixed Size 8</td><td>Fixed Size 16</td><td>Fixed Size 32</td><td>Hierarchical</td></tr><tr><td>Success</td><td>100%</td><td>100.0%</td><td>99.47%</td><td>89.32%</td><td>100%</td></tr><tr><td>Queries</td><td>763</td><td>351</td><td>168</td><td>96</td><td>150</td></tr></table>
|
| 467 |
+
|
| 468 |
+
block and the other contains both the location and the PCA feature. PCA helps the learning process of the reward and achieve higher success rate and lower number of queries. PCA feature achieves significant improvement on CorrAttack $\mathrm { F l i p }$ . We may find more useful features in the future.
|
| 469 |
+
|
| 470 |
+
# C.6 COMPARISON BETWEEN CORRATTACKFLIP, BAYESOPT AND BAYES-ATTACK
|
| 471 |
+
|
| 472 |
+
The main difference between BayesOpt and Bayes-Attack is using different types of GP regression (Standard GP for Bayes-Attack and Additive GP for BayesOpt), so we will consider these two models as a group when comparing with our model CorrAttack.
|
| 473 |
+
|
| 474 |
+
Difference between CorrAttack, BayesOpt and Bayes-Attack: For $l _ { \infty }$ attacks, assume there are no hierarchical structure, we have blocks $E = \left\{ e _ { 0 0 0 } , e _ { 0 0 1 } , \cdot \cdot \cdot , e _ { h w c } \right\}$ , where the block is $b \times b$ square of pixels and $( h , w , c ) = ( \mathrm { h e i g h t } / b$ , width/ $b$ , channel). CorrAttack, BayesOpt (Ru et al., 2020) and k (Shuwhere ) all try to search the adv, the perturbation of block rial noise oat time t is $E$ with perturbation. $\pmb { \delta } \in [ - \epsilon , \epsilon ] ^ { d }$ $d = h \times w \times c$ $e _ { i j k }$ $\delta _ { e _ { i j k } } ^ { t }$
|
| 475 |
+
|
| 476 |
+
BayesOpt and Bayes-Attack use a GP regression directly on $\pmb { \delta } \in [ - \epsilon , \epsilon ] ^ { d }$ (all blocks),
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
f ( \delta ) | \mathcal { D } _ { n } \sim \mathrm { N o r m a l } ( \mu _ { n } ( \delta ) , \sigma _ { n } ^ { 2 } ( \delta ) ) .
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
CorrAttack define an action space $A$ and use a standard GP regression on features $z _ { e _ { i j k } } = ( i , j , k , p c a )$ (single block),
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
g _ { t } \big ( a _ { e _ { i j k } } \big ) | \mathcal { D } _ { t } \sim \operatorname { N o r m a l } ( \mu _ { t } \big ( z _ { e _ { i j k } } \big ) , \sigma _ { t } ^ { 2 } \big ( z _ { e _ { i j k } } \big ) \big ) .
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
Table 11: Ablation study on features with success rate and average queries of targeted attack on ImageNet. $\varepsilon ~ = ~ 0 . 0 5$ and query limit is 10000. We use feature $\bar { z } _ { e _ { i j k } } ~ = ~ ( i , \bar { j } , k , p c a )$ for CorrAttackDiffw pca and CorrAttackFlipw $p c a$ , use $z _ { e _ { i j k } } ~ = ~ ( i , j , k )$ for CorrAttackDiffw/o pca and CorrAttackFlipw/o pca.
|
| 489 |
+
|
| 490 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="2">VGG16</td><td colspan="2">Resnet50</td><td colspan="2">Densenet121</td></tr><tr><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td><td>Success</td><td>Queries</td></tr><tr><td>CorrAttackDiffw /o pca</td><td>88.69%</td><td>3892</td><td>81.71%</td><td>4066</td><td>90.88%</td><td>3540</td></tr><tr><td>CorrAttackDiffw pca</td><td>88.41%</td><td>3826</td><td>81.84%</td><td>4064</td><td>91.29%</td><td>3513</td></tr><tr><td>CorrAttackFlipw /o pca</td><td>98.11%</td><td>2233</td><td>95.86%</td><td>2682</td><td>98.10%</td><td>2195</td></tr><tr><td>CorrAttackFlipw pca</td><td>98.07%</td><td>2191</td><td>96.39%</td><td>2531</td><td>99.41%</td><td>2019</td></tr></table>
|
| 491 |
+
|
| 492 |
+
At each iteration, in BayesOpt and Bayes-Attack, the changes of overall perturbation is
|
| 493 |
+
|
| 494 |
+
$$
|
| 495 |
+
\begin{array} { r } { \delta _ { t } - \delta _ { t - 1 } = \{ \delta _ { e _ { 0 0 0 } } ^ { t } \cup \delta _ { e _ { 0 0 1 } } ^ { t } \cup \cdot \cdot \cdot \cup \delta _ { e _ { h w c } } ^ { t } \} - \{ \delta _ { e _ { 0 0 0 } } ^ { t - 1 } \cup \delta _ { e _ { 0 0 1 } } ^ { t - 1 } \cup \cdot \cdot \cdot \cup \delta _ { e _ { h w c } } ^ { t - 1 } \} . } \end{array}
|
| 496 |
+
$$
|
| 497 |
+
|
| 498 |
+
However, in CorrAttack,
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
\delta _ { t } - \delta _ { t - 1 } = \delta _ { e _ { i j k } } ^ { t } - \delta _ { e _ { i j k } } ^ { t - 1 } .
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+
In conclusion, BayesOpt and Bayes-Attack view each block as a dimension, try to search the overall perturbation directly. CorrAttack defines a low dimension feature space, keep an overall perturbation and try to search an action on single block.
|
| 505 |
+
|
| 506 |
+
Time complexity and running time: The time complexity of fitting GP regression is $O ( d n ^ { 2 } )$ where $d$ is the dimension of input and $n$ is the number of samples. And the dimension for CorrAttack $Q = 4$ for $z _ { e _ { i j k } } = ( i , j , k , p c a ) )$ is much smaller than BayesOpt and Bayes-Attack ( $d = 6 9 1 2$ if $h = w = 4 8 , c = 3 )$ . Moreover, we can convert the continuous search space of BayesOpt and Bayes-Attack from $[ - \epsilon , \epsilon ] ^ { 6 9 1 2 }$ to discrete search space $E = \left\{ e _ { 0 0 0 } , e _ { 0 0 1 } , \cdot \cdot \cdot , e _ { h w c } \right\}$ , whose number is only 6912, smaller search space could save the computation time of acquisition function.
|
| 507 |
+
|
| 508 |
+
We compare the running time for CorrAttackFlip with BayesOpt and Bayes-Attack on 20 images from ImageNet. Table 12 shows the running time for the un-targeted attack. We use PyTorch2 to develop these two models. All experiments were conducted on a personal workstation with 28 Intel(R) Xeon(R) Gold 5120 2.20GHz CPUs, an NVIDIA GeForce RTX2080Ti 11GB GPU and 252G memory.
|
| 509 |
+
|
| 510 |
+
BayesOpt models the loss function with a very high dimensional Gaussian process. The decomposition of additive kernel also needs to be restarted several times. Even though we try to optimize the speed of BayesOpt with GPU acceleration, it is still very slow and takes hundreds of times more computational resources than CorrAttack .
|
| 511 |
+
|
| 512 |
+
Bayes-Attack could be regarded as a simpler version of BayesOpt, which does not add additive kernel. We do not evaluate it on targeted task (when query>1000) since GP inference time grows fast as evaluated query increases, e.g. For Bayes-Attack, when 150 <query $< 2 0 0$ , Time $= 1 . 6 s$ /query; $8 0 0 < \mathrm { q u e r y < 1 0 0 0 }$ , Time $= 1 0 . 5 s ,$ /query. CorrAttack solves this problem with Time ${ = } 0 . 1 s$ /query even when query reaches 10000. Since we forget the previous samples before $t - \tau$ , our input sample $n$ will be smaller than $\tau$ . The forgetting technique can not be applied into the Bayes-Attack and BayesOpt since they are searching the perturbation of all blocks so each sample needs to be remembered.
|
| 513 |
+
|
| 514 |
+
# C.7 GROWING CURVE OF SUCCESS RATE
|
| 515 |
+
|
| 516 |
+
The number of average queries is sometimes misleading due to the the heavy tail distribution of queries. Therefore in Figure 4, we plot the success rates at different query levels to show the detailed behaviors of different attacks. It shows that CorrAttack is much more efficient than other methods at all query levels.
|
| 517 |
+
|
| 518 |
+
Table 12: Comparsion of running time between CorrAttackFlipand BayesOpt on un-targeted attack. "Per Query" means the average time needed to perform one query to the loss-oracle and "Per Image" denotes the average time to successfully attack an image. Since BayesOpt needs thousands of hours to run all samples, we only tested on 20 samples from ImageNet, which will be marked as \*.
|
| 519 |
+
|
| 520 |
+
<table><tr><td rowspan="2">Time</td><td colspan="2">VGG16</td><td colspan="2">Resnet50</td><td colspan="2">Densenet121</td></tr><tr><td>Per Query</td><td>Per Image</td><td>Per Query</td><td>Per Image</td><td>Per Query</td><td>Per Image</td></tr><tr><td>BayesOpt*</td><td>28.94s</td><td>5268s</td><td>40.53s</td><td>8673s</td><td>39.57s</td><td>8825s</td></tr><tr><td>Bayes-Attack*</td><td>3.03s</td><td>739s</td><td>3.42s</td><td>869s</td><td>2.96s</td><td>630s</td></tr><tr><td>CorrAttackFlip*</td><td>0.12s</td><td>19s</td><td>0.11s</td><td>15s</td><td>0.15s</td><td>20s</td></tr></table>
|
| 521 |
+
|
| 522 |
+

|
| 523 |
+
Figure 4: Success rate of black-box attack at different query levels for undefended ImageNet models.
|
| 524 |
+
|
| 525 |
+
C.8 VISUALIZATION OF LOCAL PROPERTY AND SLOW VARYING PROPERTY
|
| 526 |
+
|
| 527 |
+
Figure 5 shows more examples of finite difference for different network architectures and different dataset. They all have local correlation structure as shown in Figure 1. And Figure 6 shows more examples like Figure 2, the slow varying properties exist for different architectures and different datasets.
|
| 528 |
+
|
| 529 |
+
# C.9 GOOGLE CLOUD VISION API
|
| 530 |
+
|
| 531 |
+
Figure 7 shows the example of attacking the Google Cloud Vision API. CorrAttackFlip and PARSI successfully change the classification result. BeyesOpt, however, can not remove the top 1 classification result out of the output.
|
| 532 |
+
|
| 533 |
+

|
| 534 |
+
Figure 5: Finite difference of perturbation like Figure 1. $h = w = 2 8$ . For Imagenet, $b = 8$ and $\eta = 0 . 0 5$ . For MNIST, $b = 1$ and $\eta = 0 . 2$
|
| 535 |
+
|
| 536 |
+

|
| 537 |
+
Figure 6: Difference of finite difference of perturbation like Figure 2. $h = w = 2 8$ . For Imagenet, $b = 8$ and $\eta = 0 . 0 5$ . For MNIST, $b = 1$ and $\eta = 0 . 2$
|
| 538 |
+
|
| 539 |
+

|
| 540 |
+
Figure 7: Example result of attacking Google Cloud Vision API
|
| 541 |
+
|
| 542 |
+

|
| 543 |
+
Figure 8: Visualization of adversarial examples for targeted attack on Densenet121. $\varepsilon = 0 . 0 5$
|
md/train/r1CE9GWR-/r1CE9GWR-.md
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNDERSTANDING GANS: THE LQG SETTING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Generative Adversarial Networks (GANs) have become a popular method to learn a probability model from data. Many GAN architectures with different optimization metrics have been introduced recently. Instead of proposing yet another architecture, this paper aims to provide an understanding of some of the basic issues surrounding GANs. First, we propose a natural way of specifying the loss function for GANs by drawing a connection with supervised learning. Second, we shed light on the generalization peformance of GANs through the analysis of a simple LQG setting: the generator is linear, the loss function is quadratic and the data is drawn from a Gaussian distribution. We show that in this setting: 1) the optimal GAN solution converges to population Principal Component Analysis (PCA) as the number of training samples increases; 2) the number of samples required scales exponentially with the dimension of the data; 3) the number of samples scales almost linearly if the discriminator is constrained to be quadratic. Thus, linear generators and quadratic discriminators provide a good balance for fast learning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Learning a probability model from data is a fundamental problem in statistics and machine learning. Building off the success of deep learning methods, Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) have given this age-old problem a face-lift. In contrast to traditional methods of parameter fitting like maximum likelihood estimation, the GAN approach views the problem as a game between a generator whose goal is to generate fake samples that are close to the real data training samples and a discriminator whose goal is to distinguish between the real and fake samples. The generator and the discriminators are typically implemented by deep neural networks. GANs have achieved impressive performance in several domains (e.g., (Ledig et al., 2016; Reed et al., 2016)). Since (Goodfellow et al., 2014), many variations of GANs have been developed, including $f$ -GAN (Nowozin et al., 2016), MMD-GAN (Dziugaite et al., 2015; Li et al., 2015), WGAN (Arjovsky et al., 2017), improved WGAN (Gulrajani et al., 2017), relaxed WGAN (Guo et al., 2017), Least-Squares GAN (Mao et al., 2016), Boundary equilibrium GAN (Berthelot et al., 2017), etc. These GANs use different metrics in the optimization for training the generator and discriminator networks (Liu et al., 2017).
|
| 12 |
+
|
| 13 |
+
The game theoretic formulation in GANs can be viewed as the dual of an optimization that minimizes a distance measure between the empirical distributions of the fake and real samples. In the population limit where there are infinite number of samples, this optimization minimizes the distance between the generated distribution and the true distribution from which the data is drawn. In the original GAN framework, this distance measure is the Jenson Shannon divergence. However, Arjovsky et al (Arjovsky et al., 2017) noted that this distance does not depend on the generated distribution whenever its dimension is smaller than that of the true distribution. In this typical case, the Jenson Shannon divergence does not serve as a useful criterion in choosing the appropriate generated distribution. To resolve this issue, (Arjovsky et al., 2017) proposed the Wasserstein GAN (WGAN) which uses the first-order Wasserstein distance instead of Jensen-Shannon divergence. This distance is meaningful even when the dimension of the generated distribution is less than the true distribution. Nevertheless there are many other distance measures that satisfy this criterion and it is not clear how to choose among them. This is responsible in part for the fact that there are so many different GAN architectures. In fact, there is currently some confusion in the literature even on the basic issue of how to specify the loss function for GANs. For example, while the ”Wasserstein” in Wasserstein
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Summary of main results in the LQG setting. The population optimal GAN solution is PCA when the discriminator is unconstrained and when the discriminator is constrained to be quadratic. But the convergence to the population optimal is exponentially faster under a quadratic constraint on the discriminator.
|
| 17 |
+
|
| 18 |
+
GAN refers to the use of Wasserstein distance in the distance measure between the generated and true distributions, the ”Least Squares” in Least-Squares GAN (Mao et al., 2016) refers to the use of squared error in the discriminator optimization objective. These are two totally different types of objects. The situation with GANs is in contrast to that in supervised learning, where how the loss function is specified in the formulation is clear and quite universally accepted.
|
| 19 |
+
|
| 20 |
+
A central issue in any learning problem is generalization: how close a model learnt from a finite amount of data is to the true distribution. Or, in statistical terms, how fast is the rate of convergence of the learnt model to the true model as a function of number of samples? Arora et al (Arora et al., 2017) have recently studied this problem for GANs. They observed that for Wasserstein GAN, if there are no constraints on the generator or the discriminator, the number of samples required to converge scales exponentially in the data dimension. They then showed that if the discriminator is constrained to be in a parametric family, then one can achieve convergence almost linearly in the number of parameters in that family (Theorem 3.1 in (Arora et al., 2017)). However, the convergence is no longer measured in the Wasserstein distance but in a new distance measure they defined (the neural network distance). The result is interesting as it highlights the role of the discriminator in generalization, but it is somewhat unsatisfactory in that the distance measure needs to be modified to tailor to the specific constraints on the discriminator. Moreover, the result requires the invention of (yet) another family of distance measures for GANs.
|
| 21 |
+
|
| 22 |
+
In this paper, we first argue that there is a natural way to specify the loss function $\ell$ for GANs, in an analogous way as in the supervised learning setup. The resulting optimal GAN minimizes a generalized loss-function dependent Wasserstein distance between the generated distribution and the true distribution, and the dual formulation of this generalized Wasserstein distance leads to a loss-function dependent discriminator architecture. To study the impact of the constraints on the generator and the discriminator on the generalization performance in this distance measure, we focus on the case when the true data distribution is Gaussian. In this case, a natural loss function to consider is quadratic, and a natural class of generators to consider is linear with a given rank $k$ . In this setting, the optimal GAN minimizes the second-order Wasserstein distance between the generated distribution and the empirical data distribution among all linear generators of a given rank. We show the following results:
|
| 23 |
+
|
| 24 |
+
1 In the population limit as the number of data samples grow, the optimal generated distribution is the rank $k$ Gaussian distribution retaining exactly the top $k$ principal components of the true distribution, i.e. GAN performs PCA in the population limit. 2 The number of samples required for convergence in (second-order) Wasserstein distance however scales exponentially with the dimension of the data distribution. 3 Under a further constraint that the discriminator is quadratic, GAN converges to the same population-optimal PCA limit, but with the number of samples scaling almost linearly with the dimension. The constrained GAN simply performs empirical PCA, and in the case when the rank $k$ of the generator is the same as the dimension of the data distribution, GAN is equivalent to maximum likelihood estimation of the underlying Gaussian model.
|
| 25 |
+
|
| 26 |
+
These results are summarized in Figure 1. The GAN architecture with a linear generator and a quadratic discriminator is shown in Figure 4.
|
| 27 |
+
|
| 28 |
+
(Arora et al., 2017) observed that the number of samples required to generalize for GAN is exponential in the dimension of the data when there are no constraints on either the generator or the discriminator. (They proved the result for first-order Wasserstein distance but a similar result holds for second-order Wasserstein distance as well, see Lemma 2 in Section 3.) Result 2 above says that even constraining the generator drastically to be linear cannot escape this exponential scaling. Result 3 says that this exponential scaling is not due to statistical limitation, but much better inference can be obtained by constraining the discriminator appropriately. Similar to Theorem 3.1 in (Arora et al., 2017), Result 3 points to the importance of constraining the discriminator. But there are two key differences. First, the convergence in Result 3 is with respect to the original (second-order) Wasserstein distance, not another distance measure tailored to the constraint on the discriminator. Thus, the original quadratic loss function is respected. Second, the population limit is the same as the PCA limit achieved without constraints on the discriminator. Thus, by imposing a discriminator constraint, the rate of convergence is drastically improved without sacrificing the limiting performance. There is no such guarantee in (Arora et al., 2017). Our results also provide concrete evidence that an appropriate balance between the classes of generators and discriminators, i.e. linear generators and quadratic discriminators, can provide fast training.
|
| 29 |
+
|
| 30 |
+
The Linear-Quadratic-Gaussian (LQG) setting, dating back to at least Gauss, has been widely used across many fields, including statistics, machine learning, control, signal processing and communication. It has resulted in celebrated successes such as linear regression, the Wiener filter, the Kalman filter, PCA, etc., and is often used to establish a baseline to understand more complex models. We believe it serves a similar role here for $\mathrm { G A N s ^ { 1 } }$ . Indeed it allows us to make a clear connection between GAN and PCA, perhaps the most basic of unsupervised learning methods. Moreover, even in this simple setting, the generalization issues in GAN are non-trivial, and understanding them in this setting provides the foundation to tackle more complex data distributions and more complex generators and discriminators such as deep nets.
|
| 31 |
+
|
| 32 |
+
The rest of the paper is organized as follows. In Section 2, we discuss a formulation of the GAN problem for general loss functions. In Section 3, we specialize to the LQG setting and analyze the generalization performance of GAN. In Section 4, we analyze the performance of GAN under a quadratic constraint on the discriminator. In Section 5, we present some experimental results.
|
| 33 |
+
|
| 34 |
+
# 2 A GENERAL FORMULATION FOR GANS
|
| 35 |
+
|
| 36 |
+
Let $\{ \mathbf { y } _ { i } \} _ { i = 1 } ^ { n }$ be $n$ observed data points in $\mathbb { R } ^ { d }$ drawn i.i.d. from the distribution $\mathbb { P } _ { Y }$ . Let $\mathbb { Q } _ { Y } ^ { n }$ be the empirical distribution of these observed samples. Moreover, let $\mathbb { P } _ { X }$ be a normal distribution $\mathcal { N } ( \mathbf { 0 } , \mathbf { I } _ { k } )$ . GANs can be viewed as an optimization that minimizes a distance between the observed empirical distribution $\mathbb { Q } _ { Y } ^ { n }$ and the generated distribution $\mathbb { P } _ { g ( X ) }$ . The population GAN optimization replaces $\mathbb { Q } _ { Y } ^ { n }$ with $\mathbb { P } _ { Y }$ . The question we ask in this section is: what is a natural way of specifying a loss function $\ell$ for GANs and how it determines the distance?
|
| 37 |
+
|
| 38 |
+
# 2.1 WGAN REVISITED
|
| 39 |
+
|
| 40 |
+
Let us start with the WGAN optimization (Arjovsky et al., 2017):
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\operatorname* { i n f } _ { g ( . ) \in \mathcal { G } } W _ { 1 } ( \mathbb { P } _ { Y } , \mathbb { P } _ { g ( X ) } ) ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\mathcal { G }$ is the set of generator functions, and the $p$ -th order Wasserstein distance between distributions $\mathbb { P } _ { Z _ { 1 } }$ and $\mathbb { P } _ { Z _ { 2 } }$ is defined as (Villani, 2008)
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
W _ { p } ^ { p } ( \mathbb { P } _ { Z _ { 1 } } , \mathbb { P } _ { Z _ { 2 } } ) : = \operatorname* { i n f } _ { \mathbb { P } _ { Z _ { 1 } , Z _ { 2 } } } \mathbb { E } \left[ \| Z _ { 1 } - Z _ { 2 } \| ^ { p } \right] ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where the minimization is over all joint distributions with marginals fixed. Replacing (2) in (1), the WGAN optimization can be re-written as
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\operatorname* { i n f } _ { g ( . ) \in { \mathcal { G } } } \ \operatorname* { i n f } _ { \mathbb { P } _ { g ( X ) , Y } } \ \mathbb { E } \left[ \| Y - g ( X ) \| \right] .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
or equivalently:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\operatorname* { i n f } _ { \mathbb { P } _ { X , Y } } \operatorname* { i n f } _ { g ( . ) \in { \mathcal { G } } } \mathbb { E } \left[ \| Y - g ( X ) \| \right] ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where the minimization is over all joint distributions $\mathbb { P } _ { X , Y }$ with fixed marginals $\mathbb { P } _ { X }$ and $\mathbb { P } _ { Y }$ .
|
| 65 |
+
|
| 66 |
+
We now connect (4) to the supervised learning setup. In supervised learning, the joint distribution $\mathbb { P } _ { X , Y }$ is fixed and the goal is to learn a relationship between the feature variable represented by $X \in \mathbb { R } ^ { k }$ , and the target variable represented by $Y \in \mathbb { R } ^ { d }$ , according to the following optimization:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\operatorname* { i n f } _ { g ( . ) \in { \mathcal { G } } } \operatorname { \mathbb { E } } \left[ \ell \left( Y , g ( X ) \right) \right] ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\ell$ is the loss function. Assuming the marginal distribution of $X$ is the same in both optimizations (4) and (5), we can connect the two optimization problems by setting $\ell ( y , y ^ { \prime } ) = \| y - y ^ { \prime } \|$ in optimization (5). Note that for every fixed $\mathbb { P } _ { X , Y }$ , the solution of the supervised learning problem (5) yields a predictor $g$ which is a feasible solution to the WGAN optimization problem (4). Therefore, the WGAN optimization (3) can be re-interpreted as solving the easiest such supervised learning problem, over all possible joint distributions $\mathbb { P } _ { X , Y }$ with fixed $\mathbb { P } _ { X }$ and $\mathbb { P } _ { Y }$ .
|
| 73 |
+
|
| 74 |
+
# 2.2 FROM SUPERVISED TO UNSUPERVISED LEARNING
|
| 75 |
+
|
| 76 |
+
GAN is a solution to an unsupervised learning problem. What we are establishing above is a general connection between supervised and unsupervised learning problems: a good predictor $g$ learnt in a supervised learning problem can be used to generate samples of the target variable Y. Hence, to solve an unsupervised learning problem for $Y$ with distribution $\mathbb { P } _ { Y }$ , one should solve the easiest supervised learning problem $\mathbb { P } _ { X , Y }$ with given marginal $\mathbb { P } _ { Y }$ (and $\mathbb { P } _ { X }$ , the randomness generating distribution). This is in contrast to the traditional view of the unsupervised learning problem as observing the feature variable $X$ without the label $Y$ . (Thus in this paper we break with tradition and use $Y$ to denote data and $X$ as randomness for the generator in stating the GAN problem.)
|
| 77 |
+
|
| 78 |
+
This connection between supervised and unsupervised learning leads to a natural way of specifying the loss function in GANs: we simply replace the $\ell _ { 2 }$ Euclidean norm in (3) with a general loss function $\ell$ :
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\operatorname* { i n f } _ { g ( . ) \in { \mathcal { G } } } \ \operatorname* { i n f } _ { \mathbb { P } _ { g ( X ) , Y } } \ \mathbb { E } \left[ \ell \left( Y , g ( X ) \right) \right] .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
The inner optimization is the optimal transport problem between distributions of $g ( X )$ and $Y$ (Villani, 2008) with general cost $\ell$ . This is a linear programming problem for general cost, so there is always a dual formulation (the Kantorovich dual (Villani, 2008)). The dual formulation can be interpreted as a generalized discriminator optimization problem for the cost $\ell$ . (For example, in the case of $\ell$ being the Euclidean norm, we get the WGAN architecture; see Figure 2(a).) Hence, we propose (6) as a formulation of GANs for general loss functions.
|
| 85 |
+
|
| 86 |
+
# 2.3 QUADRATIC LOSS
|
| 87 |
+
|
| 88 |
+
The most widely used loss function in supervised learning is the quadratic loss: $\ell ( y , y ^ { \prime } ) = \| y - y ^ { \prime } \| ^ { 2 }$ (squared Euclidean norm). Across many fields its use had led to many important discoveries. With the connection between supervised and unsupervised learning in mind, this loss function should be a prime choice to consider in GANs as well. This choice of the loss function leads to the quadratic $G A N$ optimization:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\operatorname* { i n f } _ { g ( . ) \in \mathcal { G } } W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { P } _ { g ( X ) } ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
Since Wasserstein distances are weakly continuous measures in the probability space (Villani, 2008), similar to WGAN, the optimization of the quadratic GAN is well-defined even if $k < d$ . The dual
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 2: Dual (min-max) formulations of (a) WGAN, and (b) Quadratic GAN.
|
| 98 |
+
|
| 99 |
+
formulation (discriminator) for $W _ { 2 }$ is shown in Figure 2(b). Note that in this dual, the discriminator applies $\psi$ to the real data and the convex conjugate $\psi ^ { * }$ to the generated (fake) data.
|
| 100 |
+
|
| 101 |
+
The empirical quadratic GAN optimization can be formulated by replacing $\mathbb { P } _ { Y }$ with the empirical distribution $\mathbb { Q } _ { Y } ^ { n }$ of the data as follows:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\operatorname* { i n f } _ { g ( . ) \in { \mathcal { G } } } W _ { 2 } ^ { 2 } ( { \mathbb { Q } } _ { Y } ^ { n } , { \mathbb { P } } _ { g ( X ) } ) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Note that while in practice one generates fake samples from $X$ , we will keep the notations simpler in this paper by assuming we can generate the exact distribution $g ( X )$ , i.e. we can generate as many fake samples as we wish. Almost all our results can be extended to the case when we have finite number of samples from $X$ comparable to the number of samples from $Y$ .
|
| 108 |
+
|
| 109 |
+
For the rest of the paper, we will focus on the problem (8) for the particular case of $Y$ Gaussian of dimension $d$ , and $g$ linear of rank $k \leq d$ . This is the LQG setting for GANs.
|
| 110 |
+
|
| 111 |
+
# 3 GANS UNDER THE LQG SETUP
|
| 112 |
+
|
| 113 |
+
# 3.1 THE POPULATION GAN OPTIMIZATION
|
| 114 |
+
|
| 115 |
+
First, we analyze the population GAN optimization under the LQG setup. We have the following lemma:
|
| 116 |
+
|
| 117 |
+
Lemma 1 Let $s$ be a $k$ dimensional subspace in $\mathbb { R } ^ { d }$ . Let $\hat { Y }$ be a random variable whose support lies in $s$ . Then, $\hat { Y } ^ { * }$ , the optimal solution of the optimization
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\operatorname* { i n f } _ { \mathbb { P } _ { \hat { Y } } } ~ W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { P } _ { \hat { Y } } ) ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
is the projection of $Y$ to $s$
|
| 124 |
+
|
| 125 |
+
Proof 1 See Appendix B.2.
|
| 126 |
+
|
| 127 |
+
This Lemma holds even if $\mathbb { P } _ { Y }$ is a non-Gaussian distribution. However, $\mathbb { P } _ { \hat { Y } ^ { * } }$ cannot be generated as $g ( X )$ when $\mathbb { P } _ { X } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } _ { k } )$ and $g ( . )$ is restricted to be linear.
|
| 128 |
+
|
| 129 |
+
Using Lemma 1 and under the LQG setup, we show that the optimal solution for the population GAN optimization is the same as the PCA solution. PCA is the most standard unsupervised learning approach (Jolliffe, 2002). PCA computes an optimal linear mapping from $Y$ to $\bar { \hat { Y } }$ under the rank constraint on the covariance matrix of $\hat { Y } ~ ( \mathbf { K } _ { \hat { Y } } )$ . We say $\hat { Y }$ is the $k$ -PCA solution of $Y$ if $\mathbf { K } _ { \hat { Y } }$ is a rank $k$ matrix whose top $k$ eigenvalues and eigenvectors are the same as top $k$ eigenvalues and eigenvectors of the covariance matrix of $Y$ $( \mathbf { K } _ { Y } )$ .
|
| 130 |
+
|
| 131 |
+
Theorem 1 Let $Y \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { K } _ { Y } )$ where $\mathbf { K } _ { Y }$ is full-rank. Let $X \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } _ { k } )$ where $k \leq d .$ . The optimal population GAN solution of optimization (7) under linear $\mathcal { G }$ is the $k$ -PCA solution of $Y$ .
|
| 132 |
+
|
| 133 |
+
Proof 2 See Appendix B.3.
|
| 134 |
+
|
| 135 |
+
Lemma 1 holds if we replace $W _ { 2 }$ with $W _ { 1 }$ . However, the conclusion of Theorem 1 is tied to the $W _ { 2 }$ distance because the PCA optimization also considers the quadratic projection loss.
|
| 136 |
+
|
| 137 |
+
# 3.2 THE EMPIRICAL GAN OPTIMIZATION
|
| 138 |
+
|
| 139 |
+
In reality, one solves the GAN optimization over the empirical distribution of the data $\mathbb { Q } _ { Y } ^ { n }$ , not the population distribution $\mathbb { P } _ { Y }$ . Thus, it is important to analyze how close optimal empirical and population GAN solutions are in a given sample size $n$ . This notion is captured in the generalization error of the GAN optimization, defined as follows:
|
| 140 |
+
|
| 141 |
+
Definition 1 (Generalization of GANs) Let n be the number of observed samples from $Y$ . Let ${ \hat { g } } ( . )$ and $g ^ { \ast } ( . )$ be the optimal generators for empirical and population GANs respectively. Then,
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\begin{array} { r } { d _ { \mathcal { G } } \big ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } \big ) : = W _ { 2 } ^ { 2 } \big ( \mathbb { P } _ { Y } , \mathbb { P } _ { \hat { g } ( X ) } \big ) - W _ { 2 } ^ { 2 } \big ( \mathbb { P } _ { Y } , \mathbb { P } _ { g ^ { * } ( X ) } \big ) , } \end{array}
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
is a random variable representing the excess error of $\hat { g }$ over $g ^ { * }$ , evaluated on the true distribution.
|
| 148 |
+
|
| 149 |
+
$d _ { \mathcal { G } } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } )$ can be viewed as a distance between $\mathbb { P } _ { Y }$ and $\mathbb { Q } _ { Y } ^ { n }$ which depends on $\mathcal { G }$ . To have a proper generalization property, one needs to have $d _ { \mathcal { G } } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } ) \to \mathbf { \bar { 0 } }$ quickly as $n \to \infty$ . Before analyzing the convergence rate of $d _ { \mathcal { G } } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } )$ for linear $\mathcal { G }$ , we characterize this rate for an unconstrained $\mathcal { G }$ . For an unconstrained $\mathcal { G }$ , the second term of (10) is zero (this can be seen using a space filling generator function (Cannon $\&$ Thurston, 1987)). Moreover, $\mathbb { P } _ { \hat { g } ( X ) }$ can be arbitrarily close to $\mathbb { Q } _ { Y } ^ { n }$ . Thus, we have
|
| 150 |
+
|
| 151 |
+
Lemma 2 If $\mathcal { G }$ is unconstrained, we have
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
d _ { \mathcal { G } } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } ) = W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } ) ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
which goes to zero with high probability with the rate of $\mathcal { O } ( n ^ { - 2 / d } )$
|
| 158 |
+
|
| 159 |
+
The approach described for the unconstrained $\mathcal { G }$ corresponds to the memorization of the empirical distribution $\mathbb { Q } _ { Y } ^ { n }$ using the trained model. Note that one can write
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
n ^ { - \frac { 2 } { d } } = 2 ^ { - \frac { 2 \log ( n ) } { d } } .
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
Thus, to have a small $W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } )$ , the number of samples $n$ should be exponentially large in $d$ (Canas & Rosasco, 2012). It is possible that for some distributions $\mathbb { P } _ { Y }$ , the convergence rate of $W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } )$ is much faster than $\mathcal { O } ( n ^ { - 2 / d } )$ . For example, (Weed & Bach, 2017) shows that if $\mathbb { P } _ { Y }$ is clusterable (i.e., $Y$ lies in a fixed number of separate balls with fixed radii), then the convergence of $W _ { 2 } ^ { 2 } ( { \mathbb P } _ { Y } , { \mathbb Q } _ { Y } ^ { n } )$ is fast. However, even in that case, one optimal strategy would be to memorize observed samples, which does not capture what GANs do.
|
| 166 |
+
|
| 167 |
+
In supervised learning, constraining the predictor to be from a small family improves generalization. A natural question is whether constraining the family of generator functions $\mathcal { G }$ can improve the generalization of GANs. In the LQG setting, we are constraining the generators to be linear. To simplify calculations, we assume that $Y \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } _ { d } )$ and $d = k$ . Under these assumptions, the GAN optimization (8) can be re-written as
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\operatorname* { m i n } _ { \mu , \mathbf { K } } W _ { 2 } ^ { 2 } ( \mathbb { Q } _ { Y } ^ { n } , \mathcal { N } \left( \mu , \mathbf { K } \right) ) ,
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
where $\mathbf { K }$ is the covariance matrix with the eigen decomposition $\mathbf { K } = \mathbf { U } \pmb { \Sigma } \mathbf { U } ^ { t }$ . The optimal population solution of this optimization is $\boldsymbol { \mu } _ { p o p } ^ { * } = \mathbf { 0 }$ and $\mathbf { K } _ { p o p } ^ { * } = \mathbf { I }$ , which provides a zero Wasserstein loss.
|
| 174 |
+
|
| 175 |
+
Theorem 2 Let $\boldsymbol { \mu } _ { n } ^ { * }$ and $\mathbf { K } _ { n } ^ { * }$ be optimal solutions for optimization (12). Then, $\boldsymbol { \mu } _ { n } ^ { * } \to \mathbf { 0 }$ with the rate of $\mathcal { O } ( d / n )$ and $T r ( \Sigma _ { n } ^ { * } ) \to d$ with the rate of $\mathcal { O } ( n ^ { - 2 / d } )$ .
|
| 176 |
+
|
| 177 |
+
# Proof 3 See Appendix B.4.
|
| 178 |
+
|
| 179 |
+
It turns out that $\operatorname { T r } ( \Sigma _ { n } ^ { * } )$ , which is a random variable, is strongly concentrated around its expectation. Thus, Theorem 2 indicates that there is a significant bias in GAN’s estimation of the true distribution which translates to the slow convergence of the generalization error. Note that in the Wasserstein space, the empirical distribution $\mathbb { Q } _ { Y } ^ { n }$ and the population distribution $\mathbb { P } _ { Y }$ are far from each other (the distance between them concentrates around $n ^ { - 2 / d }$ (Canas & Rosasco, 2012)). Thus, if there exists another Gaussian distribution within the sphere around $\mathbb { Q } _ { Y } ^ { n }$ with the radius of $n ^ { - 2 / d }$ , the Wasserstein-based learning method will converge to the wrong Gaussian distribution. This phenomenon causes a bias in estimating the true distribution.
|
| 180 |
+
|
| 181 |
+
Theorem 2 considers the regime where $k = d$ . In practice, the dimension of the generated distribution is often much smaller than that of the true one (i.e., $k \ll d ,$ ). In this case, GAN’s convergence rate can be increased from $\mathcal { O } ( n ^ { - 2 / d } )$ to $\mathcal { O } ( n ^ { - 2 / k } )$ . However, this faster convergence comes at the expense of the increased bias term of the excess error (the second term of (10)). The trade-off is favorable if $Y$ is near low rank. Nevertheless even the convergence rate of $\mathcal { O } ( n ^ { - 2 / k } )$ is still slow. In practice, however, GANs have demonstrated impressive performance. In the next section, we show that by suitably constraining the GAN optimization, the convergence rate can be improved exponentially.
|
| 182 |
+
|
| 183 |
+
# 4 GANS WITH CONSTRAINED DISCRIMINATORS
|
| 184 |
+
|
| 185 |
+
In this section, first we review the min-max (dual) formulation of WGAN (Arjovsky et al., 2017). Then, we characterize the min-max formulation of the quadratic GAN. Finally, we show that a properly constrained quadratic GAN achieves the empirical PCA solution, which converges to the population optimal with an exponentially faster rate of convergence compared to the case when the discriminator is unconstrained.
|
| 186 |
+
|
| 187 |
+
Using the Kantorovich duality (Villani, 2008), the first-order Wasserstein distance $W _ { 1 } ( \mathbb { P } _ { Y } , \mathbb { P } _ { g ( X ) } )$ can be written as the following optimization (Arjovsky et al., 2017):
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
W _ { 1 } \big ( \mathbb { P } _ { Y } , \mathbb { P } _ { g ( X ) } \big ) = \operatorname* { s u p } _ { \psi ( \cdot ) : 1 - \mathrm { L i p } } \mathbb { E } \left[ \psi ( Y ) - \psi ( \hat { Y } ) \right] ,
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
where the function $\psi ( . )$ is restricted to be 1-Lipschitz. This dual formulation of $W _ { 1 }$ is then used in optimization (1) to implement WGAN in a min-max architecture similar to the one of the original GAN (Figure 2). In this architecture, $\psi ( . )$ is implemented by deep neural networks.
|
| 194 |
+
|
| 195 |
+
In a similar way, one can write the second-order Wasserstein distance $W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { P } _ { g ( X ) } )$ as the following optimization (Villani, 2008):
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { P } _ { g ( X ) } ) = \mathbb { E } [ \| Y \| ^ { 2 } ] + \mathbb { E } [ \| g ( X ) \| ^ { 2 } ] + 2 \operatorname* { s u p } _ { \psi ( \cdot ) : \mathrm { c o n v e x } } - \mathbb { E } \left[ \psi ( Y ) \right] - \mathbb { E } \left[ \psi ^ { * } ( g ( X ) ) \right] ,
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
where $\psi ^ { * } ( \hat { \mathbf { y } } ) : = \operatorname* { s u p } _ { \mathbf { v } } \left( \mathbf { v } ^ { t } \hat { \mathbf { y } } - \psi ( \mathbf { v } ) \right)$ is the convex-conjugate of the function $\psi ( . )$ . Similarly, this dual formulation of $W _ { 2 } ^ { 2 }$ can be used to implement the quadratic GAN optimization (7) in a min-max architecture which can be interpreted as a game between optimizing two functions $g ( . )$ and $\psi ( . )$ (Figure 2).
|
| 202 |
+
|
| 203 |
+
The following lemma characterizes the optimal solution of optimization (14) (Chernozhukov et al., 2017):
|
| 204 |
+
|
| 205 |
+
Lemma 3 Let $\mathbb { P } _ { Y }$ be absolutely continuous whose support contained in a convex set in $\mathbb { R } ^ { d }$ . For a fixed $g ( . ) \in { \mathcal { G } }$ , let $\psi ^ { o p t }$ be the optimal solution of optimization (14). This solution is unique. Moreover, we have
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
\bigtriangledown { \psi } ^ { o p t } ( Y ) \overset { d i s t } { = } g ( X ) ,
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
$\stackrel { u v } { = }$ means matching distributions.
|
| 212 |
+
|
| 213 |
+
In the LQG setup, since $g ( X )$ is Gaussian, $\nabla \psi ^ { o p t }$ is a linear function. Thus, without loss of generality, $\psi ( . )$ in the discriminator optimization can be constrained to $\psi ( \mathbf { y } ) = \mathbf { y } ^ { t } \mathbf { A } \mathbf { y } / 2$ where $\mathbf { A }$ is positive semidefinite. Therefore, we have
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
\begin{array} { r l } & { W _ { 2 } ^ { 2 } \left( \mathbb { P } _ { Y } , \mathbb { P } _ { g ( X ) } \right) = \mathbb { E } [ \| Y \| ^ { 2 } ] + \mathbb { E } [ \| g ( X ) \| ^ { 2 } ] + 2 \operatorname* { s u p } _ { \psi ( \mathbf { y } ) = \mathbf { y } ^ { t } \ A \mathbf { y } / 2 , \mathbf { A } \geq 0 } \mathrm { ~ - ~ } \mathbb { E } \left[ \psi ( Y ) \right] - \mathbb { E } \left[ \psi ^ { * } ( g ( X ) ) \right] } \\ & { \qquad ( 1 6 } \\ & { \qquad = \mathrm { T r } ( \mathbf { K } _ { Y } ) + \mathrm { T r } ( \mathbf { K } _ { g ( X ) } ) + \underset { \mathbf { A } \succeq 0 } { \operatorname* { s u p } } \mathrm { ~ - ~ } \mathrm { T r } ( \mathbf { A } \mathbf { K } _ { Y } ) - \mathrm { T r } ( \mathbf { A } ^ { \dag } \mathbf { K } _ { g ( X ) } ) , } \end{array}
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
where $\mathbf { A } ^ { \dagger }$ is the pseudo inverse of the matrix A.
|
| 220 |
+
|
| 221 |
+
Now let $\tilde { Y }$ be a random variable whose distribution matches the empirical distribution $\mathbb { Q } _ { Y } ^ { n }$ . Similarly we can write:
|
| 222 |
+
|
| 223 |
+
$$
|
| 224 |
+
W _ { 2 } ^ { 2 } ( \mathbb { P } _ { \bar { Y } } , \mathbb { P } _ { g ( X ) } ) = \mathbb { E } [ \| \tilde { Y } \| ^ { 2 } ] + \mathbb { E } [ \| g ( X ) \| ^ { 2 } ] + 2 \operatorname* { s u p } _ { \psi ( \cdot ) \cdot \mathrm { c o n v e x } } - \mathbb { E } \left[ \psi ( \tilde { Y } ) \right] - \mathbb { E } \left[ \psi ^ { * } ( g ( X ) ) \right] .
|
| 225 |
+
$$
|
| 226 |
+
|
| 227 |
+
For $W _ { 2 } ^ { 2 } ( \mathbb { P } _ { \tilde { Y } } , \mathbb { P } _ { g ( X ) } )$ , however, we cannot restrict $\psi$ to convex quadratic functions because $\tilde { Y }$ is a discrete variable while $g ( X )$ is Gaussian. Thus, Lemma 3 implies that $\nabla \psi ^ { o p t }$ for (17) cannot be linear. Nevertheless, by constraining to quadratic discriminators, we obtain a lower bound:
|
| 228 |
+
|
| 229 |
+
$$
|
| 230 |
+
\begin{array} { r l } & { W _ { 2 } ^ { 2 } ( \mathbb { P } _ { \tilde { Y } } , \mathbb { P } _ { g ( X ) } ) > \mathbb { E } [ \| \tilde { Y } \| ^ { 2 } ] + \mathbb { E } [ \| g ( X ) \| ^ { 2 } ] + 2 \underset { \psi ( \mathbf { y } ) = \mathbf { y } ^ { \prime } \mathbb { A } \mathbf { y } / 2 , \mathbf { A } \geq 0 } { \operatorname* { s u p } } - \mathbb { E } \left[ \psi ( \tilde { Y } ) \right] - \mathbb { E } \left[ \psi ^ { * } ( g ( X ) ) \right] } \\ & { \qquad ( 1 8 \mathbf { \psi } ) } \\ & { \qquad = \mathrm { T r } ( \hat { \mathbf { K } } _ { Y } ) + \mathrm { T r } ( \mathbf { K } _ { g ( X ) } ) + \underset { \mathbf { A } \geq 0 } { \operatorname* { s u p } } - \mathrm { T r } ( \mathbf { A } \hat { \mathbf { K } } _ { Y } ) - \mathrm { T r } ( \mathbf { A } ^ { \dagger } \mathbf { K } _ { g ( X ) } ) } \\ & { \qquad = W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Z } , \mathbb { P } _ { g ( X ) } ) , } \end{array}
|
| 231 |
+
$$
|
| 232 |
+
|
| 233 |
+
where $\hat { \bf K } _ { Y } = \mathbb { E } [ \tilde { Y } \tilde { Y } ^ { t } ]$ (the empirical covariance matrix) and $Z \sim \mathcal { N } ( \mathbf { 0 } , \hat { \mathbf { K } } _ { Y } )$ 2. Therefore, the empirical constrained quadratic GAN solves the following optimization:
|
| 234 |
+
|
| 235 |
+
$$
|
| 236 |
+
\operatorname* { i n f } _ { g ( . ) \in \mathcal { G } } W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Z } , \mathbb { P } _ { g ( X ) } ) .
|
| 237 |
+
$$
|
| 238 |
+
|
| 239 |
+
Using Theorem 1, the optimal $g ( X )$ to this problem is the empirical PCA solution, i.e. keeping the top $k$ principal components of the empirical covariance matrix.
|
| 240 |
+
|
| 241 |
+
Theorem 3 Under the LQG setup, the solution of the empirical constrained quadratic GAN optimization is equivalent to the empirical $P C A$ .
|
| 242 |
+
|
| 243 |
+
Consider the case where $d = k$ (the case $k < d$ is similar). The second term in the generalization distance $d _ { \mathcal { G } } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } )$ (10) is zero. Therefore, we have
|
| 244 |
+
|
| 245 |
+
$$
|
| 246 |
+
d _ { \mathcal { G } } \left( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } \right) = W _ { 2 } ^ { 2 } \left( \mathbb { P } _ { Y } , \mathbb { P } _ { Z } \right) = W _ { 2 } ^ { 2 } \left( \mathcal { N } ( 0 , \mathbf { K } _ { Y } ) , \mathcal { N } ( 0 , \hat { \mathbf { K } } _ { Y } ) \right) .
|
| 247 |
+
$$
|
| 248 |
+
|
| 249 |
+
The $W _ { 2 } ^ { 2 }$ distance between two Gaussians depends only on the covariance matrices. More specifically:
|
| 250 |
+
|
| 251 |
+
$$
|
| 252 |
+
W _ { 2 } ^ { 2 } \left( \mathcal { N } ( 0 , \mathbf { K } _ { Y } ) , \mathcal { N } ( 0 , \hat { \mathbf { K } } _ { Y } ) \right) = \mathrm { T r } ( \mathbf { K } _ { Y } ) + \mathrm { T r } ( \hat { \mathbf { K } } _ { Y } ) - 2 \mathrm { T r } \left( \left( \mathbf { K } _ { Y } ^ { 1 / 2 } \hat { \mathbf { K } } _ { Y } \mathbf { K } _ { Y } ^ { 1 / 2 } \right) ^ { 1 / 2 } \right) .
|
| 253 |
+
$$
|
| 254 |
+
|
| 255 |
+
Hence, the convergence of this quantity only depends on the convergence of the empirical covariance to the population covariance, together with smoothness property of this function of the covariance matrices. The convergence has been established to be at a quick rate of $\tilde { \mathcal { O } } ( \sqrt { d / n } )$ (Rippl et al., 2016).
|
| 256 |
+
|
| 257 |
+
Finally, note that if one has a finite number of $X$ samples (replacing $\mathbb { P } _ { g ( X ) }$ with $\mathbb { Q } _ { g ( X ) } )$ , the constrained quadratic GAN would still have a fast convergence rate because only the empirical covariance matrix of $g ( X )$ plays a role in its optimization which converges quickly to the population covariance matrix.
|
| 258 |
+
|
| 259 |
+
# 5 EXPERIMENTAL RESULTS
|
| 260 |
+
|
| 261 |
+
For experiments, we generate $n$ i.i.d. samples from $\mathbb { P } _ { Y } \sim \mathcal { N } \left( \mathbf { 0 } , \mathbf { I } _ { d } \right)$ , represented as $Q _ { Y } ^ { n }$ . We then fit a $d$ dimensional Gaussian distribution $\mathcal { N } ( \boldsymbol { \mu } , \mathbf { K } )$ to $\mathbb { Q } _ { Y } ^ { n }$ using two methods: Maximum Likelihood (ML) estimation, which computes the sample mean and the empirical covariance; and WGAN (Arjovsky et al., 2017) with an affine generator function. Note that according to Theorem 3, ML is equivalent to the constrained quadratic GAN (19). Moreover, note that the WGAN implementation uses $W _ { 1 }$ and not $W _ { 2 }$ in its optimization. Although analyzing GANs with $W _ { 2 }$ is more tractable than that of $W _ { 1 }$ , in practice we do not expect a significant difference between their performance. Considering this and owing to the lack of an implementation of GANs with $W _ { 2 }$ , we perform numerical experiments using the WGAN implementation. Details of the experiments can be found in Appendix A.
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 3: Generalization errors of constrained quadratic GAN (ML) and WGAN under the LQG setup.
|
| 265 |
+
|
| 266 |
+
Let $\hat { \mu }$ and $\hat { \bf K }$ be the estimated mean and the covariance. For evaluation, we compute
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\| \hat { \boldsymbol \mu } \| ^ { 2 } + \| \mathbf { I } - \hat { \mathbf { K } } ^ { 1 / 2 } \| _ { F } ^ { 2 } ,
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
which is the $W _ { 2 } ^ { 2 }$ distance between $\mathcal { N } \left( \mathbf { 0 } , \mathbf { I } _ { d } \right)$ and $\mathcal { N } \left( \hat { \mu } , \hat { \mathbf { K } } \right)$ (see Lemma 4 in Appendix B).
|
| 273 |
+
|
| 274 |
+
Figure 3 demonstrates the estimation error of the ML (constrained quadratic GAN) and WGAN methods for $d = 5$ and $d = 1 0$ and in different sample sizes. These figures are consistent with Theorem 2 and results of Section 3.2 which suggest that GAN’s convergence can be slow owing to a bias in its optimal empirical solution with respect to the population one. Moreover, this figure shows that the convergence of the constrained quadratic GAN (ML) is fast. Finally, in our experimental results of Figure 3, one should take into the consideration practical issues of the WGAN implementation such as the use of the stochastic gradient descent, convergence to bad locals, etc.
|
| 275 |
+
|
| 276 |
+
# 6 DISCUSSIONS
|
| 277 |
+
|
| 278 |
+
From a broader perspective, the problem we addressed in this paper is that of finding a good generative model for data coming from a Gaussian ground-truth, $Y \sim { \mathcal { N } } ( \mu , \mathbf { K } )$ . This is an age-old problem in statistics, and the baseline solution is using maximum likelihood estimation: one uses the data to estimate the mean and covariance matrix of the Gaussian distribution, i.e. the empirical mean $\hat { \mu }$ and empirical covariance matrix $\hat { \bf K }$ , and obtain a generative model $\hat { Y } \sim \mathcal { N } ( \hat { \mu } , \hat { \mathbf { K } } )$ . And when there is a desire to do dimensionality reduction, one can have a low-rank generative Gaussian model retaining the top $k$ principal components of $\hat { \bf K }$ . This is the empirical PCA solution.
|
| 279 |
+
|
| 280 |
+
What we have shown in this paper is that there is a natural GAN architecture that can accomplish exactly these tasks (Figure 4).
|
| 281 |
+
|
| 282 |
+
While this is certainly a complicated way of performing maximum likelihood Gaussian estimation and PCA, we believe the result is interesting in several ways. First, it is not at all obvious that there is a natural GAN architecture that can accomplish this task. Since Gaussian modeling is a basic task, this is a good sanity check on GANs. Second, arriving at this GAN architecture requires us to make several advances in our understanding of GANs. We needed to find a general way to specify the loss function for GANs, and then specialize to the quadratic loss function for the Gaussian problem at hand. This led to the use of the second-order Wasserstein distance for the generator optimization, and to a general GAN architecture from the dual formulation of this optimization. We then needed to find a proper way to constrain the class of generators and the class of discriminators in a balanced way to achieve fast generalization. Indeed our goal was not to recover the maximum likelihood solution but to overcome the slow generalization when there are no constraints on the generator and the discriminator. That the final architecture with balanced generators and discriminators is also the maximum likelihood solution gives this story a satisfactory ending.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure 4: The GAN architecture that achieves maximum likelihood estimation for the zero-mean Gaussian model: a linear generator and a quadratic discriminator. On the training data, the generator minimizes over $G$ and the adversary maximizes over $A$ .
|
| 286 |
+
|
| 287 |
+
# REFERENCES
|
| 288 |
+
|
| 289 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 290 |
+
Sanjeev Arora, Rong Ge, Yingyu Liang, Tengyu Ma, and Yi Zhang. Generalization and equilibrium in generative adversarial nets (gans). arXiv preprint arXiv:1703.00573, 2017.
|
| 291 |
+
David Berthelot, Tom Schumm, and Luke Metz. Began: Boundary equilibrium generative adversarial networks. arXiv preprint arXiv:1703.10717, 2017.
|
| 292 |
+
Guillermo Canas and Lorenzo Rosasco. Learning probability measures with respect to optimal transport metrics. In Advances in Neural Information Processing Systems, pp. 2492–2500, 2012.
|
| 293 |
+
James W Cannon and William P Thurston. Group invariant peano curves. 1987.
|
| 294 |
+
Victor Chernozhukov, Alfred Galichon, Marc Hallin, Marc Henry, et al. Monge–kantorovich depth, quantiles, ranks and signs. The Annals of Statistics, 45(1):223–256, 2017.
|
| 295 |
+
Gintare Karolina Dziugaite, Daniel M Roy, and Zoubin Ghahramani. Training generative neural networks via maximum mean discrepancy optimization. arXiv preprint arXiv:1505.03906, 2015.
|
| 296 |
+
Clark R Givens, Rae Michael Shortt, et al. A class of wasserstein metrics for probability distributions. The Michigan Mathematical Journal, 31(2):231–240, 1984.
|
| 297 |
+
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.
|
| 298 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017.
|
| 299 |
+
Xin Guo, Johnny Hong, Tianyi Lin, and Nan Yang. Relaxed wasserstein with applications to gans. arXiv preprint arXiv:1705.07164, 2017.
|
| 300 |
+
Ian Jolliffe. Principal Component Analysis. Wiley Online Library, 2002.
|
| 301 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro ´ Acosta, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. arXiv preprint arXiv:1609.04802, 2016.
|
| 302 |
+
|
| 303 |
+
Yujia Li, Kevin Swersky, and Rich Zemel. Generative moment matching networks. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1718–1727, 2015.
|
| 304 |
+
|
| 305 |
+
Shuang Liu, Olivier Bousquet, and Kamalika Chaudhuri. Approximation and convergence properties of generative adversarial learning. arXiv preprint arXiv:1705.08991, 2017.
|
| 306 |
+
|
| 307 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, and Zhen Wang. Multi-class generative adversarial networks with the l2 loss function. arXiv preprint arXiv:1611.04076, 2016.
|
| 308 |
+
|
| 309 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, pp. 271–279, 2016.
|
| 310 |
+
|
| 311 |
+
Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. arXiv preprint arXiv:1605.05396, 2016.
|
| 312 |
+
|
| 313 |
+
Thomas Rippl, Axel Munk, and Anja Sturm. Limit laws of the empirical wasserstein distance: Gaussian distributions. Journal of Multivariate Analysis, 151:90–109, 2016.
|
| 314 |
+
|
| 315 |
+
Cedric Villani. ´ Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008.
|
| 316 |
+
|
| 317 |
+
Jonathan Weed and Francis Bach. Sharp asymptotic and finite-sample rates of convergence of empirical measures in wasserstein distance. arXiv preprint arXiv:1707.00087, 2017.
|
| 318 |
+
|
| 319 |
+
# Appendix
|
| 320 |
+
|
| 321 |
+
# A DETAILS OF EXPERIMENTS
|
| 322 |
+
|
| 323 |
+
The WGAN is implemented in pytorch. Denote fully connected layer with the input dimension $d _ { i n }$ and the output dimension $d _ { o u t }$ as $F C ( d _ { i n } , d _ { o u t } )$ . The generator can be represented as $F C ( d , d )$ ; and the discriminator can be represented as $F C ( d , n _ { f } ) - \bar { R e } L U - F C ( n _ { f } , n _ { f } ) - R e L U - F C ( n _ { f } , n _ { f } ) -$ $R e L U - F C ( n _ { f } , 1 )$ . The model is trained $1 0 0 \mathrm { k }$ iterations with batch size 128 with Adam optimizer. The learning rate is set to $2 \times 1 0 ^ { - 4 }$ . As for hyper parameters, $n _ { f }$ is set to 128, the ratio of iterations between discriminator and generator is set to 5, and the weight clipping threshold is set to ${ } _ { - 0 . 0 2 }$ and 0.02. Both ML and WGAN are repeated 10 times for each setting, and the mean and standard deviation is calculated and plotted $( 6 8 . { \bar { 3 } } \%$ confidence interval).
|
| 324 |
+
|
| 325 |
+
# B PROOFS
|
| 326 |
+
|
| 327 |
+
# B.1 NOTATION AND PRELIMINARY LEMMAS
|
| 328 |
+
|
| 329 |
+
For matrices we use bold-faced upper case letters, for vectors we use bold-faced lower case letters, and for scalars we use regular lower case letters. For example, $\mathbf { X }$ represents a matrix, $\mathbf { x }$ represents a vector, and $x$ represents a scalar number. ${ \mathbf I } _ { n }$ is the identity matrix of size $n \times n$ . ${ \bf 1 } _ { n _ { 1 } , n _ { 2 } }$ is the all one matrix of size $n _ { 1 } \times n _ { 2 }$ . When no confusion arises, we drop the subscripts. $\mathbf { 1 } \{ x = y \}$ is the indicator function which is equal to one if $x = y$ , otherwise it is zero. $\operatorname { T r } ( \mathbf { X } )$ and $\mathbf { X } ^ { t }$ represent the trace and the transpose of the matrix $\mathbf { X }$ , respectively. $\| \mathbf { x } \| _ { 2 } = \mathbf { x } ^ { t } \mathbf { x }$ is the second norm of the vector $\mathbf { x }$ . When no confusion arises, we drop the subscript. $\| \mathbf { X } \|$ is the operator (spectral) norm of the matrix $\mathbf { X }$ . $< \mathbf { x } , \mathbf { y } >$ is the inner product between vectors $\mathbf { x }$ and y. $\dot { \bf A } ^ { \dagger }$ is the pseudo inverse of the matrix A. The eigen decomposition of the matrix $\mathbf { A } \in \mathbb { R } ^ { n \times n }$ is denoted by $\begin{array} { r } { \bar { \mathbf { A } } = \sum _ { i = 1 } ^ { n } \lambda _ { i } ( \mathbf { A } ) \mathbf { u } _ { i } ( \mathbf { A } ) \mathbf { u } _ { i } ( \mathbf { A } ) ^ { t } } \end{array}$ , where $\lambda _ { i } ( \mathbf { A } )$ is the $i$ -th largest eigenvalue of the matrix $\mathbf { A }$ corresponding to the eigenvector $\mathbf { u } _ { i } ( \mathbf { A } )$ . We have $\lambda _ { 1 } ( \mathbf { A } ) \geq \lambda _ { 2 } ( \mathbf { A } ) \geq \cdots .$ $\mathcal { N } ( \boldsymbol { \mu } , \mathbf { K } )$ is the Gaussian distribution with mean $\mu$ and the covariance $\mathbf { K }$ . ${ \mathrm { K L } } ( \mathbb { P } _ { X } , \mathbb { P } _ { Y } )$ is the Kullback Leibler divergence between two distributions $\mathbb { P } _ { X }$ and $\mathbb { P } _ { Y }$ . $\tilde { \mathcal { O } } ( d )$ is the same as ${ \mathcal { O } } ( d \log ( d ) )$ .
|
| 330 |
+
|
| 331 |
+
Lemma 4 Let $Y \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { K } _ { Y } )$ and $\hat { Y } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { K } _ { \hat { Y } } )$ . Then,
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { r } { W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { P } _ { \hat { Y } } ) = T r ( \mathbf { K } _ { Y } ) + T r ( \mathbf { K } _ { \hat { Y } } ) - 2 T r \left( \left( \mathbf { K } _ { \hat { Y } } ^ { 1 / 2 } \mathbf { K } _ { Y } \mathbf { K } _ { \hat { Y } } ^ { 1 / 2 } \right) ^ { 1 / 2 } \right) } \\ { = T r ( \mathbf { K } _ { Y } ) + T r ( \mathbf { K } _ { \hat { Y } } ) - 2 T r \left( \left( \mathbf { K } _ { Y } ^ { 1 / 2 } \mathbf { K } _ { \hat { Y } } \mathbf { K } _ { Y } ^ { 1 / 2 } \right) ^ { 1 / 2 } \right) . } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
Proof 4 See reference (Givens et al., 1984).
|
| 338 |
+
|
| 339 |
+
# B.2 PROOF OF LEMMA 1
|
| 340 |
+
|
| 341 |
+
Let $Y = Y _ { S ^ { \prime } } + Y _ { S }$ where $Y _ { S }$ represents the projection of $Y$ onto the subspace $s$ . Since
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\mathbb { E } \left[ \Vert Y - \hat { Y } \Vert ^ { 2 } \right] = \mathbb { E } \left[ \Vert Y _ { S ^ { \prime } } \Vert ^ { 2 } \right] + \mathbb { E } \left[ \Vert Y _ { S } - \hat { Y } \Vert ^ { 2 } \right]
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
choosing $\hat { Y } = Y _ { S }$ achieves the minimum of optimization (9).
|
| 348 |
+
|
| 349 |
+
# B.3 PROOF OF THEOREM 1
|
| 350 |
+
|
| 351 |
+
Let $s$ be a fixed subspace of rank $k$ where $\hat { Y }$ lies on. According to Lemma 1, if $\hat { Y }$ is unconstrained, the optimal $\hat { Y } ^ { * }$ is the projection of $Y$ onto $s$ (i.e., $\hat { Y } ^ { * } = Y _ { S } ,$ ). Moreover, since $Y$ is Gaussian, $\hat { Y }$ is also Gaussian. Therefore, there exists a linear $g ( . )$ such that $\mathbb { P } _ { \hat { Y } ^ { * } } = \mathbb { P } _ { g ( X ) }$ where $X \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ . Thus, the problem simplifies to choosing a subspace where $\mathbb { E } \left[ \lVert Y _ { S } \rVert ^ { 2 } \right]$ is maximized, which is the same as the PCA optimization.
|
| 352 |
+
|
| 353 |
+
# B.4 PROOF OF THEOREM 2
|
| 354 |
+
|
| 355 |
+
Let $\mathbf { y } _ { 1 } , . . . , \mathbf { y } _ { n }$ be $n$ i.i.d. samples of $\mathbb { P } _ { Y }$ . Let $\hat { \mu }$ be the sample mean. Since $\mathbb { P } _ { Y }$ is absolutely continuous, the optimal $W _ { 2 }$ coupling between $\mathbb { Q } _ { Y } ^ { n }$ and $\mathbb { P } _ { Y }$ is deterministic (Villani, 2008). Thus, every point $\mathbf { y } _ { i }$ is coupled with an optimal transport vornoi region with the centroid ${ \bf c } _ { y _ { i } } ^ { ( \mu , { \bf K } ) }$ . Therefore, we
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\begin{array} { l } { { \displaystyle W _ { 2 } ^ { 2 } ( N ( \mu , { \bf K } ) , \mathbb { Q } _ { Y } ^ { n } ) } } \\ { { \displaystyle = \| \mu \| ^ { 2 } + { \bf T r } ( { \bf \bar { \bf Z } } ) + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \| { \bf y } _ { i } \| ^ { 2 } - \frac { 2 } { N } \sum _ { i = 1 } ^ { N } { \bf y } _ { i } ^ { t } { \bf c } _ { y _ { i } } ^ { ( \mu , { \bf K } ) } } } \\ { { \displaystyle = \| \mu \| ^ { 2 } + { \bf T r } ( { \bf \bar { \bf Z } } ) + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \| { \bf y } _ { i } \| ^ { 2 } - \frac { 2 } { N } \sum _ { i = 1 } ^ { N } { \bf y } _ { i } ^ { t } \left( { \bf U } { \bf \Sigma } ^ { 1 / 2 } { \bf U } ^ { t } { \bf c } _ { y _ { i } } ^ { ( 0 , { \bf I } ) } + \mu \right) } } \\ { { \displaystyle = \| \mu \| ^ { 2 } - 2 \mu \hat { \mu } + { \bf T r } ( { \bf \bar { \bf Z } } ) + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \| { \bf y } _ { i } \| ^ { 2 } - 2 { \bf T r } ( { \bf U } { \bf \Sigma } ^ { 1 / 2 } { \bf U } ^ { t } { \bf A } ) } } \end{array}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
where
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\mathbf { A } : = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathbf { c } _ { y _ { i } } ^ { ( \mathbf { 0 } , \mathbf { I } ) } \mathbf { y } _ { i } ^ { t } .
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
The first step in (25) follows from the definition of $W _ { 2 }$ , the second step follows from the optimal coupling between $\mathcal { N } ( \boldsymbol { \mu } , \mathbf { K } )$ and $\mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ , and the third step follows from the matrix trace equalities.
|
| 368 |
+
|
| 369 |
+
Therefore,
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\nabla _ { \mu } W _ { 2 } ^ { 2 } ( \mathcal { N } \left( \mu , \Sigma \right) , \mathbb { Q } _ { Y } ^ { n } ) = 2 \mu - 2 \hat { \mu } ,
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
which leads to $\boldsymbol { \mu } _ { n } ^ { * } = \boldsymbol { \hat { \mu } }$ . Moreover, each component of the sample mean is distributed according to $\mathcal { N } ( \mathbf { 0 } , 1 / n )$ . Thus, $\| \mu _ { N } ^ { * } \| ^ { 2 } \sim \chi _ { d } ^ { 2 } / n$ which goes to zero with the rate of $\tilde { \mathcal { O } } ( d / n )$ .
|
| 376 |
+
|
| 377 |
+
Let $\sigma _ { i } ^ { 2 }$ be the $i$ -th diagonal element of $\pmb { \Sigma }$ . Moreover, define $\mathbf { B } = \mathbf { U } ^ { t } \mathbf { A } \mathbf { U }$ . Therefore, we have
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\bigtriangledown _ { \sigma _ { i } } W _ { 2 } ^ { 2 } ( \mathcal { N } \left( \mu , \Sigma \right) , \mathbb { Q } _ { Y } ^ { n } ) = 2 \sigma _ { i } - 2 b _ { i , i } ,
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
where $b _ { i , i }$ is the $i$ -th diagonal element of the matrix $\mathbf { B }$ . Thus, $\sigma _ { i } ^ { * } = b _ { i , i }$ and $\operatorname { T r } ( \Sigma ^ { * } ) = \operatorname { T r } ( \mathbf { B } ) =$ $\operatorname { T r } ( \mathbf { A } )$ .
|
| 384 |
+
|
| 385 |
+
Furthermore, we have
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
W _ { 2 } ^ { 2 } ( \mathbb { P } _ { Y } , \mathbb { Q } _ { Y } ^ { n } ) = d + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \| { \bf y } _ { i } \| ^ { 2 } - 2 \mathrm { T r } ( { \bf A } ) ,
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
which goes to zero with the rate of $\mathcal { O } ( n ^ { - 2 / d } )$ (Canas & Rosasco, 2012). Since $\begin{array} { r } { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \| \mathbf { y } _ { i } \| ^ { 2 } } \end{array}$ goes to $d$ with the rate of $\mathcal { O } ( \sqrt { d / n } )$ (because it has a $\chi$ -squared distribution), $\operatorname { T r } ( \mathbf { A } )$ goes to $d$ with a rate of $\mathcal { O } ( n ^ { - 2 / d } )$ . Combining this result with $\operatorname { T r } ( \Sigma ^ { * } ) = \operatorname { T r } ( \mathbf { A } )$ completes the proof.
|
md/train/r1fYuytex/r1fYuytex.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPARSELY-CONNECTED NEURAL NETWORKS: TOWARDS EFFICIENT VLSI IMPLEMENTATION OF DEEP NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Arash Ardakani, Carlo Condo and Warren J. Gross
|
| 4 |
+
Department of Electrical and Computer Engineering
|
| 5 |
+
McGill University, Montreal, Qu ´ ebec, Canada ´
|
| 6 |
+
Email: arash.ardakani $@$ mail.mcgill.ca, carlo.condo $@$ mail.mcgill.ca, warren.gross@mcgill.ca
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Recently deep neural networks have received considerable attention due to their ability to extract and represent high-level abstractions in data sets. Deep neural networks such as fully-connected and convolutional neural networks have shown excellent performance on a wide range of recognition and classification tasks. However, their hardware implementations currently suffer from large silicon area and high power consumption due to the their high degree of complexity. The power/energy consumption of neural networks is dominated by memory accesses, the majority of which occur in fully-connected networks. In fact, they contain most of the deep neural network parameters. In this paper, we propose sparsely-connected networks, by showing that the number of connections in fullyconnected networks can be reduced by up to $90 \%$ while improving the accuracy performance on three popular datasets (MNIST, CIFAR10 and SVHN). We then propose an efficient hardware architecture based on linear-feedback shift registers to reduce the memory requirements of the proposed sparsely-connected networks. The proposed architecture can save up to $90 \%$ of memory compared to the conventional implementations of fully-connected neural networks. Moreover, implementation results show up to $84 \%$ reduction in the energy consumption of a single neuron of the proposed sparsely-connected networks compared to a single neuron of fully-connected neural networks.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Deep neural networks (DNNs) have shown remarkable performance in extracting and representing high-level abstractions in complex data (Lecun et al. (2015)). DNNs rely on multiple layers of interconnected neurons and parameters to solve complex tasks, such as image recognition and classification (Krizhevsky et al. (2012)). While they have been proven very effective in said tasks, their hardware implementations still suffer from high memory and power consumption, due to the complexity and size of their models. Therefore, research efforts have been conducted towards more efficient implementations of DNNs (Han et al. (2016)). In the past few years, the parallel nature of DNNs has led to the use of graphical processing units (GPUs) to execute neural networks tasks (Han et al. (2015)). However, their large latency and power consumption have pushed researchers towards application-specific integrated circuits (ASICs) for hardware implementations (Cavigelli et al. (2015)). For instance, in (Han et al. (2016)), it was shown that a DNN implemented with customized hardware can accelerate the classification task by $1 8 9 \times$ and $1 3 \times$ , while saving $2 4 { , } 0 0 0 \times$ and $3 { , } 4 0 0 \times$ energy compared to CPU (Intel i7-5930k) and GPU (GeForce TITAN X), respectively.
|
| 15 |
+
|
| 16 |
+
Convolutional layers in DNNs are used to extract high level abstractions and features of data. In such layers, the connectivity between neurons follows a pattern inspired by the organization of the animal visual cortex. It was shown that the computation in the visual cortex can mathematically be described by a convolution operation (LeCun et al. (1989)). Therefore, each neuron is only connected to a few neurons based on a pattern and a set of weights is shared among all neurons. In contrast, in a fully-connected layer, each neuron is connected to every neuron in the previous and next layers and each connection is associated with a weight. These layers are usually used to learn non-linear combinations of given data. Fig. 1 shows a two-layer fully-connected network. The main computation kernel performs numerous vector-matrix multiplications followed by non-linear functions in each layer. In (Courbariaux & Bengio (2016); Horowitz (2014); Han et al. (2016)), it was shown that the power/energy consumption of DNNs is dominated by memory accesses. Fully-connected layers, which are widely used in recurrent neural networks (RNNs) and adopted in many state-of-the-art neural network architectures (Krizhevsky et al. (2012); Simonyan & Zisserman (2014); Zeiler & Fergus (2013); Szegedy et al. (2015); Lecun et al. (1998)), independently or as a part of convolutional neural networks, contain most of the weights of a DNN. For instance, the first fully-connected layer of VGGNet (Simonyan & Zisserman (2014)), which is composed of 13 convolution layers and three fully-connected layers, contains 100M weights out of a total of 140M. Such large storage requirements in fully-connected networks result in copious power/energy consumption.
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
Figure 1: A two-layer fully-connected neural network
|
| 20 |
+
|
| 21 |
+
To overcome the aforementioned issue, a pruning technique was first introduced in (Han et al. (2015)) to reduce the memory required by DNN architectures for mobile applications. However, it makes use of an additional training stage, while information addresses identifying the pruned connections still need to be stored in a memory. More recently, several works have focused on the binarization and ternarization of the weights of DNNs (Courbariaux & Bengio (2016); Courbariaux et al. (2015); Lin et al. (2015); Kim & Smaragdis (2016)). While these approaches reduce weight quantization and thus the memory width, the number of weights is unchanged.
|
| 22 |
+
|
| 23 |
+
In (Shafiee et al. (2016b)), an alternative deep network connectivity named StochasticNet and inspired from the brain synaptic connection between neurons was explored on low-power CPUs. StochasticNet is formed by randomly removing up to $61 \%$ connections in both fully-connected and convolution layers of DNNs, speeding up the classification task.
|
| 24 |
+
|
| 25 |
+
In (Wen et al. (2016)), a method named structured sparsity learning (SSL) was introduced to regularize the convolutional layers’ structures of DNNs. SSL can learn a structured sparsity of DNNs to efficiently speed up the convolutional computations both on CPU and GPU platforms.
|
| 26 |
+
|
| 27 |
+
In this paper, we propose sparsely-connected networks by randomly removing some of the connections in fully-connected networks. Random connection masks are generated by linear-feedback shift registers (LFSRs), which are also used in the VLSI implementation to disable the connections. Experimental results on three commonly used datasets show that the proposed networks can improve network accuracy while removing up to $90 \%$ of the connections. Additionally, we apply the proposed algorithm on top of the binarizing/ternarizing technique achieving a better misclassification rate than the best binarized/ternarized networks reported in literature. Finally, an efficient very large scale integration (VLSI) hardware architecture of a DNN based on sparsely-connected network is proposed, which saves up to $90 \%$ memory and $84 \%$ energy with respect to the traditional architectures.
|
| 28 |
+
|
| 29 |
+
The rest of the paper is organized as follows. Section 2 briefly introduces DNNs and their hardware implementation challenges, while Section 3 describes the proposed sparsely-connected network and their training algorithm. In Section 4 the experimental results over three datasets are presented and compared to the state of the art. Section 5 portrays the proposed VLSI architecture for the sparselyconnected network, and conclusions are drawn in Section 6.
|
| 30 |
+
|
| 31 |
+
# 2 PRELIMINARIES
|
| 32 |
+
|
| 33 |
+
# 2.1 DEEP NEURAL NETWORKS
|
| 34 |
+
|
| 35 |
+
DNNs are constructed using multiple layers of neurons between the input and output layers. These are usually referred to as hidden layers. They are used in many current image and speech applications to perform complex tasks as recognition or classification. DNNs are trained through an initial phase, called the learning stage, that uses data to prepare the DNN for the task that will follow in the inference stage. Two subcategories of DNNs which are widely used in detection and recognition tasks are convolutional neural networks (CNNs) and RNNs (Han et al. (2016)). Due to parameter reuse in convolutional layers, they are well-studied and can be efficiently implemented with customized hardware platforms (Chen et al. (2016); Shafiee et al. (2016a); Chen et al. (2016)). On the other hand, fully-connected layers, which are widely used in RNNs like long short-term memories and as a part of CNNs, require a large number of parameters to be stored in memories.
|
| 36 |
+
|
| 37 |
+
DNNs are mostly trained by the backpropagation algorithm in conjunction with stochastic gradient descent (SGD) optimization method (Rumelhart et al. (1986)). This algorithm computes the gradient of a cost function $C$ with respect to all the weights in all the layers. A common choice for the cost function is using the modified hinge loss introduced in (Tang (2013)). The obtained errors are then backward propagated through the layers to update the weights in an attempt to minimize the cost function. Instead of using a whole dataset to update parameters, data are first divided in mini-batches and parameters are updated using each mini-batch several times to speed up the convergence of the training algorithm. The weight updating speed is controlled by a learning rate $\eta$ . Batch normalization is also commonly used to regularize each mini-batch of data (Ioffe & Szegedy (2015)): it speeds up the training process by allowing the use of a bigger $\eta$ .
|
| 38 |
+
|
| 39 |
+
# 2.2 TOWARDS HARDWARE IMPLEMENTATION OF DNNS
|
| 40 |
+
|
| 41 |
+
DNNs have shown excellent performance in applications such as computer vision and speech recognition: since the number of neurons has a linear relationship with the ability of a DNN to perform tasks, high-performance DNNs are extremely complex in hardware. AlexNet (Krizhevsky et al. (2012)) and VGGNet (Simonyan & Zisserman (2014)) are two models comprising convolutional layers followed by some fully-connected layers, which are widely used in classification algorithms. Despite their very good classification performance, they require large amounts of memory to store the numerous parameters. Most of these parameters (more than $9 6 \%$ ) lie in fully-connected layers. In (Han et al. (2016)), it was shown that the total energy of DNNs is dominated by the required memory accesses. Therefore, the majority of power in a DNN is dissipated through fully-connected layers of DNNs. Moreover, the huge memory requirements make possible only for very small DNNs to be fitted in on-chip RAMs in ASIC/FPGA platforms.
|
| 42 |
+
|
| 43 |
+
Recently, many works tried to reduce the computational complexity of DNNs. In (Akopyan et al. (2015)), the spiking neural network based on stochastic computing (Smithson et al. (2016)) was introduced, where 1-bit calculations are performed throughout the whole architecture. In (Ardakani et al. (2015)), integral stochastic computing was used to reduce the computation latency, showing that stochastic computing can consume less energy than conventional binary radix implementations. However, both works do not manage to reduce the DNN memory requirements.
|
| 44 |
+
|
| 45 |
+
Network pruning, compression and weight sharing have been proposed in (Han et al. (2016)), together with weight matrix sparsification and compression. However, additional indexes denoting the pruned connections are required to be stored along with the compressed weight matrices. In (Han et al. (2015)), it was shown that the number of indexes are almost the same as the number of non-zero elements of weight matrices, thus increasing the word length of the required memories. Moreover, the encoding and compression techniques require inverse computations to obtain decoded and decompressed weights, and introduce additional hardware complexity for hardware implementation compared to the conventional computational architectures. Other pruning techniques presented in literature such as (Anwar et al. (2015)) try to reduce the memory required to store the pruned locations by introducing a structured sparsity in DNNs. However, the resulting network yields up to $3 1 . 8 1 \%$ misclassification rate on the CIFAR-10 dataset.
|
| 46 |
+
|
| 47 |
+
Algorithm 1: Training algorithm for the proposed sparsely-connected network
|
| 48 |
+
|
| 49 |
+
Data: Fully-connected network with parameters $W$ , $b$ and $M$ for each layer. Input data $x$ , its
|
| 50 |
+
corresponding targets $t$ , and learning rate of $\eta$ .
|
| 51 |
+
Result: $W$ and $b$
|
| 52 |
+
1 1. Forward computations
|
| 53 |
+
2 for each layer $i$ in range( $^ { \cdot } l , N )$ do
|
| 54 |
+
3 $W _ { s } \gets W _ { i } \cdot M _ { i }$
|
| 55 |
+
4 Compute layer output $y _ { i }$ according to (3) and its previous layer output $y _ { i - 1 }$ , $W _ { s }$ and $b _ { i }$ .
|
| 56 |
+
5 end
|
| 57 |
+
6 2. Backward Computations
|
| 58 |
+
7 Initialize output layers activation gradient $\frac { \partial C } { \partial y _ { N } }$
|
| 59 |
+
8 for each layer $j$ in range(2,N-1) do
|
| 60 |
+
9 Compute $\frac { \partial C } { \partial y _ { j } }$
|
| 61 |
+
10 end
|
| 62 |
+
11 for each layer $j$ in range(1,N-1) do
|
| 63 |
+
12 Compute $\frac { \partial C } { \partial W _ { s } }$ knowing $\frac { \partial C } { \partial y _ { j } }$ and yj−1
|
| 64 |
+
13 Compute $\frac { \partial C } { \partial b _ { j } }$
|
| 65 |
+
14 Update $W _ { j } : W _ { j } W _ { j } - \eta \frac { \partial C } { \partial W _ { s } }$
|
| 66 |
+
15 Update bj : bj ← bj − η ∂bj
|
| 67 |
+
16 end
|
| 68 |
+
|
| 69 |
+
# 3 SPARSELY-CONNECTED NEURAL NETWORKS
|
| 70 |
+
|
| 71 |
+
Considering a fully-connected neural network layer with $n$ input and $m$ output nodes, the forward computations are performed as follow
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
y = a c t ( W x + b ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $W$ represents the weights and $b$ the biases, while $a c t ( )$ is the non-linear activation function in which $\mathrm { R e L U } ( x ) = m a x ( 0 , x )$ is used in most cases (Nair $\&$ Hinton (2010)). The network’s inputs and outputs are denoted by $x$ and $y$ , respectively.
|
| 78 |
+
|
| 79 |
+
Let us introduce the sparse weight matrix $W _ { s }$ as the element-wise multiplication
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
W _ { s } = W \cdot M ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $W _ { s }$ and $M$ are sparser than $W$ . The Mask binary matrix $M$ can be defined as
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
M _ { n \times m } = \left[ \begin{array} { c c c c } { M _ { 1 1 } } & { M _ { 1 2 } } & { \ldots } & { M _ { 1 m } } \\ { M _ { 2 1 } } & { M _ { 2 2 } } & { \ldots } & { M _ { 2 m } } \\ { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { M _ { n 1 } } & { M _ { n 2 } } & { \ldots } & { M _ { n m } } \end{array} \right] ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where each element of Mask $M _ { i j } \in \{ 0 , 1 \}$ , $i \in \{ 1 , \ldots , n \}$ and $j \in \{ 1 , \dots , m \}$ . Note that the dimensions of $M$ are the same as the weight matrix $W$ . Similarly to a fully-connected network (1), the forward computation of the sparsely-connected network can be expressed as
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
y = a c t ( W _ { s } x + b ) .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
We propose the use of LFSRs to form each column of $M$ , similar to the approach used in stochastic computing to generate a binary stream (Gaines (1969)). In general, an $n b$ -bit LFSR serially generates $2 ^ { n b } - 1$ numbers $S _ { i } \in ( 0 , 1 ) , \stackrel { . } { i } \in \{ 1 , 2 , . . . 2 ^ { n b } - 1 \}$ . A random binary stream with expected value of $p \in [ 0 1 ]$ can be obtained by comparing $S _ { i }$ with a constant value of $p$ . This unit is hereafter referred to as stochastic number generator (SNG). Therefore, a random binary stream element $X _ { i } \in \{ 0 , 1 \}$ is 1 when $S _ { i } ~ \geq ~ p$ , and 0 otherwise. Fig. 2 shows the formation of a small sparsely-connected network using binary streams generated by LFSR units. Fig. 2(a) shows a 3-bit LFSR unit with its 7 different values and a random binary stream with expected value of $p = 0 . 5 7$ . A total of $m$ LFSRs of $\log _ { 2 } ( n )$ -bit length with different seed values are required to form $M$ . By tuning the value of $p$ it is possible to change the sparsity degree of $M$ , and thus of the sparsely-connected network. Fig. 2(b) and Fig. 2(c) show the fully-connected network based on $W$ and the sparsely-connected version based on $W _ { s }$ .
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 2: (a) shows the formation of a Mask matrix $M$ using a 3-bit LFSR for $p = 0 . 5 7$ . (b) shows a fully-connected layer. (c) shows a sparsely-connected layer formed based on $M$ .
|
| 101 |
+
|
| 102 |
+
Algorithm 1 summarizes the training algorithm for the proposed sparsely-connected network. The algorithm itself is very similar to what would be used with a fully-connected network, but considers each network layer to have a mask that disables some of the connections. The forward propagation (line 1-5) follows (3), while derivatives in the backward computations (line 6-16) are computed with respect to $W _ { s }$ . It is worth mentioning that most CNNs use fully-connected layers and the proposed training algorithm can still be used for those layers in CNNs.
|
| 103 |
+
|
| 104 |
+
# 4 EXPERIMENTAL RESULTS
|
| 105 |
+
|
| 106 |
+
We have validated the effectiveness of the proposed sparsely-connected network and its training algorithm on three datasets: MNIST (LeCun & Cortes (2010)), CIFAR10 (Krizhevsky (2009)) and SVHN (Netzer et al. (2011)) using the Theano library (Team (2016)) in Python.
|
| 107 |
+
|
| 108 |
+
Table 1: Misclassification rate for Different Network Sizes on MNIST
|
| 109 |
+
|
| 110 |
+
<table><tr><td rowspan="2">Case</td><td rowspan="2">Method</td><td>Network</td><td>Misclassification</td><td>Number of</td></tr><tr><td>Configuration</td><td>Rate (%)</td><td>Parameters</td></tr><tr><td rowspan="2">1</td><td>Fully-Connected</td><td>784-512-512-10</td><td>1.18</td><td>669706</td></tr><tr><td>Sparsely-Connected 50%</td><td>784-512-512-10</td><td>1.19</td><td>335370</td></tr><tr><td rowspan="3">2</td><td>Fully-Connected</td><td>784-256-256-10</td><td>1.35</td><td>269322</td></tr><tr><td>Sparsely-Connected 60%</td><td>784-512-512-10</td><td>1.20</td><td>268503</td></tr><tr><td>Sparsely-Connected 70%</td><td>784-512-512-10</td><td>1.31</td><td>201636</td></tr><tr><td rowspan="2">3</td><td>Fully-Connected</td><td>784-145-145-10</td><td>1.41</td><td>136455</td></tr><tr><td>Sparsely-Connected 80%</td><td>784-512-512-10</td><td>1.28</td><td>134768</td></tr><tr><td rowspan="2">4</td><td>Fully-Connected</td><td>784-77-77-10</td><td>1.75</td><td>67231</td></tr><tr><td>Sparsely-Connected 90%</td><td>784-512-512-10</td><td>1.75</td><td>67901</td></tr><tr><td rowspan="2">5</td><td>Fully-Connected</td><td>784-12-12-10</td><td>4.68</td><td>9706</td></tr><tr><td>Sparsely-Connected 90%</td><td>784-100-100-10</td><td>3.16</td><td>8961</td></tr></table>
|
| 111 |
+
|
| 112 |
+
# 4.1 EXPERIMENTAL RESULTS ON MNIST
|
| 113 |
+
|
| 114 |
+
The MNIST dataset contains 60000 gray-scale $2 8 \times 2 8$ images (50000 for training and 10000 for testing), falling into 10 classes. A deep fully-connected neural network is used for evaluation and the hinge loss is considered as the cost function. The training set is divided into two separate parts. The first 40000 images are used as the training set and the rest for the validation and test sets. All models are trained using SGD without momentum, a batch size of 100, 500 epochs and the batch normalization method.
|
| 115 |
+
|
| 116 |
+
Table 1 summarizes the misclassification rate of sparsely-connected neural networks compared to fully-connected neural networks for different network configurations, using single-precision floating-point format. We adopted a fully-connected network with 784-512-512-10 network configuration as a reference network, in which each number represent the number of inputs to each fully-connected layer. From this, we formed sparse weight matrices $W _ { s }$ with different sparsity degrees. For instance, sparsely-connected $9 0 \%$ denotes sparse weight matrices containing $9 0 \%$ zero elements. Case 1 shows that a sparsely-connected neural network with $5 0 \%$ fewer connections achieves approximately the same accuracy as the fully-connected network using the same network configuration. In Cases 2 and 3, the sparsely-connected networks with $6 0 \%$ and $8 0 \%$ fewer connections achieve a better misclassification rate than the fully-connected network while having approximately the same number of parameters. Case 4 shows no gain in performance and number of parameters for a sparsely-connected $9 0 \%$ and network configuration of 784-512-512-10 compared to the fully-connected at the same number of parameters. However, we can still reduce the connections up to $9 0 \%$ using a smaller network, as shown in Case 5.
|
| 117 |
+
|
| 118 |
+
Recently, BinaryConnect and TernaryConnect neural networks have outperformed the state-of-theart on different datasets (Courbariaux et al. (2015); Lin et al. (2015)). In BinaryConnect, weights are represented with either $^ { - 1 }$ or 1, whereas they can be -1, 0 or 1 in TernaryConnect. These networks have emerged to facilitate hardware implementations of neural networks by reducing the memory requirements and removing multiplications. We applied our training method to BinaryConnect and TernaryConnect training algorithms: the obtained results are provided in Table 2. The source Python codes used for comparison are the same used in (Courbariaux et al. (2015); Lin et al. (2015)), available online (Lin et al. (2015)). The simulation results show that up to $7 0 \%$ and $8 0 \%$ of connections can be dropped by the proposed method from BinaryConnect and TernaryConnect networks without any compromise in performance without using data augmentation, respectively. Moreover, the binarized and ternarized sparsely-connected $5 0 \%$ improve the accuracy compared to the conventional binarized and ternarized fully-connected networks. Considering data augmentation (affine transformation), our method can drop up to $5 0 \%$ and $7 0 \%$ of connections from BinaryConnect and TernaryConnect networks without any compromise in performance, respectively. However, using data augmentation results in a better misclassification rate when it is used on networks trained with single-precision floating-point weights as shown in Table 2. In this case, our method still can drop up to $90 \%$ of connections without any performance degradation. It is worth specifying that we only used the binarized/ternarized algorithm during the learning phase, and we used single-precision floating-point weights during the test run in Section 4, similar to the approach used in (Lin et al. (2015)).
|
| 119 |
+
|
| 120 |
+
Table 2: Misclassification rate for a 784-1024-1024-1024-10 neural network on MNIST
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Misclassification Rate (%)</td><td rowspan="2"># of Parameters</td></tr><tr><td>Without Data Augmentation</td><td>With</td></tr><tr><td>Single-Precision Floating-Point (SPFP)</td><td>1.33</td><td>Data Augmentation</td><td>2913290</td></tr><tr><td>Sparsely-Connected 50% +SPFP</td><td>1.17</td><td>0.67 0.64</td><td>1458186</td></tr><tr><td>Sparsely-Connected 90% + SPFP</td><td>1.33</td><td>0.66</td><td>294103</td></tr><tr><td>BinaryConnecta(Courbariaux et al. (2015))</td><td>1.23</td><td>0.76</td><td>2913290</td></tr><tr><td>TernaryConnectb(Lin et al. (2015))</td><td>1.15</td><td>0.74</td><td>2913290</td></tr><tr><td>Sparsely-Connected 5O% +BinaryConnecta</td><td>0.99</td><td>0.75</td><td>1458186</td></tr><tr><td>Sparsely-Connected 6O% +BinaryConnecta</td><td>1.03</td><td>0.81</td><td>1167165</td></tr><tr><td>Sparsely-Connected 7O% + BinaryConnecta</td><td>1.16</td><td>0.85</td><td>876144</td></tr><tr><td>Sparsely-Connected 8O% +BinaryConnecta</td><td>1.32</td><td>1.06</td><td>585124</td></tr><tr><td>Sparsely-Connected 9O% +BinaryConnecta</td><td>1.33</td><td>1.36</td><td>294103</td></tr><tr><td>Sparsely-Connected 5O% + TernaryConnectb</td><td>0.95</td><td></td><td>1458186</td></tr><tr><td>Sparsely-Connected 6O% + TernaryConnectb</td><td>1.05</td><td>0.63 0.64</td><td>1167165</td></tr><tr><td>Sparsely-Connected 7O% + TernaryConnectb</td><td>1.01</td><td>0.73</td><td>876144</td></tr><tr><td>Sparsely-Connected 8O% + TernaryConnectb</td><td>1.11</td><td>0.85</td><td>585124</td></tr><tr><td>Sparsely-Connected 9o% + TernaryConnectb</td><td>1.41</td><td>1.05</td><td>294103</td></tr></table>
|
| 123 |
+
|
| 124 |
+
a Binarizing algorithm was only used in the learning phase and single-precision floating-point weights were used during the test run. b Ternarizing algorithm was only used in the learning phase and single-precision floating-point weights were used during the test run.
|
| 125 |
+
|
| 126 |
+
# 4.2 EXPERIMENTAL RESULTS ON CIFAR10
|
| 127 |
+
|
| 128 |
+
The CIFAR10 dataset consists of a total number of $6 0 , 0 0 0 3 2 \times 3 2$ RGB images. Similar to MNIST, we split the images into 40, 000, 10, 000 and 10, 000 training, validation and test datasets, respectively. As our model, we adopt a convolutional network comprising $\{ 1 2 8 - 1 2 8 - 2 5 6 - 2 5 6 - 5 1 2 - 5 1 2 \}$ channels for six convolution/pooling layers and two 1024-node fully-connected layers followed by a classification layer. This architecture is inspired by VGGNet (Simonyan & Zisserman (2014)) and was also used in (Courbariaux et al. (2015)). Hinge loss is used for training with batch normalization and a batch size of 50.
|
| 129 |
+
|
| 130 |
+
In order to show the performance of the proposed technique, we use sparsely-connected networks instead of fully-connected networks in the convolutional network. Again, we compare our results with the binarized and ternarized models since they are the most hardware-friendly models reported to-date. As summarized in Table 3, simulation results show significant improvement in accuracy compared to the ordinary network while having significantly fewer parameters.
|
| 131 |
+
|
| 132 |
+
# 4.3 EXPERIMENTAL RESULTS ON SVHN
|
| 133 |
+
|
| 134 |
+
SVHN dataset contains $3 2 \times 3 2$ RGB images (600, 000 images for training and roughly 26, 000 images for testing) of street house numbers. Also, $6 , 0 0 0$ images are separated from the training part for validation. Similar to the CIFAR10 case, we use a convolutional network comprising {128-128- $2 5 6 - 2 5 6 - 5 1 2 - 5 1 2 \}$ channels for six convolution/pooling layers and two 1024 fully-connected layers followed by a classification layer. Hinge loss is used as the cost function with batch normalization and batch size of 50.
|
| 135 |
+
|
| 136 |
+
Table 4 summarizes the accuracy performance of using the proposed sparsely-connected network in the convolutional network model, compared to the hardware-friendly binarized and ternarized models. Despite the fewer parameters that the proposed sparsely-connected network provides, it also yields state-of-the-art results in terms of accuracy performance.
|
| 137 |
+
|
| 138 |
+
Table 3: Misclassification rate for a Convolutional Network on CIFAR10
|
| 139 |
+
|
| 140 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Misclassification Rate (%)</td><td rowspan="2"># of Parameters</td></tr><tr><td>Without</td><td>With</td></tr><tr><td>Single-Precision Floating-Point (SPFP)</td><td>Data Augmentation</td><td>Data Augmentation</td><td></td></tr><tr><td>Sparsely-Connected 90% + SPFP</td><td>12.45</td><td>9.77</td><td>14025866 5523184</td></tr><tr><td>BinaryConnect a(Courbariaux etal. (2015))</td><td>12.05</td><td>9.30</td><td></td></tr><tr><td>TernaryConnect b(Lin et al. (2015))</td><td>9.91 9.32</td><td>8.01</td><td>14025866</td></tr><tr><td>Sparsely-Connected 5O% +BinaryConnect a</td><td></td><td>7.83</td><td>14025866</td></tr><tr><td>Sparsely-Connected 9O% +BinaryConnect a</td><td>8.95</td><td>7.27</td><td>9302154</td></tr><tr><td>Sparsely-Connected 5O% + TernaryConnect b</td><td>8.05</td><td>6.92</td><td>5523184</td></tr><tr><td>Sparsely-Connected 90% + TernaryConnect b</td><td>8.45</td><td>7.13</td><td>9302154</td></tr><tr><td></td><td>7.88</td><td>6.99</td><td>5523184</td></tr></table>
|
| 141 |
+
|
| 142 |
+
a Binarizing algorithm was only used in the learning phase and single-precision floating-point weights were used during the b Ternarizing algorithm was only used in the learning phase and single-precision floating-point weights were used during the test run.
|
| 143 |
+
|
| 144 |
+
Table 4: Misclassification rate for a Convolutional Network on SVHN
|
| 145 |
+
|
| 146 |
+
<table><tr><td>Method</td><td>Misclassification Rate (%)</td><td>Number of Parameters</td></tr><tr><td>Single-Precision Floating-Point</td><td>4.734615</td><td>14025866</td></tr><tr><td>BinaryConnect a(Courbariaux et al. (2015)</td><td>2.134615</td><td>14025866</td></tr><tr><td>TernaryConnect b(Lin et al. (2015))</td><td>2.9</td><td>14025866</td></tr><tr><td>Sparsely-Connected 90% + BinaryConnect a</td><td>2.003846</td><td>5523184</td></tr><tr><td>Sparsely-Connected 90% + TernaryConnect b</td><td>1.957692</td><td>5523184</td></tr></table>
|
| 147 |
+
|
| 148 |
+
a Binarizing algorithm was only used in the learning phase and single-precision floatingpoint weights were used during the test run. b Ternarizing algorithm was only used in the learning phase and single-precision floatingpoint weights were used during the test run.
|
| 149 |
+
|
| 150 |
+
# 4.4 COMPARISON WITH THE STATE OF THE ART
|
| 151 |
+
|
| 152 |
+
The proposed sparsely-connected network has been compared to other networks in literature in terms of misclassification rate in Table 5. In Section 4.1 to 4.3, we used the binarization/ternarization algorithm to train our models in the learning phase while using single-precision floating-point weights during the test run (i.e. inference phase). The first part of Table 5 applies the same technique, while in the second part we use binarized/ternarized weights also during the test run. We thus exploit a deterministic method introduced in (Courbariaux et al. (2015)) to perform the test run using binarized/ternarized weights. The weights are obtained as follows:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
W _ { b } = \left\{ \begin{array} { c l } { { 1 } } & { { \mathrm { i f } W \geq 0 } } \\ { { { - 1 } } } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. ,
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
W _ { t } = \left\{ \begin{array} { l l } { { 1 } } & { { \mathrm { ~ i f ~ } W \geq \frac { 1 } { 3 } } } \\ { { 0 } } & { { \mathrm { ~ o t h e r w i s e } } } \\ { { - 1 } } & { { \mathrm { ~ i f ~ } W \leq - \frac { 1 } { 3 } } } \end{array} \right. ,
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
where $W _ { b }$ and $W _ { t }$ denote binarized and ternarized weights, respectively.
|
| 163 |
+
|
| 164 |
+
From the results presented in Table 5, we can see that our proposed work outperforms the state-ofthe-art models with binarized/ternarized weights during the test run while achieving performance close to the state-of-the-art result of the model with no binarization/ternarization in the test run. The former are the most suitable and hardware-friendly models for hardware implementation of DNNs: our model shows a better performance in terms of both accuracy/misclassification rate and memory requirements. The obtained results suggest that the proposed network acts as a regularizer to prevent models from overfitting. Similar conclusions were also obtained in (Courbariaux et al. (2015)). It is worth noting that no data augmentation was used in our simulations throughout this paper except for the results reported in Table 2 and Table 3.
|
| 165 |
+
|
| 166 |
+
Table 5: Misclassification rate comparison. Sparsity degree for the proposed network is $5 0 \%$ in MNIST, and $9 0 \%$ in SVHN and CIFAR10.
|
| 167 |
+
|
| 168 |
+
<table><tr><td colspan="2"></td><td colspan="2">Datasets</td></tr><tr><td>Method</td><td>MNIST Binarized/Ternarized Weights During Test Run</td><td>SVHN</td><td>CIFAR10</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>BNN(Torch7)(Courbariaux & Bengio (2016)) BNN (Theano)(Courbariaux & Bengio (2016))</td><td>1.40%</td><td>2.53%</td><td>10.15%</td></tr><tr><td>(Baldassi et al. (2015))</td><td>0.96% 1.35%</td><td>2.80%</td><td>11.40%</td></tr><tr><td>BinaryConnect (Courbariaux et al.(2015))</td><td>1.29%</td><td>1</td><td>1</td></tr><tr><td>EBP (Cheng et al. (2015))</td><td>2.2%</td><td>2.30%</td><td>9.90%</td></tr><tr><td>Bitwise DNNs (Kim & Smaragdis (2016))</td><td>1.33%</td><td>1</td><td>1</td></tr><tr><td>(Hwang& Sung (2014))</td><td>1.45%</td><td>1</td><td>1</td></tr><tr><td></td><td>1.08%</td><td>1</td><td>1</td></tr><tr><td>Sparsely-Connected+BinaryConnect</td><td>0.98%</td><td>2.053846% 1.992308%</td><td>8.66%</td></tr><tr><td>Sparsely-Connected+ TernaryConnect</td><td></td><td></td><td>8.24%</td></tr><tr><td>Method</td><td>Single-Precision Floating-Point Weights During Test Run</td><td></td><td></td></tr><tr><td>TernaryConnect (Lin et al. (2015))</td><td>1.15%</td><td>2.42%</td><td>12.01%</td></tr><tr><td>Maxout Networks (Goodfellow et al.(2013))</td><td>0.94%</td><td>2.47%</td><td>11.68%</td></tr><tr><td>Network in Network (Lin et al.(2013))</td><td></td><td>2.35%</td><td>10.41%</td></tr><tr><td>Gated pooling (Lee et al. (2015))</td><td>1</td><td>1.69%</td><td>7.62%</td></tr><tr><td>Sparsely-Connected+BinaryConnect</td><td>0.99%</td><td>2.003846%</td><td>8.05%</td></tr><tr><td>Sparsely-Connected+ TernaryConnect</td><td>0.95%</td><td>1.957692%</td><td>7.88%</td></tr></table>
|
| 169 |
+
|
| 170 |
+
# 5 VLSI IMPLEMENTATION OF SPARSELY-CONNECTED NEURAL NETWORKS
|
| 171 |
+
|
| 172 |
+
In this Section, we propose an efficient hardware architecture for the proposed sparsely-connected network. In fully-connected networks, the main computational core is the matrix-vector multiplication that computes (1). This computation is usually implemented in parallel on GPUs. However, parallel implementation of this unit requires parallel access to memories and causes routing congestion, leading to large silicon area and power/energy consumption in customized hardware. Thus, VLSI architectures usually opt for semi-parallel implementations of such networks. In this approach, each neuron performs its computations serially, and a certain number of neurons are instantiated in parallel (Moreno et al. (2008)). Every neuron is implemented using multiply-and-accumulate (MAC) units as shown in Fig. 3(a). The number of inputs of each neuron determines the latency of this architecture. For example, considering a hidden layer with 1024 inputs and 1024 outputs, 1024 MACs are required in parallel and each MAC requires 1024 clock cycles to perform computations of this layer. In general, a counter is required to count from 0 to $N - 1$ where $N$ is the number of inputs of each neuron. It provides the addresses for the memory in which a column of the weight matrix $W$ is stored. In this way, each input and its corresponding weight are fed to the multiplier every clock cycle (see Fig. 3(a)). For binarized/ternarized networks, the multiplier in 3(a) is substituted with a multiplexer.
|
| 173 |
+
|
| 174 |
+
In Section 3, we described the formation of the Mask matrix $M$ using an SNG unit (see Fig. 2(a)). The value of $p$ , through which it is possible to tune the sparsity degree of networks, also corresponds to the occurrence of 1 in a binary stream generated by SNG. Therefore, we can save up to $9 \hat { 0 } \%$ of memory by storing only the weights corresponding to the 1s in the SNG stream. For instance, considering a Mask matrix $M$ in Fig. 2(a), $W _ { s }$ is formed as
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 3: (a) shows the conventional architecture of a single neuron of a fully-connected network. (b) shows the proposed architecture of a single neuron of a sparsely-connected network.
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
W _ { s } = \left[ \begin{array} { c c } { 0 } & { 0 } \\ { W _ { 2 1 } } & { W _ { 2 2 } } \\ { W _ { 3 1 } } & { 0 } \\ { W _ { 4 1 } } & { 0 } \\ { 0 } & { W _ { 5 2 } } \\ { W _ { 6 1 } } & { W _ { 6 2 } } \\ { 0 } & { W _ { 7 2 } } \end{array} \right] ,
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
Table 6: ASIC Implementation Results for a Single Neuron of Sparsely-Connected Network $@$ 400 MHz in TSMC 65 nm CMOS Technology.
|
| 184 |
+
|
| 185 |
+
<table><tr><td rowspan="2"></td><td colspan="5">Sparsity Degree</td></tr><tr><td>p=0 Fully-Connected (FC)</td><td>p=0.5</td><td>p=0.75 Sparsely-Connected</td><td>p= 0.875 Sparsely-Connected</td><td>p= 0.9375 Sparsely-Connected</td></tr><tr><td>Memory Size [bits]</td><td>1024</td><td>Sparsely-Connected 512</td><td>256</td><td>128</td><td>64</td></tr><tr><td>Area [μm²](improvement W.r.t.FC)</td><td>26265</td><td>13859 (47%↓)</td><td>7316 (72% ↓)</td><td>4221(84% ↓)</td><td>2662 (90%↓)</td></tr><tr><td>Power [μW]</td><td>278</td><td>155</td><td>86</td><td>60</td><td>43</td></tr><tr><td>Energy [pJ](improvement w.r.t.FC)</td><td>712</td><td>397(44%↓)</td><td>220(69%↓)</td><td>154(78%↓)</td><td>110 (84%↓)</td></tr><tr><td>Latency [μs]</td><td>2.56</td><td>2.56</td><td>2.56</td><td>2.56</td><td>2.56</td></tr></table>
|
| 186 |
+
|
| 187 |
+
and the compressed matrix $W _ { c }$ stored in on-chip memories is
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
W _ { c } = \left[ \begin{array} { l l } { W _ { 2 1 } } & { W _ { 2 2 } } \\ { W _ { 3 1 } } & { W _ { 5 2 } } \\ { W _ { 4 1 } } & { W _ { 6 2 } } \\ { W _ { 6 1 } } & { W _ { 7 2 } } \end{array} \right] .
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
The smaller memory can significantly reduce the silicon area and the power consumption of DNNs architectures. Depending on the value of $p$ , the size of the memory varies. In general, the depth of the weight memory in each neuron is $( 1 - p ) \times N$ .
|
| 194 |
+
|
| 195 |
+
Fig. 3(b) depicts the architecture of a single neuron of the proposed sparsely-connected network. Decompression is performed using an SNG generating the enable signal of the counter and accumulator. Inputs are fed into each neuron sequentially in each clock cycle. If the output of the SNG is 1, the counter counts upward and provides an address for the memory. Then, the multiplication of an input and its corresponding weight is computed, the result stored in the internal register of the accumulator. If instead the output of the SNG is 0, the counter holds its previous value, while the internal register of the accumulator is not enabled, and does not load a new value. The latency of the proposed architecture is the same as that of the conventional architecture.
|
| 196 |
+
|
| 197 |
+
Table 6 shows the ASIC implementation results of the neuron in Fig. 3(b) supposing 1024 inputs. The proposed architectures were described in VHDL and synthesized in TSMC 65 nm CMOS technology with Cadence RTL compiler, for different sparsity degrees $p$ . For the provided syntheses we used a binarized network. Implementation results show up to $\bar { 8 } 4 \%$ decrement in energy consumption and up to $9 0 \%$ less area compared to the conventional fully-connected architecture.
|
| 198 |
+
|
| 199 |
+
# 6 CONCLUSION
|
| 200 |
+
|
| 201 |
+
DNNs are capable of solving complex tasks: their ability to do so depends on the number of neurons and their connections. Fully-connected layers in DNNs contain more than $9 6 \%$ of the total neural network parameters, pushing the designers to use off-chip memories which are band-width limited and consume large amounts of energy. In this paper, we proposed sparsely-connected networks and their training algorithm to substantially reduce the memory requirements of DNNs. The sparsity degree of the proposed network can be tuned by an SNG, which is implemented using an LFSR unit and a comparator. We used the proposed sparsely-connected network instead of fully-connected networks in a VGG-like network on three commonly used datasets: we achieved better accuracy results with up to $9 0 \%$ fewer connections than the state of the art. Moreover, our simulation results confirm that the proposed network can be used as a regularizer to prevent models from overfitting. Finally, we implemented a single neuron of the sparsely-connected network in in $6 5 \ \mathrm { n m } \mathrm { C M O S }$ technology for different sparsity degrees. The implementation results show that the proposed architecture can save up to $8 4 \%$ energy and $9 0 \%$ silicon area compared to the conventional fully-connected network while having a lower misclassification rate.
|
| 202 |
+
|
| 203 |
+
# REFERENCES
|
| 204 |
+
|
| 205 |
+
F. Akopyan, J. Sawada, A. Cassidy, R. Alvarez-Icaza, J. Arthur, P. Merolla, N. Imam, Y. Nakamura, P. Datta, G. J. Nam, B. Taba, M. Beakes, B. Brezzo, J. B. Kuang, R. Manohar, W. P. Risk, B. Jackson, and D. S. Modha. TrueNorth: design and tool flow of a $6 5 ~ \mathrm { m W }$ 1 million neuron programmable neurosynaptic chip. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 34(10):1537–1557, Oct 2015. ISSN 0278-0070. doi: 10.1109/TCAD.2015. 2474396.
|
| 206 |
+
|
| 207 |
+
Sajid Anwar, Kyuyeon Hwang, and Wonyong Sung. Structured pruning of deep convolutional neural networks. CoRR, abs/1512.08571, 2015. URL http://arxiv.org/abs/1512.08571.
|
| 208 |
+
|
| 209 |
+
Arash Ardakani, Franc¸ois Leduc-Primeau, Naoya Onizawa, Takahiro Hanyu, and Warren J. Gross. VLSI implementation of deep neural network using integral stochastic computing. CoRR, abs/1509.08972, 2015. URL http://arxiv.org/abs/1509.08972.
|
| 210 |
+
|
| 211 |
+
Carlo Baldassi, Alessandro Ingrosso, Carlo Lucibello, Luca Saglietti, and Riccardo Zecchina. Subdominant dense clusters allow for simple learning and high computational performance in neural networks with discrete synapses. Phys. Rev. Lett., 115:128101, Sep 2015.
|
| 212 |
+
|
| 213 |
+
Lukas Cavigelli, David Gschwend, Christoph Mayer, Samuel Willi, Beat Muheim, and Luca Benini. Origami: a convolutional network accelerator. CoRR, abs/1512.04295, 2015. URL http:// arxiv.org/abs/1512.04295.
|
| 214 |
+
|
| 215 |
+
Yu-Hsin Chen, Joel Emer, and Vivienne Sze. Eyeriss: a spatial architecture for energy-efficient dataflow for convolutional neural networks. In Proceedings of the 43rd International Symposium on Computer Architecture, ISCA ’16, pp. 367–379, Piscataway, NJ, USA, 2016. IEEE Press. ISBN 978-1-4673-8947-1. doi: 10.1109/ISCA.2016.40. URL http://dx.doi.org/10. 1109/ISCA.2016.40.
|
| 216 |
+
|
| 217 |
+
Yu-Hsin Chen, Tushar Krishna, Joel Emer, and Vivienne Sze. Eyeriss: An Energy-Efficient Reconfigurable Accelerator for Deep Convolutional Neural Networks. In IEEE International Solid-State Circuits Conference, ISSCC 2016, Digest of Technical Papers, pp. 262–263, 2016.
|
| 218 |
+
|
| 219 |
+
Zhiyong Cheng, Daniel Soudry, Zexi Mao, and Zhen-zhong Lan. Training binary multilayer neural networks for image classification using expectation backpropagation. CoRR, abs/1503.03562, 2015.
|
| 220 |
+
|
| 221 |
+
Matthieu Courbariaux and Yoshua Bengio. BinaryNet: Training deep neural networks with weights and activations constrained to $+ 1$ or -1. CoRR, abs/1602.02830, 2016.
|
| 222 |
+
|
| 223 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. BinaryConnect: Training deep neural networks with binary weights during propagations. CoRR, abs/1511.00363, 2015.
|
| 224 |
+
|
| 225 |
+
B. R. Gaines. Stochastic Computing Systems, pp. 37–172. Springer US, Boston, MA, 1969. ISBN 978-1-4899-5841-9.
|
| 226 |
+
|
| 227 |
+
Ian J. Goodfellow, David Warde-farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. In In ICML, 2013.
|
| 228 |
+
|
| 229 |
+
S. Han, X. Liu, H. Mao, J. Pu, A. Pedram, M. A. Horowitz, and W. J. Dally. EIE: Efficient inference engine on compressed deep neural network. In 2016 ACM/IEEE 43rd Annual International Symposium on Computer Architecture (ISCA), pp. 243–254, June 2016. doi: 10.1109/ISCA.2016.30.
|
| 230 |
+
|
| 231 |
+
Song Han, Huizi Mao, and William J. Dally. Deep compression: compressing deep neural network with pruning, trained quantization and huffman coding. CoRR, abs/1510.00149, 2015.
|
| 232 |
+
|
| 233 |
+
Mark Horowitz. 1.1 computing’s energy problem (and what we can do about it). In 2014 IEEE International Solid-State Circuits Conference Digest of Technical Papers (ISSCC), pp. 10–14, Feb 2014. doi: 10.1109/ISSCC.2014.6757323.
|
| 234 |
+
|
| 235 |
+
K. Hwang and W. Sung. Fixed-point feedforward deep neural network design using weights -1, 0, and 1. In 2014 IEEE Workshop on Signal Processing Systems (SiPS), pp. 1–6, Oct 2014.
|
| 236 |
+
|
| 237 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: accelerating deep network training by reducing internal covariate shift. CoRR, abs/1502.03167, 2015. URL http://arxiv.org/ abs/1502.03167.
|
| 238 |
+
|
| 239 |
+
Minje Kim and Paris Smaragdis. Bitwise neural networks. CoRR, abs/1601.06071, 2016.
|
| 240 |
+
|
| 241 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 242 |
+
|
| 243 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 25, pp. 1097–1105. Curran Associates, Inc., 2012.
|
| 244 |
+
|
| 245 |
+
Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Comput., 1(4):541–551, December 1989. ISSN 0899-7667. doi: 10.1162/neco.1989.1.4.541. URL http://dx.doi. org/10.1162/neco.1989.1.4.541.
|
| 246 |
+
|
| 247 |
+
Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. URL http://yann. lecun.com/exdb/mnist/.
|
| 248 |
+
|
| 249 |
+
Yann Lecun, Lon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pp. 2278–2324, 1998.
|
| 250 |
+
|
| 251 |
+
Yann Lecun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 5 2015. ISSN 0028-0836. doi: 10.1038/nature14539.
|
| 252 |
+
|
| 253 |
+
Chen-Yu Lee, Patrick W. Gallagher, and Zhuowen Tu. Generalizing pooling functions in convolutional neural networks: mixed, gated, and tree. CoRR, abs/1509.08985, 2015.
|
| 254 |
+
|
| 255 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. CoRR, abs/1312.4400, 2013.
|
| 256 |
+
|
| 257 |
+
Zhouhan Lin, Matthieu Courbariaux, Roland Memisevic, and Yoshua Bengio. Neural networks with few multiplications. CoRR, abs/1510.03009, 2015.
|
| 258 |
+
|
| 259 |
+
F. Moreno, J. Alarcon, R. Salvador, and T. Riesgo. Fpga implementation of an image recognition system based on tiny neural networks and on-line reconfiguration. In Industrial Electronics, 2008. IECON 2008. 34th Annual Conference of IEEE, pp. 2445–2452, Nov 2008. doi: 10.1109/IECON. 2008.4758340.
|
| 260 |
+
|
| 261 |
+
Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In Johannes Frnkranz and Thorsten Joachims (eds.), Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 807–814. Omnipress, 2010. URL http://www.icml2010.org/papers/432.pdf.
|
| 262 |
+
|
| 263 |
+
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, 2011. URL http://ufldl.stanford.edu/ housenumbers/nips2011_housenumbers.pdf.
|
| 264 |
+
|
| 265 |
+
D. E. Rumelhart, G. E. Hinton, and R. J. Williams. Parallel distributed processing: Explorations in the microstructure of cognition, vol. 1. chapter Learning Internal Representations by Error Propagation, pp. 318–362. MIT Press, Cambridge, MA, USA, 1986. ISBN 0-262-68053-X. URL http://dl.acm.org/citation.cfm?id $\mathbf { \Phi } = \mathbf { \dot { \Phi } }$ 104279.104293.
|
| 266 |
+
|
| 267 |
+
A. Shafiee, A. Nag, N. Muralimanohar, R. Balasubramonian, J. P. Strachan, M. Hu, R. S. Williams, and V. Srikumar. ISAAC: a convolutional neural network accelerator with in-situ analog arithmetic in crossbars. In 2016 ACM/IEEE 43rd Annual International Symposium on Computer Architecture (ISCA), pp. 14–26, June 2016a. doi: 10.1109/ISCA.2016.12.
|
| 268 |
+
|
| 269 |
+
M. J. Shafiee, P. Siva, and A. Wong. StochasticNet: forming deep neural networks via stochastic connectivity. IEEE Access, 4:1915–1924, 2016b. ISSN 2169-3536.
|
| 270 |
+
|
| 271 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014.
|
| 272 |
+
|
| 273 |
+
Sean C. Smithson, Kaushik Boga, Arash Ardakani, Brett H. Meyer, and Warren J. Gross. Stochastic computing can improve upon digital spiking neural networks. In 2016 IEEE Workshop on Signal Processing Systems (SiPS), pp. 309–314, Oct 2016.
|
| 274 |
+
|
| 275 |
+
C. Szegedy, Wei Liu, Yangqing Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1–9, June 2015. doi: 10.1109/CVPR.2015.7298594.
|
| 276 |
+
|
| 277 |
+
Yichuan Tang. Deep learning using support vector machines. CoRR, abs/1306.0239, 2013. URL http://arxiv.org/abs/1306.0239.
|
| 278 |
+
|
| 279 |
+
Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016.
|
| 280 |
+
|
| 281 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. CoRR, abs/1608.03665, 2016. URL http://arxiv.org/abs/ 1608.03665.
|
| 282 |
+
|
| 283 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. CoRR, abs/1311.2901, 2013. URL http://arxiv.org/abs/1311.2901.
|
md/train/rkRwGg-0Z/rkRwGg-0Z.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BEYOND WORD IMPORTANCE: CONTEXTUAL DECOMPOSITION TO EXTRACT INTERACTIONS FROM LSTMS
|
| 2 |
+
|
| 3 |
+
Peter J. Liu Google Brain Mountain View, CA
|
| 4 |
+
|
| 5 |
+
W. James Murdoch ∗ Department of Statistics University of California, Berkeley jmurdoch@berkeley.edu
|
| 6 |
+
|
| 7 |
+
Bin Yu
|
| 8 |
+
Department of Statistics
|
| 9 |
+
Department of EECS
|
| 10 |
+
University of California, Berkeley
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
The driving force behind the recent success of LSTMs has been their ability to learn complex and non-linear relationships. Consequently, our inability to describe these relationships has led to LSTMs being characterized as black boxes. To this end, we introduce contextual decomposition (CD), an interpretation algorithm for analysing individual predictions made by standard LSTMs, without any changes to the underlying model. By decomposing the output of a LSTM, CD captures the contributions of combinations of words or variables to the final prediction of an LSTM. On the task of sentiment analysis with the Yelp and SST data sets, we show that CD is able to reliably identify words and phrases of contrasting sentiment, and how they are combined to yield the LSTM’s final prediction. Using the phrase-level labels in SST, we also demonstrate that CD is able to successfully extract positive and negative negations from an LSTM, something which has not previously been done.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
In comparison with simpler linear models, techniques from deep learning have achieved impressive accuracy by effectively learning non-linear interactions between features. However, due to our inability to describe the learned interactions, this improvement in accuracy has come at the cost of state of the art predictive algorithms being commonly regarded as black-boxes. In the domain of natural language processing (NLP), Long Short Term Memory networks (LSTMs) (Hochreiter & Schmidhuber, 1997) have become a basic building block, yielding excellent performance across a wide variety of tasks (Sutskever et al., 2014) (Rajpurkar et al., 2016) (Melis et al., 2017), while remaining largely inscrutable.
|
| 19 |
+
|
| 20 |
+
In this work, we introduce contextual decomposition (CD), a novel interpretation method for explaining individual predictions made by an LSTM without any modifications to the underlying model. CD extracts information about not only which words contributed to a LSTM’s prediction, but also how they were combined in order to yield the final prediction. By mathematically decomposing the LSTM’s output, we are able to disambiguate the contributions made at each step by different parts of the sentence.
|
| 21 |
+
|
| 22 |
+
To validate the CD interpretations extracted from an LSTM, we evaluate on the problem of sentiment analysis. In particular, we demonstrate that CD is capable of identifying words and phrases of differing sentiment within a given review. CD is also used to successfully extract positive and negative negations from an LSTM, something that has not previously been done. As a consequence of this analysis, we also show that prior interpretation methods produce scores which have document-level information built into them in complex, unspecified ways. For instance, prior work often identifies strongly negative phrases contained within positive reviews as neutral, or even positive.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
The most relevant prior work on interpreting LSTMs has focused on approaches for computing word-level importance scores, with evaluation protocols varying greatly. Murdoch & Szlam (2017) introduced a decomposition of the LSTM’s output embedding into a sum over word coefficients, and demonstrated that those coefficients are meaningful by using them to distill LSTMs into rules-based classifiers. Li et al. (2016) took a more black box approach, called Leave One Out, by observing the change in log probability resulting from replacing a given word vector with a zero vector, and relied solely on anecdotal evaluation. Finally, Sundararajan et al. (2017) presents a general gradient-based technique, called Integrated Gradients, which was validated both theoretically and with empirical anecdotes. In contrast to our proposed method, this line of work has been limited to word-based importance scores, ignoring the interactions between variables which make LSTMs so accurate.
|
| 27 |
+
|
| 28 |
+
Another line of work (Karpathy et al., 2015) (Strobelt et al., 2016) has focused on analysing the movement of raw gate activations over a sequence. Karpathy et al. (2015) was able to identify some co-ordinates of the cell state that correspond to semantically meaningful attributes, such as whether the text is in quotes. However, most of the cell co-ordinates were uninterpretable, and it is not clear how these co-ordinates combine to contribute to the actual prediction.
|
| 29 |
+
|
| 30 |
+
Decomposition-based approaches to interpretation have also been applied to convolutional neural networks (CNNs) (Bach et al., 2015) (Shrikumar et al., 2017). However, they have been limited to producing pixel-level importance scores, ignoring interactions between pixels, which are clearly quite important. Our approach is similar to these in that it computes an exact decomposition, but we leverage the unique gating structure of LSTMs in order to extract interactions.
|
| 31 |
+
|
| 32 |
+
Attention based models (Bahdanau et al., 2014) offer another means of providing some interpretability. Such models have been successfully applied to many problems, yielding improved performance (Rush et al., 2015) (Xu et al., 2015). In contrast to other word importance scores, attention is limited in that it only provides an indirect indicator of importance, with no directionality, i.e. what class the word is important for. Although attention weights are often cited anecdotally, they have not been evaluated, empirically or otherwise, as an interpretation technique. As with other prior work, attention is also incapable of describing interactions between words.
|
| 33 |
+
|
| 34 |
+
# 3 CONTEXTUAL DECOMPOSITION OF LSTMS
|
| 35 |
+
|
| 36 |
+
Given an arbitrary phrase contained within an input, we present a novel decomposition of the output of an LSTM into a sum of two contributions: those resulting solely from the given phrase, and those involving other factors. The key insight behind this decomposition is that the gating dynamics unique to LSTMs are a vehicle for modeling interactions between variables.
|
| 37 |
+
|
| 38 |
+
# 3.1 LONG SHORT TERM MEMORY NETWORKS
|
| 39 |
+
|
| 40 |
+
Over the past few years, LSTMs have become a core component of neural NLP systems. Given a sequence of word embeddings $x _ { 1 } , . . . , x _ { T } \in \mathbb { R } ^ { d _ { 1 } }$ , a cell and state vector $c _ { t } , h _ { t } \in \mathbb { R } ^ { \dot { d } _ { 2 } }$ are computed for each element by iteratively applying the below equations, with initialization $h _ { 0 } = c _ { 0 } = 0$ .
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\begin{array} { r l } & { o _ { t } = \sigma ( W _ { o } x _ { t } + V _ { o } h _ { t - 1 } + b _ { o } ) } \\ & { f _ { t } = \sigma ( W _ { f } x _ { t } + V _ { f } h _ { t - 1 } + b _ { f } ) } \\ & { i _ { t } = \sigma ( W _ { i } x _ { t } + V _ { i } h _ { t - 1 } + b _ { i } ) } \\ & { g _ { t } = \operatorname { t a n h } ( W _ { g } x _ { t } + V _ { g } h _ { t - 1 } + b _ { g } ) } \\ & { c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot g _ { t } } \\ & { h _ { t } = o _ { t } \odot \operatorname { t a n h } ( c _ { t } ) } \end{array}
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Where Wo, Wi, Wf , Wg ∈ Rd1×d2 , $V _ { o } , V _ { f } , V _ { i } , V _ { g } \in \mathbb { R } ^ { d _ { 2 } \times d _ { 2 } } , b _ { o } , b _ { g } , b _ { i } , b _ { g } \in \mathbb { R } ^ { d _ { 2 } }$ and $\odot$ denotes element-wise multiplication. $o _ { t } , f _ { t }$ and $i _ { t }$ are often referred to as output, forget and input gates, respectively, due to the fact that their values are bounded between 0 and 1, and that they are used in element-wise multiplication.
|
| 47 |
+
|
| 48 |
+
After processing the full sequence, the final state $h _ { T }$ is treated as a vector of learned features, and used as input to a multinomial logistic regression, often called SoftMax, to return a probability distribution $p$ over $C$ classes, with
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
p _ { j } = \mathrm { S o f t M a x } ( W h _ { T } ) _ { j } = \frac { \exp ( W _ { j } h _ { T } ) } { \sum _ { k = 1 } ^ { C } \exp ( W _ { k } h _ { t } ) }
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
# 3.2 CONTEXTUAL DECOMPOSITION OF LSTM
|
| 55 |
+
|
| 56 |
+
We now introduce contextual decomposition, our proposed method for interpreting LSTMs. Given an arbitrary phrase $x _ { q } , . . . , x _ { r }$ , where $1 \leq q \leq r \leq T$ , we now decompose each output and cell state $c _ { t } , h _ { t }$ in Equations 5 and 6 into a sum of two contributions.
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\begin{array} { l } { h _ { t } = \beta _ { t } + \gamma _ { t } } \\ { c _ { t } = \beta _ { t } ^ { c } + \gamma _ { t } ^ { c } } \end{array}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
The decomposition is constructed so that $\beta _ { t }$ corresponds to contributions made solely by the given phrase to $h _ { t }$ , and that $\gamma _ { t }$ corresponds to contributions involving, at least in part, elements outside of the phrase. $\beta _ { t } ^ { c }$ and $\gamma _ { t } ^ { c }$ represent analogous contributions to $c _ { t }$ .
|
| 63 |
+
|
| 64 |
+
Using this decomposition for the final output state $W h _ { T }$ in Equation 7 yields
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
p = \operatorname { S o f t M a x } ( W \beta _ { T } + W \gamma _ { T } )
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Here $W \beta _ { T }$ provides a quantitative score for the phrase’s contribution to the LSTM’s prediction. As this score corresponds to the input to a logistic regression, it may be interpreted in the same way as a standard logistic regression coefficient.
|
| 71 |
+
|
| 72 |
+
# 3.2.1 DISAMBIGUATING INTERACTIONS BETWEEN GATES
|
| 73 |
+
|
| 74 |
+
In the cell update Equation 5, neuron values in each of $i _ { t }$ and $g _ { t }$ are independently determined by both the contribution at that step, $x _ { t }$ , as well as prior context provided by $h _ { t - 1 } = \beta _ { t - 1 } + \gamma _ { t - 1 }$ . Thus, in computing the element-wise product $i _ { t } \odot g _ { t }$ , often referred to as gating, contributions made by $x _ { t }$ to $i _ { t }$ interact with contributions made by $h _ { t }$ to $g _ { t }$ , and vice versa.
|
| 75 |
+
|
| 76 |
+
We leverage this simple insight to construct our decomposition. First, assume that we have a way of linearizing the gates and updates in Equations 2, 3, 4 so that we can write each of them as a linear sum of contributions from each of their inputs.
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r l } & { i _ { t } = \sigma ( W _ { i } x _ { t } + V _ { i } h _ { t - 1 } + b _ { i } ) } \\ & { \quad = L _ { \sigma } ( W _ { i } x _ { t } ) + L _ { \sigma } ( V _ { i } h _ { t - 1 } ) + L _ { \sigma } ( b _ { i } ) } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
When we use this linearization in the cell update Equation 5, the products between gates become products over linear sums of contributions from different factors. Upon expanding these products, the resulting cross-terms yield a natural interpretation as being interactions between variables. In particular, cross-terms can be assigned as to whether they resulted solely from the phrase, e.g. $\mathsf { \bar { L } } _ { \sigma } ( V _ { i } \beta _ { t - 1 } ) \odot L _ { \operatorname { t a n h } } ( V _ { g } \beta _ { t - 1 } )$ , from some interaction between the phrase and other factors, e.g. $L _ { \sigma } ( V _ { i } \beta _ { t - 1 } ) \odot L _ { \operatorname { t a n h } } ( V _ { g } \gamma _ { t - 1 } )$ , or purely from other factors, e.g. $L _ { \sigma } ( \bar { b } _ { i } ) \odot L _ { \mathrm { t a n h } } ( V _ { g } \gamma _ { t - 1 } )$ .
|
| 83 |
+
|
| 84 |
+
Mirroring the recurrent nature of LSTMs, the above insights allow us to recursively compute our decomposition, with the initializations $\beta _ { 0 } = \beta _ { 0 } ^ { c } = \gamma _ { 0 } = \gamma _ { 0 } ^ { c } = 0$ . We derive below the update equations for the case where $q \leq t \leq r$ , so that the current time step is contained within the phrase. The other case is similar, and the general recursion formula is provided in Appendix 6.2.
|
| 85 |
+
|
| 86 |
+
For clarity, we decompose the two products in the cell update Equation 5 separately. As discussed above, we simply linearize the gates involved, expand the resulting product of sums, and group the cross-terms according to whether or not their contributions derive solely from the specified phrase, or otherwise. Terms are determined to derive solely from the specified phrase if they involve products from some combination of $\beta _ { t - 1 } , \beta _ { t - 1 } ^ { c } , x _ { t }$ and $b _ { i }$ or $b _ { g }$ (but not both). When $t$ is not within the phrase, products involving $x _ { t }$ are treated as not deriving from the phrase.
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r l } & { f _ { t } \odot c _ { t - 1 } = \left( L _ { \sigma } ( W _ { f } x _ { t } ) + L _ { \sigma } ( V _ { f } \beta _ { t - 1 } ) + L _ { \sigma } ( V _ { f } \gamma _ { t - 1 } ) + L _ { \sigma } ( b _ { f } ) \right) \odot \left( \beta _ { t - 1 } ^ { c } + \gamma _ { t - 1 } ^ { c } \right) } \\ & { \qquad = \left( \left[ L _ { \sigma } ( W _ { f } x _ { t } ) + L _ { \sigma } ( V _ { f } \beta _ { t - 1 } ) + L _ { \sigma } ( b _ { f } ) \right] \odot \beta _ { t - 1 } ^ { c } \right) } \\ & { \qquad + \left( L _ { \sigma } ( V _ { f } \gamma _ { t - 1 } ) \odot \beta _ { t - 1 } ^ { c } + f _ { t } \odot \gamma _ { t - 1 } ^ { c } \right) } \\ & { \qquad = \beta _ { t } ^ { f } + \gamma _ { t } ^ { f } } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r l } { i _ { t } \odot g _ { t } = [ L _ { \sigma } ( W _ { i } x _ { t } ) + L _ { \sigma } ( V _ { i } \beta _ { t - 1 } ) + L _ { \sigma } ( V _ { i } \gamma _ { t - 1 } ) + L _ { \sigma } ( b _ { i } ) ] } \\ { \odot [ L _ { \mathrm { t a n h } } ( W _ { g } x _ { t } ) + L _ { \mathrm { t a n h } } ( V _ { g } \beta _ { t - 1 } ) + L _ { \mathrm { t a n h } } ( V _ { g } \gamma _ { t - 1 } ) + L _ { \mathrm { t a n h } } ( b _ { g } ) ] } \\ { = [ L _ { \sigma } ( W _ { i } x _ { t } ) \odot [ L _ { \mathrm { t a n h } } ( W _ { g } x _ { t } ) + L _ { \mathrm { t a n h } } ( V _ { g } \beta _ { t - 1 } ) + L _ { \mathrm { t a n h } } ( b _ { g } ) ] } \\ { + L _ { \sigma } ( V _ { i } \beta _ { t - 1 } ) \odot [ L _ { \mathrm { t a n h } } ( W _ { g } x _ { t } ) + L _ { \mathrm { t a n h } } ( V _ { g } \beta _ { t - 1 } ) + L _ { \mathrm { t a n h } } ( b _ { g } ) ] } \\ { + L _ { \sigma } ( b _ { i } ) \odot [ L _ { \mathrm { t a n h } } ( W _ { g } x _ { t } ) + L _ { \mathrm { t a n h } } ( V _ { g } \beta _ { t - 1 } ) ] ] } \\ { + [ L _ { \sigma } ( V _ { i } \gamma _ { t - 1 } ) \odot g _ { t } + i _ { t } \odot L _ { \mathrm { t a n h } } ( V _ { g } \gamma _ { t - 1 } ) - L _ { \sigma } ( V _ { i } \gamma _ { t - 1 } ) \odot L _ { \mathrm { t a n h } } ( V _ { g } \gamma _ { t - 1 } ) } \\ { + \ell _ { \sigma } ( b _ { i } ) \odot L _ { \mathrm { t a n h } } ( b _ { g } ) ] } \\ { = \beta _ { t } ^ { u } + \gamma _ { t } ^ { u } } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
Having decomposed the two components of the cell update equation, we can attain our decomposition of $c _ { t }$ by summing the two contributions.
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { l } { \beta _ { t } ^ { c } = \beta _ { t } ^ { f } + \beta _ { t } ^ { u } } \\ { \gamma _ { t } ^ { c } = \gamma _ { t } ^ { f } + \gamma _ { t } ^ { u } } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Once we have computed the decomposition of $c _ { t }$ , it is relatively simple to compute the resulting transformation of $h _ { t }$ by linearizing the tanh function in 6. Note that we could similarly decompose the output gate as we treated the forget gate above, but we empirically found this to not produce improved results.
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r l } & { h _ { t } = o _ { t } \odot \operatorname { t a n h } ( c _ { t } ) } \\ & { \phantom { = } = o _ { t } \odot [ L _ { \operatorname { t a n h } } ( \beta _ { t } ^ { c } ) + L _ { \operatorname { t a n h } } ( \gamma _ { t } ^ { c } ) ] } \\ & { \phantom { = } = o _ { t } \odot L _ { \operatorname { t a n h } } ( \beta _ { t } ^ { c } ) + o _ { t } \odot L _ { \operatorname { t a n h } } ( \gamma _ { t } ^ { c } ) } \\ & { \phantom { = } = \beta _ { t } + \gamma _ { t } } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
# 3.2.2 LINEARIZING ACTIVATION FUNCTIONS
|
| 109 |
+
|
| 110 |
+
We now describe the linearizing functions $L _ { \sigma } , L _ { \mathrm { t a n h } }$ used in the above decomposition. Formally, for arbitrary $\{ y _ { 1 } , . . . , y _ { N } \} \in \mathbb { R }$ , where $N \leq 4$ , the problem is how to write
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\operatorname { t a n h } ( \sum _ { i = 1 } ^ { N } y _ { i } ) = \sum _ { i = 1 } ^ { N } L _ { \operatorname { t a n h } } ( y _ { i } )
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
In the cases where there is a natural ordering to $\{ y _ { i } \}$ , prior work (Murdoch & Szlam, 2017) has used a telescoping sum consisting of differences of partial sums as a linearization technique, which we show below.
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
L _ { \operatorname { t a n h } } ^ { \prime } ( y _ { k } ) = \operatorname { t a n h } ( \sum _ { j = 1 } ^ { k } y _ { j } ) - \operatorname { t a n h } ( \sum _ { j = 1 } ^ { k - 1 } y _ { j } )
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
However, in our setting $\{ y _ { i } \}$ contains terms such as $\beta _ { t - 1 }$ , $\gamma _ { t - 1 }$ and $x _ { t }$ , which have no clear ordering. Thus, there is no natural way to order the sum in Equation 26. Instead, we compute an average over all orderings. Letting $\pi _ { 1 } , . . . , \pi _ { M _ { N } }$ denote the set of all permutations of $1 , . . . , N$ , our score is given below. Note that when $\pi _ { i } ( j ) = j$ , the corresponding term is equal to equation 26.
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
L _ { \mathrm { t a n h } } ( y _ { k } ) = { \frac { 1 } { M _ { N } } } \sum _ { i = 1 } ^ { M _ { N } } [ \mathrm { t a n h } ( \sum _ { j = 1 } ^ { \pi _ { i } ^ { - 1 } ( k ) } y _ { \pi _ { i } ( j ) } ) - \mathrm { t a n h } ( \sum _ { j = 1 } ^ { \pi _ { i } ^ { - 1 } ( k ) - 1 } y _ { \pi _ { i } ( j ) } ) ]
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
$L _ { \sigma }$ can be analogously derived. When one of the terms in the decomposition is a bias, we saw improvements when restricting to permutations where the bias is the first term.
|
| 129 |
+
|
| 130 |
+
As $N$ only ranges between 2 and 4, this linearization generally takes very simple forms. For instance, when $N = 2$ , the contribution assigned to $y _ { 1 }$ is
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
L _ { \operatorname { t a n h } } ( y _ { 1 } ) = { \frac { 1 } { 2 } } ( [ \operatorname { t a n h } ( y _ { 1 } ) - \operatorname { t a n h } ( 0 ) ] + [ \operatorname { t a n h } ( y _ { 2 } + y _ { 1 } ) - \operatorname { t a n h } ( y _ { 1 } ) ] )
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
This linearization was presented in a scalar context where $y _ { i } \in \mathbb { R }$ , but trivially generalizes to the vector setting $y _ { i } \in \mathbb { R } ^ { d _ { 2 } }$ . It can also be viewed as an approximation to Shapely values, as discussed in Lundberg & Lee (2016) and Shrikumar et al. (2017).
|
| 137 |
+
|
| 138 |
+
# 4 EXPERIMENTS
|
| 139 |
+
|
| 140 |
+
We now describe our empirical validation of CD on the task of sentiment analysis. First, we verify that, on the standard problem of word-level importance scores, CD compares favorably to prior work. Then we examine the behavior of CD for word and phrase level importance in situations involving compositionality, showing that CD is able to capture the composition of phrases of differing sentiment. Finally, we show that CD is capable of extracting instances of positive and negative negation. Code for computing CD scores is available online 1.
|
| 141 |
+
|
| 142 |
+
# 4.1 TRAINING DETAILS
|
| 143 |
+
|
| 144 |
+
We first describe the process for fitting models which are used to produce interpretations. As the primary intent of this paper is not predictive accuracy, we used standard best practices without much tuning. We implemented all models in Torch using default hyperparameters for weight initializations. All models were optimized using Adam (Kingma & Ba, 2014) with the default learning rate of 0.001 using early stopping on the validation set. For the linear model, we used a bag of vectors model, where we sum pre-trained Glove vectors (Pennington et al., 2014) and add an additional linear layer from the word embedding dimension, 300, to the number of classes, 2. We fine tuned both the word vectors and linear parameters. We will use the two data sets described below to validate our new CD method.
|
| 145 |
+
|
| 146 |
+
# 4.1.1 STANFORD SENTIMENT TREEBANK
|
| 147 |
+
|
| 148 |
+
We trained an LSTM model on the binary version of the Stanford Sentiment Treebank (SST) (Socher et al., 2013), a standard NLP benchmark which consists of movie reviews ranging from 2 to 52 words long. In addition to review-level labels, it also provides labels for each phrase in the binarized constituency parse tree. Following the hyperparameter choices in Tai et al. (2015), the word and hidden representations of our LSTM were set to 300 and 168, and word vectors were initialized to pretrained Glove vectors (Pennington et al., 2014). Our LSTM attains $8 7 . 2 \%$ accuracy, and we also train a logistic regression model with bag of words features, which attains $8 3 . 2 \%$ accuracy.
|
| 149 |
+
|
| 150 |
+
# 4.1.2 YELP POLARITY
|
| 151 |
+
|
| 152 |
+
Originally introduced in Zhang et al. (2015), the Yelp review polarity dataset was obtained from the Yelp Dataset Challenge and has train and test sets of sizes 560,000 and 38,000. The task is binary prediction for whether the review is positive (four or five stars) or negative (one or two stars). The reviews are relatively long, with an average length of 160.1 words. Following the guidelines from Zhang et al. (2015), we implement an LSTM model which attains $4 . 6 \%$ error, and an ngram logistic regression model, which attains $5 . 7 \%$ error. For computational reasons, we report interpretation results on a random subset of sentences of length at most 40 words. When computing integrated gradient scores, we found that numerical issues produced unusable outputs for roughly $6 \%$ of the samples. These reviews are excluded.
|
| 153 |
+
|
| 154 |
+
# 4.1.3 INTERPRETATION BASELINES
|
| 155 |
+
|
| 156 |
+
We compare the interpretations produced by CD against four state of the art baselines: cell decomposition (Murdoch & Szlam, 2017), integrated gradients (Sundararajan et al., 2017), leave one out (Li et al., 2016), and gradient times input. We refer the reader to Section 2 for descriptions of these algorithms. For our gradient baseline, we compute the gradient of the output probability with respect to the word embeddings, and report the dot product between the word vector and its gradient. For integrated gradients, producing reasonable values required extended experimentation and communication with the creators regarding the choice of baselines and scaling issues. We ultimately used sequences of periods for our baselines, and rescaled the scores for each review by the standard deviation of the scores for that review, a trick not previously mentioned in the literature. To obtain phrase scores for word-based baselines integrated gradients, cell decomposition, and gradients, we sum the scores of the words contained within the phrase.
|
| 157 |
+
|
| 158 |
+
# 4.2 UNIGRAM (WORD) SCORES
|
| 159 |
+
|
| 160 |
+
Before examining the novel, phrase-level dynamics of CD, we first verify that it compares favorably to prior work for the standard use case of producing unigram coefficients. When sufficiently accurate in terms of prediction, logistic regression coefficients are generally treated as a gold standard for interpretability. In particular, when applied to sentiment analysis the ordering of words given by their coefficient value provides a qualitatively sensible measure of importance. Thus, when determining the validity of coefficients extracted from an LSTM, we should expect there to be a meaningful relationship between the CD scores and logistic regression coefficients.
|
| 161 |
+
|
| 162 |
+
In order to evaluate the word-level coefficients extracted by the CD method, we construct scatter plots with each point consisting of a single word in the validation set. The two values plotted correspond to the coefficient from logistic regression and importance score extracted from the LSTM. For a quantitative measure of accuracy, we use pearson correlation coefficient.
|
| 163 |
+
|
| 164 |
+
We report quantitative and qualitative results in Appendix 6.1.3. For SST, CD and integrated gradients, with correlations of 0.76 and 0.72, respectively, are substantially better than other methods, with correlations of at most 0.51. On Yelp, the gap is not as big, but CD is still very competitive, having correlation 0.52 with other methods ranging from 0.34 to 0.56. Having verified reasonably strong results in this base case, we now proceed to show the benefits of CD.
|
| 165 |
+
|
| 166 |
+
# 4.3 IDENTIFYING DISSENTING SUBPHRASES
|
| 167 |
+
|
| 168 |
+
We now show that, for phrases of at most five words, existing methods are unable to recognize subphrases with differing sentiments. For example, consider the phrase “used to be my favorite”, which is of negative sentiment. The word “favorite”, however, is strongly positive, having a logistic regression coefficient in the 93rd percentile. Nonetheless, existing methods consistently rank “favorite” as being highly negative or neutral. In contrast, as shown in Table 1, CD is able to identify “my favorite” as being strongly positive, and ”used to be” as strongly negative. A similar dynamic also occurs with the phrase “not worth the time”. The main justification for using LSTMs over simpler models is precisely that they are able to capture these kinds of interactions. Thus, it is important that an interpretation algorithm is able to properly uncover how the interactions are being handled.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Table 1: Heat maps for portion of yelp review with different attribution techniques. Only CD captures that ”favorite” is positive.
|
| 172 |
+
|
| 173 |
+
Using the above as a motivating example, we now show that a similar trend holds throughout the Yelp polarity dataset. In particular, we conduct a search for situations similar to the above, where a strongly positive/negative phrase contains a strongly dissenting subphrase. Phrases are scored using the logistic regression with n-gram features described in Section 4.1, and included if their absolute score is over 1.5. We then examine the distribution of scores for the dissenting subphrases, which are analogous to “favorite”.
|
| 174 |
+
|
| 175 |
+
For an effective interpretation algorithm, the distribution of scores for positive and negative dissenting subphrases should be significantly separate, with positive subphrases having positive scores, and vice versa. However, as can be seen in Appendix 6.1.1, for prior methods these two distributions are nearly identical. The CD distributions, on the other hand, are significantly separate, indicating that what we observed anecdotally above holds in a more general setting.
|
| 176 |
+
|
| 177 |
+
# 4.4 EXAMINING HIGH-LEVEL COMPOSITIONALITY
|
| 178 |
+
|
| 179 |
+
We now show that prior methods struggle to identify cases where a sizable portion of a review (between one and two thirds) has polarity different from the LSTM’s prediction. For instance, consider the review in Table 2, where the first phrase is clearly positive, but the second phrase causes the review to ultimately be negative. CD is the only method able to accurately capture this dynamic.
|
| 180 |
+
|
| 181 |
+
By leveraging the phrase-level labels provided in SST, we can show that this pattern holds in the general case. In particular, we conduct a search for reviews similar to the above example. The search criteria are whether a review contains a phrase labeled by SST to be of opposing sentiment to the review-level SST label, and is between one and two thirds the length of the review.
|
| 182 |
+
|
| 183 |
+
In Appendix 6.1.2, we show the distribution of the resulting positive and negative phrases for different attribution methods. A successful interpretation method would have a sizable gap between these two distributions, with positive phrases having mostly positive scores, and negative phrases mostly negative. However, prior methods struggle to satisfy these criteria. $87 \%$ of all positive phrases are labelled as negative by integrated gradients, and cell decompositions (Murdoch & Szlam, 2017) even have the distributions flipped, with negative phrases yielding more positive scores than the positive phrases. CD, on the other hand, provides a very clear difference in distributions. To quantify this separation between positive and negative distributions, we examine a two-sample KolmogorovSmirnov one-sided test statistic, a common test for the difference of distributions with values ranging from 0 to 1. CD produces a score of 0.74, indicating a strong difference between positive and negative distributions, with other methods achieving scores of 0 (cell decomposition), 0.33 (integrated gradients), 0.58 (leave one out) and 0.61 (gradient), indicating weaker distributional differences. Given that gradient and leave one out were the weakest performers in unigram scores, this provides strong evidence for the superiority of CD.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Table 2: Heat maps for portion of review from SST with different attribution techniques. Only CD captures that the first phrase is positive.
|
| 187 |
+
|
| 188 |
+
# 4.5 CONTEXTUAL DECOMPOSITION (CD) CAPTURES NEGATION
|
| 189 |
+
|
| 190 |
+
In order to understand an LSTM’s prediction mechanism, it is important to understand not just the contribution of a phrase, but how that contribution is computed. For phrases involving negation, we now demonstrate that we can use CD to empirically show that our LSTM learns a negation mechanism.
|
| 191 |
+
|
| 192 |
+
Using the phrase labels in SST, we search over the training set for instances of negation. In particular, we search for phrases of length less than ten with the first child containing a negation phrase (such as “not” or “lacks”, full list provided in Appendix 6.3) in the first two words, and the second child having positive or negative sentiment. Due to noise in the labels, we also included phrases where the entire phrase was non-neutral, and the second child contained a non-neutral phrase. We identify both positive negation, such as “isn’t a bad film”, and negative negation, such as “isn’t very interesting”, where the direction is given by the SST-provided label of the phrase.
|
| 193 |
+
|
| 194 |
+
For a given negation phrase, we extract a negation interaction by computing the CD score of the entire phrase and subtracting the CD scores of the phrase being negated and the negation term itself. The resulting score can be interpreted as an n-gram feature. Note that, of the methods we compare against, only leave one out is capable of producing such interaction scores. For reference, we also provide the distribution of all interactions for phrases of length less than 5.
|
| 195 |
+
|
| 196 |
+
We present the distribution of extracted scores in Figure 1. For CD, we can see that there is a clear distinction between positive and negative negations, and that the negation interactions are centered on the outer edges of the distribution of interactions. Leave one out is able to capture some of the interactions, but has a noticeable overlap between positive and negative negations around zero, indicating a high rate of false negatives.
|
| 197 |
+
|
| 198 |
+
# 4.6 IDENTIFYING SIMILAR PHRASES
|
| 199 |
+
|
| 200 |
+
Another benefit of using CDs for interpretation is that, in addition to providing importance scores, it also provides dense embeddings for arbitrary phrases and interactions, in the form of $\beta _ { T }$ discussed in Section 3.2. We anecdotally show that similarity in this embedding space corresponds to semantic similarity in the context of sentiment analysis.
|
| 201 |
+
|
| 202 |
+
In particular, for all words and binary interactions, we compute the average embedding $\beta _ { T }$ produced by CD across the training and validation sets. In Table 3, we show the nearest neighbours using a cosine similarity metric. The results are qualitatively sensible for three different kinds of interactions: positive negation, negative negation and modification, as well as positive and negative words. Note that we for positive and negative words, we chose the positive/negative parts of the negations, in order to emphasize that CD can disentangle this composition.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 1: Distribution of scores for positive and negative negation coefficients relative to all interaction coefficients. Only leave one out and CD are capable of producing these interaction scores.
|
| 206 |
+
|
| 207 |
+
Table 3: Nearest neighbours for selected unigrams and interactions using CD embeddings
|
| 208 |
+
|
| 209 |
+
<table><tr><td>not entertain- ing</td><td>not bad</td><td>very funny</td><td>entertaining</td><td>bad</td></tr><tr><td>not funny</td><td>never dull</td><td>well-put- together piece</td><td>intelligent</td><td>dull</td></tr><tr><td>not engaging</td><td>n't drag</td><td>entertaining romp</td><td>engaging</td><td>drag</td></tr><tr><td>never satisfac- tory</td><td>never fails</td><td>very good</td><td>satisfying</td><td>awful</td></tr><tr><td>not well</td><td>without sham</td><td>surprisingly sweet</td><td>admirable</td><td>tired</td></tr><tr><td>not fit</td><td>without missing</td><td>very well- written</td><td>funny</td><td>dreary</td></tr></table>
|
| 210 |
+
|
| 211 |
+
# 5 CONCLUSION
|
| 212 |
+
|
| 213 |
+
In this paper, we have proposed contextual decomposition (CD), an algorithm for interpreting individual predictions made by LSTMs without modifying the underlying model. In both NLP and general applications of LSTMs, CD produces importance scores for words (single variables in general), phrases (several variables together) and word interactions (variable interactions). Using two sentiment analysis datasets for empirical validation, we first show that for information also produced by prior methods, such as word-level scores, our method compares favorably. More importantly, we then show that CD is capable of identifying phrases of varying sentiment, and extracting meaningful word (or variable) interactions. This movement beyond word-level importance is critical for understanding a model as complex and highly non-linear as LSTMs.
|
| 214 |
+
|
| 215 |
+
# ACKNOWLEDGMENTS
|
| 216 |
+
|
| 217 |
+
This research was started during a summer internship at Google Brain, and later supported by a postgraduate scholarship-doctoral from NSERC and a data science research award from Adobe. This work is partially supported by Center for Science of Information (CSoI), an NSF Science and
|
| 218 |
+
|
| 219 |
+
Technology Center, under grant agreement CCF-0939370, ONR grant N00014-16-1-2664 and ARO grant W911NF1710005.
|
| 220 |
+
|
| 221 |
+
# REFERENCES
|
| 222 |
+
|
| 223 |
+
Sebastian Bach, Alexander Binder, Gregoire Montavon, Frederick Klauschen, Klaus-Robert M ´ uller, ¨ and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015.
|
| 224 |
+
|
| 225 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 226 |
+
|
| 227 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 228 |
+
|
| 229 |
+
Andrej Karpathy, Justin Johnson, and Li Fei-Fei. Visualizing and understanding recurrent networks. arXiv preprint arXiv:1506.02078, 2015.
|
| 230 |
+
|
| 231 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 232 |
+
|
| 233 |
+
Jiwei Li, Will Monroe, and Dan Jurafsky. Understanding neural networks through representation erasure. CoRR, abs/1612.08220, 2016. URL http://arxiv.org/abs/1612.08220.
|
| 234 |
+
|
| 235 |
+
Scott Lundberg and Su-In Lee. An unexpected unity among methods for interpreting model predictions. arXiv preprint arXiv:1611.07478, 2016.
|
| 236 |
+
|
| 237 |
+
Gabor Melis, Chris Dyer, and Phil Blunsom. On the state of the art of evaluation in neural language ´ models. CoRR, abs/1707.05589, 2017. URL http://arxiv.org/abs/1707.05589.
|
| 238 |
+
|
| 239 |
+
W James Murdoch and Arthur Szlam. Automatic rule extraction from long short term memory networks. ICLR, 2017.
|
| 240 |
+
|
| 241 |
+
Jeffrey Pennington, Richard Socher, and Christopher 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.
|
| 242 |
+
|
| 243 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $1 0 0 { , } 0 0 0 { + }$ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016.
|
| 244 |
+
|
| 245 |
+
Alexander M Rush, Sumit Chopra, and Jason Weston. A neural attention model for abstractive sentence summarization. arXiv preprint arXiv:1509.00685, 2015.
|
| 246 |
+
|
| 247 |
+
Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. arXiv preprint arXiv:1704.02685, 2017.
|
| 248 |
+
|
| 249 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1631–1642, 2013.
|
| 250 |
+
|
| 251 |
+
Hendrik Strobelt, Sebastian Gehrmann, Bernd Huber, Hanspeter Pfister, and Alexander M Rush. Visual analysis of hidden state dynamics in recurrent neural networks. arXiv preprint arXiv:1606.07461, 2016.
|
| 252 |
+
|
| 253 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. CoRR, abs/1703.01365, 2017. URL http://arxiv.org/abs/1703.01365.
|
| 254 |
+
|
| 255 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 256 |
+
|
| 257 |
+
Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075, 2015.
|
| 258 |
+
|
| 259 |
+
Table 4: Correlation coefficients between logistic regression coefficients and extracted scores.
|
| 260 |
+
|
| 261 |
+
<table><tr><td>Attribution Method</td><td>Stanford Sentiment</td><td>Yelp Polarity</td></tr><tr><td>Gradient</td><td>0.375</td><td>0.336</td></tr><tr><td>Leave one out (Li et al., 2016)</td><td>0.510</td><td>0.358</td></tr><tr><td>Cell decomposition (Murdoch & Szlam, 2017)</td><td>0.490</td><td>0.560</td></tr><tr><td>Integrated gradients (Sundararajan et al., 2017)</td><td>0.724</td><td>0.471</td></tr><tr><td>Contextual decompo- sition</td><td>0.758</td><td>0.520</td></tr></table>
|
| 262 |
+
|
| 263 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning, pp. 2048–2057, 2015.
|
| 264 |
+
|
| 265 |
+
Xiang Zhang, Junbo Zhao, and Yann LeCun. Character-level convolutional networks for text classification. In Advances in neural information processing systems, pp. 649–657, 2015.
|
| 266 |
+
|
| 267 |
+
# 6 APPENDIX
|
| 268 |
+
|
| 269 |
+
# 6.1 PLOTS
|
| 270 |
+
|
| 271 |
+
6.1.1 PLOTS FOR DISSENTING SUBPHRASES
|
| 272 |
+
|
| 273 |
+
We provide here the plots described in Section 4.3.
|
| 274 |
+
|
| 275 |
+
6.1.2 PLOTS FOR HIGH-LEVEL COMPOSITIONALITY
|
| 276 |
+
|
| 277 |
+
We provide here the plots referenced in Section 4.4.
|
| 278 |
+
|
| 279 |
+
6.1.3 LOGISTIC REGRESSION VERSUS EXTRACTED COEFFICIENTS SCATTERPLOTS
|
| 280 |
+
|
| 281 |
+
We provide here the scatterplots and correlations referenced in section 4.2.
|
| 282 |
+
|
| 283 |
+
# 6.2 GENERAL RECURSION FORMULA
|
| 284 |
+
|
| 285 |
+
We provide here the general recursion formula referenced in Section 3.2.1. The two cases that are considered is whether the current time step is during the phrase $\ Q \leq t \leq r ,$ ) or outside of the phrase ( $t < q$ or $t > r$ ).
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\begin{array} { r l r } { { \beta _ { t } ^ { f } = [ L _ { \sigma } ( V _ { f } \beta _ { t - 1 } ) + L _ { \sigma } ( b _ { f } ) + L _ { \sigma } ( V _ { f } x _ { t } ) ] _ { q \le t \le r } \| \odot \beta _ { t - 1 } ^ { c } } } \\ & { r _ { t } ^ { f } = f _ { t } \odot \gamma _ { t - 1 } ^ { c } + [ L _ { \sigma } ( V _ { f } \gamma _ { t - 1 } ) + L _ { \sigma } ( V _ { f } x _ { t } ) ] _ { t > q , t \le r } ] \odot \beta _ { t - 1 } ^ { c } } & { ( 3 0 ) } \\ & { u _ { t } ^ { u } = L _ { \sigma } ( V _ { i } \beta _ { t - 1 } ^ { c } ) \odot [ L _ { \operatorname { t a n h } } ( V _ { g } \beta _ { t - 1 } ^ { c } + L _ { \operatorname { t a n h } } ( b _ { g } ) ] + L _ { \sigma } ( b _ { i } ) \odot L _ { \operatorname { t a n h } } ( V _ { g } \beta _ { t - 1 } ^ { c } ) } & { ( 3 1 ) } \\ & { + [ L _ { \sigma } ( W _ { i } x _ { t } ) \odot [ L _ { \operatorname { t a n h } } ( W _ { g } x _ { t } ) + L _ { \operatorname { t a n h } } ( V _ { g } \beta _ { t - 1 } ) + L _ { \operatorname { t a n h } } ( b _ { g } ) ] + L _ { \operatorname { t a n h } } ( b _ { g } ) ] + L _ { \sigma } ( b _ { i } ) \odot L _ { \operatorname { t a n h } } ( W _ { g } x _ { t } ) ] _ { 1 q \le t \le r } } \\ & { u _ { t } ^ { u } = L _ { \sigma } ( V _ { i } \gamma _ { t - 1 } ) \odot g _ { t } + i _ { t } \odot L _ { \operatorname { t a n h } } ( V _ { g } \gamma _ { t - 1 } ) - L _ { \sigma } ( V _ { i } \gamma _ { t - 1 } ) \odot L _ { \operatorname { t a n h } } ( V _ { g } \gamma _ { t - 1 } ) + L _ { \sigma } ( b _ { i } ) \odot L _ { \operatorname { t a n h } } ( b _ { g } ) } \end{array}
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
+ \left[ L _ { \sigma } ( W _ { i } x _ { t } ) \odot [ L _ { \operatorname { t a n h } } ( W _ { g } x _ { t } ) + L _ { \operatorname { t a n h } } ( V _ { g } \beta _ { t - 1 } ) + L _ { \operatorname { t a n h } } ( b _ { g } ) ] + L _ { \sigma } ( b _ { i } ) \odot L _ { \operatorname { t a n h } } ( W _ { g } x _ { t } ) ] 1 _ { t < q , t > \tau } \right] \Biggr \} .
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
Figure 2: The distribution of attributions for positive (negative) sub-phrases contained within negative (positive) phrases of length at most five in the Yelp polarity dataset. The positive and negative distributions are nearly identical for all methods except CD, indicating an inability of prior methods to distinguish between positive and negative phrases when occurring in the context of a phrase of the opposite sentiment
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 3: Distribution of positive and negative phrases, of length between one and two thirds of the full review, in SST. The positive and negative distributions are significantly more separate for CD than other methods, indicating that even at this coarse level of granularity, other methods still struggle.
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 4: Logistic regression coefficients versus coefficients extracted from an LSTM on SST. We include a least squares regression line. Stronger linear relationships in the plots correspond to better interpretation techniques.
|
| 303 |
+
|
| 304 |
+
# 6.3 LIST OF WORDS USED TO IDENTIFY NEGATIONS
|
| 305 |
+
|
| 306 |
+
To search for negations, we used the following list of negation words: not, n’t, lacks, nobody, nor, nothing, neither, never, none, nowhere, remotely
|
md/train/rkeMHjR9Ym/rkeMHjR9Ym.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/rkmtTJZCb/rkmtTJZCb.md
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNSUPERVISED HIERARCHICAL VIDEO PREDICTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Much recent research has been devoted to video prediction and generation, yet a lot of previous work has been focused on short-scale time horizons. The hierarchical video prediction method by Villegas et al. (2017) is an example of a state of the art method for long term video prediction. However, their method has limited applicability in practical settings as it requires a ground truth pose (e.g., poses of joints of a human) at training time. This paper presents a long term hierarchical video prediction model that does not have such a restriction. We show that the network learns its own higher level structure (e.g., pose-equivalent hidden variables) that works better in cases where the ground truth pose does not fully capture all of the information needed to predict the next frame. This method gives sharper results than other video prediction methods which do not require a ground truth pose, and its efficiency is shown on the Humans 3.6M and Robot Pushing datasets.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
It is hypothesized that learning to predict the future and the effect of their actions is an important quality for intelligent agents that interact with their environment. This is a complicated task, as typical use cases require predicting the outcome of interactions between the agent and objects over multiple timesteps.
|
| 12 |
+
|
| 13 |
+
In this work we are looking at the task of predicting the pixels of future video frames given the first few observed frames. We also consider the action conditional setting, in which we are given the action that the agent is taking and are tasked to predict the pixel level outcome of that action in the future.
|
| 14 |
+
|
| 15 |
+
The method of Villegas et al. (2017) is a novel way to generate long term video predictions, but requires ground truth human pose annotations. In this work we explore ways to generate videos using a hierarchical model without requiring a ground truth pose or other high level structure annotations for each frame. The method is hierarchical in the sense that it learns to generate a high level structure, then makes next frame predictions based on that structure.
|
| 16 |
+
|
| 17 |
+
# 2 RELATED WORK
|
| 18 |
+
|
| 19 |
+
Patch level prediction The video prediction problem was initially studied at the patch level (Sutskever et al., 2009; Michalski et al., 2014; Mittelman et al., 2014; Srivastava et al., 2015). This work showed promising results on synthetic data (e.g. bouncing balls), but did not scale to predicting higher resolution videos.
|
| 20 |
+
|
| 21 |
+
Frame level prediction on realistic videos. More recently, the video prediction problem has been formulated at the entire frame level. Most of the recent work is based on the convolutional encoder/decoder framework. Finn et al. (2016) proposed a network that can perform next level video frame prediction by explicitly predicting movement. For each pixel in the previous frame, the network outputs a distribution over locations that pixel is predicted to move. The movements are averaged to get the final prediction. The network is trained end to end to minimize L2 loss. Mathieu et al. (2016) proposed adversarial training with multiscale convolutional networks to generate sharper pixel level predictions in comparison to conventional L2 loss. Villegas et al. (2017) proposed a network that decomposes motion and content in video prediction and showed improved performance over Mathieu et al. (2016). Lotter et al. (2017) proposed a deep predictive coding network in which each layer learns to predict the lower-level difference between the future frame and current frame. As an alternative approach to convolutional encoder/decoder networks, Kalchbrenner et al. (2016) proposed an autoregressive generation scheme for improved prediction performance. Despite their promise, these work have not been demonstrated for long term prediction on high resolution natural videos beyond $\approx 2 0$ frames.
|
| 22 |
+
|
| 23 |
+
Long-term prediction. Oh et al. (2015) proposed action conditional convolutional encoderdecoder architecture that has demonstrated impressive long-term prediction performance on video games (e.g., Atari games), but it has not been applied for predicting challenging real-world videos.
|
| 24 |
+
|
| 25 |
+
# 2.1 HIERARCHICAL VIDEO PREDICTION (VILLEGAS ET AL., 2017)
|
| 26 |
+
|
| 27 |
+
Villegas et al. (2017) demonstrated a long-term prediction method using hierarchical prediction where the ground truth human pose is assumed to be given as supervision. Our method is based off of that work, so we describe it in detail in the following section.
|
| 28 |
+
|
| 29 |
+
# 2.1.1 INFERENCE AND ARCHITECTURE
|
| 30 |
+
|
| 31 |
+
To generate the image at timestep $t$ , the following procedure is used. First, a convolutional neural network encoder generates an embedding vector from the previous ground truth image: $e _ { t - 1 } =$ $C N N ( i m g _ { t - 1 } )$ . This encoding represents the pose of a person.
|
| 32 |
+
|
| 33 |
+
Next, a multilayer LSTM predictor network predicts what the encoding will be in a future timestep. For some number of context frames, the predictor makes its prediction based off of the encoding from the ground truth image. After the predictor network has enough context, it makes its predictions based off of its previous predictions (Fig. 1 provides a helpful visual). For example, if there are $\textrm { C }$ context frames, the following is used to generate the encoding at step $t$ .
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r } { \left\{ \left[ p _ { t } , H _ { t } \right] = L S T M ( e _ { t - 1 } , H _ { t - 1 } ) \quad i f t < = C \right. } \\ { \left[ p _ { t } , H _ { t } \right] = L S T M ( p _ { t - 1 } , H _ { t - 1 } ) \quad i f t > C } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
$H _ { t }$ is the hidden state of the LSTM at timestep $t$ . Note that only the encoding of the context frames are used, not the subsequent frames. Similar to $e _ { t }$ in the above, $p _ { t }$ represents the predicted pose.
|
| 40 |
+
|
| 41 |
+
Once $p _ { t }$ is obtained, a visual analogy network (VAN) (Reed et al., 2015) is used to generate the corresponding image at time $t$ . The VAN applies the transformation that occurred between two images to a given query image. In this case the first frame of the video should be transformed in the same way as the encoding was transformed from the first to $t$ -th timestep. The VAN does this by mapping images to a space where analogies can be represented by additions and subtractions, and then mapping the result back to image space. To obtain the predicted image at timestep $t$ using the VAN one needs to use $\widehat { i m g } _ { t } = V A \bar { N } ( e _ { 1 } , p _ { t } , i m g _ { 1 } )$ , where the VAN is defined as
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
V A N ( e _ { 1 } , p _ { t } , i m g _ { 1 } ) = f _ { d e c } ( f _ { e n c } ( g ( p _ { t } ) ) - f _ { e n c } ( g ( e _ { 1 } ) ) + f _ { i m g } ( i m g _ { 1 } ) )
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Where $g$ is a hardcoded function to transform the pose into a 2 dimensional representation of the pose. The weights of $f _ { e n c }$ and $f _ { i m g }$ are shared.
|
| 48 |
+
|
| 49 |
+
# 2.1.2 TRAINING
|
| 50 |
+
|
| 51 |
+
The disadvantage of this method is that the training relies on ground truth pose annotations. The encoder is trained to produce the pose given the image, the predictor is trained to predict that pose into the future and the VAN is trained to generate the image given the pose.
|
| 52 |
+
|
| 53 |
+
# 3 PROPOSED METHOD
|
| 54 |
+
|
| 55 |
+
Our method uses a similar network architecture to Villegas et al. (2017) but we present ways of training the network that do not require a ground truth pose. In our method, $e _ { t }$ and $p _ { t }$ have the same dimensionality and represent the network’s own higher level structure (e.g., pose equivalent hidden variables) which the network learns as it is trained.
|
| 56 |
+
|
| 57 |
+
In our case, there is no straightforward way to transform the encoding into a 2 dimensional representation of the pose. Therefore, the part of the VAN that maps the encoding is a fully connected network instead of a convolutional neural network. As a result, the weights are not shared between the fully connected network which processes the encoding, and the ConvNet which processes the image.
|
| 58 |
+
|
| 59 |
+
The equation for the VAN becomes:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
V A N ( e _ { 1 } , p _ { t } , i m g _ { 1 } ) = f _ { d e c } ( f _ { e n c } ( p _ { t } ) - f _ { e n c } ( e _ { 1 } ) + f _ { i m g } ( i m g _ { 1 } ) )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Note that $f _ { e n c }$ is a fully connected network, and $f _ { i m g }$ is a conv net. $f _ { d e c }$ is a deconv network.
|
| 66 |
+
|
| 67 |
+
# 3.1 TRAINING
|
| 68 |
+
|
| 69 |
+
There are several ways these networks can be trained. In Villegas et al. (2017), they are each trained separately with the ground truth human pose. In this work, we explore alternative ways of training these networks in the absence of any ground truth pose or other high level structure annotations. We use the same procedure as Villegas et al. (2017) at inference time.
|
| 70 |
+
|
| 71 |
+
# 3.1.1 END TO END
|
| 72 |
+
|
| 73 |
+
One option is to connect the networks the same way as in inference time and train them end to end (E2E). In this method, the L2 loss of of the predicted image is optimized: $\begin{array} { r } { \operatorname* { m i n } ( \sum _ { t = 1 } ^ { T } L _ { 2 } ( \widehat { i m g } _ { t } , i m g _ { t } ) ) } \end{array}$ .
|
| 74 |
+
|
| 75 |
+
There are no constraints on what kind of encoding the encoder produces, or what kind of predictions the predictor makes. Because of how the networks are connected, the encoder will produce an encoding whose future state is easily predicted by the predictor. Likewise, the predictor will make predictions which the VAN can use to produce images which are similar to the ground truth. The encoder and predictor will not have to represent information that is present in the first ground truth frame, since the VAN will have access to the first frame. The size of $e _ { t }$ and $p _ { t }$ is a hyper parameter of this approach. Figure 1 represents a diagram of this method.
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 1: The E2E method. The first few frames are encoded and fed into the predictor as context. The predictor predicts the subsequent encodings, which the VAN uses to produce the pixel level predictions. The average of the losses is minimized. This is also the configuration of every method at inference time, even if the predictor and VAN are trained separately.
|
| 79 |
+
|
| 80 |
+
# 3.1.2 ENCODER PREDICTOR WITH ENCODER VAN
|
| 81 |
+
|
| 82 |
+
An alternative way to train the combined network is to explicitly train the encoder so that $e _ { t }$ is easy to predict into the future, and so that the VAN can use $e _ { t }$ to produce the next frame. We call this method Encoder Predictor with Encoder VAN, or EPEV. The encoder and predictor are trained together so the $e _ { t }$ is easy to predict and the predictor predicts that encoding into the future. To accomplish this, the difference between $e _ { t }$ and $p _ { t }$ , $L _ { 2 } ( \boldsymbol { e } _ { t } , \boldsymbol { p } _ { t } )$ is minimized. The encoder is also trained with the VAN so the VAN can use $e _ { t }$ to produce the image and so that the encoder generates an informative encoding. This is done by minimizing the loss of the VAN given the encoder output: $L _ { 2 } ( \widehat { i m g } _ { e _ { t } } , i m g _ { t } )$ where $\widehat { i m g } _ { e _ { t } } = V A N ( e _ { 1 } , e _ { t } , i m g _ { 1 } )$ . The network is trained to minimize the sum of these two losses: $\begin{array} { r } { \operatorname* { m i n } ( \sum _ { t = 1 } ^ { T } L _ { 2 } ( \widehat { i m g } _ { e _ { t } } , i m g _ { t } ) + \alpha L _ { 2 } ( e _ { t } , p _ { t } ) ) } \end{array}$ , where $\alpha$ is a hyper-parameter that controls the degree to which the $e _ { t }$ will be easy to predict vs. informative enough so the VAN can produce a good image.
|
| 83 |
+
|
| 84 |
+
See figure 2 for a diagram of the encoder and predictor trained together, and figure 3 for the encoder and VAN trained together.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: The segment of the EPEV method in which the encoder and predictor are trained together. The encoder is trained to produce an encoding that is easy to predict, and the predictor is trained to predict that encoding into the future. The average of the losses is minimized.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 3: The segment of the EPEV method in which the encoder and VAN are trained together. The encoder is trained to produce an encoding that is informative to the VAN, while the VAN is trained to output the image given the encoding. The average of the losses is minimized. This method is similar to an autoencoder.
|
| 91 |
+
|
| 92 |
+
Separate gradient descent procedures (or optimizers, in TensorFlow parlance) could be used to minimize $L _ { 2 } ( \widehat { i m g } _ { e _ { t } } , i m g _ { t } )$ and $L _ { 2 } ( e _ { t } , p _ { t } )$ , but we find that minimizing the sum works better experimentally.
|
| 93 |
+
|
| 94 |
+
With this method, the predictor will predict the encoder outputs in future timesteps, and the VAN will use the encoder output to produce the frame.
|
| 95 |
+
|
| 96 |
+
# 3.1.3 E2E WITH POSE
|
| 97 |
+
|
| 98 |
+
The end to end approach can also be augmented if the dataset has information about the ground truth pose or any other high level frame annotations. In this method, the $e _ { t }$ and $p _ { t }$ vectors would be split into two: the first path is optimized to represent the pose, and the rest of $e _ { t }$ and $p _ { t }$ is trained the same way as the E2E approach. At each training step a separate optimizer minimizes each loss. In this method, we can think of $e _ { t }$ and $p _ { t }$ as the concatenation of two vectors, one representing the pose, and the other containing additional information the network can represent. If $\boldsymbol { e _ { t } } ^ { \top } = [ e _ { p o s e _ { t } } , e _ { r e m a i n i n g _ { t } } ]$ and $p _ { t } = [ p _ { p o s e _ { t } } , p _ { r e m a i n i n g _ { t } } ]$ , the following losses are minimized:
|
| 99 |
+
|
| 100 |
+
The loss representing how well the encoder infers the pose: $\begin{array} { r } { \operatorname* { m i n } ( \sum _ { t = 1 } ^ { T } L _ { 2 } ( e _ { p o s e _ { t } } , p o s e _ { t } ) ) } \end{array}$ . The loss representing how well the predictor predicts the pose: $\begin{array} { r } { \operatorname* { m i n } ( \sum _ { t = 1 } ^ { T } L _ { 2 } ( p _ { p o s e _ { t } } , p o s e _ { t } ) ) } \end{array}$ . The end to end loss: $\begin{array} { r } { \operatorname* { m i n } ( \sum _ { t = 1 } ^ { T } L _ { 2 } ( \widehat { i m g } _ { t } , i m g _ { t } ) ) } \end{array}$ .
|
| 101 |
+
|
| 102 |
+
These losses are minimized with separate optimizers in this method. Minimizing the end to end loss ensures that the VAN will learn to use the pose provided by the predictor network, and that the encoder and predictor will learn to produce additional information besides the pose that is useful to the VAN.
|
| 103 |
+
|
| 104 |
+
# 3.1.4 INDIVIDUAL
|
| 105 |
+
|
| 106 |
+
In order to compare to a baseline, we also implemented the method where each of the networks are trained individually, as in Villegas et al. (2017). The main difference between this method and Villegas et al. (2017) is that we do not use an adversarial loss (Goodfellow et al., 2014). See section 5 for a discussion of how an adversarial loss could be added to our method.
|
| 107 |
+
|
| 108 |
+
# 4 EXPERIMENTS
|
| 109 |
+
|
| 110 |
+
These methods were tested on two different datasets, the Robot Push dataset (Finn et al., 2016) and the Humans 3.6M dataset (Ionescu et al., 2014; Catalin Ionescu, 2011). Videos of the results of our method are available by visiting the following URL: https://goo.gl/WA8uxc.
|
| 111 |
+
|
| 112 |
+
The EPEV method works best experimentally if $\alpha$ starts small, around 1e-7, and is gradually increased to around .1 during training. As a result, the encoder will first be optimized to produce an informative encoding, then gradually optimized to also make that encoding easy to predict.
|
| 113 |
+
|
| 114 |
+
# 4.1 ROBOT PUSH DATASET
|
| 115 |
+
|
| 116 |
+
This dataset contains videos of a robot arm pushing objects on a table. The current joint angles and the location of the end effector are given, and we use these as the pose for the methods which require it. The action the robot arm is taking is fed into the predictor.
|
| 117 |
+
|
| 118 |
+
Each of the methods considered was given two frames of context, and then trained to predict 17 subsequent frames. An encoding size of 16 was used for the E2E method. The size of the pose is 12, so the encoding size of the INDIVIDUAL method is 12. The other methods used an encoding size of 32.
|
| 119 |
+
|
| 120 |
+
Additionaly, we randomly split the dataset into training, validation and test. We used 64x64 images, and the same frame rate as the original dataset. Results from our test set are shown in this section. Note that our experimental protocol is different from Finn et al. (2016), where the test set is composed of novel objects.
|
| 121 |
+
|
| 122 |
+
We hypothesized that the methods where the network could learn its own pose equivalent would predict the movement of the objects the robot arm pushes more accurately than the INDIVIDUAL method. To test this, we manually compared the E2E and EPEV methods to the INDIVIDUAL method and evaluated where the movement of predicted objects most closely matched the ground truth. We evaluated 40 videos in which objects move. The results are in Table 1.
|
| 123 |
+
|
| 124 |
+
Table 1: Results from manual comparison of object predictions in 40 videos. The methods perform similarly in the remaining videos.
|
| 125 |
+
|
| 126 |
+
<table><tr><td>Comparison</td><td>Numberofvideos</td></tr><tr><td></td><td></td></tr><tr><td>EPEVbetter than INDIVIDUAL</td><td>6</td></tr><tr><td>INDIVIDUALbetter thanEPEV</td><td>3</td></tr><tr><td>E2Ebetter than INDIVIDUAL</td><td>6</td></tr><tr><td>INDIVIDUAL better than E2E</td><td>6</td></tr></table>
|
| 127 |
+
|
| 128 |
+
In the INDIVIDUAL method, the predictor network can only produce the pose, so the VAN has to infer how the objects will move based on the start and end state of the arm. We were surprised by how well the VAN could infer this. However, from examining the videos, the EPEV method had better object predictions than the INDIVIDUAL method, which supports our hypothesis. The magnified part of ground truth frame 19 in figure 4 shows that the robot arm pushed the yellow object. The EPEV and E2E methods correctly predict this, but in the INDIVIDUAL method, the robot arm covers up the yellow object instead of moving it. Additional analysis is in appendix section F.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 4: A visual comparison of the different methods on the robot push dataset. In the E2E and EPEV methods, the yellow object moves, but it does not in the INDIVIDUAL method.
|
| 132 |
+
|
| 133 |
+
The average Peak Signal to Noise Ratio (PSNR) of the different methods we introduce are similar on this dataset. In this data set, the model from Finn et al. (2016) gets a better PSNR than our model. The movement in this dataset can easily be represented by the movement of pixels, and it is relatively deterministic. So the model from Finn et al. (2016) which explicitly predicts the movement of objects and directly minimizes the L2 loss works well here.
|
| 134 |
+
|
| 135 |
+
# 4.2 LONG TERM PREDICTION ON A TOY DATASET
|
| 136 |
+
|
| 137 |
+
To confirm our claim that our method works well for long term predictions, we trained our method on a toy task with known factors of variation. We used a dataset with a generated shape that bounces around the image and changes size deterministically. We trained the EPEV method and the CDNA method in Finn et al. (2016) to predict 16 frames, given the first 3 frames as context. We do not show the E2E method since it usually predicts blurrier images than the EPEV method. Both methods are evaluated on predicting approximately 1k frames. We added noise to the LSTM states of the predictor network during training to help predict reasonable motion further into the future. Results form a held out test set are described in the following.
|
| 138 |
+
|
| 139 |
+
After visually inspecting the results of both methods, we found that when the CDNA fails, the shape disappears entirely, however when the EPEV method fails, the shape changes color. To quantitatively evaluate both methods, we used a script to measure whether a shape was present frames 1012 to 1022, and if that shape has the appropriate color. See table 2 for the results averaged over 1k runs. The CDNA method predicts a shape with the correct color about $2 5 \%$ of the time, and the EPEV method predicts a shape with the correct color about $9 7 \%$ of the time. The EPEV method sometimes fails by predicting the shape in the same location from frame to frame. This does not happen very often, as the reader can confirm by examining the randomly sampled predictions in appendix section E. It is unrealistic to expect the methods to predict the location of the shape accurately in frame 1000, since small errors propagate in each prediction step.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 5: A visual comparison of the EPEV method and CDNA from Finn et al. (2016) as the baseline. This example is cherry picked to show the typical quality of predictions from both methods. See appendix section E for non-cherry picked results.
|
| 143 |
+
|
| 144 |
+
Table 2: Results on shapes dataset
|
| 145 |
+
|
| 146 |
+
<table><tr><td>Method</td><td>Shape has correct color</td><td> Shape has wrong color</td><td>Shape disappeared</td></tr><tr><td>EPEV</td><td>96.9%</td><td>3.1%</td><td>0%</td></tr><tr><td>CDNA Baseline</td><td>24.6%</td><td>5.7%</td><td>69.7%</td></tr></table>
|
| 147 |
+
|
| 148 |
+
# 4.3 HUMANS 3.6M
|
| 149 |
+
|
| 150 |
+
Our method was also tested on the Humans 3.6M Dataset. Only the E2E and EPEV methods were tested here, since Villegas et al. (2017) has already shown the results using the ground truth pose.
|
| 151 |
+
|
| 152 |
+
We used subjects 1, 5, 6, 7 and 8 for training, subject 9 for validation. Subject 11 results are reported in this paper for testing. We used 64 by 64 images. We subsampled the dataset to 6.25 frames per second. We trained the methods to predict 32 frames and the results in this paper show predicting 64 frames. Each method is given the first 5 frames as context frames. So the in these images, the model predicts about 10 seconds into the future from .8 seconds of context. We used an encoding size of 32 for the E2E method and a encoding size of 64 for the EPEV method on this dataset. We compare our method to the CDNA method in Finn et al. (2016) in Fig. 6.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 6: A visual comparison of the EPEV method and CDNA from Finn et al. (2016) as the baseline. This example is cherry picked to show results when there is significant movement in the ground truth. See appendix section G for non cherry picked results. The contrast of these images was increased to make the humans easier to see. In CDNA from Finn et al. (2016), the person disappeared part way through the prediction. The EPEV method, produced relatively sharp predictions up until frame 42, and a blurry human prediction at frame 63.
|
| 156 |
+
|
| 157 |
+
From visually inspecting the images we found that in images where there is not significant movement in the first 5 frames of the ground truth it is hard to tell the difference between our method and CDNA since both methods predict an image similar to the early ground truth frames. However, when there is significant movement in the first 5 ground truth frames, the predictions from EPEV are sharper further into the future than CDNA. See the appendix section G for images where there is significant movement in the first 5 ground truth frames so the methods can be compared. We also collected results from the E2E method, but those blur out very quickly and are shown in appendix section G.
|
| 158 |
+
|
| 159 |
+
The CDNA method from Finn et al. (2016) produces blurry images since it is trained to minimize L2 loss directly (Finn et al., 2016). In the EPEV method, the predictor and VAN are trained separately. This prevents the VAN from learning to produce blurry images when the predictor is not confident. The predictions will be sharp as long as the predictor network predicts a valid encoding.
|
| 160 |
+
|
| 161 |
+
We also compare our method to Villegas et al. (2017). This method gives sharper results than ours. We think that this is because Villegas et al. (2017) uses a adversarial loss (Goodfellow et al., 2014) and since nothing besides the human is moving in this dataset, the pose works well as a high level structure.
|
| 162 |
+
|
| 163 |
+
# 4.3.1 PERSON DETECTOR EVALUATION
|
| 164 |
+
|
| 165 |
+
We propose to compare the methods quantitatively by considering whether the generated videos contain a recognizable person. To do this in an automated fashion, for each of the generated frames, we ran a MobileNet (Howard et al., 2017) object detection model pretrained on the MS-COCO (Lin et al., 2014) dataset. We recorded how confident the detector was that a person (one of the MSCOCO labels) is in the image. We call this the “person score” (its value ranges from 0 to 1, with a higher score corresponding to a higher confidence level). The results on each frame averaged over 1k runs are shown in Figure 7.
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 7: Confidence of the person detector that a person is in the image (“person score”). The baseline method is CDNA from Finn et al. (2016).
|
| 169 |
+
|
| 170 |
+
The person score on the ground truth frames is about 0.4. This is likely due to the mismatch between the training set images of the model (the MS-COCO dataset images are very different in terms of image statistics compared to the Humans 3.6M data). The person score is 0.26 on average for the images generated by the EPEV method, and 0.18 for CDNA from Finn et al. (2016). The person score degrades very rapidly in the first 8 frames of CDNA, but degrades more slowly in the EPEV method. The person score of the EPEV method on frame 63 is about the same as on frame 8 of CDNA. This confirms our visual analysis that the EPEV method produces clearer predictions further into the future. The EPEV method was only trained to predict 32 frames into the future but there is no significant drop in the person score at frame 32, showing that the EPEV method generalizes well to predicting longer sequences.
|
| 171 |
+
|
| 172 |
+
# 4.3.2 HUMAN EVALUATION
|
| 173 |
+
|
| 174 |
+
We also used a service similar to Mechanical Turk to collect comparisons of 1,000 generated videos from our EPEV method and the CDNA baseline. The task showed videos generated by the two methods side by side and asked raters to confirm whether one of the videos is more realistic. The workers rated the EPEV method as more realistic $5 3 . 6 \%$ of the time, the CDNA method as more realistic $1 1 . 1 \%$ of the time and the videos as being about the same $3 5 . 3 \%$ of the time. The high number of “same” responses could be because of it being difficult to tell the difference between the methods when there is little movement.
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 177 |
+
|
| 178 |
+
On datasets where the pose does not capture all of the information needed to predict future frames, letting the network define its own high level structure in addition to the pose is an improvement upon a Villegas et al. (2017). The EPEV method generates sharper images than Finn et al. (2016) on non deterministic datasets, and can generate further into the future on a toy dataset that we introduced. We posit an adversarial loss between the predictor and encoder would likely help with potentially uncertain scenarios and would fix the problem of the EPEV method sometimes generating blurry images,
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In Advances in Neural Information Processing Systems, pp. 343– 351, 2016.
|
| 183 |
+
|
| 184 |
+
Cristian Sminchisescu Catalin Ionescu, Fuxin Li. Latent structured models for human pose estimation. In International Conference on Computer Vision, 2011.
|
| 185 |
+
|
| 186 |
+
J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009.
|
| 187 |
+
|
| 188 |
+
Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Advances in Neural Information Processing Systems, pp. 64–72, 2016.
|
| 189 |
+
|
| 190 |
+
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.
|
| 191 |
+
|
| 192 |
+
Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. CoRR, abs/1704.04861, 2017. URL http://arxiv.org/abs/ 1704.04861.
|
| 193 |
+
|
| 194 |
+
Catalin Ionescu, Dragos Papava, Vlad Olaru, and Cristian Sminchisescu. Human3.6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(7):1325–1339, jul 2014.
|
| 195 |
+
|
| 196 |
+
Nal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. arXiv preprint arXiv:1610.00527, 2016.
|
| 197 |
+
|
| 198 |
+
J. Lei Ba, J. R. Kiros, and G. E. Hinton. Layer Normalization. ArXiv e-prints, July 2016.
|
| 199 |
+
|
| 200 |
+
Tsung-Yi Lin, Michael Maire, Serge J. Belongie, Lubomir D. Bourdev, Ross B. Girshick, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C. Lawrence Zitnick. Microsoft COCO:´ common objects in context. CoRR, abs/1405.0312, 2014. URL http://arxiv.org/abs/ 1405.0312.
|
| 201 |
+
|
| 202 |
+
William Lotter, Gabriel Kreiman, and David Cox. Deep predictive coding networks for video prediction and unsupervised learning. In ICLR. 2017.
|
| 203 |
+
|
| 204 |
+
Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond ¨ mean square error. In ICLR. 2016.
|
| 205 |
+
|
| 206 |
+
V. Michalski, R. Memisevic, and Kishore Konda. Modeling deep temporal dependencies with recurrent ”grammar cells”. In NIPS, 2014.
|
| 207 |
+
|
| 208 |
+
Roni Mittelman, Benjamin Kuipers, Silvio Savarese, and Honglak Lee. Structured recurrent temporal restricted boltzmann machines. In ICML. 2014.
|
| 209 |
+
|
| 210 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In NIPS. 2015.
|
| 211 |
+
|
| 212 |
+
Scott E Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep visual analogy-making. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 1252–1260. Curran Associates, Inc., 2015. URL http://papers. nips.cc/paper/5845-deep-visual-analogy-making.pdf.
|
| 213 |
+
|
| 214 |
+
K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014.
|
| 215 |
+
|
| 216 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15 (1):1929–1958, January 2014. ISSN 1532-4435. URL http://dl.acm.org/citation. cfm?id=2627435.2670313.
|
| 217 |
+
|
| 218 |
+
Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using lstms. In ICML. 2015.
|
| 219 |
+
|
| 220 |
+
Ilya Sutskever, Geoffrey E. Hinton, and Graham W. Taylor. The recurrent temporal restricted boltzmann machine. In NIPS. 2009.
|
| 221 |
+
|
| 222 |
+
Ruben Villegas, Jimei Yang, Yuliang Zou, Sungryull Sohn, Xunyu Lin, and Honglak Lee. Learning to generate long-term future via hierarchical prediction. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 3560–3569, 2017.
|
| 223 |
+
|
| 224 |
+
# Appendices
|
| 225 |
+
|
| 226 |
+
# A IMPLEMENTATION DETAILS
|
| 227 |
+
|
| 228 |
+
The convolutional neural net encoder is a VGG-16 network (Simonyan & Zisserman, 2014). In the EPEV method, the encoder needs to be pre-trained on Imagenet (Deng et al., 2009). If that is not done, the VAN will ignore the output from the encoder. All other configurations are run without pretraining.
|
| 229 |
+
|
| 230 |
+
The predictor network is a 20 layer LSTM, while the analogy network uses the deep analogy transformation described in Reed et al. (2015). The VAN outputs a mask which controls whether to use its own output, or the pixels of the first frame. This allows the network to focus on learning the changing parts of the image instead of the background.
|
| 231 |
+
|
| 232 |
+
The end effector orientation is converted to quaternions (Bousmalis et al., 2016) in order to calculate the loss if the pose is used. Layer normalization (Lei Ba et al., 2016) is used between every other layer in the VAN and predictor networks. We used dropout (Srivastava et al., 2014) on the encoder and VAN to prevent overfitting. The network overfits less in the INDIVIDUAL method, so we used less dropout.
|
| 233 |
+
|
| 234 |
+
# B HUMAN EVALUATION DETAILS
|
| 235 |
+
|
| 236 |
+
Each video in the comparison is generated from the same starting sequence. The side that the EPEV method and the CDNA method are displayed on is changed randomly.
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure 8: The screen shown to workers in the human evaluation
|
| 240 |
+
|
| 241 |
+
# C EPEV METHOD WITH ENCODER OUTPUT FED TO VAN
|
| 242 |
+
|
| 243 |
+
To see what the encoder has learned in the EPEV method, we can obtain results from the visual analogy network given the input from the encoder. The encoder is given the ground truth image. The results are shown in figure 9. The results show that the encoder encodes where the person is
|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
Figure 9: Results from the EPEV approach when the VAN is given the output of the encoder on the ground truth frame.
|
| 247 |
+
|
| 248 |
+
in the image, as well as the orientation of the arms, legs and head to some extent. The results are not as good as one would expect from an autoencoder, since the encoder has the constraint that the encoding also has to be easy to predict.
|
| 249 |
+
|
| 250 |
+
# D TRAINING DETAILS
|
| 251 |
+
|
| 252 |
+
We trained all of the methods including Finn et al. (2016) for 3 million steps using async SGD, across 32 worker machines. We used a minibatch size of 8 sequences in each step. The minibatch size could be so small because there were multiple frames per sequence. In methods with multiple optimizers, a step is defined as running each optimizer once. The hyperparameters are optimized separately for both datasets on a validation set. We used the best learning rates for each method.
|
| 253 |
+
|
| 254 |
+
E MORE RESULTS ON SHAPES DATAEST.
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
|
| 260 |
+
F MORE RESULTS ON ROBOT PUSH DATASET.
|
| 261 |
+
|
| 262 |
+
F.1 FRAMES WHERE EPEV PREDICTS OBJECTS BETTER THAN INDIVIDUAL.
|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
|
| 276 |
+
F.2 FRAMES WHERE INDIVIDUAL PREDICTS OBJECTS BETTER THAN EPEV.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
|
| 290 |
+
G MORE RESULTS ON HUMANS DATAEST.
|
| 291 |
+
|
| 292 |
+
G.1 SIGNIFICANT MOVEMENT IN THE FIRST 5 GROUND TRUTH FRAMES.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
|
| 302 |
+
G.2 NO SIGNIFICANT MOVEMENT IN THE FIRST 5 GROUND TRUTH FRAMES.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
|
| 314 |
+

|
md/train/rylnK6VtDH/rylnK6VtDH.md
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTIPLICATIVE INTERACTIONSAND WHERE TO FIND THEM
|
| 2 |
+
|
| 3 |
+
Siddhant M. Jayakumar, Wojciech M. Czarnecki, Jacob Menick, Jonathan Schwarz,
|
| 4 |
+
Jack Rae, Simon Osidnero, Yee Whye Teh, Tim Harley, Razvan Pascanu
|
| 5 |
+
DeepMind
|
| 6 |
+
{sidmj, lejlot, jmenick, schwarzjn, jwrae, osindero,
|
| 7 |
+
ywteh, tharley, razp}@google.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We explore the role of multiplicative interaction as a unifying framework to describe a range of classical and modern neural network architectural motifs, such as gating, attention layers, hypernetworks, and dynamic convolutions amongst others. Multiplicative interaction layers as primitive operations have a long-established presence in the literature, though this often not emphasized and thus under-appreciated. We begin by showing that such layers strictly enrich the representable function classes of neural networks. We conjecture that multiplicative interactions offer a particularly powerful inductive bias when fusing multiple streams of information or when conditional computation is required. We therefore argue that they should be considered in many situation where multiple compute or information paths need to be combined, in place of the simple and oft-used concatenation operation. Finally, we back up our claims and demonstrate the potential of multiplicative interactions by applying them in large-scale complex RL and sequence modelling tasks, where their use allows us to deliver state-of-the-art results, and thereby provides new evidence in support of multiplicative interactions playing a more prominent role when designing new neural network architectures.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Much attention has recently turned toward the design of custom neural network architectures and components in order to increase efficiency, maximise performance, or otherwise introduce desirable inductive biases. While there have been a plethora of newer, intricate architectures proposed, in this work we train our sights instead on an older staple of the deep learning toolkit: multiplicative interactions.
|
| 16 |
+
|
| 17 |
+
Although the term itself has fallen somewhat out of favour, multiplicative interactions have reappeared in a range of modern architectural designs. We start this work by considering multiplicative interactions as an object of study in their own right. We describe various formulations and how they relate to each other as well as connect more recent architectural developments (e.g. hypernetworks Ha et al. (2017), dynamic convolutions Wu et al. (2019)) to the rich and longer-standing literature on multiplicative interactions.
|
| 18 |
+
|
| 19 |
+
We hypothesise that multiplicative interactions are suitable for representing certain meaningful classes of functions needed to build algorithmic operations such as conditional statements or similarity metrics, and more generally as an effective way of integrating contextual information in a network in a way that generalizes effectively. We show this empirically in controlled synthetic scenarios, and also demonstrate significant performance improvement on a variety of challenging, large-scale reinforcement learning (RL) and sequence modelling tasks when a conceptually simple multiplicative interaction module is incorporated.
|
| 20 |
+
|
| 21 |
+
Such improvements are consistent with our hypothesis that the use of appropriately applied multiplicative interactions can provide a more suitable inductive bias over function classes leading to more data-efficient learning, better generalization, and stronger performance. We argue that these operations should feature more widely in neural networks in and of themselves, especially in the increasingly important setting of integrating multiple streams of information (including endogenously created streams e.g. in branching architectures).
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: (Left) Venn diagrams of multiplicative interactions with respect to other model classes commonly used in ML. (Right) Comparison of various orders of multiplicative interactions and their relation to other perspectives.
|
| 25 |
+
|
| 26 |
+
Our contributions are thus: (i) to re-explore multiplicative interactions and their design principles; (ii) to aid the community’s understanding of other models (hypernetworks, gating, multiplicative RNNs) through them; (iii) to show their efficacy at representing certain solutions; and (iv) to empirically apply them to large scale sequence modeling and reinforcement learning problems, where we demonstrate state-of-the-art results.
|
| 27 |
+
|
| 28 |
+
# 2 MULTIPLICATIVE INTERACTIONS
|
| 29 |
+
|
| 30 |
+
We start by introducing notation and formalising the concept of multiplicative interactions. The underlying question we are trying to answer is how to combine two different streams of information. Specifically, given $\mathbf { x } \in \mathbb { R } ^ { n }$ and $\mathbf { z } \in \mathbb { R } ^ { m }$ , our goal is to model an unknown function $f _ { \mathrm { t a r g e t } } ( \mathbf { x } , \mathbf { z } ) \in \mathbb { R } ^ { k }$ that entails some interaction between the two variables. In practice $\mathbf { x }$ and $\mathbf { z }$ might be arbitary hidden activations, different input modalities (e.g. vision and language), or conditioning information and inputs.
|
| 31 |
+
|
| 32 |
+
The standard approach is to approximate $f _ { \mathrm { t a r g e t } }$ by a neural network $f$ . If $f$ is restricted to employ a single layer of weights, we typically use $\breve { f } ( \mathbf { x } , \mathbf { z } ) = \mathbf { W } [ \mathbf { x } ; \mathbf { z } ] + \mathbf { b }$ , where $\left[ \mathbf { x } ; \mathbf { z } \right]$ represents the concatenation of $\mathbf { x }$ and $\mathbf { z }$ , and $\mathbf { W } \in \mathbb { R } ^ { ( m + n ) \times k }$ and $\mathbf { b } \in \mathbb { R } ^ { k }$ are learned parameters. The interaction between $\mathbf { x }$ and $\mathbf { z }$ is only additive given this formulation. However through stacking multiple similar layers (with element-wise nonlinearities inbetween), $f$ can approximate any function $f _ { \mathrm { t a r g e t } }$ given sufficient data (and capacity).
|
| 33 |
+
|
| 34 |
+
In contrast, a single layer with multiplicative interactions would impose the functional form
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
f ( \mathbf { x } , \mathbf { z } ) = \mathbf { z } ^ { T } \mathbb { W } \mathbf { x } + \mathbf { z } ^ { T } \mathbf { U } + \mathbf { V } \mathbf { x } + \mathbf { b }
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
where $\mathbb { W }$ is a 3D weight tensor, $\mathbf { U } , \mathbf { V }$ are regular weight matrices and $\mathbf { b }$ is a vector1. We posit that this specific form, while more costly, is more flexible, providing the right inductive bias to learn certain families of functions that are of interest in practice. Additionally, many existing techniques can be shown to rely on variations of the above bilinear form as detailed below.
|
| 41 |
+
|
| 42 |
+
Hypernetworks as Multiplicative Interactions. A Hypernetwork Ha et al. (2017) is a neural network $g$ that is used to generate the weights of another neural network given some context or input vector $\mathbf { z }$ . Particularly $f ( \bar { \mathbf { x } } ; \theta )$ becomes $f ( \mathbf { x } ; g ( \mathbf { z } ; \phi ) )$ . In the case where $f$ and $g$ are affine (as in the original work), such a network is exactly equivalent to the multiplicative form described above.
|
| 43 |
+
|
| 44 |
+
Specifically, we can decompose equation (1) and set $\mathbf { W } ^ { \prime } = \mathbf { z } ^ { T } \mathbb { W } + \mathbf { V }$ and $\mathbf { b } ^ { \prime } = \mathbf { z } ^ { T } \mathbf { U } + \mathbf { b }$ . We can now see $\mathbf { W } ^ { \prime }$ as the generated 2D weight matrix and $\mathbf { b } ^ { \prime }$ as the generated bias from some hypernetwork.
|
| 45 |
+
|
| 46 |
+
This allows us to have an input-conditional weight matrix and bias vector that are then used to generate output $\mathbf { y } = \mathbf { W } ^ { \prime } \mathbf { x } + \mathbf { b } ^ { \prime }$ . We can also consider the more general case of any affine transformation being generated by some arbitrary neural network, which can also be viewed as a multiplicative interaction where we first embed the context $\mathbf { z }$ and then use it in the equation above. This provides a basis for thinking about hypernetworks themselves as variations on the theme of multiplicative interactions, potentially accounting for a considerable amount of their efficacy.
|
| 47 |
+
|
| 48 |
+
Diagonal Forms and Gating Mechanisms. Let us consider a diagonal approximation to the projected $\mathbf { W } ^ { \prime }$ . This is given by a particular parametrization of ${ \bf W } ^ { \prime } = { \bf \bar { z } } ^ { T } { \mathbb { W } } + { \bf \bar { V } }$ above (see Figure 1 right). Multiplying with $\mathbf { W } ^ { \prime } = \mathrm { { d i a g } } ( a _ { 1 } , . . . , a _ { n } )$ can be implemented efficiently as $f = \mathbf { a } \odot \mathbf { x }$ where $\odot$ represents elementwise multiplication or the Hadamard product (similarly for the bias). This form now resembles commonly used gating methods, albeit they are often used with additional non-linearities (e.g. sigmoid units Dauphin et al. (2017); Van den Oord et al. (2016)). It can be viewed as a hypernetwork as well, where $\mathbf { z } ^ { T } \mathbf { W }$ represents the function generating parameters.
|
| 49 |
+
|
| 50 |
+
Attention and Multiplicative Interactions. While not the focus of this work, we note that attention systems in sequence modelling (Vaswani et al., 2017; Bahdanau et al., 2014) similarly use multiplicative interactions to effectively scale different parts of the input. This is typically done using the diagonal form above with $\mathbf { m } = { \bar { f } } ( \mathbf { x } , \mathbf { z } ) , \mathbf { y } = \mathbf { m } { \bar { \odot } } \mathbf { x }$ where $\mathbf { m }$ is often a bounded mask. Attention systems are typically used with different aims to those we describe here: they can suppress or amplify certain inputs and allow long-range dependencies by combining inputs across time-steps (when masking above is followed by a pooling layer, for example). We use these insights to posit that while more expensive, considering a higher order interaction (generating a vector mask) might prove more beneficial to such systems but we do not specifically consider attention in this paper and leave it to future work.
|
| 51 |
+
|
| 52 |
+
Scales and Biases. Further, we can make another low-rank approximation to the diagonal form and generate instead a scalar matrix – i.e. the hypernetwork outputs a single scalar scale (and/or bias) parameter per channel or feature vector we are considering, instead of a vector. We can again write this as $f = \mathbf { z } ^ { T } \mathbb { W } \odot \mathbf { x }$ where $\mathbf { z } ^ { T } \mathbb { W } = \alpha \mathbb { I }$ . This is common in methods such as FiLM (Perez et al., 2018; Dumoulin et al., 2018; 2017).
|
| 53 |
+
|
| 54 |
+
Multiplicative Interaction and Metric Learning. Another highly related field of active research is that of metric learning, where one tries to find the most suitable metric to measure similarity between objects in some parametrised space of metrics. One of the most commonly used classes is that of Mahalanobis distances $d _ { \mathbf { C } } ( \mathbf { x } , \bar { \mathbf { z } } ) = \| \mathbf { x } - \mathbf { z } \| _ { \mathbf { C } } = ( \mathbf { x } - \mathbf { z } ) ^ { T } \mathbf { C } ^ { - 1 } ( \mathbf { x } - \mathbf { z } )$ , which again maps onto multiplicative interaction units as $d _ { \bf C } ( { \bf x } , { \bf z } ) = ( { \bf x } - { \bf z } ) ^ { T } \dot { \bf C } ^ { - 1 } ( { \bf x } - { \bf z } ) = { \bf x } ^ { T } { \bf C } ^ { - 1 } { \bf x } - 2 { \bf x } ^ { T } \dot { \bf C } ^ { - 1 } { \bf z } +$ ${ \bf z } ^ { T } { \bf C } ^ { - 1 } { \bf z }$ . In metric learning, however, one usually explicitly defines losses over tuples (or higher order n-tuples) with direct supervision, while here we consider building blocks that can learn a metric internally, without direct supervision.
|
| 55 |
+
|
| 56 |
+
The Taxonomy of Multiplicative Interactions. Finally, we summarise these relationships in figure 1. We can think of multiplicative interactions equivalently in terms of either: (a) the approximation to the 3D tensor made; (b) the output of the “projected” context by the hypernetwork; or (c) the operation used to combine the generated weights/context and the input. For example, the general bilinear form is equivalent to a vanilla hypernetwork that generates a weight matrix for a matrix multiplication. Similarly, a diagonal 3D tensor is equivalent to a hypernetwork that generates a vector and is combined with a hadamard product.
|
| 57 |
+
|
| 58 |
+
# 3 EXPRESSIVITY OF THE MODEL
|
| 59 |
+
|
| 60 |
+
Vanilla MLPs are universal approximators – that is, for every continuous function $[ 0 , 1 ] ^ { d } \to \mathbb { R }$ (considered our target) and every approximation error $\epsilon > 0$ there exist hidden units $H$ and corresponding parameter values $\theta$ such that the distance in function space between the MLP output and the target function is smaller than . Consequently adding new modules/building blocks does not affect the approximation power of neural nets, however such modifications can change the hypotheses space – the set of functions that can be represented exactly (with 0 error), and the compactness of a good estimator (how many parameters are needed), as well as learnability.
|
| 61 |
+
|
| 62 |
+
We first show that multiplicative interactions strictly enlarge the hypotheses space of vanilla MLPs – that is, we add new functions which multi-layer multiplicative models can now represent perfectly, while also preserving our ability to represent those in the existing set modeled perfectly by vanilla MLPs (full proof in appendix A).
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: Number of parameters needed for a regular, single layer MLP (blue line) to represent the function up to $0 . 1 ~ \mathrm { M S E }$ over the domain of a standard $d$ -dimensional Gaussian compared to the same quantity for a multiplicative model (green line). $\sigma$ denotes sigmoid. Dotted lines represent pruned models where all weights below absolute value of 0.001 were dropped. Note that for MLP all parameters are actually used, while for MI module some of these functions (summation and dot product) can be compactly represented with pruning.
|
| 66 |
+
|
| 67 |
+
Theorem 1. Let $\mathcal { H } _ { m l p }$ denote the hypotheses space of standard MLPs with ReLU activation function, and let $\mathcal { H } _ { m u }$ denote the hypotheses space of analogous networks, but with each linear layer replaced with a multiplicative layer, then we have $\mathcal { H } _ { m l p } \subsetneq \mathcal { H } _ { m u }$ .
|
| 68 |
+
|
| 69 |
+
While valuable, such a result can also be trivially obtained by adding somewhat exotic activation functions (e.g. Weierstrass function $\begin{array} { r } { \sigma ( x ) = \sum _ { n = 0 } ^ { \infty } 0 . 5 ^ { n } \cos ( \dot { 7 } ^ { n } \pi x ) } \end{array}$ which is a continuous function but nowhere differentiable (Weierstrass, 1895); see appendix for the proof) to the pool of typically used ones. While increasing the hypothesis space on its own is not of great significance, the crucial point here is that the set $\mathcal { \bar { H } } _ { \mathrm { m u } } \backslash \mathcal { \bar { H } } _ { \mathrm { m l p } }$ helps extend our coverage to the set of basic functions that one would expect to need in composing solutions that mimic systems of interest – such as logical, physical, or biological ones.
|
| 70 |
+
|
| 71 |
+
Figure 2 shows the learnability (up to a certain error) of some simple two input functions against the number of parameters needed. We consider summation, gating, and dot products – which are basic buildings blocks of operations such as conditional statements or similarity metrics, and fundamental for implementing rich behaviours when combining different sources of information. For the gating and dot-product function classes, the complexity of MLPs required to learn them seems to grow exponentially, while the growth for multiplicative models is quadratic. On the other hand summation is trivially easier for an MLP. Thus we do not argue that multiplicative interactions are a silver bullet – but that such interactions add an important class of functions to the hypothesis set that are often the right inductive bias, or algorithmic building block, for many kinds of problems. In subsequent sections we show empirically that using them as context-integration layers leads to good performance gains across a range of tasks.
|
| 72 |
+
|
| 73 |
+
# 4 RELATED WORK
|
| 74 |
+
|
| 75 |
+
There is a vast body of literature surrounding multiplicative interactions, and these ideas have a long history, for example being discussed in the foundational era of connectionism (Rumelhart et al., 1986). Below we highlight some of the key works developed in the community over the last few decades and aim to show how these relate to each other.
|
| 76 |
+
|
| 77 |
+
Some of the earliest models leveraging multiplicative interactions were higher-order Boltzmann machines or autoencoders (Sejnowski, 1986; Memisevic & Hinton, 2007; Taylor & Hinton, 2009). Currently, the most common usage of multiplicative interactions seen in models that enjoy widespread adoption is via a factorised or diagonal representation of the necessary 3D weight tensor. The LSTM cell (Hochreiter & Schmidhuber, 1997) (and its descendents such as the GRU (Cho et al., 2014)) employ multiplicative interactions of this form in the gating units that are crucial for the long-term stability of memories. Enhanced multiplicative versions of LSTMs have also been formulated (Sutskever et al., 2011; Wu et al., 2016; Krause et al., 2016): these approaches essentially combine the previous hidden state and current input via an element-wise or hadamard product between projected representations.
|
| 78 |
+
|
| 79 |
+
Similarly, bilinear layers (often low-rank factorizations) have appeared extensively in the computer vision literature (Gao et al., 2016; Kim et al., 2016) and beyond (Dumoulin et al., 2018). Squeezeand-excitation networks, for example, can be seen as an instantiation of this idea (Hu et al., 2018). Specifically in visual-question answering systems, models like FiLM (Perez et al., 2018) or classconditional batch norm (Brock et al., 2019; Perez et al., 2017) use such diagonal forms to generate per-channel scales and biases as a function of some context. This has been shown to be effective at capturing relationships between the two different modalities (text and vision), as well as providing a powerful mechanism to allow a single network to conditionally specialize on multiple different tasks. Further, multimodal domains such as VQA have also seen such bilinear models used in combination with attention systems (Yu et al., 2017; Lu et al., 2016; Xu & Saenko, 2016; Schwartz et al., 2017).
|
| 80 |
+
|
| 81 |
+
Further, there are many additional works using gating mechanisms which can be thought of as such diagonal approximations used in conjunction with additional point-wise non-linearities or softmaxes. Recent examples of such include pixelCNNs (Van den Oord et al., 2016) and Highway Networks (Srivastava et al., 2015; Zilly et al., 2017), among others (Dauphin et al., 2017), and earlier examples can be seen in works such as Mixtures of Experts (Jacobs et al., 1991) and successors.
|
| 82 |
+
|
| 83 |
+
Multiplicative interactions in the non-factorised sense can also be thought of as a restricted class of Hypernetworks (Ha et al., 2017): models that generate the weights of one network from another. While the original presentation (Ha et al., 2017) considered their use for model compression in feed-forward nets (i.e. using layer IDs to generate weights), they also investigate HyperLSTMs, in which per timestep multiplicative biases are generated. A similar approach has also been applied to generating parameters in convolutional nets via “dynamic convolutions” where the size of the generated parameters is controlled by tying filters (Wu et al., 2019). Further, these ideas have been extended to Bayesian forms (Krueger et al., 2017) and also used for example, in architecture search (Brock et al., 2017).
|
| 84 |
+
|
| 85 |
+
Lastly, multiplicative interactions used to scale contributions from different spatial or temporal components play a key role in attention mechanisms (Bahdanau et al., 2014; Vaswani et al., 2017). They have also been used in some RL works to better condition information, e.g. in Feudal Networks (Vezhnevets et al., 2017) as a way for manager and worker units to interact, and better actionconditioning (Oh et al., 2015).
|
| 86 |
+
|
| 87 |
+
# 5 EXPERIMENTAL SETUP
|
| 88 |
+
|
| 89 |
+
We aim to demonstrate that the incorporation of multiplicative interactions can boost performance across a wide range of problems and domains, and we conjecture that this is because they effectively allow for better routing and integration of different kinds of information. Specifically we will show that multiplicative interactions allow better integration of (a) latent variables in decoder models, $( b )$ task or contextual information in multitask learning, (c) recurrent state in sequence models. We use neural process regression, multitask RL and language modelling as exemplar domains. Further details of architectures and hyper-parameters can be found in the appendix.
|
| 90 |
+
|
| 91 |
+
A Note on Implementation and Terminology. We use $\mathcal { M } ( \mathbf { x } , \mathbf { z } )$ below to mean the function $f ( \mathbf { x } , \mathbf { z } ) = \mathbf { z } ^ { T } \hat { \mathbb { W } } \mathbf { x } + \mathbf { z } ^ { T } \mathbf { U } + \mathbf { B } \mathbf { x } + \mathbf { b }$ (or referred to as MI in the legends). In all cases we implement this using a series of standard linear layers with a reshape operation in between to form the intermediate matrix (equivalently this can be done with einsum or tensor product notation; we provide a simple implementation in the appendix). The quantity $f _ { 1 } ( \mathbf { z } ) = \mathbf { z } ^ { T } \mathbb { W } + \mathbf { B }$ , (where as above $\mathbb { W }$ is 3D and $\mathbf { B }$ a 2D bias) represents the 2D output of projecting the contextual information. We refer to this interchangeably as the 2D-contextual projection or “generated weights” using the hypernet terminology. Similarly the “generated bias” is the 1D projection of the context $\mathbf { z }$ , that is, $\dot { f _ { 2 } } \dot { ( } z ) = \mathbf { z } ^ { T } \mathbf { U } + \mathbf { b }$ (and thus $f ( \mathbf { x } ; \mathbf { z } ) = f _ { 1 } ( \mathbf { z } ) \mathbf { x } + f _ { 2 } ( \mathbf { z } ) )$ .
|
| 92 |
+
|
| 93 |
+
While we aim to draw connections to other models and approximations in the literature above, our aim is not to advertise one specific instantiation or approximation over the other . As such, we use the same form above in all experiments (unless specified otherwise) and control parameter count by controlling the size of $\mathbf { z }$ . Undoubtedly, practitioners will find that task-specific tuning of the above form might yield comparable or better results with fewer parameters, given the right approximations.
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: Averaged learning curves for different models while varying the number of tasks in the toy multitask regression domain. Shaded regions represent standard error of mean estimation.
|
| 97 |
+
|
| 98 |
+
# 6 LEARNING CONTEXT DEPENDENT LAYERS FOR MULTITASK LEARNING
|
| 99 |
+
|
| 100 |
+
We start by considering the general paradigm of multitask-learning, wherein the goal is to train one model to solve $K$ different tasks. We show that we can boost performance here by learning context or task-conditional layers with multiplicative interactions. There is generally a trade-off between the transfer from similar tasks and the negative interference between those with very different solutions. Our claim is thus that context-conditional layers provide a best-of-both-worlds approach, with an inductive bias that allows transfer (as opposed to a multiheaded architecture) while also limiting interference.
|
| 101 |
+
|
| 102 |
+
We first demonstrate this with a toy example, where we attempt to regress two different classes of functions, affine and sines, with one model. Specifically, $y = a _ { i } x + b _ { i }$ and $y = a _ { i } \sin ( 1 0 x ) + b _ { i }$ where $a _ { i }$ and $b _ { i }$ are sampled per task from a uniform distribution. In Figure 3 we show results averaged over multiple runs, as we vary the number of tasks. We train both a standard MLP with multiple heads and one with that is given task ID as additional input and can see that the neither is able to use task information to do any better. On the other hand, the results show that a task-conditioned $\mathcal { M } ( x , \mathbf { t } )$ layer allows the model to learn both tasks better with less interference and also increased data efficiency. We see that the gains with using an $\mathcal { M }$ layer are more pronounced as we increase the number of tasks. More details are provided in appendix D.
|
| 103 |
+
|
| 104 |
+
# 6.1 MULTITASK RL ON DMLAB-30
|
| 105 |
+
|
| 106 |
+
Next, we consider a larger scale problem: multitask RL on the DeepMind Lab-30 domain (Beattie et al., 2016). This is a suite of 30 tasks in a partially-observable, first-person-perspective 3D environment, encompassing a range of laser-tag, navigation, and memory levels. We use a typical actor-critic RL setup within the Impala framework of Espeholt et al. (2018), with multiple actors and a single learner with off-policy correction (further details provided in appendix section E). We use exactly the architecture as in the original works (Espeholt et al., 2018; Hessel et al., 2019): a stack of convolutional layers followed by an LSTM, with output $\mathbf { h } _ { t }$ at each timestep. Normally these are then projected to policies $\pi$ and value functions $V$ that are shared across all tasks. At test time agents are typically not allowed to access ground truth task ID (e.g. this means value functions at training time could use this information).
|
| 107 |
+
|
| 108 |
+
Multi-head Policy and Value Layers We first show that a multi-headed agent architecture with one policy and value head per level does in fact boost performance. While this does use privileged information (task ID), this does show that there is some degree of interference between levels from sharing policy and value layers.
|
| 109 |
+
|
| 110 |
+
Multiplicative Policy and Value Layers We can instead consider using multiplicative layers here to integrate task information (one-hot task ID $\mathbf { I } _ { i }$ ) to modulate compute-paths. We learn a task embedding as below, and use it in a multiplicative layer that projects to policy and value functions. That is, we now have $\mathbf { c } = \mathrm { r e l u } ( \mathrm { M L P } ( \mathbf { I } _ { i } ) )$ as a context, and $\pi _ { t } , V _ { t } = \mathcal { M } ( \mathbf { h } _ { t } , \mathbf { c } )$ .
|
| 111 |
+
|
| 112 |
+
We show results in the same figure and find that such a layer provides a further boost in performance. This can be viewed as generating policy layers from some learnt embedding of the task ID. Our hypothesis is that while multiheaded architectures reduce interference, they also remove the ability of policy-transfer between the different layers. Further, each head only gets $1 / K$ of the number of gradient updates (when training on $K$ tasks).
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 4: (a) A t-SNE plot of the generated weights from an $\mathcal { M }$ layer. (b) Human normalised performance (capped at 100) when using task ID as context to an $\mathcal { M }$ layer. (c) Using a learnt context instead.
|
| 116 |
+
|
| 117 |
+
Multiplicative Policies with Learnt Contexts We find (somewhat surprisingly) that we can get similar or greater performance gains without using any task information, replacing task $\mathrm { I D } \mathbf { I } _ { i }$ instead with a learnt non-linear projection of the LSTM output. We now have, $\mathbf { c } = \mathrm { r e l u } ( \mathrm { M L P } ( \mathbf { h } _ { t } ) )$ and $\pi _ { t } , V _ { t } = \mathcal { M } ( \mathbf { h } _ { t } , \mathbf { c } )$ .
|
| 118 |
+
|
| 119 |
+
We show a t-SNE plot of the 2D projection of the state of the LSTM in Figure 4. This is coloured by level name and the transparency value indicates the timestep. We see at timestep 0, all weights are the same, and as the levels progress, we find that it can naturally detect or cluster task information, showing that the model can readily detect the current task type. We posit however that the affine policyvalue decoders may not have the right inductive bias to use this information well. We conjecture that the multiplicative interaction, via the learnt embedding, $c .$ , provides the right inductive bias: allowing the model to integrate information and providing additional densely-gated conditional-compute paths that leverage task similarity where appropriate, whilst guarding against interference where tasks differ – and thus more effectively learning task conditioned behaviour.
|
| 120 |
+
|
| 121 |
+
We note that we match state-of-the-art performance on this domain which previously used the PopArt Method (Hessel et al., 2019) (both achieve $7 3 \%$ normalised human score), with a simpler method. PopArt involves having task-specific value functions and using adaptive gradient normalisation (to limit interference between different reward scales). Our method also reduces the number of extra hyper-parameters needed to zero. As such, PopArt solves an orthogonal problem to the one considered here and we posit that these methods can be combined in future work. We also leave as future work the analysis of whether such hyper-value functions are able to implicitly learn the different reward scales that are explictly parameterised in methods like PopArt.
|
| 122 |
+
|
| 123 |
+
# 7 LATENT VARIABLE MODELS WITH MULTIPLICATIVE DECODERS
|
| 124 |
+
|
| 125 |
+
We previously demonstrated the ability of multiplicative interactions to extract and efficiently combine contextual information. We next explore the paradigm where the two streams of information being combined refer to semantically different features. Specifically, we investigate how contextual latent variables can be better integrated into neural decoders. We consider neural processes for few-shot regression. Briefly, neural processes (Garnelo et al., 2018b;a) are a neural analogue to Gaussian Processes. For few shot regression, they work by predicting a function value $\mathbf { y } ^ { * }$ at new observations $\mathbf { x } ^ { * }$ having observed previous values $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ (referred to as contexts) of the same function. As opposed to training a single predictor on the $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ , Neural Processes learn to infer a distribution over functions that are consistent with the observations collected so far.
|
| 126 |
+
|
| 127 |
+
This is achieved by embedding context points $\left( \mathbf { x } _ { i } , \mathbf { y } _ { i } \right)$ individually with an encoder network, and then taking the mean of these embeddings. This gives latent variables $\mathbf { z }$ that are a representation of the function that maps $\mathbf { x }$ to $\mathbf { y }$ , i.e. $\mathbf { y } = f ( \mathbf { x } , \mathbf { z } )$ . A new data point $\mathbf { x } ^ { * }$ is mapped to $\mathbf { y } ^ { * }$ by passing $\left[ \mathbf { z } ; \mathbf { x } ^ { * } \right]$ through a decoder network.
|
| 128 |
+
|
| 129 |
+
We aim to increase the expressivity of the decoder by improving the conditioning on $\mathbf { z }$ . The standard approach is to concatenate $\mathbf { x }$ and $\mathbf { z }$ (denoted as $\mathbf { M L P } ( [ \mathbf { x } ; \mathbf { z } ] ) ,$ ) leading to a purely additive relationship.
|
| 130 |
+
|
| 131 |
+
Instead, we replace the final layer of the MLP decoder with the multiplicative form $\mathcal { M } ( \mathbf { x } , \mathbf { z } )$ . As an additional baseline, we consider skip connections between the latent variable and each layer of the decoder (denoted Skip $\mathbf { M L P } ( [ \mathbf { x } ; \mathbf { z } ] )$ Dieng et al. (2018)), as a means to avoid latent variable collapse. We apply all methods to the regression task on function draws from a GP prior Garnelo et al. (2018b) and summarize results in Figure 5 a). The results show that multiplicative forms are able to better condition on latent information compared to the baseline MLPs. Further experimental details are provided in the appendix F.
|
| 132 |
+
|
| 133 |
+
# 8 MULTIPLICATIVE EMBEDDINGS FOR LANGUAGE MODELLING
|
| 134 |
+
|
| 135 |
+
Finally, we consider word-level language modelling with recurrent models. At each time-step, the network outputs a prediction about the next-word in the sequence, given the current generated word (ground truth at training) and its recurrent state. A standard architecture is to project one-hot word vectors $\mathbf { x } _ { t }$ to input embeddings $\mathbf { z } _ { t } ^ { i } = \mathbf { W } \mathbf { x } _ { t }$ , followed by an LSTM with output $\mathbf { h } _ { t }$ . We then produce our predicted output embedding $\mathbf { z } _ { t + 1 } ^ { o } = \mathbf { W } _ { 2 } \mathbf { h } _ { t } \mathbf { x } _ { t } + \mathbf { b }$ and output yt+1 = softmax $( \mathbf { z } _ { t + 1 } ^ { o } \mathbf { W } ^ { T } + b _ { 2 } )$ where the embedding weights W are tied.
|
| 136 |
+
|
| 137 |
+
We posit that computing embeddings with multiplicative interactions instead will allow the model to better take its recurrent context into account. We thus compute the output embedding as follows: $\mathbf { c } = \mathrm { r e l u } ( \mathbf { W } _ { 3 } \mathbf { h } _ { t } + \mathbf { b } )$ and $\mathbf { z } _ { t + 1 } ^ { o } = \mathcal { M } ( \mathbf { c } ^ { T } , \mathbf { h } _ { t } )$ . Instead of being quadratic in $\mathbf { h } _ { t }$ directly we use this context vector c defined above. This serves two purposes: firstly, we introduce an additional on-linear pathway in the network and secondly, we have $\dim ( \mathbf { c } ) \ll \dim ( \mathbf { h } _ { t } )$ which allows us to drastically cut down the parameter count (for example, we have an LSTM output size of 2048, but a context size of only 32). This is an alternative to having a diagonal approximation.
|
| 138 |
+
|
| 139 |
+
We can similarly also have a multiplicative input embedding to the LSTM such that $ { \mathbf { z } } _ { t } ^ { i }$ also integrates recurrent information from $\mathbf { h } _ { t - 1 }$ . We could define $ { \mathbf { z } } _ { t } ^ { i }$ analogous to above: $\mathbf { z } _ { t + 1 } ^ { \prime } = \mathrm { \mathcal { M } } ( \mathbf { z } _ { t } ^ { i } , \mathbf { h } _ { t - 1 } ) =$ $\mathbf { z } _ { t } ^ { i ^ { T } } \mathbb { W } ^ { \prime \prime } \mathbf { h } _ { t - 1 } + \mathbf { z } ^ { T } \mathbf { U } + \mathbf { V } \mathbf { h } _ { t - 1 } + \mathbf { b }$ . This equation is in fact very similar to the expression used to generate the gates and candidate cell of the LSTM: the last three terms are identical. A diagonal form of the first term has been used in used inside multiplicative RNNs and LSTMs (Sutskever et al., 2011; Krause et al., 2016).
|
| 140 |
+
|
| 141 |
+
We report results (in Table 1) on running this model on Wikitext-103. For multiplicative output embeddings we use the 3D form (with the low-rank bottleneck as described above) and we use a diagonal form for the input embeddings when combining the approaches. The rest of architectural choices and hyper-parameters are reported in the appendix. We find that adding multiplicative decoder (output) embeddings provides a boost in performance and further adding input embeddings increases these gains. We ascribe this to the ability of the embeddings to now be markedly changed by context and allowing better integration of information by the inductive bias in these interactions.
|
| 142 |
+
|
| 143 |
+
Table 1: Word-level perplexity on WikiText-103
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model</td><td>Valid</td><td>Test</td><td>No. Params</td></tr><tr><td>LSTM Rae et al. (2018)</td><td>34.1</td><td>34.3</td><td>88M</td></tr><tr><td>Gated CNN Dauphin et al. (2017)</td><td>1</td><td>37.2</td><td>-</td></tr><tr><td>RMC Santoro et al. (2018)</td><td>30.8</td><td>31.6</td><td>-</td></tr><tr><td>Trellis Networks Bai et al. (2019)</td><td>1</td><td>30.35</td><td>180M</td></tr><tr><td>TransformerXL Dai et al. (2018)</td><td>17.7</td><td>18.3</td><td>257M</td></tr><tr><td>LSTM (ours)</td><td>34.7</td><td>36.7</td><td>88M</td></tr><tr><td>LSTM + MultDec</td><td>31.7</td><td>33.7</td><td>105M</td></tr><tr><td>LSTM+ MultEncDec</td><td>28.9</td><td>30.3</td><td>110M</td></tr></table>
|
| 146 |
+
|
| 147 |
+
We note that we have competitive results using only a single-layer LSTM as our base model and far fewer parameters overall. Our intuition is that using such embeddings is orthognal to most of the other recent advances proposed and can thus be stacked on top of them. We leave as future work the integration of these ideas with Transformer based models.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 5: Results on Neural Processes and language modelling on WikiText-103.
|
| 151 |
+
|
| 152 |
+
# 9 CONCLUSION AND FUTURE WORK
|
| 153 |
+
|
| 154 |
+
In this work we considered multiplicative interactions and various formulations thereof, connecting them to a variety of architectures, both older and modern, such as Hypernetworks, multplicative LSTMs or gating methods. We hypothesise that the ability of such networks to better represent a broader range of algorithmic primitives (e.g. conditional-statements or inner products) allows them to better integrate contextual or task-conditional information to fuse multiple stream of data. We first tested empirically this hypothesis in two controlled settings, in order to minimize the effect of confounding factors. We further show that we could match state-of-the-art methods on multiple domains with only LSTMs and multiplicative units. While we do not necessarily advocate for a specific instance of the above methods, we hope that this work leads to a broader understanding and consideration of such methods by practitioners, and in some cases replacing the standard practice of concatenation when using conditioning, contextual inputs, or additional sources of information.
|
| 155 |
+
|
| 156 |
+
We believe there are many ways to explore this space of ideas more broadly, for instance looking at: the role of various approximations to these methods; ways to make their implementations more efficient; and their application to newer domains. Finally, while attention models use some of these multiplicative interactions, we hope that applying some of the lessons from this work (such as higher order interactions) will allow even greater integration of information in attention systems.
|
| 157 |
+
|
| 158 |
+
# ACKNOWLEDGEMENTS
|
| 159 |
+
|
| 160 |
+
The authors would like to thank Karen Simonyan and Sander Dieleman for their inputs and comments on the experiments as well as early drafts of the paper. We’d also like to thank Ali Razavi, Pablo Sprechmann, Alex Pritzel and Erich Elsen for insightful discussions around such multiplicative models and their applications.
|
| 161 |
+
|
| 162 |
+
# REFERENCES
|
| 163 |
+
|
| 164 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 165 |
+
|
| 166 |
+
Shaojie Bai, J Zico Kolter, and Vladlen Koltun. Trellis networks for sequence modeling. ICLR, 2019.
|
| 167 |
+
|
| 168 |
+
Charles Beattie, Joel Z Leibo, Denis Teplyashin, Tom Ward, Marcus Wainwright, Heinrich Küttler, Andrew Lefrancq, Simon Green, Víctor Valdés, Amir Sadik, et al. Deepmind lab. arXiv preprint arXiv:1612.03801, 2016.
|
| 169 |
+
|
| 170 |
+
Andrew Brock, Theodore Lim, J. M. Ritchie, and Nick Weston. Smash: One-shot model architecture search through hypernetworks, 2017.
|
| 171 |
+
|
| 172 |
+
Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. ICLR, 2019.
|
| 173 |
+
|
| 174 |
+
Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
|
| 175 |
+
|
| 176 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Language modeling with longer-term dependency. 2018.
|
| 177 |
+
|
| 178 |
+
Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 933–941. JMLR. org, 2017.
|
| 179 |
+
|
| 180 |
+
Adji B Dieng, Yoon Kim, Alexander M Rush, and David M Blei. Avoiding latent variable collapse with generative skip models. arXiv preprint arXiv:1807.04863, 2018.
|
| 181 |
+
|
| 182 |
+
Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. Proc. of ICLR, 2, 2017.
|
| 183 |
+
|
| 184 |
+
Vincent Dumoulin, Ethan Perez, Nathan Schucher, Florian Strub, Harm de Vries, Aaron Courville, and Yoshua Bengio. Feature-wise transformations. Distill, 2018. doi: 10.23915/distill.00011. https://distill.pub/2018/feature-wise-transformations.
|
| 185 |
+
|
| 186 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymir Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. ICML, 2018.
|
| 187 |
+
|
| 188 |
+
Yang Gao, Oscar Beijbom, Ning Zhang, and Trevor Darrell. Compact bilinear pooling. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 317–326, 2016.
|
| 189 |
+
|
| 190 |
+
Marta Garnelo, Dan Rosenbaum, Chris J Maddison, Tiago Ramalho, David Saxton, Murray Shanahan, Yee Whye Teh, Danilo J Rezende, and SM Eslami. Conditional neural processes. ICML, 2018a.
|
| 191 |
+
|
| 192 |
+
Marta Garnelo, Jonathan Schwarz, Dan Rosenbaum, Fabio Viola, Danilo J Rezende, SM Eslami, and Yee Whye Teh. Neural processes. arXiv preprint arXiv:1807.01622, 2018b.
|
| 193 |
+
|
| 194 |
+
David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. ICLR, 2017.
|
| 195 |
+
|
| 196 |
+
Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. AAAI, 2019.
|
| 197 |
+
|
| 198 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 199 |
+
|
| 200 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7132–7141, 2018.
|
| 201 |
+
|
| 202 |
+
Robert A Jacobs, Michael I Jordan, Steven J Nowlan, Geoffrey E Hinton, et al. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991.
|
| 203 |
+
|
| 204 |
+
Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojciech M Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, et al. Population based training of neural networks. arXiv preprint arXiv:1711.09846, 2017.
|
| 205 |
+
|
| 206 |
+
Hyunjik Kim, Andriy Mnih, Jonathan Schwarz, Marta Garnelo, Ali Eslami, Dan Rosenbaum, Oriol Vinyals, and Yee Whye Teh. Attentive neural processes. arXiv preprint arXiv:1901.05761, 2019.
|
| 207 |
+
|
| 208 |
+
Jin-Hwa Kim, Kyoung-Woon On, Woosang Lim, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Hadamard product for low-rank bilinear pooling. arXiv preprint arXiv:1610.04325, 2016.
|
| 209 |
+
|
| 210 |
+
Ben Krause, Liang Lu, Iain Murray, and Steve Renals. Multiplicative lstm for sequence modelling, 2016.
|
| 211 |
+
|
| 212 |
+
David Krueger, Chin-Wei Huang, Riashat Islam, Ryan Turner, Alexandre Lacoste, and Aaron Courville. Bayesian hypernetworks. arXiv preprint arXiv:1710.04759, 2017.
|
| 213 |
+
|
| 214 |
+
Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical question-image co-attention for visual question answering. In Advances In Neural Information Processing Systems, pp. 289–297, 2016.
|
| 215 |
+
|
| 216 |
+
Roland Memisevic and Geoffrey Hinton. Unsupervised learning of image transformations. In 2007 IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–8. IEEE, 2007.
|
| 217 |
+
|
| 218 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Advances in neural information processing systems, pp. 2863–2871, 2015.
|
| 219 |
+
|
| 220 |
+
Ethan Perez, Harm De Vries, Florian Strub, Vincent Dumoulin, and Aaron Courville. Learning visual reasoning without strong priors. arXiv preprint arXiv:1707.03017, 2017.
|
| 221 |
+
|
| 222 |
+
Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 223 |
+
|
| 224 |
+
Jack W Rae, Chris Dyer, Peter Dayan, and Timothy P Lillicrap. Fast parametric learning with activation memorization. arXiv preprint arXiv:1803.10049, 2018.
|
| 225 |
+
|
| 226 |
+
Malcolm Reynolds, Gabriel Barth-Maron, Frederic Besse, Diego de Las Casas, Andreas Fidjeland, Tim Green, Andria Puigdomenech, Sébastien Racanière, Jack Rae, and Fabio Viola. Open sourcing Sonnet - a new library for constructing neural networks. https://deepmind.com/blog/ open-sourcing-sonnet/, 2017.
|
| 227 |
+
|
| 228 |
+
D. E. Rumelhart, G. E. Hinton, and J. L. McClelland. Parallel distributed processing: Explorations in the microstructure of cognition, vol. 1. chapter 2: A General Framework for Parallel Distributed Processing, pp. 45–76. MIT Press, Cambridge, MA, USA, 1986. ISBN 0-262-68053-X. URL http://dl.acm.org/citation.cfm?id=104279.104286.
|
| 229 |
+
|
| 230 |
+
Adam Santoro, Ryan Faulkner, David Raposo, Jack Rae, Mike Chrzanowski, Theophane Weber, Daan Wierstra, Oriol Vinyals, Razvan Pascanu, and Timothy Lillicrap. Relational recurrent neural networks. In Advances in Neural Information Processing Systems, pp. 7299–7310, 2018.
|
| 231 |
+
|
| 232 |
+
Idan Schwartz, Alexander Schwing, and Tamir Hazan. High-order attention models for visual question answering. In Advances in Neural Information Processing Systems, pp. 3664–3674, 2017.
|
| 233 |
+
|
| 234 |
+
Terrence J Sejnowski. Higher-order boltzmann machines. In AIP Conference Proceedings, volume 151, pp. 398–403. AIP, 1986.
|
| 235 |
+
|
| 236 |
+
Rupesh Kumar Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. arXiv preprint arXiv:1505.00387, 2015.
|
| 237 |
+
|
| 238 |
+
Ilya Sutskever, James Martens, and Geoffrey E Hinton. Generating text with recurrent neural networks. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 1017–1024, 2011.
|
| 239 |
+
|
| 240 |
+
Graham W Taylor and Geoffrey E Hinton. Factored conditional restricted boltzmann machines for modeling motion style. In Proceedings of the 26th annual international conference on machine learning, pp. 1025–1032. ACM, 2009.
|
| 241 |
+
|
| 242 |
+
Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. In Advances in neural information processing systems, pp. 4790–4798, 2016.
|
| 243 |
+
|
| 244 |
+
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.
|
| 245 |
+
|
| 246 |
+
Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3540–3549. JMLR. org, 2017.
|
| 247 |
+
|
| 248 |
+
Karl Weierstrass. On continuous functions of a real argument which possess a definite derivative for no value of the argument. Königlich Preussichen Akademie der Wissenschaften, 2:71–74, 1895.
|
| 249 |
+
|
| 250 |
+
Felix Wu, Angela Fan, Alexei Baevski, Yann N Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. ICLR, 2019.
|
| 251 |
+
|
| 252 |
+
Yuhuai Wu, Saizheng Zhang, Ying Zhang, Yoshua Bengio, and Ruslan R Salakhutdinov. On multiplicative integration with recurrent neural networks. In Advances in neural information processing systems, pp. 2856–2864, 2016.
|
| 253 |
+
|
| 254 |
+
Huijuan Xu and Kate Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. In European Conference on Computer Vision, pp. 451–466. Springer, 2016.
|
| 255 |
+
|
| 256 |
+
Zhou Yu, Jun Yu, Jianping Fan, and Dacheng Tao. Multi-modal factorized bilinear pooling with co-attention learning for visual question answering. In Proceedings of the IEEE international conference on computer vision, pp. 1821–1830, 2017.
|
| 257 |
+
|
| 258 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutník, and Jürgen Schmidhuber. Recurrent highway networks. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 4189–4198. JMLR. org, 2017.
|
| 259 |
+
|
| 260 |
+
# A EXPRESSIVITY OF THE MODEL
|
| 261 |
+
|
| 262 |
+
Theorem 1. Let $\mathcal { H } _ { m l p }$ denote the hypotheses space of standard MLPs with ReLU activation function, and let $\mathcal { H } _ { m u }$ denote the hypotheses space of analogous networks, but with each linear layer replaced with multiplicative layer, then we have $\mathcal { H } _ { m l p } \subsetneq \mathcal { H } _ { m u }$ .
|
| 263 |
+
|
| 264 |
+
Proof. Inclusion comes directly from the fact that if we split input into arbitrary parts $[ \mathbf { x } ; \mathbf { z } ]$ we get:
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
\mathbf { x } ^ { T } \mathbf { W } \mathbf { z } + \mathbf { x } ^ { T } \mathbf { B } + \mathbf { V } \mathbf { z } + \mathbf { c } = \mathbf { x } ^ { T } \mathbf { W } \mathbf { z } + [ \mathbf { B } ^ { T } ; \mathbf { V } ] ^ { T } [ \mathbf { x } ; \mathbf { z } ] + \mathbf { c } = \mathbf { x } ^ { T } \mathbf { W } \mathbf { z } + \mathbf { A } [ \mathbf { x } ; \mathbf { z } ] + \mathbf { c } ,
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
which proves that $\mathcal { H } _ { \mathrm { m l p } } \subset \mathcal { H } _ { \mathrm { m u } }$ . Thus, the only aspect of the theorm left to prove is that the inclusion is strict. Let us consider a 1D function $x \to x ^ { 2 }$ , and for simplicity let $x = z$ (a domain where context equals input). A single layer MLP with a single multiplicative unit can represent this function exactly, by using $A = 0$ and $W = I$ , as then we obtain $x ^ { T } W \overset { \cdot } { x } = x ^ { T } x = \| x \| ^ { 2 }$ . Since our function is positive, it is not affecting the multiplicative network output. For a regular MLP, let us first notice that we need at least one hidden layer, as otherwise MLP is a linear function and $f$ is not. Lets denote by ${ \mathbf V } , { \mathbf c }$ and $\mathbf { w } , \mathbf { b }$ weights and biases of second, and first layers respectively. Then we have to satisfy
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
f ( x ) = g ( \mathbf { V } ^ { T } \operatorname* { m a x } ( 0 , \mathbf { w } x + \mathbf { b } ) + \mathbf { c } ) = x ^ { 2 } ,
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
where $g$ is transformation represented by all higher layers of the MLP (in particular if there are just 2 layers, then $g ( x ) = x ,$ ). Note that RHS is differentiable everywhere, while LHS is differentiable iff for each $i$ and for each $x$ we have $w _ { i } x + b _ { i } \neq 0$ (or $f$ is independent from $x$ , which $x ^ { 2 }$ does not satisfy). However, this is impossible, as if $w _ { i } \neq 0$ , then we can always pick $x = - b _ { i } / w _ { i }$ , and if all $w _ { i } = 0$ , then $f ( x ) = g ( c ) \bar { \neq } x ^ { 2 }$ , leading to a contradiction. □
|
| 277 |
+
|
| 278 |
+
Theorem 2. Let $\mathcal { H } _ { \sigma }$ denote the hypotheses space of standard MLPs with $\sigma$ activation function, and ${ \mathcal { H } } _ { w }$ analogous set, where some activations are replaced with Weiestrass function $f _ { w }$ . Then we have $\mathcal { H } _ { r e l u } \subsetneq \mathcal { H } _ { w }$ , and $\mathcal { H } _ { \sigma } \subsetneq \mathcal { H } _ { w }$ , for any $\sigma$ that is differentiable everywhere.
|
| 279 |
+
|
| 280 |
+
Proof. Inclusion comes directly from the fact that only some activations are replaced, and in particular we can always replace none, thus leading to equality of hypotheses classes. To show that the inclusion is strict lets consider a Weierstrass function itself $f ( x ) = \sigma _ { \mathrm { w } } ( x )$ . We definitely have $f \in \mathcal { H } _ { \mathrm { w } }$ as we can define 1 hidden layer network, with one hidden neuron and all the weights set to 1, and all biases to 0. Now, relu networks are piece-wise linear while the Weierstrass function is nowhere differentiable Weierstrass (1895) and thus not piece-wise linear. Similarly, network with an activation that is differentiable everywhere (e.g. sigmoid or tanh) is everywhere differentiable wrt. inputs, while Weierstrass function – nowhere Weierstrass (1895). □
|
| 281 |
+
|
| 282 |
+
# B SIMPLE IMPLEMENTATION OF MI LAYER
|
| 283 |
+
|
| 284 |
+
We use Tensorflow and Sonnet Reynolds et al. (2017) for all our model implementations. The example below is a simple code snippet for adding a multiplicative layer to any model, using the Sonnet framework as an example.
|
| 285 |
+
|
| 286 |
+
# S i m p l e p y t h o n c o d e f o r MI L a y e r s i m p o r t s o n n e t a s s n t i m p o r t t e n s o r f l o w a s t f
|
| 287 |
+
|
| 288 |
+
# A s t a n d a r d l i n e a r l a y e r # B i s t h e b a t c h s i z e # E i s t h e i n p u t s i z e # C i s t h e c o n t e x t s i z e $\begin{array} { r l } { \mathbf { X } } & { { } = } \end{array}$ . . . # i n p u t o f s i z e [ B , E ] $\mathrm { ~ \bf ~ Z ~ } =$ # c o n t e x t o f s i z e [ B , C ] $\begin{array} { r l } { \mathbf { X } Z } & { { } = } \end{array}$ t f . c o n c a t ( [ x , z ] , 1 ) $\mathrm { ~ y ~ } =$ s n t . L i n e a r ( o u t p u t _ s i z e ) ( x z )
|
| 289 |
+
|
| 290 |
+
# I n s t e a d , we g e n e r a t e a W a n d b # T h i s d e f i n e s a n i m p l i c i t 3D w e i g h t t e n s o r ${ \bf W _ { \alpha } } = { \bf \Phi }$ s n t . L i n e a r ( o u t p u t _ s i z e $^ *$ i n p u t _ s i z e ) ( z ) ${ \textbf { b } } =$ s n t . L i n e a r ( o u t p u t _ s i z e ) ( z )
|
| 291 |
+
|
| 292 |
+
# R e s h a p e t o t h e c o r r e c t s h a p e # N o t e : we h a v e B w e i g h t m a t r i c e s # i . e . o n e p e r b a t c h e l e m e n t ${ \bf W _ { \alpha } } = { \bf \Phi }$ t f . r e s h a p e (W, [ B , i n p u t _ s i z e , o u t p u t _ s i z e ] )
|
| 293 |
+
|
| 294 |
+
# O u t p u t $\mathrm { ~ y ~ } =$ t f . m a t m u l ( x , W) + b
|
| 295 |
+
|
| 296 |
+
# C DETAILS FOR SIMPLE FUNCTION EXPERIMENTS
|
| 297 |
+
|
| 298 |
+
For the experiments modeling the simple two-input functions, we consider MLP and MI models and plot number of parameters against the input hidden size. The two models are
|
| 299 |
+
|
| 300 |
+
• MLP: linear(size), relu, linear(output_size) • MI Network: MI(size), linear(output_size).
|
| 301 |
+
|
| 302 |
+
Here size is the largest value such that the network has not more than N variables and we sweep over [1, 2, 5, 10, 15, 20, 30, 40, 50, 60, 80, 100, 120, 140, 160, 180, 200]. We sweep over learning rates 0.1, 0.001, 0.0001 and pick the best result. Models are trained using Adam optimiser for 6,000 steps using Mean Squared Error loss (MSE) on mini-batches of size 100 sampled from a standard Gaussian. The reported error is based on 10,000 samples from the same distribution to minimize the estimation variance.
|
| 303 |
+
|
| 304 |
+
# D DETAILS FOR TOY REGRESSION EXPERIMENTS
|
| 305 |
+
|
| 306 |
+
In multitask toy regression we coinsider MLP, MI and multiheaded models. For $x \in \mathbb { R }$ (input to the task) and $z$ (represented as one-hot encoding of a task ID) we use:
|
| 307 |
+
|
| 308 |
+
• Conditional MLP: concat(x, linear(20)(z)), linear(30), relu, linear(20), relu, linear(1) • Conditional MI: MI( [linear(30), relu, linear(20), relu] $\mathbf { \tau } ( \mathbf { x } )$ , linear(20)(z) ) • Multiheaded MLP: linear(20), relu, linear(30), relu, linear(1); where the last linear is separate per task
|
| 309 |
+
|
| 310 |
+
Each of these models is trained in a multitask setup, where we first sample $T$ tasks (20, 40 or 60). Half of these tasks involve fitting an affine function $a x + b$ , where both $a$ and $b$ are sampled from uniform distribution over $[ 0 , 1 ]$ ; and half represent scaled sine waves, $a \sin ( 1 0 x ) + b$ with $a$ and $b$ sampled in the same way. Training is performed with Adam optimiser (with learning rate $3 e - 3$ ), on mini batches of size 50 per task (so the total batch size is $5 0 T$ ). Models are trained for 10,000 steps with Mean Squared Error loss (MSE), and the logarithm of the training MSE is reported for analysis. Each training is repeated 60 times to minimise the variance coming from the stochasticity.
|
| 311 |
+
|
| 312 |
+
# E DETAILS OF MULTITASK DEEPMIND LAB TRAINING
|
| 313 |
+
|
| 314 |
+
We train multi-task on 30 DeepMind lab levels Beattie et al. (2016) concurrently using 5 actors per task and a multi-gpu learner with 4 GPUs. We follow exactly the model and hyper-parameters used in the Impala architecture Espeholt et al. (2018). Our models are all trained with population based training (PBT) Jaderberg et al. (2017) and we show below the average over three populations with 24 independent learners each for both the baseline and our best method. We train all models for 10 billion frames of data across all levels. The human normalised score is calculated independently for each level and capped at 100 (i.e $s c o r e = m i n ( s c o r e , 1 0 0 ) )$
|
| 315 |
+
|
| 316 |
+
The architecture is as follows:
|
| 317 |
+
|
| 318 |
+
• Conv2D: 16ch, 8x8 kernels, stride=4
|
| 319 |
+
• ReLU
|
| 320 |
+
• Conv2D: 32ch 4x4 kernel,stride=2
|
| 321 |
+
• ReLU
|
| 322 |
+
• Linear layer with output size 256
|
| 323 |
+
• ReLU
|
| 324 |
+
• Concatenation with one hot encoded last action and last reward and language instruction
|
| 325 |
+
• LSTM (256 hidden units)
|
| 326 |
+
• Policy $=$ Linear layer or multiplicative interaction followed by a softmax
|
| 327 |
+
• Value function $=$ Linear layer or multiplicative intereaction
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
|
| 331 |
+
# F DETAILS OF NEURAL PROCESS EXPERIMENTS
|
| 332 |
+
|
| 333 |
+
Inspired by the experiments in Garnelo et al. (2018b), we apply Neural Processes to functions drawn for a Gaussian Process prior with an exponentiated quadratic kernel $k ( x , x ^ { \prime } ) = \sigma _ { f } ^ { 2 } \exp ( - { \textstyle \frac { 1 } { 2 } } ( x -$ $x ^ { \prime } ) ^ { 2 } / l ^ { 2 } )$ with fixed $\sigma ^ { f } = 1 . 0$ and, importantly, a random $l \sim U [ 0 . 1 , 1 0 . 0 ]$ for each draw, resulting in a broad distribution of functions. We also add Gaussian observation noise, i.e. $y \sim \mathcal { N } ( f , \sigma _ { n } ^ { 2 } )$ and set $\sigma _ { n } = 0 . 0 2$ . In all experiments, we provide a deterministic transformation $h$ of the context in addition to the latent variable $z$ , using separate encoder networks for each. For both SKIP MLP and the proposed MI, we concatenate $h$ and $z$ first, i.e. we use SKIP $\scriptstyle \mathrm { { M L P } } [ x$ ; concat $( z , h ) ]$ and $\mathbf { M I } ( x , \mathbf { c o n c a t } ( z , h ) )$ writing concat() to denote concatenation. A more detailed discussion on adding an the benefits of adding an additional deterministic path in provided in Kim et al. (2019).
|
| 334 |
+
|
| 335 |
+
The determinsitic encoder used to obtain $h$ is a deep MLP with 6 layers of 128 units each. The latent encoder used for $z$ consists of 3 hidden layers of 128 units, parameterising mean and standard deviation of a 64-dimensional Gaussian distributed latent variable. The decoder network used to predict on new target inputs $x ^ { * }$ consists of 4 layers of 128 units. We use relu activiatons throughout all components of the network. The network is trained until convergence with Adam, using a learning rate of 0.0001 and absolute value gradient clipping with a threshold of 10.0.
|
| 336 |
+
|
| 337 |
+
# G LANGUAGE MODELLING
|
| 338 |
+
|
| 339 |
+
We train a single layer LSTM of hidden size 2048 hidden units. The input to the LSTM is an embedding of size 256 and then output the LSTM is projected down to 256 with a single linear layer for the baseline. The input and output embedding-word matrices are tied. We use a training sequence length of 128. For the multiplicative model, the output embedding is calculated with an MI layer who’s context input $c$ is generated by a linear layer with output size 32 followed by a relu. We use dropout rate of 0.3 and a learning rate of 0.001 for all models. All models are trained with the Adam optimiser.
|
| 340 |
+
|
| 341 |
+
For the multiplicative encoder we use a diagonal form of the $\mathcal { M } ( . )$ layer and for the multiplicative deocder we use the full $\mathcal { M } ( . )$ form (with the bottleneck described above). This amounts to adding about 20M parameters which is the same as adding 1000 hidden units. We get 6 perplexity improvement in performance whereas naively adding 1000 hidden units only gave us an improvement of 1 perplexity. Further the parameter count could be drastically reduced by considering diagonal or low rank approximations, but we do not specifically optimise for this in this work.
|
md/train/tHgJoMfy6nI/tHgJoMfy6nI.md
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REMEMBERING FOR THE RIGHT REASONS: EXPLANATIONS REDUCE CATASTROPHIC FORGETTING
|
| 2 |
+
|
| 3 |
+
Sayna Ebrahimi1, Suzanne Petryk1, Akash Gokul1, William Gan1, Joseph E. Gonzalez1, Marcus Rohrbach2, Trevor Darrell1
|
| 4 |
+
|
| 5 |
+
1UC Berkeley, 2 Facebook AI Research
|
| 6 |
+
{sayna,spetryk,akashgokul,wjgan,jegonzal,trevordarrell}@berkeley.edu
|
| 7 |
+
mrf@fb.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
The goal of continual learning (CL) is to learn a sequence of tasks without suffering from the phenomenon of catastrophic forgetting. Previous work has shown that leveraging memory in the form of a replay buffer can reduce performance degradation on prior tasks. We hypothesize that forgetting can be further reduced when the model is encouraged to remember the evidence for previously made decisions. As a first step towards exploring this hypothesis, we propose a simple novel training paradigm, called Remembering for the Right Reasons (RRR), that additionally stores visual model explanations for each example in the buffer and ensures the model has “the right reasons” for its predictions by encouraging its explanations to remain consistent with those used to make decisions at training time. Without this constraint, there is a drift in explanations and increase in forgetting as conventional continual learning algorithms learn new tasks. We demonstrate how RRR can be easily added to any memory or regularizationbased approach and results in reduced forgetting, and more importantly, improved model explanations. We have evaluated our approach in the standard and few-shot settings and observed a consistent improvement across various CL approaches using different architectures and techniques to generate model explanations and demonstrated our approach showing a promising connection between explainability and continual learning. Our code is available at https://github.com/ SaynaEbrahimi/Remembering-for-the-Right-Reasons.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Humans are capable of continuously learning novel tasks by leveraging their lifetime knowledge and expanding them when they encounter a new experience. They can remember the majority of their prior knowledge despite the never-ending nature of their learning process by simply keeping a running tally of the observations distributed over time or presented in summary form. The field of continual learning or lifelong learning (Thrun & Mitchell, 1995; Silver et al., 2013) aims at maintaining previous performance and avoiding so-called catastrophic forgetting of previous experience (McCloskey & Cohen, 1989; McClelland et al., 1995) when learning new skills. The goal is to develop algorithms that continually update or add parameters to accommodate an online stream of data over time.
|
| 16 |
+
|
| 17 |
+
An active line of research in continual learning explores the effectiveness of using small memory budgets to store data points from the training set (Castro et al., 2018; Rajasegaran et al., 2020; Rebuffi et al., 2017; Wu et al., 2019), gradients (Lopez-Paz et al., 2017), or storing an online generative model that can fake them later (Shin et al., 2017). Memory has been also exploited in the form of accommodating space for architecture growth and storage to fully recover the old performance when needed (Ebrahimi et al., 2020b; Rusu et al., 2016). Some methods store an old snapshot of the model to distill the features (Li & Hoiem, 2016) or attention maps (Dhar et al., 2019) between the teacher and student models.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: An illustration of applying RRR paradigm. (Left) In a typical experience replay scenario, samples from prior tasks are kept in a memory buffer $\mathcal { M } ^ { \mathrm { r e p } }$ and revisited during training. (Right) In our proposed idea (RRR), in addition to ${ \mathcal { M } } ^ { \mathrm { r e p } }$ , we also store model explanations (saliency maps) as $\mathcal { M } ^ { \mathrm { R R R } }$ for those samples and encourage the model to remember the original reasoning for the prediction. Note that the saliency maps are small masks resulting in a negligible memory overhead (see Section 4.1).
|
| 21 |
+
|
| 22 |
+
The internal reasoning process of deep models is often treated as a black box and remains hidden from the user. However, recent work in explainable artificial intelligence (XAI) has developed methods to create human-interpretable explanations for model decisions (Simonyan et al., 2013; Zhang et al., 2018; Petsiuk et al., 2018; Zhou et al., 2016; Selvaraju et al., 2017). We posit that the catastrophic forgetting phenomenon is due in part to not being able to rely on the same reasoning as was used for a previously seen observation. Therefore, we hypothesize that forgetting can be mitigated when the model is encouraged to remember the evidence for previously made decisions. In other words, a model which can remember its final decision and can reconstruct the same prior reasoning. Based on this approach, we develop a novel strategy to exploit explainable models for improving performance.
|
| 23 |
+
|
| 24 |
+
Among the various explainability techniques proposed in XAI, saliency methods have emerged as a popular tool to identify the support of a model prediction in terms of relevant features in the input. These methods produce saliency maps, defined as regions of visual evidence upon which a network makes a decision. Our goal is to investigate whether augmenting experience replay with explanation replay reduces forgetting and how enforcing to remember the explanations will affect the explanations themselves. Figure 1 illustrates our proposed method.
|
| 25 |
+
|
| 26 |
+
In this work, we propose RRR, a training strategy guided by model explanations generated by any white-box differentiable explanation method; RRR adds an explanation loss to continual learning. White-box methods generate an explanation by using some internal state of the model, such as gradients, enabling their use in end-to-end training. We evaluate our approach using various popular explanation methods including vanilla backpropagation (Zeiler & Fergus, 2014), backpropagation with smoothing gradients (Smoothgrad) (Smilkov et al., 2017), Guided Backpropagation (Springenberg et al., 2014), and Gradient Class Activation Mapping (Grad-CAM) (Selvaraju et al., 2017) and compare their performance versus their computational feasibility. We integrate RRR into several state of the art class incremental learning (CIL) methods, including iTAML (Rajasegaran et al., 2020), EEIl (Castro et al., 2018), BiC (Wu et al., 2019), TOPIC (Tao et al., 2020), iCaRL (Rebuffi et al., 2017), EWC (Kirkpatrick et al., 2017), and LwF (Li & Hoiem, 2016). Note that RRR does not require task IDs at test time. We qualitatively and quantitatively analyze model explanations in the form of saliency maps and demonstrate that RRR remembers its earlier decisions in a sequence of tasks due to the requirement to focus on the the right evidence. We empirically show the effect of RRR in standard and few-shot class incremental learning (CIL) scenarios on popular benchmark datasets including CIFAR100, ImageNet100, and Caltech-UCSD Birds 200 using different network architectures where RRR improves overall accuracy and forgetting over experience replay and other memory-based method.
|
| 27 |
+
|
| 28 |
+
Our contribution is threefold: we first propose our novel, simple, yet effective memory constraint, which we call Remembering for the Right Reasons (RRR), and show that it reduces catastrophic forgetting by encouraging the model to look at the same explanations it initially found for its decisions. Second, we show how RRR can be readily combined with memory-based and regularization-based
|
| 29 |
+
|
| 30 |
+
CL methods to improve performance. Third, we demonstrate how guiding a continual learner to remember its explanations can improve the quality of the explanations themselves; i.e., the model looks at the right region in an image when making correct decisions while it focuses its maximum attention on the background when it misclassifies an object.
|
| 31 |
+
|
| 32 |
+
# 2 BACKGROUND: WHITE-BOX EXPLANABILITY TECHNIQUES
|
| 33 |
+
|
| 34 |
+
Here we briefly review the explainability methods we have evaluated our approach with. The core idea behind RRR is to guide explanations or saliency maps during training to preserve their values. Hence, only gradient-based saliency techniques can be used which are differentiable and hence trainable during training for the mainstream task as opposed to black-box saliency methods which can be used only after training to determine important parts of an image.
|
| 35 |
+
|
| 36 |
+
Vanilla Backpropagation (Zeiler & Fergus, 2014): The simplest way to understand and visualize which pixels are most salient in an image is to look at the gradients. This is typically done by making a forward pass through the model and taking the gradient of the given output class with respect to the input. Those pixel-wise derivative values can be rendered as a normalized heatmap representing the amount of change in the output probability of a class caused by perturbing that pixel. To store a saliency map for each RGB image of size $3 \times W \times H$ , we need an equivalent memory size of storing $W \times H$ pixel values.
|
| 37 |
+
|
| 38 |
+
Backpropagation with SmoothGrad: Smilkov et al. (2017) showed that the saliency maps obtained using raw gradients are visually noisy and using them as a proxy for feature importance is sub-optimal. They proposed a simple technique for denoising the gradients that adds pixel-wise Gaussian noise to $n$ copies of the image, and simply averages the resulting gradients. SmoothGrad requires the same amount of memory to store the saliency maps while it takes $n$ times longer to repeat generating each saliency map. We found $n = 4 0$ to be large enough to make a noticeable change in the saliencies in our experiments.
|
| 39 |
+
|
| 40 |
+
Gradient-weighted Class Activation Mapping (Grad-CAM) (Selvaraju et al., 2017): is a whitebox explainability technique which uses gradients to determine the influence of specific feature map activations on a given prediction. Because later layers in a convolutional neural network are known to encode higher-level semantics, taking the gradient of a model output with respect to the activations of these feature maps discovers which high-level semantics are important for the prediction. We refer to this layer as the target layer in our analysis. For example, when using Grad-CAM to visualize explanations for image classification, taking the gradient of the correct class prediction with respect to the last convolutional layer highlights class-discriminative regions in the image (such as the wings of a bird when identifying bird species).
|
| 41 |
+
|
| 42 |
+
Consider the pre-softmax score $y _ { c }$ for class $c$ in an image classification output. In general, any differentiable activation can be used. Consider also a single convolutional layer with $K$ feature maps, with a single feature map noted as $A ^ { k } \in \mathbb { R } ^ { u \times v }$ . Grad-CAM takes the derivative of $y _ { c }$ with respect to each feature map $A ^ { k }$ . It then performs global average pooling over the height and width dimensions for each of these feature map gradients, getting a vector of length $K$ . Each element in this vector is used as a weight $\alpha _ { k } ^ { c }$ , indicating the importance of feature map $k$ for the prediction $y _ { c }$ . Next, these importance weights are used in computing a linear combination of the feature maps. Followed by a ReLU (Jarrett et al., 2009) to zero-out any activations with a negative influence on the prediction of class $c$ , the final Grad-CAM output (s) is as below with $A _ { i j } ^ { k }$ defined at location $( i , j )$ in feature map $A ^ { k }$ .
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { r l } { \alpha _ { k } ^ { c } = } & { { } \frac { 1 } { u v } \displaystyle \sum _ { i = 1 } ^ { u } \displaystyle \sum _ { j = 1 } ^ { v } \frac { \partial y _ { c } } { \partial A _ { i j } ^ { k } } \qquad s _ { G r a d - C A M } ^ { c } = R e L U \left( \displaystyle \sum _ { k = 1 } ^ { K } \alpha _ { k } ^ { c } A ^ { k } \right) } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
Unlike the common saliency map techniques of Guided BackProp (Springenberg et al., 2014), Guided GradCAM (Selvaraju et al., 2016), Integrated Gradients (Sundararajan et al., 2017b), Gradient $\odot$ Input (Shrikumar et al., 2016), Backpropagation with SmoothGrad (Smilkov et al., 2017) etc., vanilla Backpropagation and Grad-CAM pass important “sanity checks” regarding their sensitivity to data and model parameters (Adebayo et al., 2018). We will compare using vanilla Backpropagation, Backpropagation with SmoothGrad, and Grad-CAM in RRR in Section 4. We will refer to the function that computes the output $s$ of these saliency method as $ { \mathcal { X } } { \mathcal { A } } { \mathcal { T } }$ .
|
| 49 |
+
|
| 50 |
+
Algorithm 1 Remembering for the Right Reasons (RRR) for Continual Learning
|
| 51 |
+
1: function TRAIN $( f _ { \theta } , \mathcal { D } ^ { t r } , \mathcal { D } ^ { t s } )$ function UPDATE MEM(f kθ , Dtrk , Mrep, MRRR)
|
| 52 |
+
2: $T$ : # of tasks, $n$ : # of samples in task (xi, k, yi) ∼ Dtrk
|
| 53 |
+
3: R ← 0 ∈ R T ×T Mrep ← Mrep ∪ {(xi, k, yi)}
|
| 54 |
+
4: Mrep ← {} sˆ ← X AI(f kθ (xi, k))
|
| 55 |
+
5: $\mathcal { M } ^ { \mathrm { R R R } } \{ \}$ MRRR ← MRRR ∪ {sˆ}
|
| 56 |
+
6: for $k = 1$ to T do return Mrep, MRRR
|
| 57 |
+
7: for $i = 1$ to n do end function
|
| 58 |
+
8: Compute cross entropy on task $( \mathcal { L } _ { \mathrm { t a s k } } )$
|
| 59 |
+
9: Compute $\mathcal { L } _ { \mathrm { R R R } }$ using Eq. 2 function EVAL(f kθ , Dts{1···k})
|
| 60 |
+
10: $\theta ^ { \prime } \theta - \alpha \nabla _ { \theta } ( \mathcal { L } _ { \mathrm { t a s k } } + \mathcal { L } _ { \mathrm { R R R } } )$ for $i = 1$ to $k$ do
|
| 61 |
+
11: end for Rk,i = Accuracy $( f _ { \theta } ^ { k } ( x , i ) , y \vert \forall ( x , y ) \in \mathcal { D } _ { i } ^ { t s } )$
|
| 62 |
+
12: $\begin{array} { r l } & { \mathcal { M } ^ { \mathrm { r e p } } , \mathcal { M } ^ { \mathrm { R R R } } \gets \mathrm { U P D A T E ~ M E M } ( f _ { \theta } ^ { k } , \mathcal { D } _ { k } ^ { t r } , \mathcal { M } ^ { \mathrm { r e p } } , } \\ & { } \\ & { R _ { k , \{ 1 \cdots k \} } \gets \mathrm { E V A L } \left( f _ { \theta } ^ { k } , \mathcal { D } _ { \{ 1 \cdots k \} } ^ { t s } \right) } \end{array}$ , end for
|
| 63 |
+
return $R$
|
| 64 |
+
13: end function
|
| 65 |
+
14: end for
|
| 66 |
+
15: return $f _ { \boldsymbol { \theta } } , R$
|
| 67 |
+
16: end function
|
| 68 |
+
|
| 69 |
+
# 3 REMEMBERING FOR THE RIGHT REASONS (RRR)
|
| 70 |
+
|
| 71 |
+
Memory-based methods in continual learning have achieved high performance on vision benchmarks using a small amount of memory, i.e. storing a few samples from the training data into the replay buffer to directly train with them when learning new tasks. This simple method, known as experience replay, has been explored and shown to be effective (Rebuffi et al., 2017; Wu et al., 2019; Castro et al., 2018; Rajasegaran et al., 2020; Ebrahimi et al., 2020b; Hayes et al., 2019; Riemer et al., 2018). In this work we aim to go one step further and investigate the role of explanations in continual learning, particularly on mitigating forgetting and change of model explanations.
|
| 72 |
+
|
| 73 |
+
We consider the problem of learning a sequence of $T$ data distributions $\mathcal { D } ^ { t r } = \{ \mathcal { D } _ { 1 } ^ { t r } , \cdot \cdot \cdot , \mathcal { D } _ { T } ^ { t r } \}$ , where $\mathcal { D } _ { k } ^ { t r } = \{ ( x _ { i } ^ { k } , y _ { i } ^ { k } ) _ { i = 1 } ^ { n _ { k } } \}$ is the data distribution for task $k$ with $n$ sample tuples of input $( \mathbf { x } ^ { k } \subset \mathcal { X } )$ and set of output labels $( \mathbf { y } ^ { k } \subset \mathcal { V } )$ . The goal is to sequentially learn the model $f _ { \theta } : \mathcal { X } \times \mathcal { T } \mathcal { Y }$ for each task that can map each input $x$ to its target output, $y$ , while maintaining its performance on all prior tasks. We aim to achieve this by using memory to enhance better knowledge transfer as well as better avoidance of catastrophic forgetting. We assume two limited memory pools $\mathcal { M } ^ { \mathrm { r e p } }$ for raw samples and $\mathcal { M } ^ { \mathrm { R R R } }$ for model explanations. In particular, $\mathcal { M } ^ { \mathrm { r e p } } = \{ ( x _ { i } ^ { j } , y _ { i } ^ { j } ) _ { i = 1 } ^ { m } \stackrel { \cdot } { \sim } \mathcal { D } _ { j = 1 \cdots k - 1 } ^ { t r } \}$ stores $m$ samples in total from all prior tasks to $k$ . Similarly $\mathcal { M } ^ { \mathrm { R R R } }$ stores the saliency maps generated based on $f _ { \theta } ^ { k }$ by one of the explanation methods $( { \mathcal { X } } { \mathcal { A } } { \mathcal { T } } )$ discussed in Section 2 for images in $\mathcal { M } ^ { \mathrm { r e p } }$ where $f _ { \theta } ^ { k }$ is $f _ { \theta }$ being trained for task $k$ . We use a single-head architecture where the task ID integer $t$ is not required at test time.
|
| 74 |
+
|
| 75 |
+
Upon finishing the $k ^ { t h }$ task, we randomly select $m / ( k { - } 1 )$ samples per task from its training data and update our replay buffer memory ${ \mathcal { M } } ^ { \mathrm { r e p } }$ . RRR uses model explanations on memory samples to perform continual learning such that the model preserves its reasoning for previously seen observations. We explore several explanation techniques to compute saliency maps using $f _ { \theta } ^ { \mathbf { \bar { k } } }$ for the stored samples in the replay buffer to populate the xai buffer memory $\mathcal { M } ^ { \mathrm { x a i } }$ . The stored saliency maps will serve as reference explanations during the learning of future tasks to prevent model parameters from being altered resulting in different reasoning for the same samples. We implement RRR using an L1 loss on the error in saliency maps generated after training a new task with respect to their stored reference evidence.
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { L } _ { \mathrm { R R R } } \big ( f _ { \theta } , \mathcal { M } ^ { \mathrm { r e p } } , \mathcal { M } ^ { \mathrm { R R R } } \big ) = \mathbb { E } _ { ( ( x , y ) , \hat { s } ) \sim \left( \mathcal { M } ^ { \mathrm { r e p } } , \mathcal { M } ^ { \mathrm { R R R } } \right) } \vert \vert \mathcal { X } \mathcal { A } \mathcal { Z } \big ( f _ { \theta } ^ { k } ( x ) \big ) - \hat { s } \vert \vert _ { 1 }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\mathcal { X } \mathcal { A } \mathcal { T } ( \cdot )$ denotes the explanation method used to compute saliency maps using the model trained on the last seen example from task $k$ , and $\hat { s }$ are the reference saliency maps generated by $\chi \mathcal { A } \mathcal { T } ( f _ { \theta } ^ { k } )$ upon learning each task prior to $T$ and stored in to the memory. We show below that combining RRR into the objective function of state-of-the-art memory and regularization-based methods results in significant performance improvements. The full algorithm for RRR is given in Alg. 1.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 2: Few-shot CIL learning of CUB200 in 11 tasks where each point shows the classification accuracy on all seen classes so far. (Left) Shows ER with and without $\mathcal { L } _ { \mathrm { R R R } }$ using different backbone architectures and saliency map techniques. (Right) Performance of the state-of-the-art existing approaches with and without $\mathcal { L } _ { \mathrm { R R R } }$ on CUB200 including TOPIC (Tao et al., 2020), EEIL (Castro et al., 2018), iCaRL (Rebuffi et al., 2017). Joint training serves as the upper bound. Results for baselines are obtained using their original implementation. All results are averaged over 3 runs and mean and standard deviation values are given in the appendix. Best viewed in color.
|
| 85 |
+
|
| 86 |
+
# 4 EXPERIMENTS
|
| 87 |
+
|
| 88 |
+
In this section, we apply RRR in two distinct learning regimes: standard and few-shot class incremental learning. These are the most challenging CL scenarios, in which task descriptions are not available at test time. We first explore the effect of backbone architecture and the saliency map technique on RRR performance. We then report our obtained results integrating $\mathcal { L } _ { \mathrm { R R R } }$ into existing memory-based and regularization-based methods.
|
| 89 |
+
|
| 90 |
+
# 4.1 FEW-SHOT CIL PERFORMANCE
|
| 91 |
+
|
| 92 |
+
We first explore CIL of low-data regimes where preventing overfitting to few-shot new classes is another challenge to overcome in addition to avoiding catastrophic forgetting of old classes. We use $C$ classes and $K$ training samples per class as the $C$ -way $K$ -shot few-shot class incrementally learning setting where we have a set of $b$ base classes to learn as the first task while the remaining classes are learned with only a few randomly selected samples. In order to provide a direct comparison to the state-of-the-art work of Tao et al. (2020) we precisely followed their setup and and used the same Caltech-UCSD Birds dataset (Wah et al., 2011), divided into 11 disjoint tasks and a 10-way 5-shot setting, where the first task contains $b = 1 0 0$ base classes resulting in 3000 samples for training and 2834 images for testing. The remaining 100 classes are divided into 10 tasks where 5 samples per class are randomly selected as the training set, while the test set is kept intact containing near 300 images per task. The images in CUB200 are resized to $2 5 6 \times 2 5 6$ and then randomly cropped to $2 2 4 \times 2 2 4$ for training. We store 4 images per class from base classes in the first task and 1 sample per each few-shot class in the remaining 10 tasks (Tao et al., 2020). We used the RAdam (Liu et al., 2019) optimizer with a learning rate of 0.001 which was reduced by 0.2 at epochs 20, 40, and 60 and trained for a total of 70 epochs with a batch size of 128 for the first and 10 for the remaining tasks.
|
| 93 |
+
|
| 94 |
+
Figure 2 (left) shows results for ER with and without $\mathcal { L } _ { \mathrm { R R R } }$ using different backbone architectures and saliency map techniques. Among the tested saliency map methods, Grad-CAM on ResNet18 outperforms Vanilla Backpropagation and SmoothGrad by $2 { - } 3 \%$ while SmoothGrad and vanilla Backpropagation achieve similar CL performance. To compute the memory overhead of storing the output for a saliency method, if we assume the memory required to store an image is $M$ , vanilla Backpropagation and SmoothGrad generate a pixel-wise saliency map that occupies $M / 3$ of memory. However, in Grad-CAM the saliency map size is equal to the feature map of the target layer in the architecture. In our study with Grad-CAM we chose our target layer to be the last convolution layer before the fully-connected layers. For instance using ResNet18 for colored $2 2 4 \times 2 2 4$ images results in the Grad-CAM output of $7 \times 7$ occupying 196B. Table 2 shows the target layer name and saliency map size for other network architectures used in this work (AlexNet and SqueezeNet1 1) as well.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 3: Effect of RRR on existing methods for CIL on CIFAR100 in (a) 10 and (b) 20 tasks and (c) ImageNet100 in 10 tasks. Each point shows the classification accuracy on all seen classes so far. Results for iTAML, BiC, and EEIL are produced with their original implementation while EWC and LwF are re-implemented by us. All results are averaged over 3 runs and mean and standard deviation values are given in the appendix. Best viewed in color.
|
| 98 |
+
|
| 99 |
+
Figure 2 (right) shows the effect of adding $\mathcal { L } _ { \mathrm { R R R } }$ on existing recent state-of-the-art methods such as TOPIC (Tao et al., 2020), EEIL (Castro et al., 2018), and iCaRL (Rebuffi et al., 2017). Tao et al. (2020) used a neural gas network (Martinetz et al., 1991; Fritzke et al., 1995) which can learn and preserve the topology of the feature manifold formed by different classes and we have followed their experimental protocol for our CUB200 experiment by using identical samples drawn in each task which are used across all the baselines for fair comparison. Adding $\mathcal { L } _ { \mathrm { R R R } }$ improves the performance of all the baselines; TOPIC becomes nearly on-par with joint training which serves as the upper bound and does not adhere to continual learning. The gap between ER and iCaRL is also reduced when ER uses $\mathcal { L } _ { \mathrm { R R R } }$ .
|
| 100 |
+
|
| 101 |
+
# 4.2 STANDARD CIL PERFORMANCE
|
| 102 |
+
|
| 103 |
+
In order to provide a direct comparison to the recent work of Rajasegaran et al. (2020) we perform our standard CIL experiment on CIFAR100 (Krizhevsky & Hinton, 2009) and ImageNet100 where we assume a memory budget of 2000 samples which are identical across all the baselines. Following Rajasegaran et al. (2020) we divide CIFAR100 to 10 and 20 disjoint tasks with 10 and 5 classes at a time. Figures 3a and 3b show the classification accuracy upon learning each task on all seen classes. We see a consistent average improvement of $2 - 4 \%$ when $\mathcal { L } _ { \mathrm { R R R } }$ is added as an additional constraint to preserve the model explanations across all methods, from the most naive memory-based method, experience replay (ER), to more sophisticated approaches which store a set of old class exemplars along with meta-learning (iTAML), correct bias for new classes (BiC), and fine tune on the exemplar set (EEIL). We also applied the RRR constraint on regularization-based methods such as EWC and LwF with no memory used as a replay buffer. The accuracy for both improves despite not benefiting from revisiting the raw data. However, they fall behind all memory-based methods with or without $\mathcal { L } _ { \mathrm { R R R } }$ . The final accuracy on the entire sequence for joint training (multi-task learning) with RAdam optimizer (Liu et al., 2019) is $8 0 . 0 3 \%$ which serves as an upper bound as it has access to data from all tasks at all time.
|
| 104 |
+
|
| 105 |
+
Figure 3c shows our results on learning ImageNet100 in 10 tasks. The effect of adding $\mathcal { L } _ { \mathrm { R R R } }$ to baselines on the ImageNet100 experiment is more significant $( 3 - 6 \% )$ compared to CIFAR100. This is mainly due to the larger size and better quality of images in ImageNet100, resulting in generating larger Grad-CAM saliency maps. These experiments clearly reveal the effectiveness of $\mathcal { L } _ { \mathrm { R R R } }$ on model explanations in a continual learning problem at nearly zero cost of memory overhead when a memory buffer is already created and applied as a catastrophic forgetting avoidance strategy. This makes Grad-CAM the ideal approach to generate saliency maps when applying the RRR training strategy, as it achieves the highest accuracy while utilizing the least storage space to store saliencies. Note that we adopt Grad-CAM to generate saliency maps in the remaining experiments in this paper. We also keep using only ResNet18 for a fair comparison with the literature.
|
| 106 |
+
|
| 107 |
+
(a) PG localization accuracy and backward transfer
|
| 108 |
+
|
| 109 |
+
<table><tr><td>Methods</td><td>PG-ACC (%)</td><td>PG-BWT (%)</td></tr><tr><td>ER</td><td>54.0</td><td>-17.4</td></tr><tr><td>ER+RRR</td><td>58.5</td><td>-15.6</td></tr><tr><td>TOPIC</td><td>72.7</td><td>-0.9</td></tr><tr><td>TOPIC+RRR</td><td>74.2</td><td>-2.1</td></tr></table>
|
| 110 |
+
|
| 111 |
+
Table 1: PG experiment results on few-shot CIL CUB200 measuring (a) PG-ACC $( \% )$ and PG-BWT $( \% )$ and (b) precision and recall averaged over all tasks. $P r _ { i , i }$ and $R e _ { i , i }$ evaluate the pointing game on each task $\mathbf { t } ^ { \mathrm { i } }$ directly after the model has been trained on $\mathbf { t } ^ { \mathbf { i } }$ . $P r _ { T , i }$ and $R e _ { T , i }$ are obtained by the evaluation for task $\mathbf { t ^ { i } }$ using the model trained for all $T$ tasks.
|
| 112 |
+
(b) Precision and recall using PG experiment
|
| 113 |
+
|
| 114 |
+
<table><tr><td></td><td colspan="2">Precision</td><td colspan="2">Recall</td></tr><tr><td>Methods</td><td>Pri,i</td><td>PrT,i</td><td>Rei,i</td><td>ReT,i</td></tr><tr><td>ER</td><td>80.0</td><td>68.9</td><td>64.1</td><td>65.1</td></tr><tr><td>ER+RRR</td><td>82.1</td><td>70.3</td><td>64.2</td><td>66.8</td></tr><tr><td>TOPIC</td><td>91.0</td><td>88.4</td><td>98.1</td><td>97.4</td></tr><tr><td>TOPIC+RRR</td><td>92.8</td><td>89.1</td><td>99.6</td><td>99.2</td></tr></table>
|
| 115 |
+
|
| 116 |
+
# 5 ANALYSIS OF MODEL EXPLANATIONS
|
| 117 |
+
|
| 118 |
+
In this section we want to answer the question “How often does the model remember its decision for the right reason upon learning a sequence of tasks?”. In particular, we want to evaluate how often the model is “pointing” at the right evidence for its predictions, instead of focusing its maximum attention on the background or other objects in the image. We use the Pointing Game experiment (PG) (Zhang et al., 2018) for this evaluation, which was introduced to measure the discriminativeness of a visualization method for target object localization. Here, we use ground truth segmentation annotation labels provided with the CUB-200 dataset to define the true object region.
|
| 119 |
+
|
| 120 |
+
First, we look into hits and misses defined by the PG experiment. When the location of the maximum in a predicted saliency map falls inside the object, it is considered as a hit and otherwise it is a miss. Figure 5 shows an example from CUB200 where the segmentation annotation is used to determine whether the peak of the predicted saliency map (marked with red cross) falls inside the object region. This example is regarded as hit as the red cross is inside the segmentation mask for the bird. PG localization accuracy is defined as the number of hits over the total number of predictions. We would like to measure both the overall PG performance of a continual learner as well as how much learning new tasks causes it to forget its ability to hit the target object. For these metrics, inspired by (Lopez-Paz et al., 2017), we define $\begin{array} { r } { \mathrm { P G } { \mathrm { - } } \mathrm { A C C } = \frac { 1 } { T } \sum _ { i = 1 } ^ { \bar { T } } \dot { R _ { T , i } } } \end{array}$ as the average PG localization accuracy computed over all prior tasks after training for each new task and $\begin{array} { r } { \mathrm { P G - B W T } = \frac { 1 } { T - 1 } \sum _ { i = 1 } ^ { T - 1 } R _ { T , i } - R _ { i , i } } \end{array}$ (backward transfer) which indicates how much learning new tasks has influenced the PG localization accuracy on previous tasks where $R _ { n , i }$ is the on task $i$ after learning the $n ^ { \mathrm { t h } }$ task. Results for ER and TOPIC with and without $\mathcal { L } _ { \mathrm { R R R } }$ on CUB200 are shown in Table 1a. It shows how constraining different models to remember their initial evidence can lead to better localization of the bird across learning new tasks.
|
| 121 |
+
|
| 122 |
+
However, PG performance does not capture all of our desired properties for a continual learner. Ideally, we not only want a model to predict the object correctly if it is looking at the right evidence, but also we want it to not predict an object if it is not able to find the right evidence for it. To measure how close our baselines can get to this ideal model when they are combined with $\mathcal { L } _ { \mathrm { R R R } }$ , we measure the precision as $\mathrm { t p / ( t p / \Delta \mathfrak { p } ) }$ , and recall as $\mathrm { t p / ( t p / \Delta \mathfrak { t } f n ) }$ . We evaluate these metrics once immediately after learning each task, denoted as $P r _ { i , i }$ and $R e _ { i , i }$ , respectively, and again at the end of the learning process of final task $T$ denoted as $P r _ { T , i }$ and $R e _ { T , i }$ , where the first subscript refers to the model ID and the second subscript is the test dataset ID on which the model is evaluated. The higher the precision for a model is, the less often it has made the right decision without looking at the right evidence. On the other hand, the higher the recall, the less often it makes a wrong decision despite looking at the correct evidence. We show our evaluation on these metrics in Table 1b for ER and TOPIC with and without $\mathcal { L } _ { \mathrm { R R R } }$ on CUB200 where $\mathcal { L } _ { \mathrm { R R R } }$ increases both precision and recall across all methods, demonstrating that our approach continually makes better predictions because it finds the right evidence for its decisions.
|
| 123 |
+
|
| 124 |
+
In our final analysis, we would like to visualize the evolution of saliency maps across learning a sequence of tasks. Figure 4 illustrates the evolution of saliency maps for an image from the test-set of the second task, which both ER without $\mathcal { L } _ { \mathrm { R R R } }$ (top row) and with $\mathcal { L } _ { \mathrm { R R R } }$ (bottom row) have seen during training for the second task. We only visualize the generated saliencies after finishing tasks #2, #5, #7, #9, and #11 for simplicity. We indicate the correctness of the prediction made by each model with ‘correct’ or ‘incorrect’ written on top of their corresponding saliency map. Our goal is to visualize if adding the loss term $\mathcal { L } _ { \mathrm { R R R } }$ prevents the drifting of explanations. Given the same input image, the ER without $\mathcal { L } _ { \mathrm { R R R } }$ model makes an incorrect prediction after being continually trained for 11 tasks while never recovering from its mistake. On the other hand, when it is combined with $\mathcal { L } _ { \mathrm { R R R } }$ . it is able to recover from an early mistake after task 5. Considering the saliency map obtained after finishing task one as a reference evidence, we can see that ER’s evidence drifts further from the reference. On the bottom row, the region of focus of ER+RRR remains nearly identical to its initial evidence, apart from one incorrect prediction. As applying $\mathcal { L } _ { \mathrm { R R R } }$ corrects its saliency back to the original, this prediction is corrected as well. This supports the conclusion that retaining the original saliency is important for retaining the original accuracy.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 4: An illustration of the progression of saliencies on an image from the test set of the second task, evaluated after the model is trained on tasks #2, #5, #7, #9, and #11 on CUB200. Failure case for ER w.o. $\mathcal { L } _ { \mathrm { R R R } }$ (top row), where saliency drifts from the original and the prediction becomes incorrect. $_ \mathrm { E R + R R R }$ (bottom row) retains close to the original saliency as the model trains on more tasks, with the exception of Task #5 which it is able to correct later on. Its performance is retained as well, for saliencies that are close to the original.
|
| 128 |
+
|
| 129 |
+
# 6 RELATED WORK
|
| 130 |
+
|
| 131 |
+
Continual learning: Past work in CL has generally made use of either memory, model structure, or regularization to prevent catastrophic forgetting. Memory-based methods store some form of past experience into a replay buffer. However, the definition of “experience” varies between methods. Rehearsal-based methods use episodic memories as raw samples (Robins, 1995; Rebuffi et al., 2017; Riemer et al., 2018) or their gradients (Lopez-Paz et al., 2017; Chaudhry et al., 2019) for the model to revisit. Incremental Classifier and Representation Learning (iCaRL) (Rebuffi et al., 2017), is a class-incremental learner that uses a nearest-exemplar algorithm for classification and prevents catastrophic forgetting by using an episodic memory. iTAML (Rajasegaran et al., 2020) is a task-agnostic meta-learning algorithm that uses a momentum based strategy for meta-update and in addition to the object classification task, it predicts task labels during inference. An end-to-end incremental learning framework (EEIL) (Castro et al., 2018) also uses an exemplar set along with data augmentation and balanced fine-tuning to alleviate the imbalance between the old and new classes. Bias Correction Method (BiC) (Wu et al., 2019) is another class-incremental learning algorithm for large datasets in which a linear model is used to correct bias towards new classes using a fully connected layer. In contrast, pseudo-rehearsal methods generate the replay samples using a generative model such as an autoencoder (Kemker & Kanan, 2017) or a GAN (Kamra et al., 2017; Shin et al., 2017). Regularization-based methods define different metrics to measure importance and limit the changes on parameters accordingly (Kirkpatrick et al., 2017; Zenke et al., 2017; Ebrahimi et al., 2020a; Serra et al., 2018; Li & Hoiem, 2016; Dhar et al., 2019) but in general these methods have limited capacity. Structure-based methods control which portions of a model are responsible for specific tasks such that the model increases its capacity in a controlled fashion as more tasks are added. Inference for different tasks can be restricted to various neurons (Fernando et al., 2017; Yoon et al., 2018), columns (Rusu et al., 2016), task-specific modules (Ebrahimi et al., 2020b), or parameters selected by a mask (Mallya & Lazebnik, 2018; Serra et al., 2018). In RRR we explored the addition of explanations to replay buffer and showed that saliency-based explanations offer performance upgrade as well as improvement in explanations across all memory-based and regularization-based baselines we tried.
|
| 132 |
+
|
| 133 |
+
Visual explanation approaches or saliency methods attempt to produce a posterior explanation or a pseudo-probability map for the detected signals from the target object in the input image. These approaches can be broadly divided into three categories including activation, gradient, and perturbation based methods. Activation-based methods (Zhou et al., 2016; Selvaraju et al., 2017; Chattopadhay et al., 2018) use a weighted linear combination of feature maps whereas gradient-based methods (Baehrens et al., 2010; Sundararajan et al., 2017a; Springenberg et al., 2014; Shrikumar et al., 2017; Zhang et al., 2018) use the derivative of outputs w.r.t the input image to compute pixel-wise importance scores to generate attention maps. Methods in these categories are only applicable to differentiable models, including convolutional neural networks (CNNs). In contrast, perturbation-based methods are model-agnostic and produce saliency maps by observing the change in prediction when the input is perturbed (Petsiuk et al., 2018; Ribeiro et al., 2016; Ross et al., 2017; Zhou et al., 2014; Seo et al., 2018). While these methods attempt to identify if models are right for the wrong reason, Ross et al. (2017) took a step further and applied penalties to correct the explanations provided in supervised/unsupervised fashion during training. Selvaraju et al. (2019) used human explanations in the form of question and answering to bring model explanations closer to human answers.
|
| 134 |
+
|
| 135 |
+
# 7 CONCLUSION
|
| 136 |
+
|
| 137 |
+
In this paper, we proposed the use of model explanations with continual learning algorithms to enhance better knowledge transfer as well as better recall of the previous tasks. The intuition behind our method is that encouraging a model to remember its evidence will increase the generalisability and rationality of recalled predictions and help retrieving the relevant aspects of each task. We advocate for the use of explainable AI as a tool to improve model performance, rather than as an artifact or interpretation of the model itself. We demonstrate that models which incorporate a “remember for the right reasons” constraint as part of a continual learning process can both be interpretable and more accurate. We empirically demonstrated the effectiveness of our approach in a variety of settings and provided an analysis of improved performance and explainability.
|
| 138 |
+
|
| 139 |
+
# REFERENCES
|
| 140 |
+
|
| 141 |
+
Julius Adebayo, Justin Gilmer, Michael Muelly, Ian Goodfellow, Moritz Hardt, and Been Kim. Sanity checks for saliency maps. In Advances in Neural Information Processing Systems, pp. 9505–9515, 2018.
|
| 142 |
+
David Baehrens, Timon Schroeter, Stefan Harmeling, Motoaki Kawanabe, Katja Hansen, and KlausRobert MA˜ zller. How to explain individual classification decisions. ˇ Journal of Machine Learning Research, 11(Jun):1803–1831, 2010.
|
| 143 |
+
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.
|
| 144 |
+
Aditya Chattopadhay, Anirban Sarkar, Prantik Howlader, and Vineeth N Balasubramanian. Gradcam $^ { + + }$ : Generalized gradient-based visual explanations for deep convolutional networks. In 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 839–847. IEEE, 2018.
|
| 145 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with A-GEM. In International Conference on Learning Representations, 2019.
|
| 146 |
+
Prithviraj Dhar, Rajat Vikram Singh, Kuan-Chuan Peng, Ziyan Wu, and Rama Chellappa. Learning without memorizing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5138–5146, 2019.
|
| 147 |
+
Sayna Ebrahimi, Mohamed Elhoseiny, Trevor Darrell, and Marcus Rohrbach. Uncertainty-guided continual learning with bayesian neural networks. In International Conference on Learning Representations, 2020a.
|
| 148 |
+
Sayna Ebrahimi, Franziska Meier, Roberto Calandra, Trevor Darrell, and Marcus Rohrbach. Adversarial continual learning. In European Conference on Computer Vision (ECCV), 2020b.
|
| 149 |
+
|
| 150 |
+
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.
|
| 151 |
+
|
| 152 |
+
Bernd Fritzke et al. A growing neural gas network learns topologies. Advances in neural information processing systems, 7:625–632, 1995.
|
| 153 |
+
|
| 154 |
+
Tyler L Hayes, Nathan D Cahill, and Christopher Kanan. Memory efficient experience replay for streaming learning. In 2019 International Conference on Robotics and Automation (ICRA), pp. 9769–9776. IEEE, 2019.
|
| 155 |
+
|
| 156 |
+
Kevin Jarrett, Koray Kavukcuoglu, Marc’Aurelio Ranzato, and Yann LeCun. What is the best multi-stage architecture for object recognition? In 2009 IEEE 12th international conference on computer vision, pp. 2146–2153. IEEE, 2009.
|
| 157 |
+
|
| 158 |
+
Nitin Kamra, Umang Gupta, and Yan Liu. Deep generative dual memory network for continual learning. arXiv preprint arXiv:1710.10368, 2017.
|
| 159 |
+
|
| 160 |
+
Ronald Kemker and Christopher Kanan. Fearnet: Brain-inspired model for incremental learning. arXiv preprint arXiv:1711.10563, 2017.
|
| 161 |
+
|
| 162 |
+
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.
|
| 163 |
+
|
| 164 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 165 |
+
|
| 166 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. In European Conference on Computer Vision, pp. 614–629. Springer, 2016.
|
| 167 |
+
|
| 168 |
+
Liyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Jiawei Han. On the variance of the adaptive learning rate and beyond. arXiv preprint arXiv:1908.03265, 2019.
|
| 169 |
+
|
| 170 |
+
David Lopez-Paz et al. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, pp. 6467–6476, 2017.
|
| 171 |
+
|
| 172 |
+
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.
|
| 173 |
+
|
| 174 |
+
Thomas Martinetz, Klaus Schulten, et al. A” neural-gas” network learns topologies. 1991.
|
| 175 |
+
|
| 176 |
+
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.
|
| 177 |
+
|
| 178 |
+
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.
|
| 179 |
+
|
| 180 |
+
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. In NIPS-W, 2017.
|
| 181 |
+
|
| 182 |
+
Vitali Petsiuk, Abir Das, and Kate Saenko. Rise: Randomized input sampling for explanation of black-box models. In Proceedings of the British Machine Vision Conference (BMVC), 2018.
|
| 183 |
+
|
| 184 |
+
Jathushan Rajasegaran, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Mubarak Shah. itaml $:$ An incremental task-agnostic meta-learning approach. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 185 |
+
|
| 186 |
+
Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In CVPR, 2017.
|
| 187 |
+
|
| 188 |
+
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, pp. 1135–1144, 2016.
|
| 189 |
+
|
| 190 |
+
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. arXiv preprint arXiv:1810.11910, 2018.
|
| 191 |
+
|
| 192 |
+
Anthony Robins. Catastrophic forgetting, rehearsal and pseudorehearsal. Connection Science, 7(2): 123–146, 1995.
|
| 193 |
+
|
| 194 |
+
Andrew Slavin Ross, Michael C Hughes, and Finale Doshi-Velez. Right for the right reasons: Training differentiable models by constraining their explanations. arXiv preprint arXiv:1703.03717, 2017.
|
| 195 |
+
|
| 196 |
+
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.
|
| 197 |
+
|
| 198 |
+
Ramprasaath R Selvaraju, Abhishek Das, Ramakrishna Vedantam, Michael Cogswell, Devi Parikh, and Dhruv Batra. Grad-cam: Why did you say that? arXiv preprint arXiv:1611.07450, 2016.
|
| 199 |
+
|
| 200 |
+
Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision, pp. 618–626, 2017.
|
| 201 |
+
|
| 202 |
+
Ramprasaath R Selvaraju, Stefan Lee, Yilin Shen, Hongxia Jin, Shalini Ghosh, Larry Heck, Dhruv Batra, and Devi Parikh. Taking a hint: Leveraging explanations to make vision and language models more grounded. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2591–2600, 2019.
|
| 203 |
+
|
| 204 |
+
Dasom Seo, Kanghan Oh, and Il-Seok Oh. Regional multi-scale approach for visually pleasing explanations of deep neural networks. arXiv preprint arXiv:1807.11720, 2018.
|
| 205 |
+
|
| 206 |
+
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.
|
| 207 |
+
|
| 208 |
+
Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In Advances in Neural Information Processing Systems, pp. 2990–2999, 2017.
|
| 209 |
+
|
| 210 |
+
Avanti Shrikumar, Peyton Greenside, Anna Shcherbina, and Anshul Kundaje. Not just a black box: Learning important features through propagating activation differences. arXiv preprint arXiv:1605.01713, 2016.
|
| 211 |
+
|
| 212 |
+
Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3145–3153. JMLR. org, 2017.
|
| 213 |
+
|
| 214 |
+
Daniel L Silver, Qiang Yang, and Lianghao Li. Lifelong machine learning systems: Beyond learning algorithms. In 2013 AAAI spring symposium series, 2013.
|
| 215 |
+
|
| 216 |
+
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013.
|
| 217 |
+
|
| 218 |
+
Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viegas, and Martin Wattenberg. Smoothgrad: ´ removing noise by adding noise. arXiv preprint arXiv:1706.03825, 2017.
|
| 219 |
+
|
| 220 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014.
|
| 221 |
+
|
| 222 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3319– 3328. JMLR. org, 2017a.
|
| 223 |
+
|
| 224 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. arXiv preprint arXiv:1703.01365, 2017b.
|
| 225 |
+
|
| 226 |
+
Xiaoyu Tao, Xiaopeng Hong, Xinyuan Chang, Songlin Dong, Xing Wei, and Yihong Gong. Fewshot class-incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12183–12192, 2020.
|
| 227 |
+
|
| 228 |
+
Sebastian Thrun and Tom M Mitchell. Lifelong robot learning. Robotics and autonomous systems, 15(1-2):25–46, 1995.
|
| 229 |
+
|
| 230 |
+
C. Wah, S. Branson, P. Welinder, P. Perona, and S. Belongie. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011.
|
| 231 |
+
|
| 232 |
+
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.
|
| 233 |
+
|
| 234 |
+
Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. In International Conference on Learning Representations, 2018.
|
| 235 |
+
|
| 236 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pp. 818–833. Springer, 2014.
|
| 237 |
+
|
| 238 |
+
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.
|
| 239 |
+
|
| 240 |
+
Jianming Zhang, Sarah Adel Bargal, Zhe Lin, Jonathan Brandt, Xiaohui Shen, and Stan Sclaroff. Top-down neural attention by excitation backprop. International Journal of Computer Vision, 126 (10):1084–1102, 2018.
|
| 241 |
+
|
| 242 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Object detectors emerge in deep scene cnns. arXiv preprint arXiv:1412.6856, 2014.
|
| 243 |
+
|
| 244 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2921–2929, 2016.
|
| 245 |
+
|
| 246 |
+
# A APPENDIX
|
| 247 |
+
|
| 248 |
+
# A.1 GRAD-CAM TARGET LAYERS
|
| 249 |
+
|
| 250 |
+
Table 2 shows the target layer names used in Grad-CAM for different network architectures according to their standard PyTorch (Paszke et al., 2017) implementations. Saliency map size is equal to the activation map of the target layers.
|
| 251 |
+
|
| 252 |
+
Table 2: Target layer names and activation maps size for saliencies generated by different network architectures in Grad-CAM.
|
| 253 |
+
|
| 254 |
+
<table><tr><td></td><td>Target layer name in PyTorch torchvision package</td><td>Saliency map size</td></tr><tr><td>SqueezeNet1_1</td><td>features.0.12.expand3x3</td><td>13 ×13</td></tr><tr><td>AlexNet</td><td>features.0.10</td><td>13 ×13</td></tr><tr><td>ResNet18</td><td>features.7.1.conv2</td><td>7×7</td></tr></table>
|
| 255 |
+
|
| 256 |
+
# B POINTING GAME VISUALIZATION
|
| 257 |
+
|
| 258 |
+
Figure 5 shows an example from CUB200 in the Pointing Game. We used the segmentation annotation to verify whether the peak of the predicted saliency map (marked with red cross) falls inside the object region. It is regarded as hit as the red cross is inside the segmentation mask for the bird.
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 5: An example of PG evaluation as hit for an image in CUB200. Left: image saliency map overlaid on the image. Right: the segmentation label where the red cross marks the peak saliency.
|
| 262 |
+
|
| 263 |
+
# C TABULAR RESULTS
|
| 264 |
+
|
| 265 |
+
In this section, we have tabulated results shown in Figure 2 and Figure 3 with means and standard deviations averaged over 3 runs.
|
| 266 |
+
|
| 267 |
+
Table 3: Classification accuracy of few-shot CIL learning of CUB200 at the end of 11 tasks for ER with and without $\mathcal { L } _ { \mathrm { R R R } }$ using different backbone architectures and saliency map techniques. Results are averaged over 3 runs. Figure 2 (left) in the main paper is generated using numbers in this Table.
|
| 268 |
+
|
| 269 |
+
<table><tr><td></td><td>2</td><td></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>RN18-RRR-GCam</td><td>67.8±0.8</td><td>53.5±0.7</td><td>45.6±0.6 39.6±0.7</td><td></td><td>35.3±0.9</td><td>32.3± 1.1</td><td>29.4±0.9</td><td>25.9±0.8</td><td>25.7±0.6</td><td>26.3±0.7</td><td>23.6±0.7</td></tr><tr><td>RN18-ER</td><td>67.8±0.8</td><td>49.7 ±0.9</td><td>41.7 ±0.8</td><td>35.8 ±0.7</td><td>31.4 ± 0.9</td><td>28.5±0.8</td><td>25.5±0.8</td><td>22.1±0.8</td><td>21.8±0.8</td><td>22.5 ± 1.1</td><td>19.8± 0.9</td></tr><tr><td>RN18-RRR-Smooth</td><td>67.8± 0.8</td><td>50.9±0.6</td><td>43.5 ± 0.9</td><td>37.0±0.8</td><td>33.0±0.7</td><td>29.5± 0.6</td><td>26.8±0.8</td><td>23.9 ±0.8</td><td>23.9±0.8</td><td>23.4± 0.8</td><td>21.5± 0.5</td></tr><tr><td>RN18-RRR-BP</td><td>67.8±0.8</td><td>50.8±0.8</td><td>43.9 ±0.6</td><td>36.6 ±0.4</td><td>32.7±0.6</td><td>28.9±0.6</td><td>27.2± 0.5</td><td>23.8 ±0.6</td><td>23.8±0.6</td><td>24.0± 0.4</td><td>21.5± 0.6</td></tr><tr><td>RN18-Finetune</td><td>67.8± 0.8</td><td>44.8 ± 0.6</td><td>32.2± 0.5</td><td>25.8±0.7</td><td>25.6 ± 0.7</td><td>25.2± 0.7</td><td>20.8±0.6</td><td>16.8 ± 0.7</td><td>18.8± 0.5</td><td>18.3 ± 0.4</td><td>17.1 ± 0.6</td></tr><tr><td>Alex-RRR-GCam</td><td>56.7±0.7</td><td>46.6±0.5</td><td>43.9±0.7</td><td>41.3± 0.7</td><td>33.7 ± 0.5</td><td>27.4± 0.7</td><td>25.3±0.7</td><td>22.0±0.5</td><td>21.5±0.6</td><td>21.4± 0.6</td><td>21.2± 0.6</td></tr><tr><td>Alex-ER</td><td>56.7± 0.7</td><td>44.6 ± 0.7</td><td>41.3 ± 0.7</td><td>38.7±0.7</td><td>31.1 ± 0.7</td><td>24.5± 0.7</td><td>22.6± 0.7</td><td>19.6 ± 0.6</td><td>19.1± 0.8</td><td>18.7 ± 0.8</td><td>19.1± 0.8</td></tr><tr><td>Alex-Finetune</td><td>56.7±0.7</td><td>42.8 ± 0.8</td><td>39.6±0.8</td><td>36.9±0.8</td><td>29.5 ± 0.7</td><td>23.3±0.6</td><td>21.4± 0.8</td><td>17.9 ± 0.7</td><td>18.0 ±0.7</td><td>17.0 ± 0.5</td><td>16.9 ± 0.4</td></tr><tr><td>SQ-RRR-GCam</td><td>46.8± 0.5</td><td>36.2 ±0.4</td><td>30.1±0.6</td><td>28.3±0.4</td><td>25.1 ± 0.5</td><td>23.4± 0.5</td><td>19.3± 0.6</td><td>19.0± 0.6</td><td>18.5± 0.5</td><td>18.4± 0.5</td><td>18.2 ±0.6</td></tr><tr><td>SQ-ER</td><td>46.8 ± 0.5</td><td>33.2±0.5 27.1±0.6</td><td></td><td>25.3±0.6</td><td>22.1±0.52</td><td>20.5±0.5</td><td>16.3± 0.4</td><td>16.0±0.6</td><td>15.5± 0.6</td><td>15.4 ± 0.6</td><td>15.2 ± 0.7</td></tr><tr><td>SQ-Finetune</td><td>46.8 ± 0.5</td><td>32.0±0.7 25.2±0.7</td><td></td><td>23.9±0.7</td><td>20.2±0.81</td><td>19.4 ± 0.4</td><td>14.9 ± 0.4</td><td>14.4 ± 0.5</td><td>13.8± 0.4</td><td>14.2 ± 0.5</td><td>13.7±0.6</td></tr></table>
|
| 270 |
+
|
| 271 |
+
Table 4: Performance of the state-of-the-art existing approaches with and without $\mathcal { L } _ { \mathrm { R R R } }$ on CUB200 including TOPIC (Tao et al., 2020), EEIL (Castro et al., 2018), iCaRL (Rebuffi et al., 2017). Results for baselines are obtained using their original implementation. Results are averaged over 3 runs. Figure 2 (right) in the main paper is generated using numbers in this Table.
|
| 272 |
+
|
| 273 |
+
<table><tr><td></td><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>EEIL</td><td>68.6±0.4</td><td>53.6± 0.4</td><td>47.9 ± 0.3</td><td>44.2±0.8</td><td>36.3±0.9</td><td>27.4 ± 1.2</td><td>25.9±0.7</td><td>24.7±0.5</td><td>23.9±0.7</td><td>24.1± 0.7</td><td>22.1 ± 0.5</td></tr><tr><td>EEIL+RRR</td><td>68.6±0.4</td><td>56.6±0.5</td><td>50.9±0.6</td><td>48.3± 0.5</td><td>39.7 ± 1.2</td><td>31.4± 0.7</td><td>28.3± 1.2</td><td>28.0±0.6</td><td>26.5±0.6</td><td>27.4± 0.6</td><td>25.2±0.9</td></tr><tr><td>iCaRL</td><td>68.6±0.4</td><td>52.6±0.7</td><td>48.6± 1.2</td><td>44.1 ± 0.5</td><td>36.6±0.3</td><td>29.5±0.9</td><td>27.8± 0.4</td><td>26.2±0.5</td><td>24.0±0.6</td><td>23.8±0.6</td><td>21.1± 0.7</td></tr><tr><td>iCaRL+RRR</td><td>68.6±0.4</td><td>55.6± 1.2</td><td>53.6±0.7</td><td>47.1 ± 0.8</td><td>39.6±0.5</td><td>32.5±0.8</td><td>31.8 ± 0.4</td><td>29.2±0.6</td><td>27.0±0.8</td><td>27.8±0.6</td><td>24.1 ± 0.3</td></tr><tr><td>TOPIC</td><td>68.6 ± 0.4</td><td>62.4 ± 0.8</td><td>54.8 ± 0.4</td><td>49.9 ± 1.2</td><td>45.2 ±0.6</td><td>41.4± 0.3</td><td>38.3±0.8</td><td>35.3±0.6</td><td>32.2± 0.3</td><td>28.3±0.6</td><td>26.2 ± 1.2</td></tr><tr><td>TOPIC+RRR</td><td>68.6±0.4</td><td>62.5 ± 0.9</td><td>56.8 ± 0.4</td><td>51.5 ± 0.5</td><td>48.2 ± 0.4</td><td>44.4 ± 0.4</td><td>42.3±0.7</td><td>38.3±0.6</td><td>35.2±0.9</td><td>32.3±0.9</td><td>29.2 ± 0.5</td></tr><tr><td>FT</td><td>68.6±0.4</td><td>44.8 ± 0.5</td><td>32.2±0.8</td><td>25.8± 0.4</td><td>25.6 ± 1.1</td><td>25.2± 0.7</td><td>20.8± 1.1</td><td>16.7± 0.4</td><td>18.8 ± 1.1</td><td>18.2± 0.3</td><td>17.1 ± 0.8</td></tr><tr><td>ER</td><td>67.8±0.8</td><td>49.7± 0.9</td><td>41.7 ± 0.8</td><td>35.8 ±0.7</td><td>31.4± 0.9</td><td>28.5±0.8</td><td>25.5±0.8</td><td>22.1± 0.8</td><td>21.8± 0.6</td><td>22.5 ± 1.1</td><td>19.8±0.9</td></tr><tr><td>RRR</td><td>67.8±0.8</td><td>53.5± 0.7</td><td>45.6± 0.6</td><td>39.6± 0.7</td><td>35.3±0.9</td><td>32.3 ± 1.1</td><td>29.4± 0.9</td><td>25.9± 0.8</td><td>25.7±0.6</td><td>26.3±0.7</td><td>23.6±0.7</td></tr><tr><td>JT</td><td>68.6±0.4</td><td>62.4± 0.4</td><td>57.2 ± 0.4</td><td>52.8±0.5</td><td>49.5 ± 0.9</td><td>46.1 ± 0.5</td><td>42.8 ± 1.1</td><td>40.1±0.8</td><td>38.7±0.7</td><td>37.1± 0.5</td><td>35.6±0.9</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 5: Performance of the state-of-the-art existing approaches with and without $\mathcal { L } _ { \mathrm { R R R } }$ on CIFAR100 in 10 tasks. Results for iTAML (Rajasegaran et al., 2020), BiC (Wu et al., 2019), and EEIL (Castro et al., 2018) are produced with their original implementation while EWC (Kirkpatrick et al., 2017) and LwF (Li & Hoiem, 2016) are re-implemented by us. Results are averaged over 3 runs. Figure 3a in the main paper is generated using numbers in this Table.
|
| 276 |
+
|
| 277 |
+
<table><tr><td></td><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></tr><tr><td>iTAML+RRR</td><td>89.2± 0.5</td><td>92.3±0.7</td><td>89.5 ± 1.2</td><td>87.5 ± 1.2</td><td>84.1±0.8</td><td>83.5±0.9</td><td>83.9±0.7</td><td>81.2± 0.3</td><td>79.6 ± 0.9</td><td>79.7±0.5</td></tr><tr><td>iTAML</td><td>89.2± 0.5</td><td>88.9±0.5</td><td>87.0 ± 1.1</td><td>85.7 ± 1.1</td><td>84.1 ± 1.1</td><td>81.8 ± 0.3</td><td>80.0±0.6</td><td>79.0± 0.3</td><td>78.6 ±0.8</td><td>77.8 ±0.6</td></tr><tr><td>BiC</td><td>90.3±0.7</td><td>82.1 ± 0.7</td><td>75.1± 0.4</td><td>69.8 ± 1.2</td><td>65.3±0.8</td><td>61.3± 0.9</td><td>57.4± 0.7</td><td>54.9± 0.5</td><td>53.2 ±0.9</td><td>50.3±0.7</td></tr><tr><td>BiC+RRR</td><td>90.3±0.7</td><td>84.9 ± 1.1</td><td>76.4± 0.6</td><td>69.3±0.3</td><td>65.1±0.9</td><td>63.3± 0.4</td><td>59.7 ± 1.1</td><td>55.4± 0.8</td><td>55.8 ± 0.7</td><td>52.1 ± 0.5</td></tr><tr><td>EEIL</td><td>80.0±0.7</td><td>80.5± 1.2</td><td>75.5± 0.9</td><td>71.5± 0.4</td><td>68.0± 1.2</td><td>62.0±0.9</td><td>59.0± 0.7</td><td>55.1 ± 1.2</td><td>51.4 ± 0.8</td><td>48.7 ± 0.4</td></tr><tr><td>EEIL+RRR</td><td>80.0±0.7</td><td>83.5± 0.3</td><td>78.7 ± 1.2</td><td>74.0 ± 1.2</td><td>71.7± 0.3</td><td>65.1 ± 0.4</td><td>61.2± 0.5</td><td>57.6± 0.5</td><td>54.1 ± 0.4</td><td>51.7± 0.3</td></tr><tr><td>LwF</td><td>86.1 ± 1.2</td><td>69.0±0.7</td><td>55.0±0.3</td><td>45.8± 0.3</td><td>40.4± 0.5</td><td>36.7±0.9</td><td>30.8 ±0.7</td><td>28.6±0.5</td><td>26.1 ± 0.7</td><td>24.2 ±0.7</td></tr><tr><td>LwF+RRR</td><td>86.1 ± 1.2</td><td>72.4± 0.8</td><td>57.0 ± 1.1</td><td>48.3 ± 0.3</td><td>43.2 ±0.8</td><td>39.3 ±0.5</td><td>34.1 ± 0.6</td><td>32.1 ± 1.1</td><td>29.8 ±0.7</td><td>27.1± 0.6</td></tr><tr><td>EWC</td><td>86.1 ± 1.2</td><td>52.6 ± 0.4</td><td>48.6± 0.4</td><td>38.5±0.5</td><td>31.1 ± 0.9</td><td>26.5±0.3</td><td>21.7±0.6</td><td>20.0±0.7</td><td>18.9 ± 0.5</td><td>16.6 ±0.9</td></tr><tr><td>EWC+RRR</td><td>86.1 ± 1.2</td><td>56.0± 0.4</td><td>53.9 ± 1.2</td><td>44.4 ± 0.9</td><td>35.1±0.5</td><td>28.6±0.6</td><td>25.1 ± 1.1</td><td>23.1± 0.5</td><td>18.8 ±0.9</td><td>19.0 ± 1.2</td></tr><tr><td>ER</td><td>86.1 ± 1.2</td><td>74.5 ± 0.9</td><td>65.2±0.8</td><td>62.5± 0.8</td><td>56.7±0.7</td><td>50.5± 0.3</td><td>47.6 ± 0.4</td><td>43.4± 0.3</td><td>41.6 ± 0.9</td><td>38.1 ± 1.1</td></tr><tr><td>RRR</td><td>86.1 ± 1.2</td><td>78.5± 0.9</td><td>69.2 ± 1.1</td><td>63.5 ± 1.2</td><td>58.7±0.8</td><td>53.5 ± 1.1</td><td>49.6± 0.7</td><td>44.4± 0.3</td><td>42.6 ± 1.2</td><td>39.1 ± 1.1</td></tr></table>
|
| 278 |
+
|
| 279 |
+
Table 7: Performance of the state-of-the-art existing approaches with and without $\mathcal { L } _ { \mathrm { R R R } }$ on ImageNet100 in 10 tasks. Results for iTAML (Rajasegaran et al., 2020), BiC (Wu et al., 2019), and EEIL (Castro et al., 2018) are produced with their original implementation while EWC (Kirkpatrick et al., 2017) and LwF (Li & Hoiem, 2016) are re-implemented by us. Results are averaged over 3 runs. Figure 3c in the main paper is generated using numbers in this Table.
|
| 280 |
+
|
| 281 |
+
<table><tr><td></td><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></tr><tr><td>iTAML</td><td>99.4± 0.8</td><td>96.4±0.9</td><td>94.4 ± 0.9</td><td>93.0±0.3</td><td>92.4± 1.2</td><td>90.6±0.3</td><td>89.9 ±0.4</td><td>90.3±0.8</td><td>90.3 ±1.1</td><td>89.8±0.4</td></tr><tr><td>iTAML+RRR</td><td>99.4± 0.8</td><td>97.3± 0.5</td><td>96.6±0.7</td><td>96.3 ± 1.1</td><td>95.3 ± 0.5</td><td>93.1 ± 0.5</td><td>92.1 ± 0.6</td><td>92.1±0.6</td><td>92.9±0.9</td><td>91.9 ± 0.4</td></tr><tr><td>EEIL</td><td>99.5 ± 0.4</td><td>98.8 ± 1.1</td><td>95.9±0.9</td><td>93.0 ±0.4</td><td>88.3 ±1.1</td><td>86.7 ± 1.2</td><td>83.0 ±1.2</td><td>81.1± 0.5</td><td>78.2 ±0.7</td><td>75.4± 0.4</td></tr><tr><td>EEIL+RRR</td><td>99.5± 0.4</td><td>98.1 ± 0.7</td><td>97.4 ± 1.1</td><td>96.7 ± 0.4</td><td>93.3 ± 0.5</td><td>89.4 ± 1.1</td><td>86.5±0.3</td><td>86.1 ± 1.1</td><td>81.8 ± 0.4</td><td>77.0± 0.3</td></tr><tr><td>BiC</td><td>98.3±0.7</td><td>94.9 ±0.8</td><td>93.5±0.7</td><td>90.9 ± 1.2</td><td>89.0 ± 1.2</td><td>87.3± 0.6</td><td>85.2±0.7</td><td>83.2 ± 0.4</td><td>82.5±0.9</td><td>81.1 ± 1.1</td></tr><tr><td>BiC+RRR</td><td>98.3±0.7</td><td>98.9 ±0.3</td><td>96.5±0.6</td><td>93.9 ± 0.4</td><td>92.0±0.7</td><td>89.3 ± 1.1</td><td>87.2 ±0.8</td><td>87.2 ± 1.1</td><td>85.5±0.9</td><td>84.1± 0.6</td></tr><tr><td>iCaRL</td><td>99.3±0.4</td><td>97.2 ± 0.9</td><td>93.5±0.9</td><td>91.0 ± 0.3</td><td>87.5 ± 1.2</td><td>82.1 ± 1.2</td><td>77.1 ± 0.4</td><td>72.8± 0.6</td><td>67.1 ±0.8</td><td>63.5 ± 1.1</td></tr><tr><td>iCaRL+RRR</td><td>99.3± 0.4</td><td>97.9 ± 1.2</td><td>94.1 ± 0.7</td><td>92.8 ±0.7</td><td>91.7 ± 0.9</td><td>85.7 ± 1.1</td><td>82.1 ± 0.6</td><td>74.4 ± 0.9</td><td>72.2 ± 0.8</td><td>68.1±0.9</td></tr><tr><td>LwF</td><td>99.3±0.5</td><td>95.2 ± 0.9</td><td>85.9± 0.9</td><td>73.9 ± 1.1</td><td>63.7±0.8</td><td>54.8 ± 0.8</td><td>50.1 ± 0.6</td><td>44.5 ± 0.9</td><td>40.7 ± 0.5</td><td>36.7±0.3</td></tr><tr><td>LwF+RRR</td><td>99.3±0.5</td><td>97.1 ± 1.2</td><td>89.3 ±0.6</td><td>79.1 ± 0.5</td><td>69.1 ± 1.1</td><td>59.4 ± 1.1</td><td>57.2 ± 0.7</td><td>48.2 ± 1.1</td><td>45.1 ± 0.6</td><td>41.5 ± 0.5</td></tr><tr><td>FT</td><td>99.3± 0.5</td><td>49.4 ± 0.3</td><td>32.6±0.3</td><td>24.7 ± 0.6</td><td>20.0 ± 1.2</td><td>16.7 ± 0.3</td><td>13.9 ± 0.3</td><td>12.3 ± 0.7</td><td>11.1 ± 0.6</td><td>9.9 ±0.7</td></tr><tr><td>ER</td><td>99.3± 0.5</td><td>95.2 ± 0.8</td><td>88.1±0.8</td><td>78.1± 0.9</td><td>72.5 ± 0.6</td><td>69.1± 0.8</td><td>67.1 ± 0.6</td><td>61.8 ±0.6</td><td>55.1± 0.3</td><td>50.1 ± 1.1</td></tr><tr><td>RRR</td><td>99.3± 0.5</td><td>96.5 ± 0.3</td><td>93.4±0.8</td><td>84.8±0.7</td><td>78.7 ± 0.4</td><td>74.7 ± 0.4</td><td>73.1 ± 0.5</td><td>68.4±0.8</td><td>60.2±0.3</td><td>55.1 ±0.7</td></tr></table>
|
| 282 |
+
|
| 283 |
+
Table 6: Performance of the state-of-the-art existing approaches with and without $\mathcal { L } _ { \mathrm { R R R } }$ on CIFAR100 in 20 tasks. Results for iTAML (Rajasegaran et al., 2020), BiC (Wu et al., 2019), and EEIL (Castro et al., 2018) are produced with their original implementation while EWC (Kirkpatrick et al., 2017) and LwF (Li & Hoiem, 2016) are re-implemented by us. Results are averaged over 3 runs. Figure 3b in the main paper is generated using numbers in this Table.
|
| 284 |
+
(a) Tasks 1-10
|
| 285 |
+
|
| 286 |
+
<table><tr><td></td><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></tr><tr><td>iTAML</td><td>84.7±0.6</td><td>85.7 ±0.4</td><td>86.5±0.3</td><td>86.5±0.8</td><td>86.3±1.2</td><td>85.7±0.8</td><td>84.9 ± 1.1</td><td>82.6±0.3</td><td>80.8±0.7</td><td>82.4± 0.3</td></tr><tr><td>iTAML+RRR</td><td>84.7±0.6</td><td>89.9± 0.5</td><td>89.2±0.9</td><td>89.2±0.6</td><td>89.0 ± 1.1</td><td>87.2 ±0.6</td><td>88.0±0.4</td><td>85.6 ± 1.1</td><td>86.6±0.3</td><td>85.4±0.3</td></tr><tr><td>BiC</td><td>95.7±0.6</td><td>90.3±0.9</td><td>80.9±0.8</td><td>75.8 ± 0.8</td><td>73.5±0.6</td><td>71.5 ± 1.2</td><td>67.8±0.4</td><td>65.4±0.8</td><td>62.7 ± 1.2</td><td>61.9 ± 1.2</td></tr><tr><td>BiC+RRR</td><td>95.7± 0.6</td><td>93.3±0.6</td><td>84.7 ± 1.1</td><td>77.5 ± 0.9</td><td>73.4±0.6</td><td>74.8 ± 0.6</td><td>69.6± 0.7</td><td>67.4± 0.3</td><td>65.7± 0.5</td><td>64.9±0.6</td></tr><tr><td>EEIL</td><td>81.9 ± 0.5</td><td>86.3±0.3</td><td>84.9 ± 0.4</td><td>80.7±0.3</td><td>77.7 ±0.6</td><td>74.9± 0.3</td><td>70.9±0.7</td><td>67.4± 0.7</td><td>64.9 ± 0.5</td><td>62.4±0.3</td></tr><tr><td>EEIL+RRR</td><td>81.9±0.5</td><td>88.4±0.8</td><td>87.6±0.7</td><td>82.6 ± 1.2</td><td>78.5 ± 0.6</td><td>76.9 ± 0.4</td><td>71.2 ±0.7</td><td>67.3± 0.4</td><td>67.0 ± 1.2</td><td>64.5±0.3</td></tr><tr><td>LwF</td><td>85.1 ± 0.7</td><td>68.8 ±0.9</td><td>58.6 ±1.1</td><td>50.5 ± 1.2</td><td>43.5±0.9</td><td>37.5 ± 0.6</td><td>33.7±0.9</td><td>30.4±0.9</td><td>26.8 ± 1.1</td><td>24.9 ± 0.7</td></tr><tr><td>LwF+RRR</td><td>85.1±0.7</td><td>71.6 ± 0.6</td><td>61.8±0.7</td><td>54.2 ± 0.5</td><td>46.2±0.9</td><td>40.7 ±0.7</td><td>36.7 ± 1.2</td><td>34.4± 0.4</td><td>29.8±0.7</td><td>27.2 ± 1.2</td></tr><tr><td>EWC</td><td>85.1± 0.7</td><td>61.3± 0.5</td><td>47.4± 0.8</td><td>36.2±0.3</td><td>31.3±0.6</td><td>27.9± 0.5</td><td>23.7 ± 1.1</td><td>22.5± 0.4</td><td>20.8±0.8</td><td>18.9±0.7</td></tr><tr><td>EWC+RRR</td><td>85.1±0.7</td><td>68.9 ±0.5</td><td>52.2 ±0.9</td><td>39.9 ±0.9</td><td>35.2±0.3</td><td>30.0±0.3</td><td>24.3 ± 0.8</td><td>24.0±0.6</td><td>23.7 ± 0.4</td><td>21.0 ± 1.1</td></tr><tr><td>ER</td><td>85.1± 0.7</td><td>83.1± 0.9</td><td>81.8±0.7</td><td>74.9 ± 0.3</td><td>70.4± 0.3</td><td>61.5 ± 1.2</td><td>60.8 ± 1.1</td><td>57.0±0.7</td><td>54.3 ± 0.4</td><td>48.2±0.6</td></tr><tr><td>RRR</td><td>85.1± 0.7</td><td>85.1 ± 0.9</td><td>83.8±0.4</td><td>77.9 ± 0.4</td><td>72.4 ± 1.2</td><td>64.5 ± 0.7</td><td>62.8±0.7</td><td>59.0±0.3</td><td>57.3±0.8</td><td>51.2 ± 1.1</td></tr></table>
|
| 287 |
+
|
| 288 |
+
(b) Tasks 11-20
|
| 289 |
+
|
| 290 |
+
<table><tr><td></td><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td><td>20</td></tr><tr><td>iTAML</td><td>80.0 ± 1.1</td><td>80.6±0.5</td><td>74.3 ± 0.8</td><td>70.7±0.6</td><td>71.3 ± 1.1</td><td>68.3±0.5</td><td>70.3 ±0.8</td><td>68.3±0.6</td><td>69.5 ± 0.3</td><td>66.0±0.6</td></tr><tr><td>iTAML+RRR</td><td>85.5±0.5</td><td>85.2±0.8</td><td>79.7± 0.6</td><td>74.3 ± 0.4</td><td>74.0± 0.9</td><td>73.4 ± 1.1</td><td>74.8± 0.9</td><td>74.4 ± 0.4</td><td>73.9 ±0.5</td><td>71.8±0.9</td></tr><tr><td>BiC</td><td>59.2 ±0.4</td><td>57.0± 0.6</td><td>56.1 ± 1.2</td><td>55.7± 0.6</td><td>53.8±0.5</td><td>52.4 ± 1.2</td><td>49.7 ± 0.6</td><td>49.2 ± 1.2</td><td>47.7 ± 1.1</td><td>46.7 ± 1.2</td></tr><tr><td>BiC+RRR</td><td>62.2 ± 0.5</td><td>59.1 ±0.7</td><td>58.2±0.5</td><td>57.8±0.5</td><td>54.4 ± 1.2</td><td>56.6±0.9</td><td>53.9 ±0.7</td><td>52.4 ± 1.1</td><td>49.5 ± 0.8</td><td>49.4± 0.9</td></tr><tr><td>EEIL</td><td>60.9±0.6</td><td>59.5 ± 0.6</td><td>57.8±0.6</td><td>55.1 ± 0.3</td><td>53.9±0.5</td><td>51.7± 0.3</td><td>50.1±0.8</td><td>49.4± 0.5</td><td>47.4± 0.6</td><td>46.9 ± 0.9</td></tr><tr><td>EEIL+RRR</td><td>63.7±0.6</td><td>62.9 ± 0.4</td><td>59.7 ± 0.4</td><td>57.0±0.3</td><td>55.6±0.8</td><td>53.5± 0.4</td><td>53.5±0.3</td><td>52.7 ± 0.4</td><td>49.1 ± 0.3</td><td>47.8 ± 0.4</td></tr><tr><td>LwF</td><td>23.9 ±0.7</td><td>21.4± 0.7</td><td>20.0±0.7</td><td>19.1 ± 0.9</td><td>18.7±0.8</td><td>17.1 ± 0.8</td><td>15.6 ±0.8</td><td>14.7 ± 0.8</td><td>14.0 ± 0.8</td><td>13.7 ± 1.1</td></tr><tr><td>LwF+RRR</td><td>27.7± 0.7</td><td>26.9 ±0.9</td><td>25.7±0.7</td><td>24.5 ± 1.2</td><td>23.6±0.6</td><td>22.6±0.7</td><td>19.5 ± 0.3</td><td>18.6 ± 0.5</td><td>19.7 ± 0.8</td><td>18.4± 1.2</td></tr><tr><td>EWC</td><td>17.2 ± 1.1</td><td>16.0 ± 0.5</td><td>15.0± 0.8</td><td>14.5 ± 0.8</td><td>13.4 ± 1.1</td><td>12.4 ± 0.4</td><td>12.3 ± 0.4</td><td>11.5 ± 0.8</td><td>11.2 ± 0.8</td><td>9.44± 0.5</td></tr><tr><td>EWC+RRR</td><td>20.7±0.3</td><td>19.5 ± 0.4</td><td>18.4± 0.7</td><td>17.3 ± 0.5</td><td>16.2 ± 0.4</td><td>15.8 ± 0.5</td><td>15.0 ± 0.7</td><td>16.6± 0.9</td><td>14.3 ± 0.4</td><td>13.2± 0.3</td></tr><tr><td>ER</td><td>45.8 ± 0.6</td><td>42.7± 0.7</td><td>41.6 ± 0.6</td><td>41.2 ± 0.6</td><td>36.5±0.4</td><td>36.5±0.6</td><td>33.8± 0.4</td><td>32.4± 1.2</td><td>31.4± 0.7</td><td>30.2±0.5</td></tr><tr><td>RRR</td><td>48.8± 0.3</td><td>46.7 ± 0.9</td><td>43.6 ± 1.1</td><td>44.2 ± 0.7</td><td>39.5±0.3</td><td>38.5±0.9</td><td>35.8±0.3</td><td>33.4± 0.3</td><td>32.4±0.3</td><td>31.2±0.3</td></tr></table>
|